From f34dd96ab52365c2037f212cc1462ad2b3701d74 Mon Sep 17 00:00:00 2001 From: Lionel Landwerlin Date: Wed, 20 May 2026 22:05:20 +0300 Subject: [PATCH] anv: fix render target remapping tracking at the beginning of render passes At the beginning of render passes we need to consider all entries as unknown because it's all new color outputs. Signed-off-by: Lionel Landwerlin Fixes: d2f7b6d5a7 ("anv: implement VK_KHR_dynamic_rendering_local_read") Closes: https://gitlab.freedesktop.org/mesa/mesa/-/work_items/15475 Reviewed-by: Ivan Briano Part-of: --- src/intel/vulkan/anv_private.h | 7 +++++-- src/intel/vulkan/genX_cmd_buffer.c | 3 +++ 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/src/intel/vulkan/anv_private.h b/src/intel/vulkan/anv_private.h index 989f32057fe..6deccb712e3 100644 --- a/src/intel/vulkan/anv_private.h +++ b/src/intel/vulkan/anv_private.h @@ -190,15 +190,18 @@ get_max_vbs(const struct intel_device_info *devinfo) { #define ANV_TRTT_L1_NULL_TILE_VAL 0 #define ANV_TRTT_L1_INVALID_TILE_VAL 1 -/* The binding table entry id disabled, the shader can write to it and the +/* The binding table entry is disabled, the shader can write to it and the * driver should use a null surface state so that writes are discarded. */ #define ANV_COLOR_OUTPUT_DISABLED (0xff) -/* The binding table entry id unused, the shader does not write to it and the +/* The binding table entry is unused, the shader does not write to it and the * driver can leave whatever surface state was used before. Transitioning * to/from this entry does not require render target cache flush. */ #define ANV_COLOR_OUTPUT_UNUSED (0xfe) +/* The binding table entry is unknown. + */ +#define ANV_COLOR_OUTPUT_UNKNOWN (0xfd) static inline uint64_t align_down_npot_u64(uint64_t v, uint64_t a) diff --git a/src/intel/vulkan/genX_cmd_buffer.c b/src/intel/vulkan/genX_cmd_buffer.c index df04e16f616..73298dc8513 100644 --- a/src/intel/vulkan/genX_cmd_buffer.c +++ b/src/intel/vulkan/genX_cmd_buffer.c @@ -6772,6 +6772,9 @@ void genX(CmdBeginRendering)( */ gfx->dirty |= ANV_CMD_DIRTY_ALL_SHADERS(cmd_buffer->device); + memset(gfx->color_output_mapping, ANV_COLOR_OUTPUT_UNKNOWN, + sizeof(gfx->color_output_mapping)); + #if GFX_VER >= 11 if (render_target_change && cmd_buffer->device->physical->rt_change_needs_flush) { /* The PIPE_CONTROL command description says: