gpu: centralize depth copy state validation in target resolution

This commit is contained in:
nmzik
2026-10-11 07:57:27 +02:00
parent f848d2761b
commit 65144ce4ac
2 changed files with 6 additions and 14 deletions
+3 -12
View File
@@ -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");
@@ -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<uint8_t>(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<uint8_t>(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)) {