Symbol UBOs fixes (#2331)

This commit is contained in:
Alex Cristici
2024-04-26 19:15:42 +03:00
committed by GitHub
parent 51a77b4b26
commit 84ec4f8234
13 changed files with 10 additions and 68 deletions

View File

@@ -1079,8 +1079,8 @@ void RenderSymbolLayer::update(gfx::ShaderRegistry& shaders,
auto addCollisionDrawables = [&](const bool isText, const bool hasCollisionBox, const bool hasCollisionCircle) {
if (!hasCollisionBox && !hasCollisionCircle) return;
const auto& group = getCollisionTileLayerGroup();
if (!group) {
const auto& collisionGroup = getCollisionTileLayerGroup();
if (!collisionGroup) {
return;
}
@@ -1132,7 +1132,7 @@ void RenderSymbolLayer::update(gfx::ShaderRegistry& shaders,
auto drawData = std::make_unique<gfx::CollisionDrawableData>(values.translate, values.translateAnchor);
drawable->setData(std::move(drawData));
group->addDrawable(passes, tileID, std::move(drawable));
collisionGroup->addDrawable(passes, tileID, std::move(drawable));
++stats.drawablesAdded;
}
};

View File

@@ -5,10 +5,10 @@ namespace shaders {
const std::array<UniformBlockInfo, 5> ShaderSource<BuiltIn::SymbolIconShader, gfx::Backend::Type::Metal>::uniforms = {
UniformBlockInfo{true, false, sizeof(GlobalPaintParamsUBO), idGlobalPaintParamsUBO},
UniformBlockInfo{true, true, sizeof(SymbolDrawableUBO), idSymbolDrawableUBO},
UniformBlockInfo{true, false, sizeof(SymbolDrawableUBO), idSymbolDrawableUBO},
UniformBlockInfo{true, true, sizeof(SymbolTilePropsUBO), idSymbolTilePropsUBO},
UniformBlockInfo{true, false, sizeof(SymbolInterpolateUBO), idSymbolInterpolateUBO},
UniformBlockInfo{true, true, sizeof(SymbolEvaluatedPropsUBO), idSymbolEvaluatedPropsUBO},
UniformBlockInfo{false, true, sizeof(SymbolEvaluatedPropsUBO), idSymbolEvaluatedPropsUBO},
};
const std::array<AttributeInfo, 6> ShaderSource<BuiltIn::SymbolIconShader, gfx::Backend::Type::Metal>::attributes = {
// always attributes

View File

@@ -9,7 +9,7 @@ const std::array<UniformBlockInfo, 5> ShaderSource<BuiltIn::SymbolSDFIconShader,
UniformBlockInfo{true, true, sizeof(SymbolDrawableUBO), idSymbolDrawableUBO},
UniformBlockInfo{true, true, sizeof(SymbolTilePropsUBO), idSymbolTilePropsUBO},
UniformBlockInfo{true, false, sizeof(SymbolInterpolateUBO), idSymbolInterpolateUBO},
UniformBlockInfo{true, true, sizeof(SymbolEvaluatedPropsUBO), idSymbolEvaluatedPropsUBO},
UniformBlockInfo{false, true, sizeof(SymbolEvaluatedPropsUBO), idSymbolEvaluatedPropsUBO},
};
const std::array<AttributeInfo, 10> ShaderSource<BuiltIn::SymbolSDFIconShader, gfx::Backend::Type::Metal>::attributes =
{

View File

@@ -9,7 +9,7 @@ const std::array<UniformBlockInfo, 5>
UniformBlockInfo{true, true, sizeof(SymbolDrawableUBO), idSymbolDrawableUBO},
UniformBlockInfo{true, true, sizeof(SymbolTilePropsUBO), idSymbolTilePropsUBO},
UniformBlockInfo{true, false, sizeof(SymbolInterpolateUBO), idSymbolInterpolateUBO},
UniformBlockInfo{true, true, sizeof(SymbolEvaluatedPropsUBO), idSymbolEvaluatedPropsUBO},
UniformBlockInfo{false, true, sizeof(SymbolEvaluatedPropsUBO), idSymbolEvaluatedPropsUBO},
};
const std::array<AttributeInfo, 9>
ShaderSource<BuiltIn::SymbolTextAndIconShader, gfx::Backend::Type::Metal>::attributes = {