From dd528c6607244e483d026cec67279c3c80ff7265 Mon Sep 17 00:00:00 2001 From: Chris Loer Date: Tue, 23 Oct 2018 16:36:37 -0700 Subject: [PATCH] Workaround for failure to clear depth buffer on some Android devices. Fixes issue #3437. --- src/gl/context.js | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/gl/context.js b/src/gl/context.js index 8c183868d65..a21987d7f79 100644 --- a/src/gl/context.js +++ b/src/gl/context.js @@ -189,6 +189,11 @@ class Context { if (typeof depth !== 'undefined') { mask |= gl.DEPTH_BUFFER_BIT; + + // Workaround for platforms where clearDepth doesn't seem to work + // without reseting the depthRange. See https://github.com/mapbox/mapbox-gl-js/issues/3437 + this.depthRange.set([0, 1]); + this.clearDepth.set(depth); this.depthMask.set(true); }