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

Compile terrain shader program earlier when terrain is detected #10194

Closed
karimnaaji opened this issue Dec 11, 2020 · 0 comments · Fixed by #12039
Closed

Compile terrain shader program earlier when terrain is detected #10194

karimnaaji opened this issue Dec 11, 2020 · 0 comments · Fixed by #12039
Labels
3d 📐 performance ⚡ Speed, stability, CPU usage, memory usage, or power usage

Comments

@karimnaaji
Copy link
Contributor

karimnaaji commented Dec 11, 2020

mapbox-gl-js version: 2.0.0

Following preemptive shader compilation (a30ccc8) with terrain, we noticed that we have a lot of "cache miss" once preemptive compilation has done its first pass:

Screen Shot 2020-08-28 at 12 52 52 PM

This is due to the highlighted line, rtt is only set after a state change in the terrain system, which then inject RENDER_TO_TEXTURE to a few variant of our shaders.

A fix for that would be to immediately add this define to the program definition whenever terrain is detected by default in the style, this would save a lot of shader variant being compiled with delay. Terrain shader variant could benefit from the preemptive shader compilation strategy already introduced.

Eventually reevaluate KHR_parallel_shader_compile.

@karimnaaji karimnaaji added the performance ⚡ Speed, stability, CPU usage, memory usage, or power usage label Dec 11, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
3d 📐 performance ⚡ Speed, stability, CPU usage, memory usage, or power usage
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants