From 168a8d0b520aa09105e633b9857ea62d44a98adc Mon Sep 17 00:00:00 2001 From: Samuel Pitoiset Date: Tue, 18 Nov 2025 16:14:53 +0100 Subject: [PATCH] radv: fix RB+ for depth-only with unused attachments When there are no color outputs in the rendering state, but color write enable/write aren't masked out (which seems legal with VK_EXT_dynamic_rendering_unused_attachments), the driver must emit CB_DISABLE to disable CB rendering completely. Otherwise, if there is also a depth/stencil attachment in the rendering state, CB0 is always set to 32_R for RB+. That means, the pixel shader would still export fragments but to the previously bound color attachment. VKCTS is missing coverage. Fixes: 4580293ab2c ("radv: implement RB+ depth-only rendering for better perf") Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/14319 Signed-off-by: Samuel Pitoiset Part-of: --- src/amd/vulkan/radv_cmd_buffer.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/amd/vulkan/radv_cmd_buffer.c b/src/amd/vulkan/radv_cmd_buffer.c index 5a22a398071..6a56563cdc7 100644 --- a/src/amd/vulkan/radv_cmd_buffer.c +++ b/src/amd/vulkan/radv_cmd_buffer.c @@ -12039,7 +12039,7 @@ radv_emit_cb_render_state(struct radv_cmd_buffer *cmd_buffer) if (cmd_buffer->state.custom_blend_mode) { cb_color_control |= S_028808_MODE(cmd_buffer->state.custom_blend_mode); } else { - if (d->color_write_mask) { + if (render->color_att_count > 0 && d->color_write_mask) { cb_color_control |= S_028808_MODE(V_028808_CB_NORMAL); } else { cb_color_control |= S_028808_MODE(V_028808_CB_DISABLE);