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:
mwilsnd
2023-10-02 09:22:19 -04:00
committed by GitHub
parent 34a2097bdd
commit f4d3cb6b69
48 changed files with 754 additions and 576 deletions

View File

@@ -93,7 +93,7 @@ void FillLayerTweaker::execute(LayerGroupBase& layerGroup,
#if MLN_RENDER_BACKEND_METAL
using ShaderClass = ShaderSource<BuiltIn::FillShader, gfx::Backend::Type::Metal>;
if (propertiesChanged || !fillPermutationUniformBuffer) {
if (permutationUpdated || !fillPermutationUniformBuffer) {
const FillPermutationUBO permutationUBO = {
/* .color = */ {/*.source=*/source(ShaderClass::attributes[1].name), /*.expression=*/{}},
/* .opacity = */ {/*.source=*/source(ShaderClass::attributes[2].name), /*.expression=*/{}},
@@ -132,7 +132,7 @@ void FillLayerTweaker::execute(LayerGroupBase& layerGroup,
#if MLN_RENDER_BACKEND_METAL
using ShaderClass = ShaderSource<BuiltIn::FillOutlineShader, gfx::Backend::Type::Metal>;
if (propertiesChanged || !fillOutlinePermutationUniformBuffer) {
if (permutationUpdated || !fillOutlinePermutationUniformBuffer) {
const FillOutlinePermutationUBO permutationUBO = {
/* .outline_color = */ {/*.source=*/source(ShaderClass::attributes[1].name), /*.expression=*/{}},
/* .opacity = */ {/*.source=*/source(ShaderClass::attributes[2].name), /*.expression=*/{}},
@@ -173,7 +173,7 @@ void FillLayerTweaker::execute(LayerGroupBase& layerGroup,
#if MLN_RENDER_BACKEND_METAL
using ShaderClass = ShaderSource<BuiltIn::FillOutlinePatternShader, gfx::Backend::Type::Metal>;
if (propertiesChanged || !fillPatternPermutationUniformBuffer) {
if (permutationUpdated || !fillPatternPermutationUniformBuffer) {
const FillPatternPermutationUBO permutationUBO = {
/* .pattern_from = */ {/*.source=*/source(ShaderClass::attributes[1].name), /*.expression=*/{}},
/* .pattern_to = */ {/*.source=*/source(ShaderClass::attributes[2].name), /*.expression=*/{}},
@@ -212,7 +212,7 @@ void FillLayerTweaker::execute(LayerGroupBase& layerGroup,
#if MLN_RENDER_BACKEND_METAL
using ShaderClass = ShaderSource<BuiltIn::FillOutlinePatternShader, gfx::Backend::Type::Metal>;
if (propertiesChanged || !fillOutlinePermutationUniformBuffer) {
if (permutationUpdated || !fillOutlinePatternPermutationUniformBuffer) {
const FillOutlinePatternPermutationUBO permutationUBO = {
/* .pattern_from = */ {/*.source=*/source(ShaderClass::attributes[1].name), /*.expression=*/{}},
/* .pattern_to = */ {/*.source=*/source(ShaderClass::attributes[2].name), /*.expression=*/{}},
@@ -255,6 +255,10 @@ void FillLayerTweaker::execute(LayerGroupBase& layerGroup,
#endif
layerGroup.visitDrawables([&](gfx::Drawable& drawable) {
if (!drawable.getTileID() || !checkTweakDrawable(drawable)) {
return;
}
auto& uniforms = drawable.mutableUniformBuffers();
// auto& drawableType = drawable.getShader()->typeName();
@@ -287,9 +291,6 @@ void FillLayerTweaker::execute(LayerGroupBase& layerGroup,
}
}
}
if (!drawable.getTileID()) {
return;
}
if (uniforms.get(idFillInterpolateUBOName)) {
UpdateFillUniformBuffers();
@@ -361,7 +362,7 @@ void FillLayerTweaker::execute(LayerGroupBase& layerGroup,
#endif // MLN_RENDER_BACKEND_METAL
});
propertiesChanged = false;
permutationUpdated = false;
}
} // namespace mbgl