Elts are always ints, pass vOut pointers in-line in command

This commit is contained in:
Ian Romanick 2008-01-30 19:24:40 -08:00 committed by Ben Skeggs
parent bbbd5c166a
commit dcfe7e1dca
2 changed files with 5 additions and 15 deletions

View file

@ -144,13 +144,13 @@ struct cell_shader_info
} ALIGN16_ATTRIB; } ALIGN16_ATTRIB;
#define SPU_VERTS_PER_BATCH 64
struct cell_command_vs struct cell_command_vs
{ {
struct cell_shader_info shader; struct cell_shader_info shader;
void *elts;
unsigned num_elts; unsigned num_elts;
unsigned bytes_per_elt; unsigned elts[SPU_VERTS_PER_BATCH];
void *vOut; uint64_t vOut[SPU_VERTS_PER_BATCH];
} ALIGN16_ATTRIB; } ALIGN16_ATTRIB;

View file

@ -81,7 +81,7 @@ compute_clipmask(const float *clip, /*const*/ float plane[][4], unsigned nr)
static void static void
run_vertex_program(struct spu_vs_context *draw, run_vertex_program(struct spu_vs_context *draw,
unsigned elts[4], unsigned count, unsigned elts[4], unsigned count,
struct vertex_header *vOut[]) const uint64_t *vOut)
{ {
struct spu_exec_machine *machine = &draw->machine; struct spu_exec_machine *machine = &draw->machine;
unsigned int j; 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) { for (i = 0; i < vs->num_elts; i += 4) {
const unsigned batch_size = MIN2(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++) { run_vertex_program(draw, & vs->elts[i], batch_size, &vs->vOut[i]);
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);
} }
} }