summaryrefslogtreecommitdiff
path: root/src/gallium/drivers/cell/ppu/cell_state_emit.c
diff options
context:
space:
mode:
authorIan Romanick <idr@us.ibm.com>2008-03-17 15:45:52 -0700
committerIan Romanick <idr@us.ibm.com>2008-03-17 15:47:45 -0700
commit1936e4bdfd776f78f9fe44f77ce66066fd166360 (patch)
treec72c00d624d332733d2b643e3dffd5114b18cc34 /src/gallium/drivers/cell/ppu/cell_state_emit.c
parent0c715de39fa8337a2753dacd77ed280000416c1a (diff)
cell: Initial code-gen for alpha / stencil / depth testing
Alpha test is currently broken because all per-fragment testing occurs before alpha is calculated. Stencil test is currently broken because the Z-clear code asserts if there is a stencil buffer.
Diffstat (limited to 'src/gallium/drivers/cell/ppu/cell_state_emit.c')
-rw-r--r--src/gallium/drivers/cell/ppu/cell_state_emit.c24
1 files changed, 21 insertions, 3 deletions
diff --git a/src/gallium/drivers/cell/ppu/cell_state_emit.c b/src/gallium/drivers/cell/ppu/cell_state_emit.c
index 670eb26bdd..c8d5fdf709 100644
--- a/src/gallium/drivers/cell/ppu/cell_state_emit.c
+++ b/src/gallium/drivers/cell/ppu/cell_state_emit.c
@@ -71,9 +71,27 @@ cell_emit_state(struct cell_context *cell)
}
if (cell->dirty & CELL_NEW_DEPTH_STENCIL) {
- emit_state_cmd(cell, CELL_CMD_STATE_DEPTH_STENCIL,
- cell->depth_stencil,
- sizeof(struct pipe_depth_stencil_alpha_state));
+ struct cell_command_depth_stencil_alpha_test dsat;
+
+
+ dsat.base = (intptr_t) cell->depth_stencil->code.store;
+ dsat.size = (char *) cell->depth_stencil->code.csr
+ - (char *) cell->depth_stencil->code.store;
+ dsat.read_depth = TRUE;
+ dsat.read_stencil = FALSE;
+
+ {
+ uint32_t *p = cell->depth_stencil->code.store;
+
+ printf("\t.text\n");
+ for (/* empty */; p < cell->depth_stencil->code.csr; p++) {
+ printf("\t.long\t0x%04x\n", *p);
+ }
+ fflush(stdout);
+ }
+
+ emit_state_cmd(cell, CELL_CMD_STATE_DEPTH_STENCIL, &dsat,
+ sizeof(dsat));
}
if (cell->dirty & CELL_NEW_SAMPLER) {