diff options
author | Brian <brian.paul@tungstengraphics.com> | 2007-12-10 17:32:08 -0700 |
---|---|---|
committer | Brian <brian.paul@tungstengraphics.com> | 2007-12-10 17:32:43 -0700 |
commit | 7d1894c6558c5cc7f503142cda11b8a12ea24e65 (patch) | |
tree | 0e6bdb0417a0f444f527d2559cc809cab4228703 /src/mesa/pipe/cell/ppu/cell_surface.c | |
parent | aef25b1994cf93aaf64baf24a2ec4e29ee086a08 (diff) |
Cell: first triangle.
This is a feeble first step, but it works.
The cell_clear_surface() function has been hijacked to set up a "draw triangle"
command and send it to all the SPUs.
The Gallium softpipe triangle code was copied to the SPU module and modified.
Only the progs/trivial/clear.c program runs.
Diffstat (limited to 'src/mesa/pipe/cell/ppu/cell_surface.c')
-rw-r--r-- | src/mesa/pipe/cell/ppu/cell_surface.c | 29 |
1 files changed, 21 insertions, 8 deletions
diff --git a/src/mesa/pipe/cell/ppu/cell_surface.c b/src/mesa/pipe/cell/ppu/cell_surface.c index 1692960244..66e4b5108b 100644 --- a/src/mesa/pipe/cell/ppu/cell_surface.c +++ b/src/mesa/pipe/cell/ppu/cell_surface.c @@ -70,14 +70,6 @@ cell_clear_surface(struct pipe_context *pipe, struct pipe_surface *ps, struct cell_context *cell = cell_context(pipe); uint i; - printf("%s 0x%08x\n", __FUNCTION__, clearValue); - - { - char s[100]; - pf_sprint_name(s, ps->format); - printf("format = %s\n", s); - } - if (!ps->map) pipe_surface_map(ps); @@ -90,9 +82,30 @@ cell_clear_surface(struct pipe_context *pipe, struct pipe_surface *ps, } for (i = 0; i < cell->num_spus; i++) { + /* XXX clear color varies per-SPU for debugging */ command[i].clear.value = clearValue | (i << 21); send_mbox_message(control_ps_area[i], CELL_CMD_CLEAR_TILES); } + +#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: */ + command[i].tri.x0 = 20.0; + command[i].tri.y0 = ps->height - 20; + + command[i].tri.x1 = ps->width - 20.0; + command[i].tri.y1 = ps->height - 20; + + command[i].tri.x2 = ps->width / 2; + command[i].tri.y2 = 20.0; + + /* XXX color varies per SPU */ + command[i].tri.color = 0xffff00 | ((i*40)<<24); /* yellow */ + + send_mbox_message(control_ps_area[i], CELL_CMD_TRIANGLE); + } +#endif } |