From 0d3464428e4632f3ec905766baf778d3355dd80c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Christian=20Str=C3=B8mme?= Date: Tue, 15 Sep 2015 16:33:05 +0200 Subject: 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 --- src/plugins/platforms/mirclient/qmirclientglcontext.cpp | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'src/plugins') 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 +#include #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(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; } -- cgit v1.2.3