Conversation
|
Also, optional follow-up: |
| else if (strcmp(procName, "glDrawElementsInstancedANGLE") == 0) proc = (void *)glDrawElementsInstancedANGLE; | ||
| else if (strcmp(procName, "glVertexAttribDivisorANGLE") == 0) proc = (void *)glVertexAttribDivisorANGLE; | ||
| #endif | ||
|
|
There was a problem hiding this comment.
rlgl uses the loader for the following potential functions:
glGenVertexArraysOES
glBindVertexArrayOES
glDeleteVertexArraysOES
glDrawArraysInstancedANGLE
glDrawElementsInstancedANGLE
glVertexAttribDivisorANGLE
glDrawArraysInstancedEXT
glDrawElementsInstancedEXT
glVertexAttribDivisorEXT
glDrawArraysInstancedNV
glDrawElementsInstancedNV
glVertexAttribDivisorNV
Maybe the additional EXT/NV names should be also checked instead of relying only on ANGLE extension names.
There was a problem hiding this comment.
On web, the only instancing extension WebGL defines is ANGLE_instanced_arrays (there's no EXT/NV variant in the WebGL extension registry), so rlgl will only ever request the *ANGLE functions there. The EXT/NV branches can't be hit on this platform.
That said, I'm happy to add the EXT/NV names too if you'd prefer it to be defensive.
|
@vdemcak that's a nice improvement! Added some review. Also, please, could you update |
On Emscripten, referencing
glfwGetProcAddress()oremscripten_webgl_get_proc_address()links a lookup table of every GL function into both the JS and the wasm, but rlgl only needs 6 extension functions on WebGL. Emscripten links GL functions statically, so a small loader now returns them directly. See #3713.Applied to both
rcore_web.cand the experimentalrcore_web_emscripten.c. The loader body is guarded byGRAPHICS_API_OPENGL_ES2, because software rendering builds don't declare the GLES extension functions.core_basic_window, JS + wasm gzipped: 91.4 -> 83.9 KB (WebGL 1), 94.4 -> 81.3 KB (WebGL 2).
On web,
rlGetProcAddress()now only returns those 6 functions.Tested
shaders_mesh_instancingon WebGL 1 & 2: works identically.