From cbf649ff92e7d3416cb9d03609648f96efdf76dd Mon Sep 17 00:00:00 2001
From: Ricardo Salveti de Araujo <ricardo.salveti@canonical.com>
Date: Mon, 17 Mar 2014 19:43:41 -0300
Subject: [PATCH] Add workaround for GL on Android emulator
On the Android Emulator, the shaders will be compiled by a desktop
GL driver, since the GL driver in the emulator is just a thin
wrapper. The GL driver does not necessarily support the precision
qualifiers, which can cause applications to break. We detect this
at runtime in the platform plugin and set a workaround flag to
Upstream (9eeb1bd) just enabled the workaround when the android
backend is used, which is not true in our case (traditional desktop).
As a consequence, we also need a similar check in order to have
a functional Ubuntu Touch emulator.
Signed-off-by: Ricardo Salveti de Araujo <ricardo.salveti@canonical.com>
---
src/gui/kernel/qopenglcontext.cpp | 5 +++++
1 file changed, 5 insertions(+)
|
|
|
900 | 900 | |
901 | 901 | d->shareGroup->d_func()->deletePendingResources(this); |
902 | 902 | |
| 903 | const char *rendererString = reinterpret_cast<const char *>(glGetString(GL_RENDERER)); |
| 904 | if (rendererString != 0 && qstrncmp(rendererString, "Android Emulator", 16) == 0) { |
| 905 | QOpenGLContextPrivate *ctx_d = QOpenGLContextPrivate::get(this); |
| 906 | ctx_d->workaround_missingPrecisionQualifiers = true; |
| 907 | } |
903 | 908 | #ifndef QT_NO_DEBUG |
904 | 909 | QOpenGLContextPrivate::toggleMakeCurrentTracker(this, true); |
905 | 910 | #endif |