uint i;
if (surfaceIndex == 0) {
- clear_c_tile(ctile);
+ clear_c_tile(&ctile);
for (i = spu.init.id; i < num_tiles; i += spu.init.num_spus) {
uint tx = i % spu.fb.width_tiles;
uint ty = i / spu.fb.width_tiles;
if (tile_status[ty][tx] == TILE_STATUS_CLEAR) {
- put_tile(tx, ty, (uint *) ctile, TAG_SURFACE_CLEAR, 0);
+ put_tile(tx, ty, &ctile, TAG_SURFACE_CLEAR, 0);
}
}
}
uint tx = i % spu.fb.width_tiles;
uint ty = i / spu.fb.width_tiles;
if (tile_status_z[ty][tx] == TILE_STATUS_CLEAR)
- put_tile(tx, ty, (uint *) ctile, TAG_SURFACE_CLEAR, 1);
+ put_tile(tx, ty, &ctile, TAG_SURFACE_CLEAR, 1);
}
}
if (clear->surface == 0) {
spu.fb.color_clear_value = clear->value;
- clear_c_tile(ctile);
+ clear_c_tile(&ctile);
}
else {
spu.fb.depth_clear_value = clear->value;
uint tx = i % spu.fb.width_tiles;
uint ty = i / spu.fb.width_tiles;
if (clear->surface == 0)
- put_tile(tx, ty, (uint *) ctile, TAG_SURFACE_CLEAR, 0);
+ put_tile(tx, ty, &ctile, TAG_SURFACE_CLEAR, 0);
else
- put_tile(tx, ty, (uint *) ztile.t32, TAG_SURFACE_CLEAR, 1);
+ put_tile(tx, ty, &ztile, TAG_SURFACE_CLEAR, 1);
/* XXX we don't want this here, but it fixes bad tile results */
}
*/
if (spu.depth_stencil.depth.enabled) {
if (tile_status_z[ty][tx] != TILE_STATUS_CLEAR) {
- get_tile(tx, ty, (uint *) ztile.t32, TAG_READ_TILE_Z, 1);
+ get_tile(tx, ty, &ztile, TAG_READ_TILE_Z, 1);
}
}
if (tile_status[ty][tx] != TILE_STATUS_CLEAR) {
- get_tile(tx, ty, (uint *) ctile, TAG_READ_TILE_COLOR, 0);
+ get_tile(tx, ty, &ctile, TAG_READ_TILE_COLOR, 0);
}
ASSERT(render->prim_type == PIPE_PRIM_TRIANGLES);
/* write color/z tiles back to main framebuffer, if dirtied */
if (tile_status[ty][tx] == TILE_STATUS_DIRTY) {
- put_tile(tx, ty, (uint *) ctile, TAG_WRITE_TILE_COLOR, 0);
+ put_tile(tx, ty, &ctile, TAG_WRITE_TILE_COLOR, 0);
tile_status[ty][tx] = TILE_STATUS_DEFINED;
}
if (spu.depth_stencil.depth.enabled) {
if (tile_status_z[ty][tx] == TILE_STATUS_DIRTY) {
- put_tile(tx, ty, (uint *) ztile.t32, TAG_WRITE_TILE_Z, 1);
+ put_tile(tx, ty, &ztile, TAG_WRITE_TILE_Z, 1);
tile_status_z[ty][tx] = TILE_STATUS_DEFINED;
}
}
-uint ctile[TILE_SIZE][TILE_SIZE] ALIGN16_ATTRIB;
+tile_t ctile ALIGN16_ATTRIB;
tile_t ztile ALIGN16_ATTRIB;
ubyte tile_status[MAX_HEIGHT/TILE_SIZE][MAX_WIDTH/TILE_SIZE] ALIGN16_ATTRIB;
void
-get_tile(uint tx, uint ty, uint *tile, int tag, int zBuf)
+get_tile(uint tx, uint ty, tile_t *tile, int tag, int zBuf)
{
const uint offset = ty * spu.fb.width_tiles + tx;
const uint bytesPerTile = TILE_SIZE * TILE_SIZE * (zBuf ? spu.fb.zsize : 4);
printf("get_tile: dest: %p src: 0x%x size: %d\n",
tile, (unsigned int) src, bytesPerTile);
*/
- mfc_get(tile, /* dest in local memory */
+ mfc_get(tile->t32, /* dest in local memory */
(unsigned int) src, /* src in main memory */
bytesPerTile,
tag,
void
-put_tile(uint tx, uint ty, const uint *tile, int tag, int zBuf)
+put_tile(uint tx, uint ty, const tile_t *tile, int tag, int zBuf)
{
const uint offset = ty * spu.fb.width_tiles + tx;
const uint bytesPerTile = TILE_SIZE * TILE_SIZE * (zBuf ? spu.fb.zsize : 4);
spu.init.id,
tile, (unsigned int) dst, bytesPerTile);
*/
- mfc_put((void *) tile, /* src in local memory */
+ mfc_put((void *) tile->t32, /* src in local memory */
(unsigned int) dst, /* dst in main memory */
bytesPerTile,
tag,
} tile_t;
-extern uint ctile[TILE_SIZE][TILE_SIZE] ALIGN16_ATTRIB;
+extern tile_t ctile ALIGN16_ATTRIB;
extern tile_t ztile ALIGN16_ATTRIB;
void
-get_tile(uint tx, uint ty, uint *tile, int tag, int zBuf);
+get_tile(uint tx, uint ty, tile_t *tile, int tag, int zBuf);
void
-put_tile(uint tx, uint ty, const uint *tile, int tag, int zBuf);
+put_tile(uint tx, uint ty, const tile_t *tile, int tag, int zBuf);
static INLINE void
-clear_c_tile(uint tile[TILE_SIZE][TILE_SIZE])
+clear_c_tile(tile_t *ctile)
{
- memset32((uint*) tile, spu.fb.color_clear_value, TILE_SIZE * TILE_SIZE);
+ memset32((uint*) ctile->t32,
+ spu.fb.color_clear_value,
+ TILE_SIZE * TILE_SIZE);
}
if (mask) {
if (tile_status[setup->ty][setup->tx] == TILE_STATUS_CLEAR) {
/* now, _really_ clear the tile */
- clear_c_tile(ctile);
+ clear_c_tile(&ctile);
}
else {
/* make sure we've got the tile from main mem */
tile_status[setup->ty][setup->tx] = TILE_STATUS_DIRTY;
if (mask & MASK_TOP_LEFT)
- ctile[iy][ix] = pack_color(colors[QUAD_TOP_LEFT]);
+ ctile.t32[iy][ix] = pack_color(colors[QUAD_TOP_LEFT]);
if (mask & MASK_TOP_RIGHT)
- ctile[iy][ix+1] = pack_color(colors[QUAD_TOP_RIGHT]);
+ ctile.t32[iy][ix+1] = pack_color(colors[QUAD_TOP_RIGHT]);
if (mask & MASK_BOTTOM_LEFT)
- ctile[iy+1][ix] = pack_color(colors[QUAD_BOTTOM_LEFT]);
+ ctile.t32[iy+1][ix] = pack_color(colors[QUAD_BOTTOM_LEFT]);
if (mask & MASK_BOTTOM_RIGHT)
- ctile[iy+1][ix+1] = pack_color(colors[QUAD_BOTTOM_RIGHT]);
+ ctile.t32[iy+1][ix+1] = pack_color(colors[QUAD_BOTTOM_RIGHT]);
}
#endif
}