-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Do not render tiles from disabled layers #6345
Conversation
@kkaefer, thanks for your PR! By analyzing this pull request, we identified @jfirebaugh, @ansis and @tmpsantos to be potential reviewers. |
Missing tests |
👍 after adding utests |
79d65a9
to
935e634
Compare
This actually turned out to be a different problem: So far, we didn't properly disable layers that are outside the zoom range. This means that we rendered layers that should not have been rendered, albeit we didn't make any attempt to load tiles for those layers. However, when zooming in/out, existing tiles might already have been loaded in the source which continued to be rendered. In most cases they weren't actually visible because either the matrices weren't updated, or the clip IDs weren't set so that they would be "rendered" off-screen and clipped completely. In any case, we did way too much work. |
There are a number of follow up issues that I found while working on this:
|
935e634
to
0384496
Compare
Urgh, the color is off by one on Linux. On Mac, I get |
I thought #5828 was supposed to fix that? |
#5828 didn't resolve this fully. It didn't actually stop rendering the layers, it just stopped updating them. This lead to a situation where they were still rendered, but their position matrix and stencil mask wasn't updated anymore. In most situations, this resulted either in a matrix that was off-screen, or a stencil mask that was all zeros, but we still issued all of the draw calls. This patch introduces an |
2f9b64c
to
9142feb
Compare
Do we need to introduce more state ( |
9142feb
to
2ac5352
Compare
Changed to call |
2ac5352
to
135bb1e
Compare
So far, we didn't properly disable layers that are outside the zoom range. This means that we rendered layers that should not have been rendered, albeit we didn't make any attempt to load tiles for those layers. However, when zooming in/out, existing tiles might already have been loaded in the source which continued to be rendered. In most cases they weren't actually visible because either the matrices weren't updated, or the clip IDs weren't set so that they would be "rendered" off-screen and clipped completely. In any case, we did way too much work.
135bb1e
to
1e8f9c7
Compare
When a source has a
minzoom
andmaxzoom
, tiles from it should be be rendered when they are outside the range. However, when building the list of tiles to render, we are not skipping them correctly.