summaryrefslogtreecommitdiffstats
path: root/src/plugins/platforms/xcb
diff options
context:
space:
mode:
authorDavid Edmundson <davidedmundson@kde.org>2018-04-02 19:50:27 +0100
committerDavid Edmundson <davidedmundson@kde.org>2018-04-05 14:50:51 +0000
commitf1fc449016333525aef5bde51c2de666f2da1790 (patch)
treedf4deb60c3c4c1773ae610a4121de4705972249b /src/plugins/platforms/xcb
parenta14bfea50058f58f23d7864b8ab90bd92b9364d8 (diff)
Support graphics reset status for offscreen surfaces in XCB-GLX
I originally didn't to match the ANGLE code, however it's important for all surfaces to be able to know to reset if their makeContext fails. This is espcially relevant on some Linux nvidia drivers which has a bug where while(glGetError()) won't ever clear whilst a reset is in progress. Change-Id: Iae3502168cda748c601a9aee1497e40c6d82cd83 Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
Diffstat (limited to 'src/plugins/platforms/xcb')
-rw-r--r--src/plugins/platforms/xcb/gl_integrations/xcb_glx/qglxintegration.cpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/plugins/platforms/xcb/gl_integrations/xcb_glx/qglxintegration.cpp b/src/plugins/platforms/xcb/gl_integrations/xcb_glx/qglxintegration.cpp
index 86ca7afa12..6a663712b8 100644
--- a/src/plugins/platforms/xcb/gl_integrations/xcb_glx/qglxintegration.cpp
+++ b/src/plugins/platforms/xcb/gl_integrations/xcb_glx/qglxintegration.cpp
@@ -539,6 +539,7 @@ bool QGLXContext::makeCurrent(QPlatformSurface *surface)
m_lost = false;
if (m_getGraphicsResetStatus && m_getGraphicsResetStatus() != GL_NO_ERROR) {
m_lost = true;
+ success = false;
// Drop the surface. Will recreate on the next makeCurrent.
window->invalidateSurface();
}
@@ -547,6 +548,11 @@ bool QGLXContext::makeCurrent(QPlatformSurface *surface)
QGLXPbuffer *pbuffer = static_cast<QGLXPbuffer *>(surface);
glxDrawable = pbuffer->pbuffer();
success = glXMakeContextCurrent(m_display, glxDrawable, glxDrawable, m_context);
+ m_lost = false;
+ if (m_getGraphicsResetStatus && m_getGraphicsResetStatus() != GL_NO_ERROR) {
+ m_lost = true;
+ success = false;
+ }
}
if (success && surfaceClass == QSurface::Window) {