From be46d18cd7cee6da8e25cac559544bd815d6d82c Mon Sep 17 00:00:00 2001 From: Anton Chernykh Date: Sun, 13 Apr 2025 16:44:53 +0300 Subject: [PATCH] Optimize stencil debug pass Instead of blitting debugHandle back to resourceData.activeColorTexture just set resourceData.cameraColor to ready to use debugHandle --- Runtime/StencilDebug.cs | 16 +--------------- 1 file changed, 1 insertion(+), 15 deletions(-) diff --git a/Runtime/StencilDebug.cs b/Runtime/StencilDebug.cs index a78df33..d50f117 100644 --- a/Runtime/StencilDebug.cs +++ b/Runtime/StencilDebug.cs @@ -91,21 +91,7 @@ public override void RecordRenderGraph(RenderGraph renderGraph, ContextContainer }); } - // 2. Compose. - // -> Compose stencil texture with scene. - using (var builder = renderGraph.AddRasterRenderPass(ShaderPassName.Compose, out _, profilingSampler)) - { - builder.UseTexture(debugHandle); - builder.SetRenderAttachment(resourceData.activeColorTexture, 0); - - builder.AllowPassCulling(false); - builder.AllowGlobalStateModification(false); - - builder.SetRenderFunc((PassData _, RasterGraphContext context) => - { - Blitter.BlitTexture(context.cmd, debugHandle, new Vector4(1, 1, 0, 0), 0, false); - }); - } + resourceData.cameraColor = debugHandle; } #endif private RTHandle cameraDepthRTHandle;