summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBrian Paul <brian.paul@tungstengraphics.com>2008-08-06 19:15:10 -0600
committerBrian Paul <brian.paul@tungstengraphics.com>2008-08-06 19:15:10 -0600
commita56ccb90c6a374c86158ac2323f844a4003560fa (patch)
tree32c9674ab2d96ad025a3e32b0a9fb5f81f56ee06
parentbe66a8f43172327e3cdde27281e40377cacbb121 (diff)
gallium: fix clipping/stride bugs in pipe_get_tile_raw(), pipe_put_tile_raw()
We need to compute the default dst_stride and src_stride _before_ clipping. After clipping, the width value may have changed. This fixes visible tile glitches in some demos like progs/glsl/texdemo.c
-rw-r--r--src/gallium/auxiliary/util/p_tile.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/gallium/auxiliary/util/p_tile.c b/src/gallium/auxiliary/util/p_tile.c
index 2b6db43bee..d65e603785 100644
--- a/src/gallium/auxiliary/util/p_tile.c
+++ b/src/gallium/auxiliary/util/p_tile.c
@@ -51,12 +51,12 @@ pipe_get_tile_raw(struct pipe_surface *ps,
{
const void *src;
- if (pipe_clip_tile(x, y, &w, &h, ps))
- return;
-
if (dst_stride == 0)
dst_stride = pf_get_nblocksx(&ps->block, w) * ps->block.size;
+ if (pipe_clip_tile(x, y, &w, &h, ps))
+ return;
+
src = pipe_surface_map(ps, PIPE_BUFFER_USAGE_CPU_READ);
assert(src);
if(!src)
@@ -79,12 +79,12 @@ pipe_put_tile_raw(struct pipe_surface *ps,
{
void *dst;
- if (pipe_clip_tile(x, y, &w, &h, ps))
- return;
-
if (src_stride == 0)
src_stride = pf_get_nblocksx(&ps->block, w) * ps->block.size;
+ if (pipe_clip_tile(x, y, &w, &h, ps))
+ return;
+
dst = pipe_surface_map(ps, PIPE_BUFFER_USAGE_CPU_WRITE);
assert(dst);
if(!dst)