From 730e83b525cb27e153e929ed0e57ac6e3ad4b741 Mon Sep 17 00:00:00 2001 From: Nanley Chery Date: Fri, 20 Sep 2024 20:08:09 -0400 Subject: [PATCH] anv: Require compression for fast-clears on gfx20+ In commit 44351d67f8f, I needed to change some variables in a check for compression in anv_can_fast_clear_color_view(). Instead of doing that, I dropped the check altogether because I thought the call to anv_layout_to_fast_clear_type() which followed right afterwards would return ANV_FAST_CLEAR_NONE if the aux usage was ISL_AUX_USAGE_NONE. That turned out not to be the case, due to special-casing of Xe2+. For now, make Xe2+ more like other platforms when it comes to enabling fast-clears. If there comes a reason to actually fast-clear with ISL_AUX_USAGE_NONE, we can revisit this. Fixes: 44351d67f8f ("anv: Change params of anv_can_fast_clear_color_view") Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/11920 Reviewed-by: Paulo Zanoni Reviewed-by: Lionel Landwerlin Part-of: --- src/intel/vulkan/anv_image.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/intel/vulkan/anv_image.c b/src/intel/vulkan/anv_image.c index b1d317d3055..8d61cccefdf 100644 --- a/src/intel/vulkan/anv_image.c +++ b/src/intel/vulkan/anv_image.c @@ -3155,18 +3155,18 @@ anv_layout_to_fast_clear_type(const struct intel_device_info * const devinfo, if (INTEL_DEBUG(DEBUG_NO_FAST_CLEAR)) return ANV_FAST_CLEAR_NONE; - /* Xe2+ platforms don't have fast clear type and can always support - * arbitrary fast-clear values. - */ - if (devinfo->ver >= 20) - return ANV_FAST_CLEAR_ANY; - const uint32_t plane = anv_image_aspect_to_plane(image, aspect); /* If there is no auxiliary surface allocated, there are no fast-clears */ if (image->planes[plane].aux_usage == ISL_AUX_USAGE_NONE) return ANV_FAST_CLEAR_NONE; + /* Xe2+ platforms don't have fast clear type and can always support + * arbitrary fast-clear values. + */ + if (devinfo->ver >= 20) + return ANV_FAST_CLEAR_ANY; + enum isl_aux_state aux_state = anv_layout_to_aux_state(devinfo, image, aspect, layout, queue_flags);