From bf3d6ca94fa56eea8f989b0ca8c5cfe7fb8b7065 Mon Sep 17 00:00:00 2001 From: Kenneth Graunke Date: Thu, 6 Oct 2022 00:14:35 -0700 Subject: [PATCH] iris: Allow fast clears on compressed image load/store access While I haven't found documentation saying definitively that HDC supports fast clear blocks, it seems to work just fine, even on Tigerlake. I have found several issues (atomics and HDC support for linear compression) that both call out fast clears as an issue in those corner cases, which suggests that fast clears do actually work outside of those corners (which we already disable). The previous commit implemented actual aux state updates for image views. With ISL_AUX_USAGE_GFX12_CCS_E, this means that we update the aux state to COMPRESSED_CLEAR after writes. But because we weren't supporting fast clears, this meant that any such images would need partial resolves to remove the clear color on next use. Supporting fast clears allows us to drop all these resolves. Reviewed-by: Nanley Chery Part-of: --- src/gallium/drivers/iris/iris_resolve.c | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/src/gallium/drivers/iris/iris_resolve.c b/src/gallium/drivers/iris/iris_resolve.c index f0ecb3a622b..b299b5b9339 100644 --- a/src/gallium/drivers/iris/iris_resolve.c +++ b/src/gallium/drivers/iris/iris_resolve.c @@ -141,10 +141,20 @@ resolve_image_views(struct iris_context *ice, enum isl_aux_usage aux_usage = iris_image_view_aux_usage(ice, pview, info); + enum isl_format view_format = iris_image_view_get_format(ice, pview); + + bool clear_supported = isl_aux_usage_has_fast_clears(aux_usage); + + if (!iris_render_formats_color_compatible(view_format, + res->surf.format, + res->aux.clear_color, + res->aux.clear_color_unknown)) + clear_supported = false; + iris_resource_prepare_access(ice, res, pview->u.tex.level, 1, pview->u.tex.first_layer, num_layers, - aux_usage, false); + aux_usage, clear_supported); shs->image_aux_usage[i] = aux_usage; } else {