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>bb10
parent
a14bfea500
commit
f1fc449016
|
|
@ -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) {
|
||||
|
|
|
|||
Loading…
Reference in New Issue