summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/gui/opengl/qopengltexturehelper.cpp12
1 files 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<const char *>(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<void (QOPENGLF_APIENTRYP)(GLuint , GLenum , GLenum , GLint )>(context->getProcAddress(QByteArrayLiteral("glTextureParameteriEXT")));
TextureParameterivEXT = reinterpret_cast<void (QOPENGLF_APIENTRYP)(GLuint , GLenum , GLenum , const GLint *)>(context->getProcAddress(QByteArrayLiteral("glTextureParameterivEXT")));