aboutsummaryrefslogtreecommitdiffstats
path: root/src/mesa
diff options
context:
space:
mode:
authorBrian <[email protected]>2008-02-04 15:06:10 -0700
committerBrian <[email protected]>2008-02-04 15:06:10 -0700
commit7a1d01f2a0d8f0875a265e7d4e31e1348fd82677 (patch)
tree2c466f58cc0da6f531e3d1fbd8c33beb6f29e297 /src/mesa
parent8f924e4df06a5d45dda338e7a0a87308e48df57e (diff)
Cell: emit blend state to SPUs
Diffstat (limited to 'src/mesa')
-rw-r--r--src/mesa/pipe/cell/common.h3
-rw-r--r--src/mesa/pipe/cell/ppu/cell_state_emit.c6
-rw-r--r--src/mesa/pipe/cell/spu/spu_main.c17
-rw-r--r--src/mesa/pipe/cell/spu/spu_main.h1
4 files changed, 26 insertions, 1 deletions
diff --git a/src/mesa/pipe/cell/common.h b/src/mesa/pipe/cell/common.h
index 7e193f31be6..d861e82d332 100644
--- a/src/mesa/pipe/cell/common.h
+++ b/src/mesa/pipe/cell/common.h
@@ -85,7 +85,8 @@
#define CELL_CMD_STATE_VERTEX_INFO 14
#define CELL_CMD_STATE_VIEWPORT 15
#define CELL_CMD_STATE_VS_ARRAY_INFO 16
-#define CELL_CMD_VS_EXECUTE 17
+#define CELL_CMD_STATE_BLEND 17
+#define CELL_CMD_VS_EXECUTE 18
#define CELL_NUM_BUFFERS 4
diff --git a/src/mesa/pipe/cell/ppu/cell_state_emit.c b/src/mesa/pipe/cell/ppu/cell_state_emit.c
index 702184416bf..3b2670f786b 100644
--- a/src/mesa/pipe/cell/ppu/cell_state_emit.c
+++ b/src/mesa/pipe/cell/ppu/cell_state_emit.c
@@ -61,6 +61,12 @@ cell_emit_state(struct cell_context *cell)
fb->height = cell->framebuffer.cbufs[0]->height;
}
+ if (cell->dirty & CELL_NEW_BLEND) {
+ emit_state_cmd(cell, CELL_CMD_STATE_BLEND,
+ cell->blend,
+ sizeof(struct pipe_blend_state));
+ }
+
if (cell->dirty & CELL_NEW_DEPTH_STENCIL) {
emit_state_cmd(cell, CELL_CMD_STATE_DEPTH_STENCIL,
cell->depth_stencil,
diff --git a/src/mesa/pipe/cell/spu/spu_main.c b/src/mesa/pipe/cell/spu/spu_main.c
index 48e016fc8b4..9d8e6df0e30 100644
--- a/src/mesa/pipe/cell/spu/spu_main.c
+++ b/src/mesa/pipe/cell/spu/spu_main.c
@@ -233,6 +233,18 @@ cmd_state_framebuffer(const struct cell_command_framebuffer *cmd)
static void
+cmd_state_blend(const struct pipe_blend_state *state)
+{
+ if (Debug)
+ printf("SPU %u: BLEND: ztest %d\n",
+ spu.init.id,
+ state->blend_enable);
+
+ memcpy(&spu.blend, state, sizeof(*state));
+}
+
+
+static void
cmd_state_depth_stencil(const struct pipe_depth_stencil_alpha_state *state)
{
if (Debug)
@@ -398,6 +410,11 @@ cmd_batch(uint opcode)
cmd_finish();
pos += 1;
break;
+ case CELL_CMD_STATE_BLEND:
+ cmd_state_blend((struct pipe_blend_state *)
+ &buffer[pos+1]);
+ pos += (1 + sizeof(struct pipe_blend_state) / 4);
+ break;
case CELL_CMD_STATE_DEPTH_STENCIL:
cmd_state_depth_stencil((struct pipe_depth_stencil_alpha_state *)
&buffer[pos+1]);
diff --git a/src/mesa/pipe/cell/spu/spu_main.h b/src/mesa/pipe/cell/spu/spu_main.h
index fb98b0d8897..b22d5635518 100644
--- a/src/mesa/pipe/cell/spu/spu_main.h
+++ b/src/mesa/pipe/cell/spu/spu_main.h
@@ -86,6 +86,7 @@ struct spu_global
struct cell_init_info init;
struct spu_framebuffer fb;
+ struct pipe_blend_state blend_stencil;
struct pipe_depth_stencil_alpha_state depth_stencil;
struct pipe_blend_state blend;
struct pipe_sampler_state sampler[PIPE_MAX_SAMPLERS];