summaryrefslogtreecommitdiff
path: root/src/mesa/pipe/cell/spu/spu_tile.c
diff options
context:
space:
mode:
authorBrian <brian.paul@tungstengraphics.com>2008-01-20 17:27:05 -0700
committerBrian <brian.paul@tungstengraphics.com>2008-01-20 17:27:05 -0700
commitf0be276c2e84716856ae87b4b0f0411700ed5be4 (patch)
tree7aa3d98bb0c822a29a5038a0129bb7e361dfde39 /src/mesa/pipe/cell/spu/spu_tile.c
parent661be1ae7b1cd5837d8e7224a5ebe1b8d428137e (diff)
Cell: clean-up/re-org tile code
Also, support 16 or 32-bit Z buffer at runtime.
Diffstat (limited to 'src/mesa/pipe/cell/spu/spu_tile.c')
-rw-r--r--src/mesa/pipe/cell/spu/spu_tile.c39
1 files changed, 3 insertions, 36 deletions
diff --git a/src/mesa/pipe/cell/spu/spu_tile.c b/src/mesa/pipe/cell/spu/spu_tile.c
index 13fc5e345f..9895360f5f 100644
--- a/src/mesa/pipe/cell/spu/spu_tile.c
+++ b/src/mesa/pipe/cell/spu/spu_tile.c
@@ -32,11 +32,7 @@
uint ctile[TILE_SIZE][TILE_SIZE] ALIGN16_ATTRIB;
-#if ZSIZE == 2
-ushort ztile[TILE_SIZE][TILE_SIZE] ALIGN16_ATTRIB;
-#else
-uint ztile[TILE_SIZE][TILE_SIZE] ALIGN16_ATTRIB;
-#endif
+tile_t ztile ALIGN16_ATTRIB;
ubyte tile_status[MAX_HEIGHT/TILE_SIZE][MAX_WIDTH/TILE_SIZE] ALIGN16_ATTRIB;
ubyte tile_status_z[MAX_HEIGHT/TILE_SIZE][MAX_WIDTH/TILE_SIZE] ALIGN16_ATTRIB;
@@ -47,7 +43,7 @@ void
get_tile(uint tx, uint ty, uint *tile, int tag, int zBuf)
{
const uint offset = ty * spu.fb.width_tiles + tx;
- const uint bytesPerTile = TILE_SIZE * TILE_SIZE * (zBuf ? ZSIZE : 4);
+ const uint bytesPerTile = TILE_SIZE * TILE_SIZE * (zBuf ? spu.fb.zsize : 4);
const ubyte *src = zBuf ? spu.fb.depth_start : spu.fb.color_start;
src += offset * bytesPerTile;
@@ -72,7 +68,7 @@ void
put_tile(uint tx, uint ty, const uint *tile, int tag, int zBuf)
{
const uint offset = ty * spu.fb.width_tiles + tx;
- const uint bytesPerTile = TILE_SIZE * TILE_SIZE * (zBuf ? ZSIZE : 4);
+ const uint bytesPerTile = TILE_SIZE * TILE_SIZE * (zBuf ? spu.fb.zsize : 4);
ubyte *dst = zBuf ? spu.fb.depth_start : spu.fb.color_start;
dst += offset * bytesPerTile;
@@ -93,32 +89,3 @@ put_tile(uint tx, uint ty, const uint *tile, int tag, int zBuf)
0 /* rid */);
}
-
-void
-clear_tile(uint tile[TILE_SIZE][TILE_SIZE], uint value)
-{
- uint i, j;
- for (i = 0; i < TILE_SIZE; i++) {
- for (j = 0; j < TILE_SIZE; j++) {
- tile[i][j] = value;
- }
- }
-}
-
-void
-clear_tile_z(
-#if ZSIZE == 2
- ushort tile[TILE_SIZE][TILE_SIZE],
-#else
- uint tile[TILE_SIZE][TILE_SIZE],
-#endif
- uint value)
-{
- uint i, j;
- for (i = 0; i < TILE_SIZE; i++) {
- for (j = 0; j < TILE_SIZE; j++) {
- tile[i][j] = value;
- }
- }
-}
-