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 <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/40149>
This commit is contained in:
Calder Young 2026-02-06 16:13:36 -08:00 committed by Marge Bot
parent bd88042f57
commit aee9602fea
2 changed files with 7 additions and 3 deletions

View file

@ -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)
/** @} */
/**

View file

@ -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."