summaryrefslogtreecommitdiffstats
path: root/src/gallium/auxiliary/draw
diff options
context:
space:
mode:
authorZack Rusin <[email protected]>2008-04-07 20:38:39 -0400
committerKeith Whitwell <[email protected]>2008-04-14 11:00:26 +0100
commit4f550ab821f9aef9f19d9f1e10785f8c1f511ad4 (patch)
treebaf17ec59c5c8b6d1c3e23f929f13068e7add41e /src/gallium/auxiliary/draw
parent84994693f53668d5ca72d57765a0729fe343593b (diff)
introduce a define to maxout the processed vertices
Diffstat (limited to 'src/gallium/auxiliary/draw')
-rw-r--r--src/gallium/auxiliary/draw/draw_vertex_shader.c14
1 files changed, 7 insertions, 7 deletions
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);
}