From 137cb72284a115d8f5ffadf2154b6f5eb5323a7d Mon Sep 17 00:00:00 2001 From: Ian Romanick Date: Wed, 30 Jan 2008 19:24:40 -0800 Subject: [PATCH] Elts are always ints, pass vOut pointers in-line in command --- src/mesa/pipe/cell/common.h | 6 +++--- src/mesa/pipe/cell/spu/spu_vertex_shader.c | 14 ++------------ 2 files changed, 5 insertions(+), 15 deletions(-) diff --git a/src/mesa/pipe/cell/common.h b/src/mesa/pipe/cell/common.h index 80a1425..fbbdf72 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 595f54b..8216550 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]); } } -- 2.7.4