From a5bc71dc5659baeda3d732e306b0f8e638317f19 Mon Sep 17 00:00:00 2001 From: Nanley Chery Date: Wed, 28 May 2025 10:13:29 -0400 Subject: [PATCH] iris: Update check for sampler field changes Use isl_get_sampler_clear_field_offset() to more accurately determine when the sampler will change the field it reads from on gfx11-12. This avoids partial resolving in a number of cases. Reviewed-by: Lionel Landwerlin Part-of: --- src/gallium/drivers/iris/iris_resolve.c | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/src/gallium/drivers/iris/iris_resolve.c b/src/gallium/drivers/iris/iris_resolve.c index cc9f4aef27b..ab2bfbc669c 100644 --- a/src/gallium/drivers/iris/iris_resolve.c +++ b/src/gallium/drivers/iris/iris_resolve.c @@ -1153,14 +1153,12 @@ iris_resource_prepare_texture(struct iris_context *ice, } /* With indirect clear colors, the sampler reads clear values stored in - * pixel form. The location the sampler reads from is dependent on the - * bits-per-channel of the format. Disable support for clear colors if the - * new format points the sampler to an incompatible location. See - * isl_get_sampler_clear_field_offset() for more information. + * pixel form. Disable support for clear colors if the new format points + * the sampler to an incompatibly formatted location. */ - if (res->aux.clear_color_bo && + if (res->aux.clear_color_bo && res->surf.format != view_format && isl_format_get_layout(res->surf.format)->channels.r.bits != 32 && - isl_format_get_layout(view_format)->channels.r.bits == 32) { + isl_get_sampler_clear_field_offset(devinfo, view_format, false) == 0) { clear_supported = false; }