summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLaszlo Agocs <laszlo.agocs@qt.io>2018-05-25 15:53:04 +0200
committerLaszlo Agocs <laszlo.agocs@qt.io>2018-05-25 14:52:39 +0000
commite57a7059935922fad40e76a846ff594c62294d7f (patch)
tree104b580251e15177b1040fa1a680c9c42c18b1f5
parentc3fc5daa864af9bc42e30dd7dd3cd7a587b65f95 (diff)
Force max lights per layer to 2 on Vivante GLES 3.0 (i.MX6)
We have no means to figure out what's going on in the GLES implementation. Using 3 already triggers something weird in the driver and uniform values will not be read correctly. So stick to 2. Change-Id: Icefa4237178bdee2b545c9bd47f1e74c80b25c04 Reviewed-by: Andy Nichols <andy.nichols@qt.io>
-rw-r--r--src/runtime/q3dsengine.cpp13
1 files changed, 10 insertions, 3 deletions
diff --git a/src/runtime/q3dsengine.cpp b/src/runtime/q3dsengine.cpp
index 0c14d31..20d9b0e 100644
--- a/src/runtime/q3dsengine.cpp
+++ b/src/runtime/q3dsengine.cpp
@@ -214,9 +214,9 @@ static void initGraphicsLimits(QOpenGLContext *ctx)
gfxLimits.norm16TexturesSupported = ctx->isOpenGLES() ? extensions.contains("GL_EXT_texture_norm16") : true;
// now apply some driver-specific overrides
- if (gfxLimits.vendor.contains(QByteArrayLiteral("Vivante Corporation"))
- && gfxLimits.version.contains(QByteArrayLiteral("OpenGL ES 3.0")))
- {
+ const bool vivante = gfxLimits.vendor.contains(QByteArrayLiteral("Vivante Corporation"))
+ && gfxLimits.version.contains(QByteArrayLiteral("OpenGL ES 3.0"));
+ if (vivante) {
qDebug(" found Vivante OpenGL ES 3.0, forcing OpenGL ES 2.0 rendering path");
gfxLimits.useGles2Path = true;
}
@@ -231,6 +231,13 @@ static void initGraphicsLimits(QOpenGLContext *ctx)
gfxLimits.maxLightsPerLayer = 16;
}
+ if (vivante) {
+ // In addition to not being able to handle GLES3.0 stuff, having a lot of uniforms
+ // makes the i.MX6 Vivante driver do weird things. Avoid this by reducing the max
+ // number of lights (and so the number of uniforms).
+ gfxLimits.maxLightsPerLayer = 2;
+ }
+
qDebug(" use feature-limited GLES2 rendering path: %s", gfxLimits.useGles2Path ? "true" : "false");
qDebug(" max lights per layer: %d", gfxLimits.maxLightsPerLayer);
qDebug(" GL_MAX_DRAW_BUFFERS: %d", gfxLimits.maxDrawBuffers);