diff options
author | Patrice Mandin <[email protected]> | 2009-07-26 16:18:06 +0200 |
---|---|---|
committer | Patrice Mandin <[email protected]> | 2009-07-26 16:18:06 +0200 |
commit | 2b8a8f75f33931622a46287a2bf633879f23285e (patch) | |
tree | f15e979d7dda13fd93a49bcb1ec19b321bb052cc /src/gallium/drivers/nv04/nv04_surface_2d.c | |
parent | 77a8a650e61047582794512ef61c8e6525aea059 (diff) |
nouveau: Take into account destination position for copy_swizzle, need to split copy a bit more
Diffstat (limited to 'src/gallium/drivers/nv04/nv04_surface_2d.c')
-rw-r--r-- | src/gallium/drivers/nv04/nv04_surface_2d.c | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/src/gallium/drivers/nv04/nv04_surface_2d.c b/src/gallium/drivers/nv04/nv04_surface_2d.c index 143b8589e8e..ff4e51178dc 100644 --- a/src/gallium/drivers/nv04/nv04_surface_2d.c +++ b/src/gallium/drivers/nv04/nv04_surface_2d.c @@ -133,7 +133,7 @@ nv04_surface_copy_swizzle(struct nv04_surface_2d *ctx, for (cy = 0; cy < h; cy += sub_h) { for (cx = 0; cx < w; cx += sub_w) { BEGIN_RING(chan, swzsurf, NV04_SWIZZLED_SURFACE_OFFSET, 1); - OUT_RELOCl(chan, dst_bo, dst->offset + nv04_swizzle_bits(cx, cy) * + OUT_RELOCl(chan, dst_bo, dst->offset + nv04_swizzle_bits(cx+dx, cy+dy) * dst->texture->block.size, NOUVEAU_BO_GART | NOUVEAU_BO_VRAM | NOUVEAU_BO_WR); @@ -264,19 +264,29 @@ nv04_surface_copy(struct nv04_surface_2d *ctx, struct pipe_surface *dst, int remainWidth = w-potWidth; int remainHeight = h-potHeight; + /* top left is always POT */ nv04_surface_copy_swizzle(ctx, dst, dx, dy, src, sx, sy, potWidth, potHeight); + /* top right */ if (remainWidth>0) { nv04_surface_copy(ctx, dst, dx+potWidth, dy, src, sx+potWidth, sy, remainWidth, potHeight); } + /* bottom left */ if (remainHeight>0) { nv04_surface_copy(ctx, dst, dx, dy+potHeight, src, sx, sy+potHeight, - w, remainHeight); + potWidth, remainHeight); + } + + /* bottom right */ + if ((remainWidth>0) && (remainHeight>0)) { + nv04_surface_copy(ctx, dst, dx+potWidth, dy+potHeight, + src, sx+potWidth, sy+potHeight, + remainWidth, remainHeight); } return; |