summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBrian Paul <brianp@vmware.com>2016-06-13 09:54:12 -0600
committerBrian Paul <brianp@vmware.com>2016-06-13 13:30:19 -0600
commitcf9bb9acac0fd3b5926da8102bda33171a906a6b (patch)
tree56fd9ba5afd6c9aa7bcfe081eb487ab602fb003a
parent5a0d294d38505ae61293ae1a9184e1b3228ef2af (diff)
util: update some assertions in util_resource_copy_region()
To cope with copies of compressed images which are not multiples of the block size. Suggested by Jose. Reviewed-by: Jose Fonseca <jfonseca@vmware.com> Reviewed-by: Roland Scheidegger <sroland@sroland@vmware.com>
-rw-r--r--src/gallium/auxiliary/util/u_surface.c12
1 files changed, 8 insertions, 4 deletions
diff --git a/src/gallium/auxiliary/util/u_surface.c b/src/gallium/auxiliary/util/u_surface.c
index e48e47c2ec2..b9d2da0ab5d 100644
--- a/src/gallium/auxiliary/util/u_surface.c
+++ b/src/gallium/auxiliary/util/u_surface.c
@@ -332,12 +332,16 @@ util_resource_copy_region(struct pipe_context *pipe,
/* check that region boxes are block aligned */
assert(src_box.x % src_bw == 0);
assert(src_box.y % src_bh == 0);
- assert(src_box.width % src_bw == 0 || src_box.width < src_bw);
- assert(src_box.height % src_bh == 0 || src_box.height < src_bh);
+ assert(src_box.width % src_bw == 0 ||
+ src_box.x + src_box.width == minify(src->width0, src_level, src_bw));
+ assert(src_box.height % src_bh == 0 ||
+ src_box.y + src_box.height == minify(src->height0, src_level, src_bh));
assert(dst_box.x % dst_bw == 0);
assert(dst_box.y % dst_bh == 0);
- assert(dst_box.width % dst_bw == 0 || dst_box.width < dst_bw);
- assert(dst_box.height % dst_bh == 0 || dst_box.height < src_bh);
+ assert(dst_box.width % dst_bw == 0 ||
+ dst_box.x + dst_box.width == minify(dst->width0, dst_level, dst_bw));
+ assert(dst_box.height % dst_bh == 0 ||
+ dst_box.y + dst_box.height == minify(dst->height0, dst_level, dst_bh));
/* check that region boxes are not out of bounds */
assert(src_box.x + src_box.width <=