diff options
author | Robert Ellison <papillo@tungstengraphics.com> | 2008-12-18 09:46:53 -0700 |
---|---|---|
committer | Robert Ellison <papillo@tungstengraphics.com> | 2008-12-18 10:22:33 -0700 |
commit | 5ccef84c018c5e99bf4b8cffb5ba1bb66bf40cc4 (patch) | |
tree | 6b7cdf73355c32fff2163e62d6a1889c9e5e6568 /src/gallium/auxiliary | |
parent | 2389c055ed4c26ba5f3979c4a7871a333725dd88 (diff) |
Gallium: fix for conform test
The following construction in util_surface_copy() in
gallium/auxiliary/util/u_rect.c, introduced in commit
d177c9ddda2c452cf7d6696d89cf4458ef986f98, incorrectly inverts
the Y coordinate in the last parameter to pipe_copy_rect().
/* If do_flip, invert src_y position and pass negative src stride
*/
pipe_copy_rect(dst_map,
&dst->block,
dst->stride,
dst_x, dst_y,
w, h,
src_map,
do_flip ? -(int) src->stride : src->stride,
src_x,
do_flip ? w - src_y : src_y);
The intention is to start at the last Y coordinate line and move
backwards, in the case of a flip; in that case, the correct
calculation is "src_y + h - 1", not "w - src_y".
This fixes a Gallium assertion failure in the conformance tests:
u_rect.c:65:pipe_copy_rect: Assertion `src_y >= 0' failed.
debug_get_bool_option: GALLIUM_ABORT_ON_ASSERT = TRUE
Trace/breakpoint trap
Diffstat (limited to 'src/gallium/auxiliary')
-rw-r--r-- | src/gallium/auxiliary/util/u_rect.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/gallium/auxiliary/util/u_rect.c b/src/gallium/auxiliary/util/u_rect.c index 30f32413d7..fe81a685be 100644 --- a/src/gallium/auxiliary/util/u_rect.c +++ b/src/gallium/auxiliary/util/u_rect.c @@ -223,7 +223,7 @@ util_surface_copy(struct pipe_context *pipe, src_map, do_flip ? -(int) src->stride : src->stride, src_x, - do_flip ? w - src_y : src_y); + do_flip ? src_y + h - 1 : src_y); } pipe->screen->surface_unmap(pipe->screen, src); |