From f8d5ad494ae6e8d82aec1f04ca357cc1e966857e Mon Sep 17 00:00:00 2001 From: Gurchetan Singh Date: Tue, 20 Mar 2018 10:26:01 -0700 Subject: [PATCH] vrend: use u_minify instead of right shift We don't want to end up with a height of zero. Fixes "vrend: further modify read_transfer_data / write_transfer_data" and the following dEQP tests: dEQP-GLES3.functional.texture.specification.texstorage3d.format.*2d_array* Example tests: dEQP-GLES3.functional.texture.specification.texstorage3d.format.rgba16i_2d_array dEQP-GLES3.functional.texture.specification.texstorage3d.format.rgba16ui_2d_array --- src/vrend_renderer.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/vrend_renderer.c b/src/vrend_renderer.c index 5df3f68..8b1a462 100644 --- a/src/vrend_renderer.c +++ b/src/vrend_renderer.c @@ -4772,7 +4772,7 @@ static void read_transfer_data(struct pipe_resource *res, else { if (invert) { for (d = 0; d < box->depth; d++) { - uint32_t myoffset = offset + d * src_stride * (res->height0 >> level); + uint32_t myoffset = offset + d * src_stride * u_minify(res->height0, level); for (h = bh - 1; h >= 0; h--) { void *ptr = data + (h * bwx) + d * (bh * bwx); vrend_read_from_iovec(iov, num_iovs, myoffset, ptr, bwx); @@ -4781,7 +4781,7 @@ static void read_transfer_data(struct pipe_resource *res, } } else { for (d = 0; d < box->depth; d++) { - uint32_t myoffset = offset + d * src_stride * (res->height0 >> level); + uint32_t myoffset = offset + d * src_stride * u_minify(res->height0, level); for (h = 0; h < bh; h++) { void *ptr = data + (h * bwx) + d * (bh * bwx); vrend_read_from_iovec(iov, num_iovs, myoffset, ptr, bwx); @@ -4815,7 +4815,7 @@ static void write_transfer_data(struct pipe_resource *res, vrend_write_to_iovec(iov, num_iovs, offset, data, send_size); } else if (invert) { for (d = 0; d < box->depth; d++) { - uint32_t myoffset = offset + d * stride * (res->height0 >> level); + uint32_t myoffset = offset + d * stride * u_minify(res->height0, level); for (h = bh - 1; h >= 0; h--) { void *ptr = data + (h * bwx) + d * (bh * bwx); vrend_write_to_iovec(iov, num_iovs, myoffset, ptr, bwx); @@ -4824,7 +4824,7 @@ static void write_transfer_data(struct pipe_resource *res, } } else { for (d = 0; d < box->depth; d++) { - uint32_t myoffset = offset + d * stride * (res->height0 >> level); + uint32_t myoffset = offset + d * stride * u_minify(res->height0, level); for (h = 0; h < bh; h++) { void *ptr = data + (h * bwx) + d * (bh * bwx); vrend_write_to_iovec(iov, num_iovs, myoffset, ptr, bwx);