Avoid redundant bindings/states based on Metal profiler feedback. (#2006)

This commit is contained in:
Tim Sylvester
2024-01-22 07:02:36 -08:00
committed by GitHub
parent cd3de6d3ad
commit 5c304614d6
9 changed files with 90 additions and 35 deletions

View File

@@ -43,7 +43,7 @@ void TileLayerGroup::render(RenderOrchestrator&, PaintParameters& parameters) {
}
auto& context = static_cast<Context&>(parameters.context);
const auto& renderPass = static_cast<const mtl::RenderPass&>(*parameters.renderPass);
auto& renderPass = static_cast<mtl::RenderPass&>(*parameters.renderPass);
const auto& encoder = renderPass.getMetalEncoder();
const auto& renderable = renderPass.getDescriptor().renderable;
@@ -101,9 +101,7 @@ void TileLayerGroup::render(RenderOrchestrator&, PaintParameters& parameters) {
// 2D drawables will set their own stencil mode within `draw`.
if (features3d) {
const auto& state = drawable.getEnableStencil() ? stateWithStencil : stateWithoutStencil;
if (state) {
encoder->setDepthStencilState(state.get());
}
renderPass.setDepthStencilState(state);
}
drawable.draw(parameters);