#include "spu_render.h"
#include "spu_texture.h"
#include "spu_tile.h"
+//#include "spu_test.h"
#include "spu_vertex_shader.h"
#include "pipe/cell/common.h"
#include "pipe/p_defines.h"
}
+
/* In some versions of the SDK the SPE main takes 'unsigned long' as a
* parameter. In others it takes 'unsigned long long'. Use a define to
* select between the two.
(void) speid;
+ ASSERT(sizeof(tile_t) == TILE_SIZE * TILE_SIZE * 4);
+
one_time_init();
if (Debug)
0 /* rid */);
wait_on_mask( 1 << tag );
+#if 0
+ if (spu.init.id==0)
+ spu_test_misc();
+#endif
main_loop();
spu.init.id, src, tex_tiles[pos].t32);
#endif
- ASSERT_ALIGN16(tex_tiles[pos].t32);
+ ASSERT_ALIGN16(tex_tiles[pos].ui);
ASSERT_ALIGN16(src);
- mfc_get(tex_tiles[pos].t32, /* dest */
+ mfc_get(tex_tiles[pos].ui, /* dest */
(unsigned int) src,
bytes_per_tile, /* size */
TAG_TEXTURE_TILE,
uint i = (uint) (texcoord.f[0] * spu.texture.width) % spu.texture.width;
uint j = (uint) (texcoord.f[1] * spu.texture.height) % spu.texture.height;
uint pos = get_tex_tile(i, j);
- uint texel = tex_tiles[pos].t32[j % TILE_SIZE][i % TILE_SIZE];
+ uint texel = tex_tiles[pos].ui[j % TILE_SIZE][i % TILE_SIZE];
return texel;
}
printf("get_tile: dest: %p src: 0x%x size: %d\n",
tile, (unsigned int) src, bytesPerTile);
*/
- mfc_get(tile->t32, /* dest in local memory */
+ mfc_get(tile->ui, /* dest in local memory */
(unsigned int) src, /* src in main memory */
bytesPerTile,
tag,
spu.init.id,
tile, (unsigned int) dst, bytesPerTile);
*/
- mfc_put((void *) tile->t32, /* src in local memory */
+ mfc_put((void *) tile->ui, /* src in local memory */
(unsigned int) dst, /* dst in main memory */
bytesPerTile,
tag,
typedef union {
- ushort t16[TILE_SIZE][TILE_SIZE];
- uint t32[TILE_SIZE][TILE_SIZE];
+ ushort us[TILE_SIZE][TILE_SIZE];
+ uint ui[TILE_SIZE][TILE_SIZE];
vector unsigned short us8[TILE_SIZE/2][TILE_SIZE/4];
vector unsigned int ui4[TILE_SIZE/2][TILE_SIZE/2];
} tile_t;
static INLINE void
clear_c_tile(tile_t *ctile)
{
- memset32((uint*) ctile->t32,
+ memset32((uint*) ctile->ui,
spu.fb.color_clear_value,
TILE_SIZE * TILE_SIZE);
}
clear_z_tile(tile_t *ztile)
{
if (spu.fb.depth_format == PIPE_FORMAT_Z16_UNORM) {
- memset16((ushort*) ztile->t16,
+ memset16((ushort*) ztile->us,
spu.fb.depth_clear_value,
TILE_SIZE * TILE_SIZE);
}
else {
ASSERT(spu.fb.depth_format == PIPE_FORMAT_Z32_UNORM);
-#if SIMD_Z
- union fi z;
- z.f = 1.0;
- memset32((uint*) ztile->t32,
- z.i,/*spu.fb.depth_clear_value,*/
- TILE_SIZE * TILE_SIZE);
-#else
- memset32((uint*) ztile->t32,
+ memset32((uint*) ztile->ui,
spu.fb.depth_clear_value,
TILE_SIZE * TILE_SIZE);
-#endif
}
}
cur_tile_status_c = TILE_STATUS_DIRTY;
if (spu_extract(mask, 0))
- ctile.t32[iy][ix] = colors[QUAD_TOP_LEFT];
+ ctile.ui[iy][ix] = colors[QUAD_TOP_LEFT];
if (spu_extract(mask, 1))
- ctile.t32[iy][ix+1] = colors[QUAD_TOP_RIGHT];
+ ctile.ui[iy][ix+1] = colors[QUAD_TOP_RIGHT];
if (spu_extract(mask, 2))
- ctile.t32[iy+1][ix] = colors[QUAD_BOTTOM_LEFT];
+ ctile.ui[iy+1][ix] = colors[QUAD_BOTTOM_LEFT];
if (spu_extract(mask, 3))
- ctile.t32[iy+1][ix+1] = colors[QUAD_BOTTOM_RIGHT];
+ ctile.ui[iy+1][ix+1] = colors[QUAD_BOTTOM_RIGHT];
#if 0
/* SIMD_Z with swizzled color buffer (someday) */