-
Notifications
You must be signed in to change notification settings - Fork 517
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
ifdef out GL_FRAMEBUFFER_UNDEFINED from webgl builds #933
Conversation
GL_FRAMEBUFFER_UNDEFINED doesn't exist in webgl2, ifdef it out.
Not sure if |
Strange, sokol_gfx.h includes Lines 4217 to 4221 in bd7fa93
...and this includes the definition: The Emscripten builds are also working fine in CI (and of course locally on my machine): https://github.com/floooh/sokol-samples/actions/runs/6697850493 https://github.com/floooh/sokol/actions/runs/6697703312 No idea how it could fail tbh... PS: ignore the confusion with the various edits of this comment, I was confusing OpenGL's GL_FRAMEBUFFER_UNDEFINED, with sokol_gfx.h's GL_FRAMEBUFFER_STATUS_UNDEFINED. But still, GL_FRAMEBUFFER_UNDEFINED is defined in GLES3/gl3.h, ...so I still don't have any idea what could go wrong :) What's you Emscripten SDK version? |
Ah, now I see, the WebGL2 spec removed it (see: https://registry.khronos.org/webgl/specs/latest/2.0/)
Since Emscripten uses the GLES3/gl3.h header it compiles though even if WebGL2 doesn't have that error value. Are you using different headers than what Emscripten provides? (apart from that, the best define to check for would probably be |
Ah, yeah we're not using emscripten. we use clang's wasm target directly and wrote our own webgl headers and javascript glue. I guess we'll go the route of matching GLES3 headers. Thanks for the comments! |
FYI I have solved this a bit differently (will be part of #985): #if defined(SOKOL_GLES3)
// on WebGL2, GL_FRAMEBUFFER_UNDEFINED technically doesn't exist (it is defined
// in the Emscripten headers, but may not exist in other WebGL2 shims)
// see: https://github.com/floooh/sokol/pull/933
#ifndef GL_FRAMEBUFFER_UNDEFINED
#define GL_FRAMEBUFFER_UNDEFINED 0x8219
#endif
#endi
(the WebGL2 APIs will never return GL_FRAMEBUFFER_UNDEFINED, so the define just exists to make the code compile, even if that specific error code will never be returned) |
GL_FRAMEBUFFER_UNDEFINED doesn't exist in webgl2, ifdef it out.