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

Determine need for clip ID based on actual layers/tiles - #10198

Merged
kkaefer merged 1 commit into
masterfrom
10198-dont-generate-clip-ids-needlessly
Oct 17, 2017
Merged

kkaefer merged 1 commit into
masterfrom
10198-dont-generate-clip-ids-needlessly

Conversation

@kkaefer

@kkaefer kkaefer commented Oct 14, 2017

Copy link
Copy Markdown
Member

When generating clip IDs for our stencil buffer based clipping approach, we are currently looking at the tiles of a particular source. Instead, we should only consider layers that actually need clipping (lines, fills, extrusions) rather than blindly generating clip IDs for every tile.

An example: A vector tile source is only used in symbol layers (which don't require clipping). Since we're currently generating clip IDs for all tiles in a geometry source (but not a raster source), we'd still generate clip IDs for these tiles even though they're never used.

if (bucket) {
sortedTilesForInsertion.emplace_back(tile);
tile.used = true;
if (!symbolLayer || parameters.mapMode == MapMode::Still) {

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

This should be improved to exclude clipping for raster tiles as well. We could also add a virtual call to the Render*Layer object.

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.

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.

Can you add a comment here explaining why clipping is not needed for symbol layers, unless it's still mode?

@brunoabinader brunoabinader 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.

💯

@kkaefer
kkaefer requested a review from jfirebaugh October 17, 2017 00:03
if (bucket) {
sortedTilesForInsertion.emplace_back(tile);
tile.used = true;
if (!symbolLayer || parameters.mapMode == MapMode::Still) {

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.

Can you add a comment here explaining why clipping is not needed for symbol layers, unless it's still mode?

@lilykaiser lilykaiser added this to the android-v5.1.5 milestone Oct 17, 2017
@kkaefer
kkaefer force-pushed the 10198-dont-generate-clip-ids-needlessly branch from 4fa976e to f9661ad Compare October 17, 2017 19:28
@kkaefer
kkaefer force-pushed the 10198-dont-generate-clip-ids-needlessly branch from f9661ad to 28bf50f Compare October 17, 2017 20:49
@kkaefer
kkaefer merged commit cbff0a9 into master Oct 17, 2017
@kkaefer
kkaefer deleted the 10198-dont-generate-clip-ids-needlessly branch October 17, 2017 22:08
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.

4 participants