summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/plugins/platforms/mirclient/qmirclientglcontext.cpp10
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;
}