From d74a03a70d8e978423dc0d9339b4a55a291e5b92 Mon Sep 17 00:00:00 2001 From: Nanley Chery Date: Mon, 27 Apr 2026 12:57:40 -0400 Subject: [PATCH] anv: Flush previous aux-mode changes If the aux-usage changes, we need to flush out the previous mode from the cache (see iris's flush_previous_aux_mode()). I ran into this while testing layout-based compression toggling with the Hogwarts Legacy trace on DG2. The trace exhibited graphical corruption unless the DATA_CACHE was flushed. On an unmodified driver, this currently only affects transitions from AUX_NONE->AUX_CCS_D. Backport-to: * Reviewed-by: Lionel Landwerlin Part-of: --- src/intel/vulkan/genX_cmd_buffer.c | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/src/intel/vulkan/genX_cmd_buffer.c b/src/intel/vulkan/genX_cmd_buffer.c index 73298dc8513..9b96862521b 100644 --- a/src/intel/vulkan/genX_cmd_buffer.c +++ b/src/intel/vulkan/genX_cmd_buffer.c @@ -1369,9 +1369,18 @@ transition_color_buffer(struct anv_cmd_buffer *cmd_buffer, final_aux_usage == ISL_AUX_USAGE_NONE || initial_aux_usage == final_aux_usage); - /* If initial aux usage is NONE, there is nothing to resolve */ - if (initial_aux_usage == ISL_AUX_USAGE_NONE) + /* If initial aux usage is NONE, there is nothing to resolve. However, we + * need to ensure uncompressed cachelines don't interfere with compressed + * cachelines which may be generated in the final layout. + */ + if (initial_aux_usage == ISL_AUX_USAGE_NONE) { + if (final_aux_usage != ISL_AUX_USAGE_NONE) { + genX(cmd_buffer_update_color_aux_op)(cmd_buffer, GFX_VER == 9 ? + ANV_COLOR_AUX_OP_CLASS_SW_AMBIGUATE : + ANV_COLOR_AUX_OP_CLASS_HW_AMBIGUATE); + } return; + } enum isl_aux_op resolve_op = ISL_AUX_OP_NONE;