From 4f550ab821f9aef9f19d9f1e10785f8c1f511ad4 Mon Sep 17 00:00:00 2001 From: Zack Rusin Date: Mon, 7 Apr 2008 20:38:39 -0400 Subject: introduce a define to maxout the processed vertices --- src/gallium/auxiliary/draw/draw_vertex_shader.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'src/gallium/auxiliary/draw') diff --git a/src/gallium/auxiliary/draw/draw_vertex_shader.c b/src/gallium/auxiliary/draw/draw_vertex_shader.c index 133418baca0..d5f37bca219 100644 --- a/src/gallium/auxiliary/draw/draw_vertex_shader.c +++ b/src/gallium/auxiliary/draw/draw_vertex_shader.c @@ -37,7 +37,7 @@ #include "draw_context.h" #include "draw_vs.h" - +#define MAX_SHADER_VERTICES 4 /** * Run the vertex shader on all vertices in the vertex queue. @@ -58,23 +58,23 @@ draw_vertex_shader_queue_flush(struct draw_context *draw) // fprintf(stderr, "%s %d\n", __FUNCTION__, draw->vs.queue_nr ); /* run vertex shader on vertex cache entries, four per invokation */ - for (i = 0; i < draw->vs.queue_nr; i += 4) { - struct vertex_header *dests[4]; - unsigned elts[4]; - int j, n = MIN2(4, draw->vs.queue_nr - i); + for (i = 0; i < draw->vs.queue_nr; i += MAX_SHADER_VERTICES) { + struct vertex_header *dests[MAX_SHADER_VERTICES]; + unsigned elts[MAX_SHADER_VERTICES]; + int j, n = MIN2(MAX_SHADER_VERTICES, - i); for (j = 0; j < n; j++) { elts[j] = draw->vs.queue[i + j].elt; dests[j] = draw->vs.queue[i + j].vertex; } - for ( ; j < 4; j++) { + for ( ; j < MAX_SHADER_VERTICES; j++) { elts[j] = elts[0]; dests[j] = draw->vs.queue[i + j].vertex; } assert(n > 0); - assert(n <= 4); + assert(n <= MAX_SHADER_VERTICES); shader->run(shader, draw, elts, n, dests); } -- cgit v1.2.3