From 235da629dceb23bfddea1eadfcf771d2794d6119 Mon Sep 17 00:00:00 2001 From: Brian Date: Fri, 25 Jan 2008 08:17:52 -0700 Subject: Cell: propogate vertex info to SPUs, use it for attrib interpolation --- src/mesa/pipe/cell/spu/spu_main.c | 19 ++++++++++++++++--- 1 file changed, 16 insertions(+), 3 deletions(-) (limited to 'src/mesa/pipe/cell/spu/spu_main.c') diff --git a/src/mesa/pipe/cell/spu/spu_main.c b/src/mesa/pipe/cell/spu/spu_main.c index 1d0de7b1f9..880f8de550 100644 --- a/src/mesa/pipe/cell/spu/spu_main.c +++ b/src/mesa/pipe/cell/spu/spu_main.c @@ -390,6 +390,17 @@ cmd_state_sampler(const struct pipe_sampler_state *state) } +static void +cmd_state_vertex_info(const struct vertex_info *vinfo) +{ + if (Debug) + printf("SPU %u: VERTEX_INFO num_attribs=%u\n", spu.init.id, + vinfo->num_attribs); + memcpy(&spu.vertex_info, vinfo, sizeof(*vinfo)); +} + + + static void cmd_finish(void) { @@ -472,7 +483,6 @@ cmd_batch(uint opcode) /* Tell PPU we're done copying the buffer to local store */ release_batch_buffer(buf); - for (pos = 0; pos < usize; /* no incr */) { switch (buffer[pos]) { case CELL_CMD_FRAMEBUFFER: @@ -509,10 +519,13 @@ cmd_batch(uint opcode) pos += (1 + sizeof(struct pipe_depth_stencil_alpha_state) / 4); break; case CELL_CMD_STATE_SAMPLER: - cmd_state_sampler((struct pipe_sampler_state *) - &buffer[pos+1]); + cmd_state_sampler((struct pipe_sampler_state *) &buffer[pos+1]); pos += (1 + sizeof(struct pipe_sampler_state) / 4); break; + case CELL_CMD_STATE_VERTEX_INFO: + cmd_state_vertex_info((struct vertex_info *) &buffer[pos+1]); + pos += (1 + sizeof(struct vertex_info) / 4); + break; default: printf("SPU %u: bad opcode: 0x%x\n", spu.init.id, buffer[pos]); ASSERT(0); -- cgit v1.2.3