summaryrefslogtreecommitdiff
path: root/src/mesa/pipe/cell/ppu
diff options
context:
space:
mode:
authorBrian <brian.paul@tungstengraphics.com>2007-12-11 18:26:52 -0700
committerBrian <brian.paul@tungstengraphics.com>2007-12-11 18:26:52 -0700
commitb2ad30d57197c2167789e4f3f5b34af6df56dde2 (patch)
tree8b230ce86bb17bbb4c0e2ced792477a9c2a6f200 /src/mesa/pipe/cell/ppu
parent9828310a1bba1c1c2dffa7ae8866b648e26c2039 (diff)
Cell: draw smooth-shaded triangle
Diffstat (limited to 'src/mesa/pipe/cell/ppu')
-rw-r--r--src/mesa/pipe/cell/ppu/cell_surface.c29
1 files changed, 20 insertions, 9 deletions
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);
}