diff options
author | David Edmundson <davidedmundson@kde.org> | 2018-04-04 18:31:55 +0100 |
---|---|---|
committer | Liang Qi <liang.qi@qt.io> | 2018-04-05 19:57:09 +0000 |
commit | 63a433f6c855684f2b3a25fdd7cbbfdacf1954e1 (patch) | |
tree | 29e0fc6f54038ecc5b0024b28237584da84c9881 | |
parent | 1c463000ed7427ef6b311b5ae30b91b0570754d1 (diff) |
Make nvidia resets opt-in based on QSurfaceFormat::ResetNotification
We can't be sure every user will check the return value from makeCurrent
and reset appropriately.
Even though after a reset a user will be left with the same garbage as
before, it's safer than a potential infinite loop.
Change-Id: I5b328c654ad2a89c5b8c4399e2eb38150f4f384b
Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
-rw-r--r-- | src/plugins/platforms/xcb/gl_integrations/xcb_glx/qglxintegration.cpp | 2 |
1 files changed, 1 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 6a663712b8..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; |