[virglrenderer-devel] [PATCH] vrend: use u_minify instead of right shift
Gurchetan Singh
gurchetansingh at chromium.org
Tue Mar 20 17:26:01 UTC 2018
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);
--
2.16.2.804.g6dcf76e118-goog
More information about the virglrenderer-devel
mailing list