intel/isl: add ISL_SURF_USAGE_SPARSE_BIT
authorPaulo Zanoni <paulo.r.zanoni@intel.com>
Fri, 21 Apr 2023 23:33:00 +0000 (16:33 -0700)
committerMarge Bot <emma+marge@anholt.net>
Thu, 28 Sep 2023 06:16:40 +0000 (06:16 +0000)
commit0de5d142e8632bce355ba99db0d509fedfb2d0a5
tree3fe29a089b931568fac63036ee596ac979e77b47
parent968cefbff113d3e49c384aafa29d07f4f31a5a80
intel/isl: add ISL_SURF_USAGE_SPARSE_BIT

Vulkan Sparse resources have their own set of rules, so here we try to
make ISL aware of them through ISL_SURF_USAGE_SPARSE_BIT.

The big deal here is when some image ends up not using Tile64 nor
TileYs. Previously Ys was not supported on TGL at all, and Tile64 did
not have support for 3D. Now we still have some formats that end up
not being used with either Tile64 and Ys, but need to support Sparse
on them (e.g., YUV on Tile64). In the future we may have new tiling
formats or hardware restrictions that would force this case to happen
again.

So here we do some adjustments so we can make sparse work with other
tiling formats, although with limited functionality (e.g., those
formats may be restricted to opaque binds, and certainly don't support
the standard block shapes).

v2: before we had Ys support, we had defined TGL's block size as 4k.
v3: move the size_B chunk to before nte notify_failure() checks (Ken).

Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Signed-off-by: Paulo Zanoni <paulo.r.zanoni@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23045>
src/intel/isl/isl.c
src/intel/isl/isl.h