From a098077366a714dfde80719e2024225357114c10 Mon Sep 17 00:00:00 2001 From: Nanley Chery Date: Fri, 1 Dec 2023 17:11:28 -0500 Subject: [PATCH] iris: Initialize HiZ to the CLEAR state on BDW-ICL We disable HiZ for some LODs on gfx8-9 to comply with ambiguate operation restrictions. Avoid this restriction by initializing HiZ to the CLEAR state on those platforms. By doing this, an ambiguate will never occur. Also, do this for ICL as an optimization. We'll enable HiZ for all LODs on gfx8-9 in the next patch. Reviewed-by: Lionel Landwerlin Part-of: --- src/gallium/drivers/iris/iris_resource.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/gallium/drivers/iris/iris_resource.c b/src/gallium/drivers/iris/iris_resource.c index abb1fd001f0..5ee54596347 100644 --- a/src/gallium/drivers/iris/iris_resource.c +++ b/src/gallium/drivers/iris/iris_resource.c @@ -989,6 +989,14 @@ iris_resource_init_aux_buf(struct iris_screen *screen, if (isl_aux_usage_has_ccs(res->aux.usage) && devinfo->ver <= 11) zero_aux = true; + /* Initialize HiZ on BDW-ICL to the CLEAR state. This allows us to skip + * initializing fast-clears and this ensures that we won't have to perform + * an ambiguate operation. Ambiguates are not allowed on non-8x4-aligned + * LODs for BDW and SKL. + */ + if (res->aux.usage == ISL_AUX_USAGE_HIZ && devinfo->ver <= 11) + zero_aux = true; + if (zero_aux != res->bo->zeroed) { void* map = iris_bo_map(NULL, res->bo, MAP_WRITE | MAP_RAW); if (!map)