spu_tile.c File Reference

Include dependency graph for spu_tile.c:

Go to the source code of this file.

Functions

void get_tile (uint tx, uint ty, tile_t *tile, int tag, int zBuf)
 Get tile of color or Z values from main memory, put into SPU memory.
void put_tile (uint tx, uint ty, const tile_t *tile, int tag, int zBuf)
 Move tile of color or Z values from SPU memory to main memory.


Function Documentation

void get_tile ( uint  tx,
uint  ty,
tile_t tile,
int  tag,
int  zBuf 
)

Get tile of color or Z values from main memory, put into SPU memory.

Definition at line 38 of file spu_tile.c.

References ASSERT, ASSERT_ALIGN16, spu_framebuffer::color_start, spu_framebuffer::depth_start, spu_global::fb, spu_framebuffer::height_tiles, offset(), spu, TILE_SIZE, tile_t::ui, spu_framebuffer::width_tiles, and spu_framebuffer::zsize.

00039 {
00040    const uint offset = ty * spu.fb.width_tiles + tx;
00041    const uint bytesPerTile = TILE_SIZE * TILE_SIZE * (zBuf ? spu.fb.zsize : 4);
00042    const ubyte *src = zBuf ? spu.fb.depth_start : spu.fb.color_start;
00043 
00044    src += offset * bytesPerTile;
00045 
00046    ASSERT(tx < spu.fb.width_tiles);
00047    ASSERT(ty < spu.fb.height_tiles);
00048    ASSERT_ALIGN16(tile);
00049    /*
00050    printf("get_tile:  dest: %p  src: 0x%x  size: %d\n",
00051           tile, (unsigned int) src, bytesPerTile);
00052    */
00053    mfc_get(tile->ui,  /* dest in local memory */
00054            (unsigned int) src, /* src in main memory */
00055            bytesPerTile,
00056            tag,
00057            0, /* tid */
00058            0  /* rid */);
00059 }

void put_tile ( uint  tx,
uint  ty,
const tile_t tile,
int  tag,
int  zBuf 
)

Move tile of color or Z values from SPU memory to main memory.

Definition at line 66 of file spu_tile.c.

References ASSERT, ASSERT_ALIGN16, spu_framebuffer::color_start, spu_framebuffer::depth_start, spu_global::fb, spu_framebuffer::height_tiles, offset(), spu, TILE_SIZE, tile_t::ui, spu_framebuffer::width_tiles, and spu_framebuffer::zsize.

00067 {
00068    const uint offset = ty * spu.fb.width_tiles + tx;
00069    const uint bytesPerTile = TILE_SIZE * TILE_SIZE * (zBuf ? spu.fb.zsize : 4);
00070    ubyte *dst = zBuf ? spu.fb.depth_start : spu.fb.color_start;
00071 
00072    dst += offset * bytesPerTile;
00073 
00074    ASSERT(tx < spu.fb.width_tiles);
00075    ASSERT(ty < spu.fb.height_tiles);
00076    ASSERT_ALIGN16(tile);
00077    /*
00078    printf("SPU %u: put_tile:  src: %p  dst: 0x%x  size: %d\n",
00079           spu.init.id,
00080           tile, (unsigned int) dst, bytesPerTile);
00081    */
00082    mfc_put((void *) tile->ui,  /* src in local memory */
00083            (unsigned int) dst,  /* dst in main memory */
00084            bytesPerTile,
00085            tag,
00086            0, /* tid */
00087            0  /* rid */);
00088 }


Generated on Tue Sep 29 06:25:33 2009 for Gallium3D by  doxygen 1.5.4