aboutsummaryrefslogtreecommitdiffstats
path: root/src/mesa/pipe/cell/ppu
diff options
context:
space:
mode:
authorBrian <[email protected]>2008-01-25 08:17:52 -0700
committerBrian <[email protected]>2008-01-25 08:20:10 -0700
commit235da629dceb23bfddea1eadfcf771d2794d6119 (patch)
tree12bb5e34b092ae19fa62dc89433fca5ae6dfea83 /src/mesa/pipe/cell/ppu
parent4c4f691069411c77b33a6bfca64766f861cbc823 (diff)
Cell: propogate vertex info to SPUs, use it for attrib interpolation
Diffstat (limited to 'src/mesa/pipe/cell/ppu')
-rw-r--r--src/mesa/pipe/cell/ppu/cell_state.h1
-rw-r--r--src/mesa/pipe/cell/ppu/cell_state_derived.c5
-rw-r--r--src/mesa/pipe/cell/ppu/cell_state_emit.c6
3 files changed, 12 insertions, 0 deletions
diff --git a/src/mesa/pipe/cell/ppu/cell_state.h b/src/mesa/pipe/cell/ppu/cell_state.h
index fbca7c95744..3a71ba14fa8 100644
--- a/src/mesa/pipe/cell/ppu/cell_state.h
+++ b/src/mesa/pipe/cell/ppu/cell_state.h
@@ -19,6 +19,7 @@
#define CELL_NEW_VERTEX 0x1000
#define CELL_NEW_VS 0x2000
#define CELL_NEW_CONSTANTS 0x4000
+#define CELL_NEW_VERTEX_INFO 0x8000
diff --git a/src/mesa/pipe/cell/ppu/cell_state_derived.c b/src/mesa/pipe/cell/ppu/cell_state_derived.c
index f3b3ae8544d..56daf5dfde0 100644
--- a/src/mesa/pipe/cell/ppu/cell_state_derived.c
+++ b/src/mesa/pipe/cell/ppu/cell_state_derived.c
@@ -30,6 +30,7 @@
#include "pipe/draw/draw_context.h"
#include "pipe/draw/draw_vertex.h"
#include "cell_context.h"
+#include "cell_batch.h"
#include "cell_state.h"
#include "cell_state_emit.h"
@@ -85,6 +86,7 @@ calculate_vertex_layout( struct cell_context *cell )
assert(src >= 0);
draw_emit_vertex_attr(vinfo, EMIT_4F, INTERP_POS, src);
+
/*
* Loop over fragment shader inputs, searching for the matching output
* from the vertex shader.
@@ -126,6 +128,9 @@ calculate_vertex_layout( struct cell_context *cell )
}
draw_compute_vertex_size(vinfo);
+
+ /* XXX only signal this if format really changes */
+ cell->dirty |= CELL_NEW_VERTEX_INFO;
}
diff --git a/src/mesa/pipe/cell/ppu/cell_state_emit.c b/src/mesa/pipe/cell/ppu/cell_state_emit.c
index e7d14d0d252..e5b7c925143 100644
--- a/src/mesa/pipe/cell/ppu/cell_state_emit.c
+++ b/src/mesa/pipe/cell/ppu/cell_state_emit.c
@@ -49,4 +49,10 @@ cell_emit_state(struct cell_context *cell)
cell_batch_append(cell, cell->sampler[0],
sizeof(struct pipe_sampler_state));
}
+
+ if (cell->dirty & CELL_NEW_VERTEX_INFO) {
+ uint cmd = CELL_CMD_STATE_VERTEX_INFO;
+ cell_batch_append(cell, &cmd, 4);
+ cell_batch_append(cell, &cell->vertex_info, sizeof(struct vertex_info));
+ }
}