diff options
author | José Fonseca <[email protected]> | 2009-08-09 23:58:06 +0100 |
---|---|---|
committer | José Fonseca <[email protected]> | 2009-08-29 09:21:27 +0100 |
commit | 3ce1abf950b7175d65a32fb9d182561a9d3d57f7 (patch) | |
tree | 827eb31eceea434a4ec96a8c2ed8bae84aa59c89 /src/gallium/drivers/llvmpipe/lp_tile_cache.c | |
parent | 29d94a9cbb7858cc8b0cfb05c0bb66f56a6acfa5 (diff) |
llvmpipe: Store tile color in SoA.
Diffstat (limited to 'src/gallium/drivers/llvmpipe/lp_tile_cache.c')
-rw-r--r-- | src/gallium/drivers/llvmpipe/lp_tile_cache.c | 42 |
1 files changed, 18 insertions, 24 deletions
diff --git a/src/gallium/drivers/llvmpipe/lp_tile_cache.c b/src/gallium/drivers/llvmpipe/lp_tile_cache.c index 01ba843806b..65b62c44dcd 100644 --- a/src/gallium/drivers/llvmpipe/lp_tile_cache.c +++ b/src/gallium/drivers/llvmpipe/lp_tile_cache.c @@ -38,6 +38,7 @@ #include "lp_context.h" #include "lp_surface.h" #include "lp_texture.h" +#include "lp_tile_soa.h" #include "lp_tile_cache.h" @@ -216,15 +217,11 @@ clear_tile_rgba(struct llvmpipe_cached_tile *tile, memset(tile->data.color, 0, sizeof(tile->data.color)); } else { - uint i, j; - for (i = 0; i < TILE_SIZE; i++) { - for (j = 0; j < TILE_SIZE; j++) { - tile->data.color[i][j][0] = clear_value[0]; - tile->data.color[i][j][1] = clear_value[1]; - tile->data.color[i][j][2] = clear_value[2]; - tile->data.color[i][j][3] = clear_value[3]; - } - } + uint i, x, y; + for (i = 0; i < 4; ++i) + for (y = 0; y < TILE_SIZE; y++) + for (x = 0; x < TILE_SIZE; x++) + tile->data.color[i][y][x] = clear_value[i]; } } @@ -334,11 +331,10 @@ lp_flush_tile_cache(struct llvmpipe_tile_cache *tc) tile->data.depth32, 0/*STRIDE*/); } else { - pipe_put_tile_rgba(pt, - tile->addr.bits.x * TILE_SIZE, - tile->addr.bits.y * TILE_SIZE, - TILE_SIZE, TILE_SIZE, - (float *) tile->data.color); + lp_put_tile_rgba_soa(pt, + tile->addr.bits.x * TILE_SIZE, + tile->addr.bits.y * TILE_SIZE, + tile->data.color); } tile->addr.bits.invalid = 1; /* mark as empty */ inuse++; @@ -390,11 +386,10 @@ lp_find_cached_tile(struct llvmpipe_tile_cache *tc, tile->data.depth32, 0/*STRIDE*/); } else { - pipe_put_tile_rgba(pt, - tile->addr.bits.x * TILE_SIZE, - tile->addr.bits.y * TILE_SIZE, - TILE_SIZE, TILE_SIZE, - (float *) tile->data.color); + lp_put_tile_rgba_soa(pt, + tile->addr.bits.x * TILE_SIZE, + tile->addr.bits.y * TILE_SIZE, + tile->data.color); } } @@ -420,11 +415,10 @@ lp_find_cached_tile(struct llvmpipe_tile_cache *tc, tile->data.depth32, 0/*STRIDE*/); } else { - pipe_get_tile_rgba(pt, - tile->addr.bits.x * TILE_SIZE, - tile->addr.bits.y * TILE_SIZE, - TILE_SIZE, TILE_SIZE, - (float *) tile->data.color); + lp_get_tile_rgba_soa(pt, + tile->addr.bits.x * TILE_SIZE, + tile->addr.bits.y * TILE_SIZE, + tile->data.color); } } } |