Drawable Renderer (#1570), Improve handling of multiple drawables per tile

This commit is contained in:
Tim Sylvester
2023-06-01 08:47:33 -07:00
committed by Bart Louwers
parent 51c270495b
commit ee7f57fcb4
5 changed files with 30 additions and 28 deletions

View File

@@ -286,19 +286,9 @@ void RenderBackgroundLayer::update(gfx::ShaderRegistry& shaders,
// For each tile in the cover set, add a tile drawable if one doesn't already exist.
// We currently assume only one drawable per tile.
for (const auto& tileID : tileCover) {
auto& tileDrawable = tileLayerGroup->getDrawable(renderPass, tileID);
if (!(renderPass & drawPasses)) {
// Not in this pass
if (tileDrawable) {
tileLayerGroup->removeDrawables(renderPass, tileID);
++stats.tileDrawablesRemoved;
}
continue;
}
if (tileDrawable) {
// Already created, update it.
// If we already have drawables for this tile, skip.
// If a drawable needs to be updated, that's handled in the layer tweaker.
if (tileLayerGroup->getDrawableCount(renderPass, tileID) > 0) {
continue;
}