Merge branch 'topic/metal-sep21' into main (#1695)
Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: Tim Sylvester <tim@wetdogweather.com> Co-authored-by: Bart Louwers <bart@emeel.net> Co-authored-by: Alex Cristici <alex.cristici@gmail.com> Co-authored-by: Stefan Karschti <stefan.karschti@gmail.com> Co-authored-by: Alex Cristici <alex@skoon.energy> Co-authored-by: Bart Louwers <bart.louwers@gmail.com> Co-authored-by: Wei Chen <alanchenboy@gmail.com> Co-authored-by: Siarhei Fedartsou <siarhei.fedartsou@gmail.com> Co-authored-by: tdcosta100 <tdcosta100@gmail.com>
This commit is contained in:
@@ -90,7 +90,7 @@ void SymbolLayerTweaker::execute(LayerGroupBase& layerGroup,
|
||||
const auto zoom = parameters.state.getZoom();
|
||||
|
||||
#if MLN_RENDER_BACKEND_METAL
|
||||
if (propertiesChanged) {
|
||||
if (permutationUpdated) {
|
||||
const SymbolPermutationUBO permutationUBO = {
|
||||
/* .fill_color = */ {/*.source=*/getAttributeSource("a_fill_color"), /*.expression=*/{}},
|
||||
/* .halo_color = */ {/*.source=*/getAttributeSource("a_halo_color"), /*.expression=*/{}},
|
||||
@@ -108,7 +108,7 @@ void SymbolLayerTweaker::execute(LayerGroupBase& layerGroup,
|
||||
permutationUniformBuffer = context.createUniformBuffer(&permutationUBO, sizeof(permutationUBO));
|
||||
}
|
||||
|
||||
propertiesChanged = false;
|
||||
permutationUpdated = false;
|
||||
}
|
||||
if (!expressionUniformBuffer) {
|
||||
const auto expressionUBO = buildExpressionUBO(zoom, parameters.frameCount);
|
||||
@@ -116,6 +116,12 @@ void SymbolLayerTweaker::execute(LayerGroupBase& layerGroup,
|
||||
}
|
||||
#endif
|
||||
|
||||
if (propertiesUpdated) {
|
||||
textPropertiesUpdated = true;
|
||||
iconPropertiesUpdated = true;
|
||||
propertiesUpdated = false;
|
||||
}
|
||||
|
||||
layerGroup.visitDrawables([&](gfx::Drawable& drawable) {
|
||||
if (!drawable.getTileID() || !drawable.getData()) {
|
||||
return;
|
||||
@@ -125,14 +131,15 @@ void SymbolLayerTweaker::execute(LayerGroupBase& layerGroup,
|
||||
const auto& symbolData = static_cast<gfx::SymbolDrawableData&>(*drawable.getData());
|
||||
const auto isText = (symbolData.symbolType == SymbolType::Text);
|
||||
|
||||
if (isText && (!textPaintBuffer || propertiesUpdated)) {
|
||||
if (isText && (!textPaintBuffer || textPropertiesUpdated)) {
|
||||
const auto props = buildPaintUBO(true, evaluated);
|
||||
textPaintBuffer = parameters.context.createUniformBuffer(&props, sizeof(props));
|
||||
} else if (!isText && (!iconPaintBuffer || propertiesUpdated)) {
|
||||
textPropertiesUpdated = false;
|
||||
} else if (!isText && (!iconPaintBuffer || iconPropertiesUpdated)) {
|
||||
const auto props = buildPaintUBO(false, evaluated);
|
||||
iconPaintBuffer = parameters.context.createUniformBuffer(&props, sizeof(props));
|
||||
iconPropertiesUpdated = false;
|
||||
}
|
||||
propertiesUpdated = false;
|
||||
|
||||
// from RenderTile::translatedMatrix
|
||||
const auto translate = isText ? evaluated.get<style::TextTranslate>() : evaluated.get<style::IconTranslate>();
|
||||
|
||||
Reference in New Issue
Block a user