From 49d96917d582f4eaaecad44a11bc660060a0588d Mon Sep 17 00:00:00 2001 From: Samuel Pitoiset Date: Wed, 30 Apr 2025 19:40:57 +0200 Subject: [PATCH] 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: e1483d022b2 ("radv: clear unwritten color attachments for monolithic PS earlier") Signed-off-by: Samuel Pitoiset Part-of: (cherry picked from commit 55ad0fd35c600538150f4c94ca2f03024cb0076b) --- .pick_status.json | 2 +- src/amd/vulkan/radv_shader_info.c | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/.pick_status.json b/.pick_status.json index bb42ba9dde9..3650566d4c0 100644 --- a/.pick_status.json +++ b/.pick_status.json @@ -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 diff --git a/src/amd/vulkan/radv_shader_info.c b/src/amd/vulkan/radv_shader_info.c index 2f8e99d2990..0513e55b3fa 100644 --- a/src/amd/vulkan/radv_shader_info.c +++ b/src/amd/vulkan/radv_shader_info.c @@ -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); }