diff --git a/.pick_status.json b/.pick_status.json index 3765c19b41c..5a1b03956ca 100644 --- a/.pick_status.json +++ b/.pick_status.json @@ -1354,7 +1354,7 @@ "description": "radv: fix color attachment remapping with fast-GPL/ESO", "nominated": true, "nomination_type": 1, - "resolution": 0, + "resolution": 1, "main_sha": null, "because_sha": null, "notes": null diff --git a/src/amd/vulkan/radv_cmd_buffer.c b/src/amd/vulkan/radv_cmd_buffer.c index eb0a47680c7..b4948534510 100644 --- a/src/amd/vulkan/radv_cmd_buffer.c +++ b/src/amd/vulkan/radv_cmd_buffer.c @@ -5401,7 +5401,7 @@ lookup_ps_epilog(struct radv_cmd_buffer *cmd_buffer) state.color_attachment_formats[i] = render->color_att[i].format; } - for (unsigned i = 0; i < MAX_RTS; i++) { + for (unsigned i = 0; i < render->color_att_count; i++) { VkBlendOp eqRGB = d->vk.cb.attachments[i].color_blend_op; VkBlendFactor srcRGB = d->vk.cb.attachments[i].src_color_blend_factor; VkBlendFactor dstRGB = d->vk.cb.attachments[i].dst_color_blend_factor; @@ -5454,6 +5454,14 @@ lookup_ps_epilog(struct radv_cmd_buffer *cmd_buffer) struct radv_ps_epilog_key key = radv_generate_ps_epilog_key(device, &state); + /* Adjust the remapping for alpha-to-coverage without any color attachment and dual-source + * blending to make sure colors written aren't cleared. + */ + if (!state.color_attachment_count && state.need_src_alpha) + color_remap[0] = 0; + if (state.mrt0_is_dual_src) + color_remap[1] = 1; + /* Determine the actual colors written if outputs are remapped. */ uint32_t colors_written = 0; for (uint32_t i = 0; i < MAX_RTS; i++) {