anv: Require compression for fast-clears on gfx20+

In commit 44351d67f8, 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: 44351d67f8 ("anv: Change params of anv_can_fast_clear_color_view")
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/11920
Reviewed-by: Paulo Zanoni <paulo.r.zanoni@intel.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/31297>
This commit is contained in:
Nanley Chery 2024-09-20 20:08:09 -04:00 committed by Marge Bot
parent d5f207311d
commit 730e83b525

View file

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