Skip to content

Commit

Permalink
Workaround for failure to clear depth buffer on some Android devices.
Browse files Browse the repository at this point in the history
Fixes issue #3437.
  • Loading branch information
ChrisLoer committed Oct 24, 2018
1 parent 1d734ca commit 42d1a5a
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/gl/context.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Expand Down

0 comments on commit 42d1a5a

Please sign in to comment.