summaryrefslogtreecommitdiffstats
path: root/src/gallium/drivers/softpipe/sp_surface.c
diff options
context:
space:
mode:
authorKeith Whitwell <[email protected]>2008-05-01 11:07:21 +0100
committerKeith Whitwell <[email protected]>2008-05-01 12:00:45 +0100
commitc9ed86a96483063f3d6789ed16645a3dca77d726 (patch)
tree136ac2158534366c0ca77af7fa4b257155a21f7a /src/gallium/drivers/softpipe/sp_surface.c
parent7584bcf3f746573fc379c7748acc0be96a3db7de (diff)
gallium: tex surface checkpoint
Diffstat (limited to 'src/gallium/drivers/softpipe/sp_surface.c')
-rw-r--r--src/gallium/drivers/softpipe/sp_surface.c23
1 files changed, 17 insertions, 6 deletions
diff --git a/src/gallium/drivers/softpipe/sp_surface.c b/src/gallium/drivers/softpipe/sp_surface.c
index 653449c4f18..b5cc0535481 100644
--- a/src/gallium/drivers/softpipe/sp_surface.c
+++ b/src/gallium/drivers/softpipe/sp_surface.c
@@ -47,18 +47,27 @@ sp_surface_copy(struct pipe_context *pipe,
unsigned srcx, unsigned srcy, unsigned width, unsigned height)
{
assert( dst->cpp == src->cpp );
+ void *dst_map = pipe->screen->surface_map( pipe->screen,
+ dst,
+ PIPE_BUFFER_USAGE_GPU_WRITE );
- pipe_copy_rect(pipe_surface_map(dst),
+ const void *src_map = pipe->screen->surface_map( pipe->screen,
+ src,
+ PIPE_BUFFER_USAGE_GPU_READ );
+
+ assert(src_map && dst_map);
+
+ pipe_copy_rect(dst_map,
dst->cpp,
dst->pitch,
dstx, dsty,
width, height,
- pipe_surface_map(src),
+ src_map,
do_flip ? -(int) src->pitch : src->pitch,
srcx, do_flip ? 1 - srcy - height : srcy);
- pipe_surface_unmap(src);
- pipe_surface_unmap(dst);
+ pipe->screen->surface_unmap(pipe->screen, src);
+ pipe->screen->surface_unmap(pipe->screen, dst);
}
@@ -83,7 +92,9 @@ sp_surface_fill(struct pipe_context *pipe,
unsigned width, unsigned height, unsigned value)
{
unsigned i, j;
- void *dst_map = pipe_surface_map(dst);
+ void *dst_map = pipe->screen->surface_map( pipe->screen,
+ dst,
+ PIPE_BUFFER_USAGE_GPU_WRITE );
assert(dst->pitch > 0);
assert(width <= dst->pitch);
@@ -147,7 +158,7 @@ sp_surface_fill(struct pipe_context *pipe,
break;
}
- pipe_surface_unmap( dst );
+ pipe->screen->surface_unmap(pipe->screen, dst);
}