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

@@ -233,10 +233,8 @@ void Drawable::draw(PaintParameters& parameters) const {
impl->depthStencilState = context.makeDepthStencilState(depthMode, stencilMode, renderable);
impl->previousStencilMode = *newStencilMode;
}
if (impl->depthStencilState) {
encoder->setDepthStencilState(impl->depthStencilState.get());
encoder->setStencilReferenceValue(impl->previousStencilMode.ref);
}
renderPass.setDepthStencilState(impl->depthStencilState);
renderPass.setStencilReference(impl->previousStencilMode.ref);
}
for (const auto& seg_ : impl->segments) {