anv: Flush previous aux-mode changes
Some checks are pending
macOS-CI / macOS-CI (dri) (push) Waiting to run
macOS-CI / macOS-CI (xlib) (push) Waiting to run

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 <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/41034>
This commit is contained in:
Nanley Chery 2026-04-27 12:57:40 -04:00 committed by Marge Bot
parent c49674188e
commit d74a03a70d

View file

@ -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;