Module: Mesa
Branch: main
Commit: 74e6e207fe21b7241d34906db430467b0c49f4c3
URL:    
http://cgit.freedesktop.org/mesa/mesa/commit/?id=74e6e207fe21b7241d34906db430467b0c49f4c3

Author: Faith Ekstrand <[email protected]>
Date:   Tue Feb 28 11:14:36 2023 -0600

intel/blorp: Set array_len for 3D images properly

We need to minify the depth so we don't set a size that's out-of-bounds.

Reviewed-by: Lionel Landwerlin <[email protected]>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21376>

---

 src/intel/blorp/blorp.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/src/intel/blorp/blorp.c b/src/intel/blorp/blorp.c
index 69dcfbfc3f6..48a8edf88f4 100644
--- a/src/intel/blorp/blorp.c
+++ b/src/intel/blorp/blorp.c
@@ -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 ||

Reply via email to