From 9da56a369801bc9392a272d223babfae1d01a165 Mon Sep 17 00:00:00 2001 From: Nanley Chery Date: Tue, 25 Jul 2023 14:09:48 -0400 Subject: [PATCH] iris: Inline iris_can_sample_mcs_with_clear Now that there's only one user, inline the function. While we're here, update the stale comment about unknown sampling formats causing us to implement a simplified workaround. We've had visibility into the formats that blorp_copy will use for some time now. Reviewed-by: Lionel Landwerlin Part-of: --- src/gallium/drivers/iris/iris_resolve.c | 25 ++++++------------------ src/gallium/drivers/iris/iris_resource.h | 3 --- 2 files changed, 6 insertions(+), 22 deletions(-) diff --git a/src/gallium/drivers/iris/iris_resolve.c b/src/gallium/drivers/iris/iris_resolve.c index 5f7b2b433ca..14a6d95d583 100644 --- a/src/gallium/drivers/iris/iris_resolve.c +++ b/src/gallium/drivers/iris/iris_resolve.c @@ -1087,24 +1087,6 @@ iris_image_view_aux_usage(struct iris_context *ice, return res->aux.usage; } -bool -iris_can_sample_mcs_with_clear(const struct intel_device_info *devinfo, - const struct iris_resource *res) -{ - assert(isl_aux_usage_has_mcs(res->aux.usage)); - - /* On TGL, the sampler has an issue with some 8 and 16bpp MSAA fast clears. - * See HSD 1707282275, wa_14013111325. Due to the use of - * format-reinterpretation, a simplified workaround is implemented. - */ - if (intel_needs_workaround(devinfo, 14013111325) && - isl_format_get_layout(res->surf.format)->bpb <= 16) { - return false; - } - - return true; -} - static bool formats_are_fast_clear_compatible(enum isl_format a, enum isl_format b) { @@ -1166,8 +1148,13 @@ iris_resource_prepare_texture(struct iris_context *ice, clear_supported = false; } + /* On gfx12.0, the sampler has an issue with some 8 and 16bpp MSAA fast + * clears. See HSD 1707282275, wa_14013111325. A simplified workaround is + * implemented, but we could implement something more specific. + */ if (isl_aux_usage_has_mcs(aux_usage) && - !iris_can_sample_mcs_with_clear(devinfo, res)) { + intel_needs_workaround(devinfo, 14013111325) && + isl_format_get_layout(res->surf.format)->bpb <= 16) { clear_supported = false; } diff --git a/src/gallium/drivers/iris/iris_resource.h b/src/gallium/drivers/iris/iris_resource.h index a845b8e3304..80e079d4031 100644 --- a/src/gallium/drivers/iris/iris_resource.h +++ b/src/gallium/drivers/iris/iris_resource.h @@ -491,9 +491,6 @@ bool iris_resource_level_has_hiz(const struct intel_device_info *devinfo, bool iris_sample_with_depth_aux(const struct intel_device_info *devinfo, const struct iris_resource *res); -bool iris_can_sample_mcs_with_clear(const struct intel_device_info *devinfo, - const struct iris_resource *res); - bool iris_has_color_unresolved(const struct iris_resource *res, unsigned start_level, unsigned num_levels, unsigned start_layer, unsigned num_layers);