From: Kenneth Graunke Date: Tue, 3 Jul 2018 20:23:47 +0000 (-0700) Subject: iris: fix zoffset asserts with 2DArray/Cube X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=36301bbe4047bf848cf8d936f6a5838c625ee118;p=mesa.git iris: fix zoffset asserts with 2DArray/Cube --- diff --git a/src/gallium/drivers/iris/iris_resource.c b/src/gallium/drivers/iris/iris_resource.c index 924a6919989..b50fef9f5f3 100644 --- a/src/gallium/drivers/iris/iris_resource.c +++ b/src/gallium/drivers/iris/iris_resource.c @@ -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;