[core] shader program must always match bucket in render symbol layer

Before this change, `RenderSymbolLayer` with updated style was trying to render
symbols using the previous bucket (with paint property binders that matched a previous program).

Now, symbol bucket caches the latest corresponding paint properties (caching is happening on
complete tiles only). As a result, `RenderSymbolLayer` always picks the shader program and
its parameters in sync with the obtained bucket.
This commit is contained in:
Mikhail Pozdnyakov
2019-01-03 17:17:57 +02:00
parent 2da9d483ac
commit 2bdab82ded
8 changed files with 73 additions and 53 deletions

View File

@@ -71,10 +71,13 @@ RenderLayer::RenderTiles RenderLayer::filterRenderTiles(RenderTiles tiles, Filte
continue;
}
if (tile.tile.getBucket(*baseImpl)) {
if (Bucket* bucket = tile.tile.getBucket(*baseImpl)) {
tile.used = true;
tile.needsClipping |= needsClipping_;
filtered.emplace_back(tile);
if (tile.tile.isComplete()) {
updateBucketPaintProperties(bucket);
}
}
}
return filtered;
@@ -84,6 +87,10 @@ void RenderLayer::markContextDestroyed() {
// no-op
}
void RenderLayer::updateBucketPaintProperties(Bucket*) const {
// no-op
}
void RenderLayer::checkRenderability(const PaintParameters& parameters,
const uint32_t activeBindingCount) {
// Only warn once for every layer.