From 186cd59cf244cc891db95ea46106de27c51790e8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Iv=C3=A1n=20Briano?= Date: Mon, 22 Sep 2025 17:06:36 -0700 Subject: [PATCH] anv: use the color_map if present for calculating color_mask If the FS has writes to multiple color outputs, but there are not enough color attachments for them all, we may optimize out the exceeding ones. With VK_KHR_dynamic_rendering_local_read, we were not respecting the mapping from output to attachment set by the application, and the wrong writes were getting eliminated. Fixes future CTS tests: dEQP-VK.renderpasses.dynamic_rendering.primary_cmd_buff.local_read.remap_single_attachment* Reviewed-by: Lionel Landwerlin Part-of: --- src/intel/ci/angle-anv-adl-fails.txt | 2 -- src/intel/ci/angle-anv-jsl-fails.txt | 3 --- src/intel/ci/angle-anv-tgl-fails.txt | 2 -- src/intel/vulkan/anv_shader_compile.c | 10 ++++++++-- 4 files changed, 8 insertions(+), 9 deletions(-) diff --git a/src/intel/ci/angle-anv-adl-fails.txt b/src/intel/ci/angle-anv-adl-fails.txt index 0466068513a..e69de29bb2d 100644 --- a/src/intel/ci/angle-anv-adl-fails.txt +++ b/src/intel/ci/angle-anv-adl-fails.txt @@ -1,2 +0,0 @@ -# New failures with ES CTS 3.2.12.0 -KHR-GLES3.framebuffer_blit.scissor_blit,Fail diff --git a/src/intel/ci/angle-anv-jsl-fails.txt b/src/intel/ci/angle-anv-jsl-fails.txt index ab8efdce645..71668615d67 100644 --- a/src/intel/ci/angle-anv-jsl-fails.txt +++ b/src/intel/ci/angle-anv-jsl-fails.txt @@ -13,6 +13,3 @@ KHR-GLES31.core.texture_border_clamp.Texture2DDC16Linear,Fail # new with ANGLE 2024-10-17 KHR-GLES31.core.blend_equation_advanced.test_coherency.multiplySequence,Fail - -# New failures with ES CTS 3.2.12.0 -KHR-GLES3.framebuffer_blit.scissor_blit,Fail diff --git a/src/intel/ci/angle-anv-tgl-fails.txt b/src/intel/ci/angle-anv-tgl-fails.txt index 0466068513a..e69de29bb2d 100644 --- a/src/intel/ci/angle-anv-tgl-fails.txt +++ b/src/intel/ci/angle-anv-tgl-fails.txt @@ -1,2 +0,0 @@ -# New failures with ES CTS 3.2.12.0 -KHR-GLES3.framebuffer_blit.scissor_blit,Fail diff --git a/src/intel/vulkan/anv_shader_compile.c b/src/intel/vulkan/anv_shader_compile.c index 2cd612cffad..e44ec68654e 100644 --- a/src/intel/vulkan/anv_shader_compile.c +++ b/src/intel/vulkan/anv_shader_compile.c @@ -395,8 +395,14 @@ rp_color_mask(const struct vk_graphics_pipeline_state *state) uint32_t color_mask = 0; for (uint32_t i = 0; i < state->rp->color_attachment_count; i++) { - if (state->rp->color_attachment_formats[i] != VK_FORMAT_UNDEFINED) - color_mask |= BITFIELD_BIT(i); + if (state->rp->color_attachment_formats[i] != VK_FORMAT_UNDEFINED) { + if (state->cal) { + if (state->cal->color_map[i] != MESA_VK_ATTACHMENT_UNUSED) + color_mask |= BITFIELD_BIT(state->cal->color_map[i]); + } else { + color_mask |= BITFIELD_BIT(i); + } + } } return color_mask;