bgfx: 22-windows example using OpenGL renderer crashes on Windows10
Fatal error info: Code 0(DebugCheck) Message: glPopDebugGroup(); GL Error 0x504 <GLenum?> Error points to renderer_gl.cpp line 6515.
Switching to DX11 backend, works as expected.
It seems to be related to bgfx::setViewFrameBuffer
. Commenting out the call in the update function, the app does not crash. Creates the window properly and destroys it as well without issues.
About this issue
- Original URL
- State: closed
- Created 5 years ago
- Comments: 16 (15 by maintainers)
Seems like when
bgfx::setViewFrameBuffer
is called with a valid framebuffer, somehow the Debug Groups end up popping one time too many at line 6515(tries to pop default debug group, which is why it throws the error).Ok I think I found the problem.
There actually is a context switch in
setFrameBuffer
(L6551), causingBGFX_GL_PROFILER_END()
(L6559) to pop an empty debug group stack. For some reason I missed the fact that each swap chain has its own GL context (thought it only stored the window surface). So the call looks like it matches the call toBGFX_GL_PROFILER_BEGIN_LITERAL()
(L6402) from the top of thesubmit()
function, but it does not.The fix is to close the debug group before calling
setFrameBuffer
and then open up another debug group, like so:This fixes the example 22-windows for me on Linux.