From 65144ce4ac051b38a6ee6353e0d8cbadf8b21e63 Mon Sep 17 00:00:00 2001 From: nmzik Date: Sun, 11 Oct 2026 07:57:27 +0200 Subject: [PATCH] gpu: centralize depth copy state validation in target resolution --- src/graphics/host_gpu/renderer/debug.cpp | 15 +++------------ .../host_gpu/renderer/depthRenderTarget.cpp | 5 +++-- 2 files changed, 6 insertions(+), 14 deletions(-) diff --git a/src/graphics/host_gpu/renderer/debug.cpp b/src/graphics/host_gpu/renderer/debug.cpp index 6d8cb3745..8837d6885 100644 --- a/src/graphics/host_gpu/renderer/debug.cpp +++ b/src/graphics/host_gpu/renderer/debug.cpp @@ -394,26 +394,20 @@ static void RcPrint(const char* func, const HW::RenderControl& c) { LOGF("\t depth_clear_enable = %s\n" "\t stencil_clear_enable = %s\n" + "\t copy_depth_to_color = %s\n" + "\t copy_stencil_to_color = %s\n" "\t resummarize_enable = %s\n" "\t stencil_compress_disable = %s\n" "\t depth_compress_disable = %s\n" "\t copy_centroid = %s\n" "\t copy_sample = %" PRIu8 "\n", c.depth_clear_enable ? "true" : "false", c.stencil_clear_enable ? "true" : "false", + c.copy_depth_to_color ? "true" : "false", c.copy_stencil_to_color ? "true" : "false", c.resummarize_enable ? "true" : "false", c.stencil_compress_disable ? "true" : "false", c.depth_compress_disable ? "true" : "false", c.copy_centroid ? "true" : "false", c.copy_sample); } -static void RcCheck(const HW::RenderControl& c) { - // EXIT_NOT_IMPLEMENTED(c.depth_clear_enable != false); - // EXIT_NOT_IMPLEMENTED(c.stencil_clear_enable != false); - // EXIT_NOT_IMPLEMENTED(c.stencil_compress_disable != false); - // EXIT_NOT_IMPLEMENTED(c.depth_compress_disable != false); - EXIT_NOT_IMPLEMENTED(c.copy_centroid != false); - EXIT_NOT_IMPLEMENTED(c.copy_sample != 0); -} - static void McPrint(const char* func, const HW::ModeControl& c) { LOGF("%s\n", func); @@ -869,9 +863,6 @@ void hw_check(const CommandBuffer& buffer) { VpCheck(vp, smc); log_phase("clip"); ClipCheck(c); - log_phase("rc"); - RcCheck(rc); - log_phase("depth"); log_phase("mode"); McCheck(mc); log_phase("blend"); diff --git a/src/graphics/host_gpu/renderer/depthRenderTarget.cpp b/src/graphics/host_gpu/renderer/depthRenderTarget.cpp index 8ac58043a..033e9ac67 100644 --- a/src/graphics/host_gpu/renderer/depthRenderTarget.cpp +++ b/src/graphics/host_gpu/renderer/depthRenderTarget.cpp @@ -298,8 +298,9 @@ void RenderExecutor::ResolveRenderDepthTarget(CommandBuffer& buffer, RenderDepth } return; } - if (rc.copy_depth_to_color || rc.copy_stencil_to_color || rc.copy_centroid || - rc.copy_sample != 0 || dc.zfunc > static_cast(vk::CompareOp::eAlways) || + // Centroid/sample selectors only affect depth/stencil-to-color copies. + if (rc.copy_depth_to_color || rc.copy_stencil_to_color || + dc.zfunc > static_cast(vk::CompareOp::eAlways) || (!z.depth_view.depth_write_disable && z.z_write_base_addr != z.z_read_base_addr) || (has_stencil && !z.depth_view.stencil_write_disable && z.stencil_write_base_addr != z.stencil_read_base_addr)) {