Cell: rename fields of the tile_t union

This commit is contained in:
Brian 2008-02-01 13:49:51 -07:00 committed by Ben Skeggs
parent 7a0099b9f3
commit a3d5d7067e
5 changed files with 22 additions and 22 deletions

View file

@ -36,6 +36,7 @@
#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"
@ -495,6 +496,7 @@ one_time_init(void)
}
/* 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.
@ -515,6 +517,8 @@ main(main_param_t speid, main_param_t argp)
(void) speid;
ASSERT(sizeof(tile_t) == TILE_SIZE * TILE_SIZE * 4);
one_time_init();
if (Debug)
@ -528,6 +532,10 @@ main(main_param_t speid, main_param_t argp)
0 /* rid */);
wait_on_mask( 1 << tag );
#if 0
if (spu.init.id==0)
spu_test_misc();
#endif
main_loop();

View file

@ -97,10 +97,10 @@ get_tex_tile(uint i, uint j)
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,
@ -134,6 +134,6 @@ sample_texture(float4 texcoord)
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;
}

View file

@ -56,7 +56,7 @@ get_tile(uint tx, uint ty, tile_t *tile, int tag, int zBuf)
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,
@ -82,7 +82,7 @@ put_tile(uint tx, uint ty, const tile_t *tile, int tag, int zBuf)
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,

View file

@ -40,8 +40,8 @@
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;
@ -74,7 +74,7 @@ put_tile(uint tx, uint ty, const tile_t *tile, int tag, int zBuf);
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);
}
@ -84,23 +84,15 @@ static INLINE void
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
}
}

View file

@ -349,13 +349,13 @@ emit_quad( int x, int y, mask_t mask )
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) */