diff options
author | Brian <[email protected]> | 2008-01-02 18:58:44 -0700 |
---|---|---|
committer | Brian <[email protected]> | 2008-01-02 18:58:44 -0700 |
commit | d55c4ec9d2c0a8cd9ba75985962297381e6c0364 (patch) | |
tree | a7b76ebaa86f55a447ff65a4de280c8d9f084dfb /src/mesa | |
parent | de9f8e8b717aa4b4ab94af73be5aa70088cd6b81 (diff) |
remove previous triangle test code
Diffstat (limited to 'src/mesa')
-rw-r--r-- | src/mesa/pipe/cell/common.h | 9 | ||||
-rw-r--r-- | src/mesa/pipe/cell/ppu/cell_surface.c | 33 | ||||
-rw-r--r-- | src/mesa/pipe/cell/spu/main.c | 30 | ||||
-rw-r--r-- | src/mesa/pipe/cell/spu/tri.c | 23 | ||||
-rw-r--r-- | src/mesa/pipe/cell/spu/tri.h | 4 |
5 files changed, 5 insertions, 94 deletions
diff --git a/src/mesa/pipe/cell/common.h b/src/mesa/pipe/cell/common.h index 0868e8d90fc..8202bbbe762 100644 --- a/src/mesa/pipe/cell/common.h +++ b/src/mesa/pipe/cell/common.h @@ -49,7 +49,6 @@ #define CELL_CMD_EXIT 1 #define CELL_CMD_FRAMEBUFFER 2 #define CELL_CMD_CLEAR_TILES 3 -#define CELL_CMD_TRIANGLE 4 #define CELL_CMD_FINISH 5 #define CELL_CMD_RENDER 6 @@ -74,13 +73,6 @@ struct cell_command_clear_tiles } ALIGN16_ATTRIB; -struct cell_command_triangle -{ - float vert[3][4]; - float color[3][4]; -} ALIGN16_ATTRIB; - - struct cell_command_render { uint prim_type; @@ -95,7 +87,6 @@ struct cell_command { struct cell_command_framebuffer fb; struct cell_command_clear_tiles clear; - struct cell_command_triangle tri; struct cell_command_render render; } ALIGN16_ATTRIB; diff --git a/src/mesa/pipe/cell/ppu/cell_surface.c b/src/mesa/pipe/cell/ppu/cell_surface.c index c487d0439a4..8b3ed4a23a9 100644 --- a/src/mesa/pipe/cell/ppu/cell_surface.c +++ b/src/mesa/pipe/cell/ppu/cell_surface.c @@ -71,37 +71,4 @@ cell_clear_surface(struct pipe_context *pipe, struct pipe_surface *ps, cell_global.command[i].clear.value = clearValue | (i << 21); send_mbox_message(cell_global.spe_contexts[i], CELL_CMD_CLEAR_TILES); } - -#if 0 - /* XXX Draw a test triangle over the cleared surface */ - for (i = 0; i < cell->num_spus; i++) { - /* Same triangle data for all SPUs */ - struct cell_command_triangle *tri = &cell_global.command[i].tri; - tri->vert[0][0] = 20.0; - tri->vert[0][1] = ps->height - 20; - - tri->vert[1][0] = ps->width - 20.0; - tri->vert[1][1] = ps->height - 20; - - tri->vert[2][0] = ps->width / 2; - tri->vert[2][1] = 20.0; - - tri->color[0][0] = 1.0; - tri->color[0][1] = 0.0; - tri->color[0][2] = 0.0; - tri->color[0][3] = 0.0; - - tri->color[1][0] = 0.0; - tri->color[1][1] = 1.0; - tri->color[1][2] = 0.0; - tri->color[1][3] = 0.0; - - tri->color[2][0] = 0.0; - tri->color[2][1] = 0.0; - tri->color[2][2] = 1.0; - tri->color[2][3] = 0.0; - - send_mbox_message(cell_global.spe_contexts[i], CELL_CMD_TRIANGLE); - } -#endif } diff --git a/src/mesa/pipe/cell/spu/main.c b/src/mesa/pipe/cell/spu/main.c index 183397a5ff6..94b9eda5c37 100644 --- a/src/mesa/pipe/cell/spu/main.c +++ b/src/mesa/pipe/cell/spu/main.c @@ -139,30 +139,6 @@ clear_tiles(const struct cell_command_clear_tiles *clear) static void -triangle(const struct cell_command_triangle *tri) -{ - uint num_tiles = fb.width_tiles * fb.height_tiles; - struct prim_header prim; - uint i; - - COPY_4V(prim.v[0].data[0], tri->vert[0]); - COPY_4V(prim.v[1].data[0], tri->vert[1]); - COPY_4V(prim.v[2].data[0], tri->vert[2]); - - COPY_4V(prim.v[0].data[1], tri->color[0]); - COPY_4V(prim.v[1].data[1], tri->color[1]); - COPY_4V(prim.v[2].data[1], tri->color[2]); - - for (i = init.id; i < num_tiles; i += init.num_spus) { - uint tx = i % fb.width_tiles; - uint ty = i / fb.width_tiles; - draw_triangle(&prim, tx, ty); - } -} - - - -static void render(const struct cell_command_render *render) { const uint num_tiles = fb.width_tiles * fb.height_tiles; @@ -223,7 +199,7 @@ render(const struct cell_command_render *render) COPY_4V(prim.v[1].data[1], prim_buffer.vertex[j+1][1]); COPY_4V(prim.v[2].data[1], prim_buffer.vertex[j+2][1]); - draw_triangle(&prim, tx, ty); + tri_draw(&prim, tx, ty); } put_tile(&fb, tx, ty, (uint *) tile, DefaultTag); @@ -288,10 +264,6 @@ main_loop(void) printf("SPU %u: CLEAR to 0x%08x\n", init.id, cmd.clear.value); clear_tiles(&cmd.clear); break; - case CELL_CMD_TRIANGLE: - printf("SPU %u: TRIANGLE\n", init.id); - triangle(&cmd.tri); - break; case CELL_CMD_RENDER: printf("SPU %u: RENDER %u verts, prim %u\n", init.id, cmd.render.num_verts, cmd.render.prim_type); diff --git a/src/mesa/pipe/cell/spu/tri.c b/src/mesa/pipe/cell/spu/tri.c index ce759a56470..4e198e638cb 100644 --- a/src/mesa/pipe/cell/spu/tri.c +++ b/src/mesa/pipe/cell/spu/tri.c @@ -868,25 +868,10 @@ struct draw_stage *sp_draw_render_stage( struct softpipe_context *softpipe ) #endif -void -draw_triangle(struct prim_header *tri, uint tx, uint ty) -{ - /* set clipping bounds to tile bounds */ - cliprect_minx = tx * TILE_SIZE; - cliprect_miny = ty * TILE_SIZE; - cliprect_maxx = (tx + 1) * TILE_SIZE; - cliprect_maxy = (ty + 1) * TILE_SIZE; - - get_tile(&fb, tx, ty, (uint *) tile, DefaultTag); - wait_on_mask(1 << DefaultTag); - - setup_tri(tri); - - put_tile(&fb, tx, ty, (uint *) tile, DefaultTag); - wait_on_mask(1 << DefaultTag); -} - - +/** + * Draw triangle into tile at (tx, ty) (tile coords) + * The tile data should have already been fetched. + */ void tri_draw(struct prim_header *tri, uint tx, uint ty) { diff --git a/src/mesa/pipe/cell/spu/tri.h b/src/mesa/pipe/cell/spu/tri.h index 576030579fc..01612a25794 100644 --- a/src/mesa/pipe/cell/spu/tri.h +++ b/src/mesa/pipe/cell/spu/tri.h @@ -46,10 +46,6 @@ struct prim_header { extern void -draw_triangle(struct prim_header *tri, uint tx, uint ty); - - -extern void tri_draw(struct prim_header *tri, uint tx, uint ty); |