iris: fix zoffset asserts with 2DArray/Cube
authorKenneth Graunke <kenneth@whitecape.org>
Tue, 3 Jul 2018 20:23:47 +0000 (13:23 -0700)
committerKenneth Graunke <kenneth@whitecape.org>
Thu, 21 Feb 2019 18:26:07 +0000 (10:26 -0800)
src/gallium/drivers/iris/iris_resource.c

index 924a69199896fa8791209e405ca5d6f06eff4dea..b50fef9f5f3777d0558c9bacaa8c37066f10ff71 100644 (file)
@@ -423,7 +423,9 @@ tile_extents(struct isl_surf *surf,
    assert(box->y % fmtl->bh == 0);
 
    unsigned x0_el, y0_el;
-   isl_surf_get_image_offset_el(surf, level, box->z, box->z, &x0_el, &y0_el);
+   isl_surf_get_image_offset_el(surf, level, box->z,
+                                surf->dim == ISL_SURF_DIM_3D ? box->z : 0,
+                                &x0_el, &y0_el);
 
    *x1_B = (box->x / fmtl->bw + x0_el) * cpp;
    *y1_el = box->y / fmtl->bh + y0_el;