From 0e7c1e80eb75f875b7ddcd7c2212660069795480 Mon Sep 17 00:00:00 2001 From: Robin KAY Date: Sat, 6 Aug 2022 01:41:17 +0100 Subject: [PATCH] Disable stencil pass if there are no outlines. --- src/node.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/node.rs b/src/node.rs index 4fda3bd..ade7269 100644 --- a/src/node.rs +++ b/src/node.rs @@ -169,8 +169,8 @@ impl Node for OutlineNode { } // No window }; - // Always run stencil pass to ensure depth buffer is cleared - { + // If drawing anything, run stencil pass to clear the depth buffer + if !opaque_phase.items.is_empty() || !transparent_phase.items.is_empty() { let pass_descriptor = RenderPassDescriptor { label: Some("outline_stencil_pass"), color_attachments: &[],