From 12e88e486b2a38272c0e9a5402b2af708339b8a3 Mon Sep 17 00:00:00 2001 From: Laszlo Agocs Date: Fri, 13 Mar 2015 14:33:47 +0100 Subject: [PATCH] Disable DSA on Radeon Try to prevent crashes on Windows and broken textures on Linux. Task-number: QTBUG-40653 Task-number: QTBUG-44988 Change-Id: I1fd259ba5ca3980c3087411e1dae1ae56bb2c2e4 Reviewed-by: Sean Harmer --- src/gui/opengl/qopengltexturehelper.cpp | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/src/gui/opengl/qopengltexturehelper.cpp b/src/gui/opengl/qopengltexturehelper.cpp index 386c4af232..3635a7dd1b 100644 --- a/src/gui/opengl/qopengltexturehelper.cpp +++ b/src/gui/opengl/qopengltexturehelper.cpp @@ -40,8 +40,16 @@ QT_BEGIN_NAMESPACE QOpenGLTextureHelper::QOpenGLTextureHelper(QOpenGLContext *context) { - // Resolve EXT_direct_state_access entry points if present - if (!context->isOpenGLES() + // Resolve EXT_direct_state_access entry points if present. + + // However, disable it on some systems where DSA is known to be unreliable. + bool allowDSA = true; + const char *renderer = reinterpret_cast(context->functions()->glGetString(GL_RENDERER)); + // QTBUG-40653, QTBUG-44988 + if (renderer && strstr(renderer, "AMD Radeon HD")) + allowDSA = false; + + if (allowDSA && !context->isOpenGLES() && context->hasExtension(QByteArrayLiteral("GL_EXT_direct_state_access"))) { TextureParameteriEXT = reinterpret_cast(context->getProcAddress(QByteArrayLiteral("glTextureParameteriEXT"))); TextureParameterivEXT = reinterpret_cast(context->getProcAddress(QByteArrayLiteral("glTextureParameterivEXT")));