diff options
Diffstat (limited to 'src/gallium/drivers/llvmpipe/lp_tile_image.c')
-rw-r--r-- | src/gallium/drivers/llvmpipe/lp_tile_image.c | 22 |
1 files changed, 10 insertions, 12 deletions
diff --git a/src/gallium/drivers/llvmpipe/lp_tile_image.c b/src/gallium/drivers/llvmpipe/lp_tile_image.c index 0852150..2b63992 100644 --- a/src/gallium/drivers/llvmpipe/lp_tile_image.c +++ b/src/gallium/drivers/llvmpipe/lp_tile_image.c @@ -122,14 +122,15 @@ tile_4_4_uint16(const uint16_t *src, uint16_t *dst, unsigned src_stride) /** * Convert a tiled image into a linear image. - * \param src_stride source row stride in bytes (bytes per row of tiles) * \param dst_stride dest row stride in bytes */ void lp_tiled_to_linear(const void *src, void *dst, unsigned x, unsigned y, unsigned width, unsigned height, - enum pipe_format format, unsigned dst_stride) + enum pipe_format format, + unsigned dst_stride, + unsigned tiles_per_row) { assert(x % TILE_SIZE == 0); assert(y % TILE_SIZE == 0); @@ -191,8 +192,6 @@ lp_tiled_to_linear(const void *src, void *dst, const uint bpp = 4; const uint tile_w = TILE_SIZE, tile_h = TILE_SIZE; const uint bytes_per_tile = tile_w * tile_h * bpp; - const uint src_stride = dst_stride * tile_w; - const uint tiles_per_row = src_stride / bytes_per_tile; uint i, j; for (j = 0; j < height; j += tile_h) { @@ -202,7 +201,7 @@ lp_tiled_to_linear(const void *src, void *dst, uint byte_offset = tile_offset * bytes_per_tile; const uint8_t *src_tile = (uint8_t *) src + byte_offset; - lp_tile_write_4ub(format, + lp_tile_unswizzle_4ub(format, src_tile, dst, dst_stride, ii, jj, tile_w, tile_h); @@ -215,13 +214,14 @@ lp_tiled_to_linear(const void *src, void *dst, /** * Convert a linear image into a tiled image. * \param src_stride source row stride in bytes - * \param dst_stride dest row stride in bytes (bytes per row of tiles) */ void lp_linear_to_tiled(const void *src, void *dst, unsigned x, unsigned y, unsigned width, unsigned height, - enum pipe_format format, unsigned src_stride) + enum pipe_format format, + unsigned src_stride, + unsigned tiles_per_row) { assert(x % TILE_SIZE == 0); assert(y % TILE_SIZE == 0); @@ -281,8 +281,6 @@ lp_linear_to_tiled(const void *src, void *dst, const uint bpp = 4; const uint tile_w = TILE_SIZE, tile_h = TILE_SIZE; const uint bytes_per_tile = tile_w * tile_h * bpp; - const uint dst_stride = src_stride * tile_w; - const uint tiles_per_row = dst_stride / bytes_per_tile; uint i, j; for (j = 0; j < height; j += TILE_SIZE) { @@ -292,7 +290,7 @@ lp_linear_to_tiled(const void *src, void *dst, uint byte_offset = tile_offset * bytes_per_tile; uint8_t *dst_tile = (uint8_t *) dst + byte_offset; - lp_tile_read_4ub(format, + lp_tile_swizzle_4ub(format, dst_tile, src, src_stride, ii, jj, tile_w, tile_h); @@ -320,10 +318,10 @@ test_tiled_linear_conversion(void *data, /*unsigned tiled_stride = wt * TILE_SIZE * TILE_SIZE * 4;*/ lp_linear_to_tiled(data, tiled, 0, 0, width, height, format, - stride); + stride, wt); lp_tiled_to_linear(tiled, data, 0, 0, width, height, format, - stride); + stride, wt); free(tiled); } |