remove previous triangle test code

This commit is contained in:
Brian
2008-01-02 18:58:44 -07:00
parent de9f8e8b71
commit d55c4ec9d2
5 changed files with 5 additions and 94 deletions
-9
View File
@@ -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;
-33
View File
@@ -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
}
+1 -29
View File
@@ -138,30 +138,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)
{
@@ -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);
+4 -19
View File
@@ -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)
{
-4
View File
@@ -45,10 +45,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);