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

Include bindVertexBuffer in Context.setDirty() #7080

Merged
merged 1 commit into from
Aug 6, 2018

Conversation

davidmanzanares
Copy link

While doing a PoC of integrating CARTO VL with Mapbox GL using this new API we found a flickering issue (the screen was cleared to white intermittently sometimes).

The problem only happened when using WebGL outside the rendering loop (async).

We discovered that BindVertexBuffer.set() was being called after our async code executed and that the if (this.current !== v || this.dirty === true) { didn't pass in the first time set was called after our code, which made our buffers bound and MGL buffers unbound, causing the problems.

Adding this.bindVertexBuffer.dirty = true; to Context.setDirty() seems to fix the issue.

Thank you!

Copy link
Contributor

@ansis ansis left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @davidmanzanares! looks like index buffers aren't handled correctly either but I'll push a fix for that directly to the pr.

@ansis ansis merged commit bd488ea into mapbox:custom-layers Aug 6, 2018
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.

2 participants