From aee9602fea69080cff5f962f500164b5562546ef Mon Sep 17 00:00:00 2001 From: Calder Young Date: Fri, 6 Feb 2026 16:13:36 -0800 Subject: [PATCH] isl: Add usage flag to force SurfaceArray to false When sampling BUFFER, 1D, or 2D surfaces, with no MSAA, no mipmap levels, linear tiling, and SurfaceArray set to false, the surface padding requirements are relaxed and its much easier to use the sampler to do buffer-to-image copies in BLORP. We can't have it like this by default though because we need SurfaceArray true for robustness. Reviewed-by: Lionel Landwerlin Part-of: --- src/intel/isl/isl.h | 1 + src/intel/isl/isl_surface_state.c | 9 ++++++--- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/src/intel/isl/isl.h b/src/intel/isl/isl.h index 4d32062b3c7..2c40c5f7fc9 100644 --- a/src/intel/isl/isl.h +++ b/src/intel/isl/isl.h @@ -1172,6 +1172,7 @@ typedef uint64_t isl_surf_usage_flags_t; #define ISL_SURF_USAGE_MULTI_ENGINE_PAR_BIT (1u << 25) #define ISL_SURF_USAGE_SOFTWARE_DETILING (1u << 26) #define ISL_SURF_USAGE_PREFER_4K_ALIGNMENT (1u << 27) +#define ISL_SURF_USAGE_NO_ARRAY_OVERFETCH_BIT (1u << 28) /** @} */ /** diff --git a/src/intel/isl/isl_surface_state.c b/src/intel/isl/isl_surface_state.c index 492069949f7..95488082212 100644 --- a/src/intel/isl/isl_surface_state.c +++ b/src/intel/isl/isl_surface_state.c @@ -243,9 +243,10 @@ isl_genX(surf_fill_state_s)(const struct isl_device *dev, void *state, ISL_SURF_USAGE_STORAGE_BIT); /* They may only specify one of the above bits at a time */ assert(__builtin_popcount(_base_usage) == 1); - /* The only other allowed bit is ISL_SURF_USAGE_CUBE_BIT */ + /* Check that only the other allowed bits are set */ assert((info->view->usage & ~(ISL_SURF_USAGE_CUBE_BIT | - ISL_SURF_USAGE_PROTECTED_BIT)) == + ISL_SURF_USAGE_PROTECTED_BIT | + ISL_SURF_USAGE_NO_ARRAY_OVERFETCH_BIT)) == _base_usage); #endif @@ -449,7 +450,9 @@ isl_genX(surf_fill_state_s)(const struct isl_device *dev, void *state, } #if GFX_VER >= 7 - if (INTEL_NEEDS_WA_1806565034) { + if (info->view->usage & ISL_SURF_USAGE_NO_ARRAY_OVERFETCH_BIT) { + s.SurfaceArray = false; + } else if (INTEL_NEEDS_WA_1806565034) { /* Wa_1806565034: * * "Only set SurfaceArray if arrayed surface is > 1."