diff options
author | Brian <[email protected]> | 2008-01-21 21:15:43 -0700 |
---|---|---|
committer | Brian <[email protected]> | 2008-01-21 21:17:21 -0700 |
commit | cfeda4165b2845d2253d3082aa771a2346bac6a0 (patch) | |
tree | 098dcd9c5afb62c3ebd1c50966471db06fff46c0 | |
parent | 0c085717cbb63f00223dc1df3d514f1ef2aaeda1 (diff) |
Cell: initial support for sampler state
-rw-r--r-- | src/mesa/pipe/cell/common.h | 1 | ||||
-rw-r--r-- | src/mesa/pipe/cell/ppu/cell_state_emit.c | 7 | ||||
-rw-r--r-- | src/mesa/pipe/cell/spu/spu_main.c | 15 | ||||
-rw-r--r-- | src/mesa/pipe/cell/spu/spu_main.h | 1 |
4 files changed, 24 insertions, 0 deletions
diff --git a/src/mesa/pipe/cell/common.h b/src/mesa/pipe/cell/common.h index f05070d25a1..4c998722a26 100644 --- a/src/mesa/pipe/cell/common.h +++ b/src/mesa/pipe/cell/common.h @@ -60,6 +60,7 @@ #define CELL_CMD_RENDER 5 #define CELL_CMD_BATCH 6 #define CELL_CMD_STATE_DEPTH_STENCIL 7 +#define CELL_CMD_STATE_SAMPLER 8 #define CELL_NUM_BATCH_BUFFERS 3 diff --git a/src/mesa/pipe/cell/ppu/cell_state_emit.c b/src/mesa/pipe/cell/ppu/cell_state_emit.c index e1a1458f39a..e7d14d0d252 100644 --- a/src/mesa/pipe/cell/ppu/cell_state_emit.c +++ b/src/mesa/pipe/cell/ppu/cell_state_emit.c @@ -42,4 +42,11 @@ cell_emit_state(struct cell_context *cell) cell_batch_append(cell, cell->depth_stencil, sizeof(struct pipe_depth_stencil_alpha_state)); } + + if (cell->dirty & CELL_NEW_SAMPLER) { + uint cmd = CELL_CMD_STATE_SAMPLER; + cell_batch_append(cell, &cmd, 4); + cell_batch_append(cell, cell->sampler[0], + sizeof(struct pipe_sampler_state)); + } } diff --git a/src/mesa/pipe/cell/spu/spu_main.c b/src/mesa/pipe/cell/spu/spu_main.c index 2b32c26854c..2e5cb76b4a2 100644 --- a/src/mesa/pipe/cell/spu/spu_main.c +++ b/src/mesa/pipe/cell/spu/spu_main.c @@ -378,7 +378,17 @@ cmd_state_depth_stencil(const struct pipe_depth_stencil_alpha_state *state) state->depth.enabled); memcpy(&spu.depth_stencil, state, sizeof(*state)); +} + + +static void +cmd_state_sampler(const struct pipe_sampler_state *state) +{ + if (Debug) + printf("SPU %u: SAMPLER\n", + spu.init.id); + memcpy(&spu.sampler[0], state, sizeof(*state)); } @@ -501,6 +511,11 @@ cmd_batch(uint opcode) &buffer[pos+1]); 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]); + pos += (1 + sizeof(struct pipe_sampler_state) / 4); + break; default: printf("SPU %u: bad opcode: 0x%x\n", spu.init.id, buffer[pos]); ASSERT(0); diff --git a/src/mesa/pipe/cell/spu/spu_main.h b/src/mesa/pipe/cell/spu/spu_main.h index 2aa7015ae3b..3ef73c9473d 100644 --- a/src/mesa/pipe/cell/spu/spu_main.h +++ b/src/mesa/pipe/cell/spu/spu_main.h @@ -58,6 +58,7 @@ struct spu_global struct spu_framebuffer fb; struct pipe_depth_stencil_alpha_state depth_stencil; struct pipe_blend_state blend; + struct pipe_sampler_state sampler[PIPE_MAX_SAMPLERS]; /* XXX more state to come */ } ALIGN16_ATTRIB; |