-
Notifications
You must be signed in to change notification settings - Fork 3.4k
Please add ANGLE_instanced_arrays support to GLES2 wrapper #2510
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
Comments
cc @juj Sounds good, can you perhaps make a testcase for this? |
Yes, I'll try to derive a testcase from one of the existing tests, might take until the weekend until I get around this though. Also, ANGLE_instanced_arrays isn't implemented in FF on Windows right now, which is strange because it works on OSX, and also on Chrome/Windows. There's a fairly old ticket here: https://bugzilla.mozilla.org/show_bug.cgi?id=843673 Would be good to poke the right people about this ;) |
I see @jdashg assigned it to himself today, so the right people have certainly been poked ;) |
The patch is ready to commit, so it should be in nightly by the weekend.
|
I can help here, or @floooh , did you already have a test in the works? |
Hi @juj I didn't get around to write a test yet, I was planning to cobble something together on the weekend, so if you're more familiar writing emscripten GL tests you're welcome to take over :) I was thinking that a general instanced-arrays test would make sense, which can be switched between Core-GL, ARB_instanced_arrays and ANGLE_instanced_arrays with a define (I think the extension is in Core-GL since 3.1 or 3.2). The implementation would be the same, only the method names for glVertexAttribDivisor(), glDrawElementsInstanced() and glDrawArraysInstanced() would be different. I'm not sure whether other extensions or Core-GL has more DrawXXXInstanced() variants (I think ANGLE/ARB_instanced_arrays only adds those 3 methods). |
On further thought, I think handling ARB_instanced_arrays is not necessary, since the emscripten desktop GL wrapper already implements the Core-GL calls. There's also another problem in the current Desktop-GL implementation (at least in my demo here: http://floooh.github.io/oryol/Instancing.html) with a runtime error because closure seems to remove some code (more details here: https://groups.google.com/forum/#!topic/emscripten-discuss/Lcm7RzIs7UY), you'll probably also stumble across this when running your test and use closure in the linker stage. |
Surely the GLES2 wrapper should expose |
The GLES extension registry lists both EXT_instanced_arrays and ANGLE_instanced_arrays (and a third NV_instanced_arrays). I think the reason that there is a separate ANGLE extension is that this has slight under-the-hood limitations because it needs to be compatible with D3D9. So the right way would be to expose both EXT_instanced_arrays and ANGLE_instanced_arrays I think. I think we can skip the NV extension because this was very likely the blueprint for the EXT extension. The official GLES2 extension header (http://www.khronos.org/registry/gles/api/GLES2/gl2ext.h) has all 3 instanced_arrays extensions. |
Ah, I didn't realise that From a quick scan through, there are very minor differences: the ANGLE extension contains an extra limitation, as you mentioned:
|
This issue has been automatically marked as stale because there has been no activity in the past 2 years. It will be closed automatically if no further activity occurs in the next 7 days. Feel free to re-open at any time if this issue is still relevant. |
FWIW I think this is properly fixed for quite a while now. All the required ANGLE extension prototypes are in the IMHO the ticket can be closed as fixed. |
This test unnecessarily checked for the presence of an explicit type in a function definition in a .wast. The upcoming PR emscripten-core#2510 removes this type from wast output, so this test needed to be updated first to keep the rollers happy.
…-core#10011) This test unnecessarily checked for the presence of an explicit type in a function definition in a .wast. The upcoming PR emscripten-core#2510 removes this type from wast output, so this test needed to be updated first to keep the rollers happy.
The GLES2 wrapper seems to be missing support for ANGLE_instanced_arrays:
glVertexAttribDivisorANGLE()
glDrawElementsInstancedANGLE()
glDrawArraysInstancedANGLE()
I tried copying the latest GL headers from here (http://www.khronos.org/registry/gles/api/GLES2/) to emscripten/system/include/GLES2, this worked for compilation, but the linker failed to find the ANGLE-postfixed GLES2 functions (since they are missing in library_gl.js).
Since WebGL is closer to GLES2 then Desktop GL I'd like to continue using the GLES2 headers and emulation wrapper for the emscripten port, which would require support for ANGLE_instanced_arrays though.
Thanks!
-Floh.
The text was updated successfully, but these errors were encountered: