diff options
author | Keith Whitwell <keith@tungstengraphics.com> | 2008-01-22 14:38:36 +0000 |
---|---|---|
committer | José Fonseca <jrfonseca@tungstengraphics.com> | 2008-01-26 10:32:13 +0900 |
commit | f3aa4de034b0d791ce2e38e8aeb3b3abdb4e3b50 (patch) | |
tree | 3888f963ea9113f73dd48da697168d592ff87ebe /src/mesa/state_tracker | |
parent | 1e9e4341e08a45c93e7caa90c2cca844469f4629 (diff) |
gallium: minor cleanups to pipe interface
- Remove put/get tile, just have users call put_tile_raw, etc directly.
- Remove surface_data call, just map it locally.
Diffstat (limited to 'src/mesa/state_tracker')
-rw-r--r-- | src/mesa/state_tracker/st_texture.c | 35 |
1 files changed, 29 insertions, 6 deletions
diff --git a/src/mesa/state_tracker/st_texture.c b/src/mesa/state_tracker/st_texture.c index a2bdf846ca..15cc458be8 100644 --- a/src/mesa/state_tracker/st_texture.c +++ b/src/mesa/state_tracker/st_texture.c @@ -201,6 +201,29 @@ st_texture_image_unmap(struct st_texture_image *stImage) +/* Upload data to a rectangular sub-region. Lots of choices how to do this: + * + * - memcpy by span to current destination + * - upload data as new buffer and blit + * + * Currently always memcpy. + */ +static void +st_surface_data(struct pipe_context *pipe, + struct pipe_surface *dst, + unsigned dstx, unsigned dsty, + const void *src, unsigned src_pitch, + unsigned srcx, unsigned srcy, unsigned width, unsigned height) +{ + pipe_copy_rect(pipe_surface_map(dst), + dst->cpp, + dst->pitch, + dstx, dsty, width, height, src, src_pitch, srcx, srcy); + + pipe_surface_unmap(dst); +} + + /* Upload data for a particular image. */ void @@ -225,12 +248,12 @@ st_texture_image_data(struct pipe_context *pipe, dst_surface = pipe->get_tex_surface(pipe, dst, face, level, i); - pipe->surface_data(pipe, dst_surface, - 0, 0, /* dstx, dsty */ - srcUB, - src_row_pitch, - 0, 0, /* source x, y */ - dst->width[level], height); /* width, height */ + st_surface_data(pipe, dst_surface, + 0, 0, /* dstx, dsty */ + srcUB, + src_row_pitch, + 0, 0, /* source x, y */ + dst->width[level], height); /* width, height */ pipe_surface_reference(&dst_surface, NULL); |