diff options
author | Christian Strømme <christian.stromme@theqtcompany.com> | 2015-09-15 16:33:05 +0200 |
---|---|---|
committer | Christian Stromme <christian.stromme@theqtcompany.com> | 2015-09-17 14:46:55 +0000 |
commit | 0d3464428e4632f3ec905766baf778d3355dd80c (patch) | |
tree | 0376d176e57f2dd95622dcde4cc1e48985b8820a /src/plugins/platforms/mirclient/qmirclientglcontext.cpp | |
parent | e287e17e456ebaab93bddfd5b47f6327157304f5 (diff) |
Mir: Enable workaround for missing precision qualifiers.
This change enables the workaround for missing precision qualifiers when
running in the emulator. The same workaround is already applied to the
Android plugin (9eeb1bd).
Change-Id: I46ca344f71a48c9586bd8f491e56a1a814ee7ab6
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@theqtcompany.com>
Diffstat (limited to 'src/plugins/platforms/mirclient/qmirclientglcontext.cpp')
-rw-r--r-- | src/plugins/platforms/mirclient/qmirclientglcontext.cpp | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/src/plugins/platforms/mirclient/qmirclientglcontext.cpp b/src/plugins/platforms/mirclient/qmirclientglcontext.cpp index bfba5051e5..bbd7f5ee75 100644 --- a/src/plugins/platforms/mirclient/qmirclientglcontext.cpp +++ b/src/plugins/platforms/mirclient/qmirclientglcontext.cpp @@ -39,6 +39,7 @@ #include "qmirclientwindow.h" #include "qmirclientlogging.h" #include <QtPlatformSupport/private/qeglconvenience_p.h> +#include <QtGui/private/qopenglcontext_p.h> #if !defined(QT_NO_DEBUG) static void printOpenGLESConfig() { @@ -103,6 +104,15 @@ bool QMirClientOpenGLContext::makeCurrent(QPlatformSurface* surface) ASSERT(eglMakeCurrent(mEglDisplay, eglSurface, eglSurface, mEglContext) == EGL_TRUE); printOpenGLESConfig(); #endif + + // When running on the emulator, shaders will be compiled using a thin wrapper around the desktop drivers. + // These wrappers might not support the precision qualifiers, so set the workaround flag to true. + const char *rendererString = reinterpret_cast<const char *>(glGetString(GL_RENDERER)); + if (rendererString != 0 && qstrncmp(rendererString, "Android Emulator", 16) == 0) { + QOpenGLContextPrivate *ctx_d = QOpenGLContextPrivate::get(context()); + ctx_d->workaround_missingPrecisionQualifiers = true; + } + return true; } |