From a65d17a5d689257a35644e01e9d15539361f0bf0 Mon Sep 17 00:00:00 2001 From: nmzik Date: Sat, 1 Aug 2026 00:22:24 +0200 Subject: [PATCH] renderer: skip debug checks when stencil&depth is not active --- src/graphics/host_gpu/renderer/debug.cpp | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/src/graphics/host_gpu/renderer/debug.cpp b/src/graphics/host_gpu/renderer/debug.cpp index f26e8c47b..bda3fcc89 100644 --- a/src/graphics/host_gpu/renderer/debug.cpp +++ b/src/graphics/host_gpu/renderer/debug.cpp @@ -497,7 +497,15 @@ static void ZPrint(const char* func, const HW::DepthRenderTarget& z) { } // NOLINTNEXTLINE(readability-function-cognitive-complexity) -static void ZCheck(const HW::DepthRenderTarget& z) { +static void ZCheck(const HW::DepthRenderTarget& z, const HW::DepthControl& dc, + const HW::RenderControl& rc) { + const bool depth_active = + dc.z_enable || dc.z_write_enable || dc.depth_bounds_enable || rc.depth_clear_enable; + const bool stencil_active = dc.stencil_enable || rc.stencil_clear_enable; + if (!depth_active && !stencil_active) { + return; + } + EXIT_NOT_IMPLEMENTED(!z.z_info.HasValidTextureCompatibility()); EXIT_NOT_IMPLEMENTED(!z.stencil_info.HasValidTextureCompatibility()); if (z.z_info.format == 0) { @@ -1206,7 +1214,7 @@ void hw_check(const RenderCommandBuffer& buffer) { log_phase("vp"); VpCheck(vp, smc); log_phase("z"); - ZCheck(z); + ZCheck(z, d, rc); log_phase("clip"); ClipCheck(c); log_phase("rc");