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
This commit is contained in:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user