summaryrefslogtreecommitdiff
path: root/src/mesa/pipe/cell/spu
diff options
context:
space:
mode:
Diffstat (limited to 'src/mesa/pipe/cell/spu')
-rw-r--r--src/mesa/pipe/cell/spu/main.c17
-rw-r--r--src/mesa/pipe/cell/spu/main.h6
-rw-r--r--src/mesa/pipe/cell/spu/tri.c2
3 files changed, 15 insertions, 10 deletions
diff --git a/src/mesa/pipe/cell/spu/main.c b/src/mesa/pipe/cell/spu/main.c
index a131bd5198..6292962f44 100644
--- a/src/mesa/pipe/cell/spu/main.c
+++ b/src/mesa/pipe/cell/spu/main.c
@@ -70,7 +70,7 @@ get_tile(const struct framebuffer *fb, uint tx, uint ty, uint *tile,
{
uint offset = ty * fb->width_tiles + tx;
uint bytesPerTile = TILE_SIZE * TILE_SIZE * 4;
- ubyte *src = (ubyte *) fb->start + offset * bytesPerTile;
+ ubyte *src = (ubyte *) fb->color_start + offset * bytesPerTile;
assert(tx < fb->width_tiles);
assert(ty < fb->height_tiles);
@@ -94,7 +94,7 @@ put_tile(const struct framebuffer *fb, uint tx, uint ty, const uint *tile,
{
uint offset = ty * fb->width_tiles + tx;
uint bytesPerTile = TILE_SIZE * TILE_SIZE * 4;
- ubyte *dst = (ubyte *) fb->start + offset * bytesPerTile;
+ ubyte *dst = (ubyte *) fb->color_start + offset * bytesPerTile;
assert(tx < fb->width_tiles);
assert(ty < fb->height_tiles);
@@ -180,7 +180,6 @@ tile_bounding_box(const struct cell_command_render *render,
static void
render(const struct cell_command_render *render)
{
- const uint num_tiles = fb.width_tiles * fb.height_tiles;
struct cell_prim_buffer prim_buffer ALIGN16_ATTRIB;
int tag = init.id /**DefaultTag**/;
uint i, j, vertex_bytes;
@@ -302,16 +301,20 @@ main_loop(void)
printf("SPU %u: FRAMEBUFFER: %d x %d at %p, format 0x%x\n", init.id,
cmd.fb.width,
cmd.fb.height,
- cmd.fb.start,
- cmd.fb.format);
- fb.format = cmd.fb.format;
+ cmd.fb.color_start,
+ cmd.fb.color_format);
+ fb.color_start = cmd.fb.color_start;
+ fb.depth_start = cmd.fb.depth_start;
+ fb.color_format = cmd.fb.color_format;
+ fb.depth_format = cmd.fb.depth_format;
fb.width = cmd.fb.width;
fb.height = cmd.fb.height;
fb.width_tiles = (fb.width + TILE_SIZE - 1) / TILE_SIZE;
fb.height_tiles = (fb.height + TILE_SIZE - 1) / TILE_SIZE;
+ /*
printf("SPU %u: %u x %u tiles\n",
init.id, fb.width_tiles, fb.height_tiles);
- fb.start = cmd.fb.start;
+ */
break;
case CELL_CMD_CLEAR_TILES:
printf("SPU %u: CLEAR to 0x%08x\n", init.id, cmd.clear.value);
diff --git a/src/mesa/pipe/cell/spu/main.h b/src/mesa/pipe/cell/spu/main.h
index 3240e01615..60a565bfa7 100644
--- a/src/mesa/pipe/cell/spu/main.h
+++ b/src/mesa/pipe/cell/spu/main.h
@@ -37,8 +37,10 @@
extern volatile struct cell_init_info init;
struct framebuffer {
- void *start; /**< addr of surface in main memory */
- enum pipe_format format;
+ void *color_start; /**< addr of color surface in main memory */
+ void *depth_start; /**< addr of depth surface in main memory */
+ enum pipe_format color_format;
+ enum pipe_format depth_format;
uint width, height; /**< size in pixels */
uint width_tiles, height_tiles; /**< width and height in tiles */
};
diff --git a/src/mesa/pipe/cell/spu/tri.c b/src/mesa/pipe/cell/spu/tri.c
index 3707ebea45..f58cc4b024 100644
--- a/src/mesa/pipe/cell/spu/tri.c
+++ b/src/mesa/pipe/cell/spu/tri.c
@@ -234,7 +234,7 @@ pack_color(const float color[4])
uint g = (uint) (color[1] * 255.0);
uint b = (uint) (color[2] * 255.0);
uint a = (uint) (color[3] * 255.0);
- switch (fb.format) {
+ switch (fb.color_format) {
case PIPE_FORMAT_A8R8G8B8_UNORM:
return (a << 24) | (r << 16) | (g << 8) | b;
case PIPE_FORMAT_B8G8R8A8_UNORM: