diff options
author | Jason Ekstrand <jason.ekstrand@intel.com> | 2017-05-13 11:02:22 -0700 |
---|---|---|
committer | Juan A. Suarez Romero <jasuarez@igalia.com> | 2017-06-01 04:25:09 +0200 |
commit | 39c70f902c451e414cc34577cac7a1ac9f4f68c3 (patch) | |
tree | 7e0c6fe28069d939f0b19ff341221ccc93b2c593 /src/mesa/drivers | |
parent | af08c1672ee071df754f62bba550676714601763 (diff) |
i965: Round copy size to the nearest block in intel_miptree_copy
The width and height of the copy don't have to be aligned to the block
size if they specify the right or bottom edges of the image. (See also
the comment and asserts right above). We need to round them up when we
do the division in order to get it 100% right.
Reviewed-by: Ben Widawsky <ben@bwidawsk.net>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Cc: "17.0 17.1" <mesa-stable@lists.freedesktop.org>
(cherry picked from commit 0901d0bc4c78313eaaf29dff74c6a7bf5514f75b)
Signed-off-by: Juan A. Suarez Romero <jasuarez@igalia.com>
Diffstat (limited to 'src/mesa/drivers')
-rw-r--r-- | src/mesa/drivers/dri/i965/intel_blit.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/mesa/drivers/dri/i965/intel_blit.c b/src/mesa/drivers/dri/i965/intel_blit.c index 568ed541528..2925fc2c14f 100644 --- a/src/mesa/drivers/dri/i965/intel_blit.c +++ b/src/mesa/drivers/dri/i965/intel_blit.c @@ -411,8 +411,8 @@ intel_miptree_copy(struct brw_context *brw, src_x /= (int)bw; src_y /= (int)bh; - src_width /= (int)bw; - src_height /= (int)bh; + src_width = DIV_ROUND_UP(src_width, (int)bw); + src_height = DIV_ROUND_UP(src_height, (int)bh); } src_x += src_image_x; src_y += src_image_y; |