Skip to content
This repository was archived by the owner on Aug 8, 2023. It is now read-only.

Simplify render path - #1325

Merged
kkaefer merged 14 commits into
masterfrom
1325-simplify-render-path
May 4, 2015
Merged

kkaefer merged 14 commits into
masterfrom
1325-simplify-render-path

Conversation

@kkaefer

@kkaefer kkaefer commented Apr 23, 2015

Copy link
Copy Markdown
Member

We're currently have a pretty complicated way of rendering a tile, going through many layers of objects and some double dispatching along the way. This makes the code hard to follow and we need to traverse the hierarchy several times, for rendering opaque and translucent objects. We also want to add an additional step before that, giving renderable objects (=buckets) an opportunity to upload data to the GPU before we kick off rendering a frame.

@kkaefer
kkaefer force-pushed the 1325-simplify-render-path branch 3 times, most recently from dbc14eb to dc617d4 Compare April 27, 2015 16:03
@kkaefer

kkaefer commented Apr 27, 2015

Copy link
Copy Markdown
Member Author

@mapbox/gl Please review.

@ansis

ansis commented Apr 27, 2015

Copy link
Copy Markdown
Contributor

Is there a measurable performance improvement from wrapping all calls that modify gl state?
What performance impact did the switch to uploading at the beginning of a frame have?
Any plans to port this to -js?

@kkaefer

kkaefer commented Apr 28, 2015

Copy link
Copy Markdown
Member Author

This fixes #434

@kkaefer
kkaefer force-pushed the 1325-simplify-render-path branch 3 times, most recently from a5406c5 to bc091c8 Compare April 30, 2015 17:35
kkaefer added 14 commits May 4, 2015 17:33
This moves all texture updates and buffer uploads to the beginning of every frame, before we issue any drawing commands. This means the GPU typically has much more time to upload the data in the background until we actually need it, and doesn't have to pause to store/load the framebuffer.
We always need to do a full upload to adjust the image buffer size when we adjust the size of our sprite atlas. This can happen when we change the pixelRatio of the map we're rendering.
- previously, we reallocated the glyph atlas on every upload. Instead, we're now using glTexSubImage2D to reuse the existing buffer
- we're no longer forcing a texture upload when we remove glyphs; they won't be rendered anyway
- we're now only doing a texture upload once per frame; previously, worker threads that added glyphs mid-render could trigger a texture upload while rendering is in progress
@kkaefer
kkaefer force-pushed the 1325-simplify-render-path branch from bc091c8 to 27d8e82 Compare May 4, 2015 15:33
kkaefer added a commit that referenced this pull request May 4, 2015
@kkaefer
kkaefer merged commit 539d1be into master May 4, 2015
@kkaefer
kkaefer deleted the 1325-simplify-render-path branch May 4, 2015 15:49
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants