Skip to content

Include bindVertexBuffer in Context.setDirty() - #7080

Merged
ansis merged 1 commit into
mapbox:custom-layersfrom
CartoDB:setdirty-array-buffer
Aug 6, 2018
Merged

ansis merged 1 commit into
mapbox:custom-layersfrom
CartoDB:setdirty-array-buffer

Conversation

@davidmanzanares

Copy link
Copy Markdown

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!

@ansis ansis left a comment

Copy link
Copy Markdown
Contributor

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