blorp: allow 3D blits/copies on Ys/Yf/Tile64 tiling
authorLionel Landwerlin <lionel.g.landwerlin@intel.com>
Wed, 21 Jun 2023 15:44:27 +0000 (18:44 +0300)
committerMarge Bot <emma+marge@anholt.net>
Fri, 1 Sep 2023 23:22:18 +0000 (23:22 +0000)
The data in Ys/Yf/Tile64 tiled images is arranged differently for 2D &
3D images. Therefore we cannot assume that we will use 2D images for
blits/copies.

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Nanley Chery <nanley.g.chery@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23620>

src/intel/blorp/blorp_blit.c

index 57aced3..425e0aa 100644 (file)
@@ -2833,14 +2833,21 @@ blorp_surf_convert_to_uncompressed(const struct isl_device *isl_dev,
    info->addr.offset += offset_B;
 
    /* BLORP doesn't use the actual intratile offsets.  Instead, it needs the
-    * surface to be a bit bigger and we offset the vertices instead.
+    * surface to be a bit bigger and we offset the vertices instead. Standard
+    * tilings don't need intratile offsets because each subresource is aligned
+    * to a bpb-based tile boundary or miptail slot offset.
     */
-   assert(info->surf.dim == ISL_SURF_DIM_2D);
-   assert(info->surf.logical_level0_px.array_len == 1);
-   info->surf.logical_level0_px.w += info->tile_x_sa;
-   info->surf.logical_level0_px.h += info->tile_y_sa;
-   info->surf.phys_level0_sa.w += info->tile_x_sa;
-   info->surf.phys_level0_sa.h += info->tile_y_sa;
+  if (info->surf.tiling == ISL_TILING_64 ||
+      isl_tiling_is_std_y(info->surf.tiling)) {
+      assert(info->tile_x_sa == 0 && info->tile_y_sa == 0);
+   } else {
+      assert(info->surf.dim == ISL_SURF_DIM_2D);
+      assert(info->surf.logical_level0_px.array_len == 1);
+      info->surf.logical_level0_px.w += info->tile_x_sa;
+      info->surf.logical_level0_px.h += info->tile_y_sa;
+      info->surf.phys_level0_sa.w += info->tile_x_sa;
+      info->surf.phys_level0_sa.h += info->tile_y_sa;
+   }
 }
 
 bool