From 95d61c5c75bd36a43488e41ac677fb28fc02eacd Mon Sep 17 00:00:00 2001 From: Kenneth Graunke Date: Thu, 22 Sep 2022 22:50:37 -0700 Subject: [PATCH] iris: Ignore aux for copy_region source if there's no unresolved color This mirrors the behavior of iris_resource_texture_aux_usage(), which bypasses the aux metadata when there's no advantage to using it. Reviewed-by: Nanley Chery Part-of: --- src/gallium/drivers/iris/iris_blit.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/src/gallium/drivers/iris/iris_blit.c b/src/gallium/drivers/iris/iris_blit.c index 0b50526..a7bcfb2 100644 --- a/src/gallium/drivers/iris/iris_blit.c +++ b/src/gallium/drivers/iris/iris_blit.c @@ -599,6 +599,18 @@ get_copy_region_aux_settings(struct iris_context *ice, FALLTHROUGH; case ISL_AUX_USAGE_CCS_E: case ISL_AUX_USAGE_GFX12_CCS_E: { + /* If our source doesn't have any unresolved color, report an aux + * usage of ISL_AUX_USAGE_NONE. This way, texturing won't even look + * at the aux surface and we can save some bandwidth. + */ + if (!is_dest && + !iris_has_invalid_primary(res, level, 1, + 0, INTEL_REMAINING_LAYERS)) { + *out_aux_usage = ISL_AUX_USAGE_NONE; + *out_clear_supported = false; + break; + } + /* blorp_copy may reinterpret the surface format and has limited support * for adjusting the clear color, so clear support may only be enabled * in some cases: -- 2.7.4