-
Notifications
You must be signed in to change notification settings - Fork 12
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Simplify instancing, instancedArrays and vertexArray polyfilling code #116
Milestone
Comments
From this: if (!gl.drawElementsInstanced) {
const ext = gl.getExtension("ANGLE_instanced_arrays");
if (!ext) {
// TODO: this._caps[CAPS_INSTANCED_ARRAYS] = false;
gl.drawElementsInstanced = () => {
throw new Error(
"gl.drawElementsInstanced not available. ANGLE_instanced_arrays not supported"
);
};
gl.drawArraysInstanced = () => {
throw new Error(
"gl.drawArraysInstanced not available. ANGLE_instanced_arrays not supported"
);
};
gl.vertexAttribDivisor = () => {
throw new Error(
"gl.vertexAttribDivisor not available. ANGLE_instanced_arrays not supported"
);
};
} else {
// TODO: this._caps[CAPS_INSTANCED_ARRAYS] = true;
gl.drawElementsInstanced = ext.drawElementsInstancedANGLE.bind(ext);
gl.drawArraysInstanced = ext.drawArraysInstancedANGLE.bind(ext);
gl.vertexAttribDivisor = ext.vertexAttribDivisorANGLE.bind(ext);
capabilities.instancedArrays = true;
capabilities.instancing = true; // TODO: deprecate
}
} else {
capabilities.instancedArrays = true;
capabilities.instancing = true; // TODO: deprecate
} to this: if (!gl.drawElementsInstanced) {
const ext = gl.getExtension("ANGLE_instanced_arrays");
gl.drawElementsInstanced = ext.drawElementsInstancedANGLE.bind(ext);
gl.drawArraysInstanced = ext.drawArraysInstancedANGLE.bind(ext);
gl.vertexAttribDivisor = ext.vertexAttribDivisorANGLE.bind(ext);
} and removing capabilities.instancing/instancedArrays/vertexArrayObject. |
Looks good |
dmnsgn
added a commit
that referenced
this issue
May 19, 2022
…ement_index_uint and OES_vertex_array_object are universally supported - remove extension check for ANGLE_instanced_arrays and OES_vertex_array_object - remove capabilities.instancing/instancedArrays/vertexArrayObject - remove OES_element_index_uint and OES_standard_derivatives from capabilities Closes #116
dmnsgn
added a commit
that referenced
this issue
Jun 8, 2022
OES_element_index_uint and OES_standard_derivatives still need a call to get activated. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
According to MDN WebGL_best_practices,
ANGLE_instanced_arrays
,OES_standard_derivatives
,OES_element_index_uint
andOES_vertex_array_object
are universally supported in WebGL 1.So we could remove the checks for their existence and just polyfill directly.
Related #114.
The text was updated successfully, but these errors were encountered: