diff options
author | Qt Forward Merge Bot <qt_forward_merge_bot@qt-project.org> | 2018-04-06 09:32:13 +0200 |
---|---|---|
committer | Qt Forward Merge Bot <qt_forward_merge_bot@qt-project.org> | 2018-04-06 09:32:13 +0200 |
commit | 1a464f35d19fbf6a5cbe93b2a2d52f2f44465913 (patch) | |
tree | 7306fbbb50429d66cf4d3d08e60e7310431b9f85 /src/plugins/platforms/xcb | |
parent | 061fbceb777c41b23bc2b8180b2af85d9b35b246 (diff) | |
parent | b6f7230cda02d9b11b309816ca1e41dbd2716fe0 (diff) |
Merge remote-tracking branch 'origin/5.11' into dev
Change-Id: Ic811cd444e523b904211797112bba6aaec85dddd
Diffstat (limited to 'src/plugins/platforms/xcb')
-rw-r--r-- | src/plugins/platforms/xcb/gl_integrations/xcb_glx/qglxintegration.cpp | 8 |
1 files changed, 7 insertions, 1 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..d37eb572a6 100644 --- a/src/plugins/platforms/xcb/gl_integrations/xcb_glx/qglxintegration.cpp +++ b/src/plugins/platforms/xcb/gl_integrations/xcb_glx/qglxintegration.cpp @@ -302,7 +302,7 @@ void QGLXContext::init(QXcbScreen *screen, QPlatformOpenGLContext *share) contextAttributes << GLX_CONTEXT_PROFILE_MASK_ARB << GLX_CONTEXT_ES2_PROFILE_BIT_EXT; } - if (supportsRobustness && supportsVideoMemoryPurge) { + if (supportsRobustness && supportsVideoMemoryPurge && m_format.testOption(QSurfaceFormat::ResetNotification)) { QVector<int> contextAttributesWithNvidiaReset = contextAttributes; contextAttributesWithNvidiaReset << GLX_CONTEXT_RESET_NOTIFICATION_STRATEGY_ARB << GLX_LOSE_CONTEXT_ON_RESET_ARB; @@ -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) { |