summaryrefslogtreecommitdiff
path: root/src/mesa/pipe/draw/draw_vertex_shader.c
diff options
context:
space:
mode:
authorKeith Whitwell <keith@tungstengraphics.com>2008-01-28 12:40:29 +0000
committerKeith Whitwell <keith@tungstengraphics.com>2008-01-28 12:40:29 +0000
commit88858e046888d0bcb763537adc74a64e564678df (patch)
tree1d75e2ecfa70c5d94b268656dc1ede7743c6dc10 /src/mesa/pipe/draw/draw_vertex_shader.c
parent99f297651198c3424aab202595064d6f5596b2fc (diff)
gallium: add a couple of hardwired vertex fetch functions
Diffstat (limited to 'src/mesa/pipe/draw/draw_vertex_shader.c')
-rw-r--r--src/mesa/pipe/draw/draw_vertex_shader.c12
1 files changed, 8 insertions, 4 deletions
diff --git a/src/mesa/pipe/draw/draw_vertex_shader.c b/src/mesa/pipe/draw/draw_vertex_shader.c
index 289c35c7ae..0806e23d6c 100644
--- a/src/mesa/pipe/draw/draw_vertex_shader.c
+++ b/src/mesa/pipe/draw/draw_vertex_shader.c
@@ -110,7 +110,7 @@ run_vertex_program(struct draw_context *draw,
machine->Inputs = ALIGN16_ASSIGN(inputs);
machine->Outputs = ALIGN16_ASSIGN(outputs);
- draw_vertex_fetch( draw, machine, elts, count );
+ draw->vertex_fetch.fetch_func( draw, machine, elts, count );
/* run shader */
#if defined(__i386__) || defined(__386__)
@@ -219,14 +219,18 @@ draw_vertex_shader_queue_flush(struct draw_context *draw)
for (i = 0; i < draw->vs.queue_nr; i += 4) {
struct vertex_header *dests[4];
unsigned elts[4];
- int n;
+ int n = MIN2(4, draw->vs.queue_nr - i);
- for (j = 0; j < 4; j++) {
+ for (j = 0; j < n; j++) {
elts[j] = draw->vs.queue[i + j].elt;
dests[j] = draw->vs.queue[i + j].dest;
}
- n = MIN2(4, draw->vs.queue_nr - i);
+ for ( ; j < 4; j++) {
+ elts[j] = elts[0];
+ dests[j] = dests[0];
+ }
+
assert(n > 0);
assert(n <= 4);