intel/blorp: Set array_len for 3D images properly
authorFaith Ekstrand <faith.ekstrand@collabora.com>
Tue, 28 Feb 2023 17:14:36 +0000 (11:14 -0600)
committerMarge Bot <emma+marge@anholt.net>
Sat, 4 Mar 2023 06:12:46 +0000 (06:12 +0000)
We need to minify the depth so we don't set a size that's out-of-bounds.

Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21376>

src/intel/blorp/blorp.c

index 69dcfbf..48a8edf 100644 (file)
@@ -189,8 +189,9 @@ brw_blorp_surface_info_init(struct blorp_batch *batch,
       .swizzle = ISL_SWIZZLE_IDENTITY,
    };
 
-   info->view.array_len = MAX2(info->surf.logical_level0_px.depth,
-                               info->surf.logical_level0_px.array_len);
+   info->view.array_len =
+      MAX2(u_minify(info->surf.logical_level0_px.depth, level),
+           info->surf.logical_level0_px.array_len);
 
    if (!is_dest &&
        (info->surf.dim == ISL_SURF_DIM_3D ||