summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/mesa/pipe/cell/spu/spu_main.c8
-rw-r--r--src/mesa/pipe/cell/spu/spu_texture.c6
-rw-r--r--src/mesa/pipe/cell/spu/spu_tile.c4
-rw-r--r--src/mesa/pipe/cell/spu/spu_tile.h18
-rw-r--r--src/mesa/pipe/cell/spu/spu_tri.c8
5 files changed, 22 insertions, 22 deletions
diff --git a/src/mesa/pipe/cell/spu/spu_main.c b/src/mesa/pipe/cell/spu/spu_main.c
index d6393048f5..7d6e910ad5 100644
--- a/src/mesa/pipe/cell/spu/spu_main.c
+++ b/src/mesa/pipe/cell/spu/spu_main.c
@@ -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();
diff --git a/src/mesa/pipe/cell/spu/spu_texture.c b/src/mesa/pipe/cell/spu/spu_texture.c
index 7a1ca097c0..c1dc6bfe90 100644
--- a/src/mesa/pipe/cell/spu/spu_texture.c
+++ b/src/mesa/pipe/cell/spu/spu_texture.c
@@ -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;
}
diff --git a/src/mesa/pipe/cell/spu/spu_tile.c b/src/mesa/pipe/cell/spu/spu_tile.c
index aea4785bc2..fd65c2b49c 100644
--- a/src/mesa/pipe/cell/spu/spu_tile.c
+++ b/src/mesa/pipe/cell/spu/spu_tile.c
@@ -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,
diff --git a/src/mesa/pipe/cell/spu/spu_tile.h b/src/mesa/pipe/cell/spu/spu_tile.h
index 4b1ef2a4c8..85a0d55807 100644
--- a/src/mesa/pipe/cell/spu/spu_tile.h
+++ b/src/mesa/pipe/cell/spu/spu_tile.h
@@ -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
}
}
diff --git a/src/mesa/pipe/cell/spu/spu_tri.c b/src/mesa/pipe/cell/spu/spu_tri.c
index a26a4f098d..b04b6841c0 100644
--- a/src/mesa/pipe/cell/spu/spu_tri.c
+++ b/src/mesa/pipe/cell/spu/spu_tri.c
@@ -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) */