radv: do not clear unwritten color attachments with dual-source blending

This is incorrect because the color format at slot 0 needs to be
replicated to the slot 1. But with dual-source blending the colors
written mask is only 0xf and this was clearing the color format at
slot 1.

Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/13082
Fixes: e1483d022b ("radv: clear unwritten color attachments for monolithic PS earlier")
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/34773>
(cherry picked from commit 55ad0fd35c600538150f4c94ca2f03024cb0076b)
This commit is contained in:
Samuel Pitoiset
2025-04-30 19:40:57 +02:00
committed by Eric Engestrom
parent 52d082981f
commit 49d96917d5
2 changed files with 3 additions and 2 deletions

View File

@@ -674,7 +674,7 @@
"description": "radv: do not clear unwritten color attachments with dual-source blending",
"nominated": true,
"nomination_type": 2,
"resolution": 0,
"resolution": 1,
"main_sha": null,
"because_sha": "e1483d022b28218bd53aea1c4917739cf0398b3e",
"notes": null

View File

@@ -997,7 +997,8 @@ gather_shader_info_fs(const struct radv_device *device, const nir_shader *nir,
info->ps.spi_shader_col_format = gfx_state->ps.epilog.spi_shader_col_format;
/* Clear color attachments that aren't exported by the FS to match IO shader arguments. */
info->ps.spi_shader_col_format &= info->ps.colors_written;
if (!info->ps.mrt0_is_dual_src)
info->ps.spi_shader_col_format &= info->ps.colors_written;
info->ps.cb_shader_mask = ac_get_cb_shader_mask(info->ps.spi_shader_col_format);
}