diff options
author | Keith Whitwell <keith@tungstengraphics.com> | 2008-09-12 10:31:23 +0100 |
---|---|---|
committer | Keith Whitwell <keith@tungstengraphics.com> | 2008-09-12 10:31:23 +0100 |
commit | 176c454765b88c71d8b1ef474bc0fd53cb253a08 (patch) | |
tree | 76a2aee9ab3ae7f94661faf305d1b7b7b82b5cb3 /src/gallium/drivers/cell/spu/spu_main.c | |
parent | 1f135456795adfb1d739a6fb66ab9540aa79b461 (diff) | |
parent | aa66f08a21b791f338b519f0c2162cd8f7b3aeb0 (diff) |
Merge commit 'origin/gallium-0.1' into gallium-0.2
Conflicts:
progs/fp/Makefile
Diffstat (limited to 'src/gallium/drivers/cell/spu/spu_main.c')
-rw-r--r-- | src/gallium/drivers/cell/spu/spu_main.c | 25 |
1 files changed, 24 insertions, 1 deletions
diff --git a/src/gallium/drivers/cell/spu/spu_main.c b/src/gallium/drivers/cell/spu/spu_main.c index 2a7cb75f59..78260c4259 100644 --- a/src/gallium/drivers/cell/spu/spu_main.c +++ b/src/gallium/drivers/cell/spu/spu_main.c @@ -232,7 +232,7 @@ cmd_state_fragment_ops(const struct cell_command_fragment_ops *fops) printf("SPU %u: CMD_STATE_FRAGMENT_OPS\n", spu.init.id); /* Copy SPU code from batch buffer to spu buffer */ memcpy(spu.fragment_ops_code, fops->code, SPU_MAX_FRAGMENT_OPS_INSTS * 4); - /* Copy state info */ + /* Copy state info (for fallback case only) */ memcpy(&spu.depth_stencil_alpha, &fops->dsa, sizeof(fops->dsa)); memcpy(&spu.blend, &fops->blend, sizeof(fops->blend)); @@ -245,6 +245,21 @@ cmd_state_fragment_ops(const struct cell_command_fragment_ops *fops) static void +cmd_state_fragment_program(const struct cell_command_fragment_program *fp) +{ + if (Debug) + printf("SPU %u: CMD_STATE_FRAGMENT_PROGRAM\n", spu.init.id); + /* Copy SPU code from batch buffer to spu buffer */ + memcpy(spu.fragment_program_code, fp->code, + SPU_MAX_FRAGMENT_PROGRAM_INSTS * 4); +#if 01 + /* Point function pointer at new code */ + spu.fragment_program = (spu_fragment_program_func)spu.fragment_program_code; +#endif +} + + +static void cmd_state_framebuffer(const struct cell_command_framebuffer *cmd) { if (Debug) @@ -473,6 +488,14 @@ cmd_batch(uint opcode) pos += sizeof(*fops) / 8; } break; + case CELL_CMD_STATE_FRAGMENT_PROGRAM: + { + struct cell_command_fragment_program *fp + = (struct cell_command_fragment_program *) &buffer[pos]; + cmd_state_fragment_program(fp); + pos += sizeof(*fp) / 8; + } + break; case CELL_CMD_STATE_SAMPLER: { struct cell_command_sampler *sampler |