From 1be4f6c32c9846a2343f94628ba9704cf22ec5b1 Mon Sep 17 00:00:00 2001 From: Laszlo Agocs Date: Mon, 5 Nov 2018 15:57:22 +0100 Subject: Avoid querying unknown RESET_NOTIFICATION_STRATEGY value on GL < 4.0 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Fixes: QTBUG-55759 Change-Id: Ie2758859a6862a214691a5011761bf549a31a93e Reviewed-by: Christian Strømme --- .../xcb/gl_integrations/xcb_glx/qglxintegration.cpp | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) (limited to 'src/plugins/platforms/xcb/gl_integrations/xcb_glx') 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 f26f698e76..5e5fefca90 100644 --- a/src/plugins/platforms/xcb/gl_integrations/xcb_glx/qglxintegration.cpp +++ b/src/plugins/platforms/xcb/gl_integrations/xcb_glx/qglxintegration.cpp @@ -163,10 +163,12 @@ static void updateFormatFromContext(QSurfaceFormat &format) format.setOption(QSurfaceFormat::StereoBuffers); if (format.renderableType() == QSurfaceFormat::OpenGL) { - GLint value = 0; - glGetIntegerv(GL_RESET_NOTIFICATION_STRATEGY_ARB, &value); - if (value == GL_LOSE_CONTEXT_ON_RESET_ARB) - format.setOption(QSurfaceFormat::ResetNotification); + if (format.version() >= qMakePair(4, 0)) { + GLint value = 0; + glGetIntegerv(GL_RESET_NOTIFICATION_STRATEGY_ARB, &value); + if (value == GL_LOSE_CONTEXT_ON_RESET_ARB) + format.setOption(QSurfaceFormat::ResetNotification); + } if (format.version() < qMakePair(3, 0)) { format.setOption(QSurfaceFormat::DeprecatedFunctions); @@ -175,7 +177,7 @@ static void updateFormatFromContext(QSurfaceFormat &format) // Version 3.0 onwards - check if it includes deprecated functionality or is // a debug context - value = 0; + GLint value = 0; glGetIntegerv(GL_CONTEXT_FLAGS, &value); if (!(value & GL_CONTEXT_FLAG_FORWARD_COMPATIBLE_BIT)) format.setOption(QSurfaceFormat::DeprecatedFunctions); -- cgit v1.2.3