Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

"Clear" stencil buffer manually; workaround for #5490 #5704

Merged
merged 1 commit into from
Nov 17, 2017
Merged

Conversation

lbud
Copy link
Contributor

@lbud lbud commented Nov 17, 2017

As of Chrome v62, depth reads in certain Intel Iris graphics cards (at least Intel Iris Graphics 6100) all fail on intermittent frames, creating a flashing effect as in #5490. I believe this bug is some kind of race condition or incorrect vector access related to stencil buffer clearing. This PR mitigates this issue pending an upstream fix by never using gl.clear(gl.STENCIL_BUFFER_BIT) and instead "clearing" it manually by drawing a stencil mask of all 0s to the full viewport. I've confirmed on maps where this effect is most dramatic (maps with many sources) that this fix eliminates flashing entirely.

Fixes #5490.
Upstream issue: https://bugs.chromium.org/p/chromium/issues/detail?id=784030

Mimic clearStencil without actually using it by drawing a viewport-sized depth "mask" with value=0
@lbud lbud changed the title Temporary workaround for #5490: Temporary workaround for #5490 Nov 17, 2017
@lbud lbud changed the title Temporary workaround for #5490 "Clear" stencil buffer manually; workaround for #5490 Nov 17, 2017
@lbud lbud requested a review from jfirebaugh November 17, 2017 22:23
@SBRK
Copy link

SBRK commented Feb 2, 2018

Does this impact performance ?

@lbud
Copy link
Contributor Author

lbud commented Feb 5, 2018

@SBRK in theory it might impact performance ever so slightly (effectively trading the cost of natively clearing the stencil buffer with the cost of rendering one additional layer; this happens once per source change in the layer order) but it is a necessary workaround to a critical upstream bug.

@SBRK
Copy link

SBRK commented Feb 6, 2018

@lbud yep I know we had this problem and it was affecting half the computers in our company :) But it seemed to me the performance was slightly worse after updating. It could just be an impression though

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Map blink when zooming
3 participants