-
Notifications
You must be signed in to change notification settings - Fork 64
SDL_GL_CONTEXT_FLAGS, SDL_GL_FRAMEBUFFER_SRGB_CAPABLE issues #86
Comments
Yes, it looks like setting some SDL_GL* flags (in particular SDL_GL_CONTEXT_FLAGS) after having set SDL_GL_CONTEXT_PROFILE can make things fail. |
To me, the issue probably come from here: SDL_egl.c, line 590, function SDL_EGL_CreateContext:
The "if" expression is a bit cryptic to understand, but in the end, it look likes that if there is some gl_config.flags, it will just fail... |
That
Edit: I think I've hit this on Android as well. |
I guess nobody is checking for SDL_Errors ;) Maybe the "flags" should be filtered out before calling the SDL EGL backend ? |
It happens on any platform that uses EGL and only supports ~GLES2.0, not just Emscripten though. |
Okay. I think this is nevertheless and issue, because the documentation of SDL_GL_SetAttribute says these settings are requests (https://wiki.libsdl.org/SDL_GL_SetAttribute#Remarks) and apps must use SDL_GL_GetAttribute after window and context creation to see if those features are available. But if it is not only Emscripten specific, then this is an issue for upstream SDL. |
Just ran into |
There's no way to request an sRGB default framebuffer though, which is what we would need to implement that flag. (Plus a bunch of work in emscripten's EGL implementation). |
@Daft-Freak yes, looks like SRGB conversion would need to be done manually for WebGL2: https://stackoverflow.com/questions/51032480/how-do-you-implement-a-gamma-correct-workflow-in-webgl2 That's a shame, I had though that thanks to ES 3 supporting it, engines could move to a default linear color space model by default, but WebGL is holding that back. Or I guess put up with a |
See
https://groups.google.com/d/msg/emscripten-discuss/iZId9geA_9E/wcfQPHQXAwAJ
It sounds like
SDL_GL_CONTEXT_FLAGS
andSDL_GL_FRAMEBUFFER_SRGB_CAPABLE
can make things silently fail?If there isn't a good fix, perhaps this could be turned into an error at least?
cc @gabrielcuvillier who may have more info
The text was updated successfully, but these errors were encountered: