-
-
Notifications
You must be signed in to change notification settings - Fork 107
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
EGLBE: Fix OGL errs in glXMake*()/glXSwapBuffers()
- When calling FakePbuffer::createBuffer() from backend::makeCurrent(), don't try to re-bind the old FBO if the new FBO will immediately be bound. This fixes a GL_INVALID_OPERATION error that could occur due to the following sequence of function calls: glXMakeCurrent(dpy, window, context); glXMakeCurrent(dpy, 0, 0); XDestroyWindow(dpy, window); glXMakeCurrent(dpy, other_drawable, context); XDestroyWindow() destroys the FakePbuffer instance associated with the window, which destroys the FBO and RBOs associated with the FakePbuffer instance. Since XDestroyWindow() is a context-less function, the FBO destruction occurs in the RBO context. However, the destroyed FBO is still the current FBO in the application's context. The FBO associated with other_drawable will be made current once the second glXMake*Current() call completes, so we simply need to avoid binding the destroyed FBO within the body of that function call. The easiest way to do that is to avoid restoring an FBO binding via the BufferState instance created in FakePbuffer::createBuffer() if that binding would immediately be overwritten. We do likewise within FakePbuffer:swap(), to fix a similar GL_INVALID_OPERATION error in glXSwapBuffers() that was observed sporadically in the fakerut multithreaded rendering test. The exact mechanism behind this error was not entirely clear. - In backend::makeCurrent(), call FakePbuffer::setDrawBuffer() rather than FakePbuffer::setDrawBuffers() if ContextHashEGL.getDrawBuffers() returns only one buffer. If ContextHashEGL.getDrawBuffers() returns only one buffer, then that buffer may be GL_FRONT or another enum that would trigger a GL_INVALID_ENUM error if passed to FakePbuffer::setDrawBuffers() (since FakePbuffer::setDrawBuffers() emulates the behavior of glDrawBuffers().) Fixes #199
- Loading branch information
1 parent
e97eb1e
commit ea748cc
Showing
5 changed files
with
63 additions
and
18 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters