summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohn Firebaugh <john.firebaugh@gmail.com>2017-07-20 16:19:17 -0700
committerJohn Firebaugh <john.firebaugh@gmail.com>2017-07-20 16:23:45 -0700
commitf69387b8b1609ccb7836c7a0e54d544a51434a6a (patch)
treee8082835cbe7be66c4de92653117f1fcb40d5e54
parentb43e1ae12328e8a36a9a36c03e49e1db0a395189 (diff)
downloadqtlocation-mapboxgl-upstream/fix-9164.tar.gz
[core] Work around Adreno 2xx GPU bugsupstream/fix-9164
-rw-r--r--src/mbgl/gl/context.cpp7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/mbgl/gl/context.cpp b/src/mbgl/gl/context.cpp
index 35683cff89..1a8d5c0775 100644
--- a/src/mbgl/gl/context.cpp
+++ b/src/mbgl/gl/context.cpp
@@ -615,6 +615,13 @@ void Context::setDrawMode(const TriangleStrip&) {
void Context::setDepthMode(const DepthMode& depth) {
if (depth.func == DepthMode::Always && !depth.mask) {
depthTest = false;
+
+ // Workaround for rendering errors on Adreno 2xx GPUs. Depth-related state should
+ // not matter when the depth test is disabled, but on these GPUs it apparently does.
+ // https://github.com/mapbox/mapbox-gl-native/issues/9164
+ depthFunc = depth.func;
+ depthMask = depth.mask;
+ depthRange = depth.range;
} else {
depthTest = true;
depthFunc = depth.func;