summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIan Romanick <idr@us.ibm.com>2008-01-30 19:24:40 -0800
committerIan Romanick <idr@us.ibm.com>2008-01-30 20:14:51 -0800
commit137cb72284a115d8f5ffadf2154b6f5eb5323a7d (patch)
treef432376a52ac0a93b67eaceeeb8b26b19ee34992
parent334986114665df650649634b63184be6f1b9cd9b (diff)
Elts are always ints, pass vOut pointers in-line in command
-rw-r--r--src/mesa/pipe/cell/common.h6
-rw-r--r--src/mesa/pipe/cell/spu/spu_vertex_shader.c14
2 files changed, 5 insertions, 15 deletions
diff --git a/src/mesa/pipe/cell/common.h b/src/mesa/pipe/cell/common.h
index 80a1425ec7..fbbdf728a1 100644
--- a/src/mesa/pipe/cell/common.h
+++ b/src/mesa/pipe/cell/common.h
@@ -144,13 +144,13 @@ struct cell_shader_info
} ALIGN16_ATTRIB;
+#define SPU_VERTS_PER_BATCH 64
struct cell_command_vs
{
struct cell_shader_info shader;
- void *elts;
unsigned num_elts;
- unsigned bytes_per_elt;
- void *vOut;
+ unsigned elts[SPU_VERTS_PER_BATCH];
+ uint64_t vOut[SPU_VERTS_PER_BATCH];
} ALIGN16_ATTRIB;
diff --git a/src/mesa/pipe/cell/spu/spu_vertex_shader.c b/src/mesa/pipe/cell/spu/spu_vertex_shader.c
index 595f54b0eb..82165501c5 100644
--- a/src/mesa/pipe/cell/spu/spu_vertex_shader.c
+++ b/src/mesa/pipe/cell/spu/spu_vertex_shader.c
@@ -81,7 +81,7 @@ compute_clipmask(const float *clip, /*const*/ float plane[][4], unsigned nr)
static void
run_vertex_program(struct spu_vs_context *draw,
unsigned elts[4], unsigned count,
- struct vertex_header *vOut[])
+ const uint64_t *vOut)
{
struct spu_exec_machine *machine = &draw->machine;
unsigned int j;
@@ -206,17 +206,7 @@ spu_execute_vertex_shader(struct spu_vs_context *draw,
for (i = 0; i < vs->num_elts; i += 4) {
const unsigned batch_size = MIN2(vs->num_elts - i, 4);
- unsigned elts[4];
-
- for (j = 0; j < batch_size; j++) {
- switch (vs->bytes_per_elt) {
- case 1: elts[j] = ((unsigned char *) vs->elts)[i + j]; break;
- case 2: elts[j] = ((unsigned short *)vs->elts)[i + j]; break;
- case 4: elts[j] = ((unsigned int *) vs->elts)[i + j]; break;
- }
- }
- run_vertex_program(draw, elts, batch_size,
- (struct vertex_header (*)[]) vs->vOut);
+ run_vertex_program(draw, & vs->elts[i], batch_size, &vs->vOut[i]);
}
}