diff options
author | Keith Whitwell <[email protected]> | 2009-02-16 19:50:48 +0000 |
---|---|---|
committer | Keith Whitwell <[email protected]> | 2009-02-16 19:50:48 +0000 |
commit | 59d54334c96f44ed1d8bf660dc96221362a77d04 (patch) | |
tree | e9ab34e568256bcdc2a88602c47072ab769211e8 /src/gallium/auxiliary/util | |
parent | 7c8836e9ef49d938aa55a1c385b95c6371c301f1 (diff) | |
parent | c5c383596ddb26cd75e4b355918ad16915283b59 (diff) |
Merge branch 'master' into gallium-texture-transfer
Conflicts:
src/mesa/state_tracker/st_cb_accum.c
src/mesa/state_tracker/st_cb_drawpixels.c
Diffstat (limited to 'src/gallium/auxiliary/util')
-rw-r--r-- | src/gallium/auxiliary/util/u_linear.c | 17 | ||||
-rw-r--r-- | src/gallium/auxiliary/util/u_linear.h | 9 |
2 files changed, 14 insertions, 12 deletions
diff --git a/src/gallium/auxiliary/util/u_linear.c b/src/gallium/auxiliary/util/u_linear.c index a76704ffc7f..e999cefe748 100644 --- a/src/gallium/auxiliary/util/u_linear.c +++ b/src/gallium/auxiliary/util/u_linear.c @@ -3,13 +3,13 @@ #include "u_linear.h" void -pipe_linear_to_tile(size_t src_stride, void *src_ptr, +pipe_linear_to_tile(size_t src_stride, const void *src_ptr, struct pipe_tile_info *t, void *dst_ptr) { int x, y, z; char *ptr; size_t bytes = t->cols * t->block.size; - + char *dst_ptr2 = (char *) dst_ptr; assert(pipe_linear_check_tile(t)); @@ -19,20 +19,21 @@ pipe_linear_to_tile(size_t src_stride, void *src_ptr, /* this inner loop could be replace with SSE magic */ ptr = (char*)src_ptr + src_stride * t->rows * y + bytes * x; for (z = 0; z < t->rows; z++) { - memcpy(dst_ptr, ptr, bytes); - dst_ptr += bytes; + memcpy(dst_ptr2, ptr, bytes); + dst_ptr2 += bytes; ptr += src_stride; } } } } -void pipe_linear_from_tile(struct pipe_tile_info *t, void *src_ptr, +void pipe_linear_from_tile(struct pipe_tile_info *t, const void *src_ptr, size_t dst_stride, void *dst_ptr) { int x, y, z; char *ptr; size_t bytes = t->cols * t->block.size; + const char *src_ptr2 = (const char *) src_ptr; /* lets read lineary from the tiled buffer */ for (y = 0; y < t->tiles_y; y++) { @@ -40,8 +41,8 @@ void pipe_linear_from_tile(struct pipe_tile_info *t, void *src_ptr, /* this inner loop could be replace with SSE magic */ ptr = (char*)dst_ptr + dst_stride * t->rows * y + bytes * x; for (z = 0; z < t->rows; z++) { - memcpy(ptr, src_ptr, bytes); - src_ptr += bytes; + memcpy(ptr, src_ptr2, bytes); + src_ptr2 += bytes; ptr += dst_stride; } } @@ -50,7 +51,7 @@ void pipe_linear_from_tile(struct pipe_tile_info *t, void *src_ptr, void pipe_linear_fill_info(struct pipe_tile_info *t, - struct pipe_format_block *block, + const struct pipe_format_block *block, unsigned tile_width, unsigned tile_height, unsigned tiles_x, unsigned tiles_y) { diff --git a/src/gallium/auxiliary/util/u_linear.h b/src/gallium/auxiliary/util/u_linear.h index e337cfd7702..1589f029bc4 100644 --- a/src/gallium/auxiliary/util/u_linear.h +++ b/src/gallium/auxiliary/util/u_linear.h @@ -3,6 +3,7 @@ #define U_LINEAR_H #include "pipe/p_format.h" + struct pipe_tile_info { unsigned size; @@ -23,10 +24,10 @@ struct pipe_tile_info struct pipe_format_block block; }; -void pipe_linear_to_tile(size_t src_stride, void *src_ptr, +void pipe_linear_to_tile(size_t src_stride, const void *src_ptr, struct pipe_tile_info *t, void *dst_ptr); -void pipe_linear_from_tile(struct pipe_tile_info *t, void *src_ptr, +void pipe_linear_from_tile(struct pipe_tile_info *t, const void *src_ptr, size_t dst_stride, void *dst_ptr); /** @@ -39,11 +40,11 @@ void pipe_linear_from_tile(struct pipe_tile_info *t, void *src_ptr, * @tiles_y number of tiles in y axis */ void pipe_linear_fill_info(struct pipe_tile_info *t, - struct pipe_format_block *block, + const struct pipe_format_block *block, unsigned tile_width, unsigned tile_height, unsigned tiles_x, unsigned tiles_y); -static INLINE boolean pipe_linear_check_tile(struct pipe_tile_info *t) +static INLINE boolean pipe_linear_check_tile(const struct pipe_tile_info *t) { if (t->tile.size != t->block.size * t->cols * t->rows) return FALSE; |