From b2ad30d57197c2167789e4f3f5b34af6df56dde2 Mon Sep 17 00:00:00 2001 From: Brian Date: Tue, 11 Dec 2007 18:26:52 -0700 Subject: Cell: draw smooth-shaded triangle --- src/mesa/pipe/cell/ppu/cell_surface.c | 29 ++++++++++++++++++++--------- 1 file changed, 20 insertions(+), 9 deletions(-) (limited to 'src/mesa/pipe/cell/ppu') diff --git a/src/mesa/pipe/cell/ppu/cell_surface.c b/src/mesa/pipe/cell/ppu/cell_surface.c index 143f554b60..185eeb26e8 100644 --- a/src/mesa/pipe/cell/ppu/cell_surface.c +++ b/src/mesa/pipe/cell/ppu/cell_surface.c @@ -69,20 +69,31 @@ cell_clear_surface(struct pipe_context *pipe, struct pipe_surface *ps, #if 1 /* XXX Draw a test triangle over the cleared surface */ for (i = 0; i < cell->num_spus; i++) { - /* Same triangle data for all SPUs, of course: */ + /* 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->x0 = 20.0; - tri->y0 = ps->height - 20; + tri->vert[1][0] = ps->width - 20.0; + tri->vert[1][1] = ps->height - 20; - tri->x1 = ps->width - 20.0; - tri->y1 = ps->height - 20; + tri->vert[2][0] = ps->width / 2; + tri->vert[2][1] = 20.0; - tri->x2 = ps->width / 2; - tri->y2 = 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; - /* XXX color varies per SPU */ - tri->color = 0xffff00 | ((i*40)<<24); /* yellow */ + 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); } -- cgit v1.2.3