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

Unset fill-outine-color duplicates fill-color paint buffer if the latter is data-driven #10579

Open
mourner opened this issue Apr 15, 2021 · 0 comments
Labels
performance ⚡ Speed, stability, CPU usage, memory usage, or power usage

Comments

@mourner
Copy link
Member

mourner commented Apr 15, 2021

When a fill layer has a data-driven fill-color but fill-outline-color is unset (which is very common in our styles), it inherits the value and we end up uploading two identical, independently generated paint buffers, increasing the GPU memory footprint of rendering such layers:

const outlineColor = this.paint._values['fill-outline-color'];
if (outlineColor.value.kind === 'constant' && outlineColor.value.value === undefined) {
this.paint._values['fill-outline-color'] = this.paint._values['fill-color'];
}

We should optimize this somehow — maybe add special code to reuse the fill-color paint buffer for the outline if the value is undefined?

@mourner mourner added the performance ⚡ Speed, stability, CPU usage, memory usage, or power usage label Apr 15, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
performance ⚡ Speed, stability, CPU usage, memory usage, or power usage
1 participant