#include "draw_context.h"
#include "draw_vs.h"
-
+#define MAX_SHADER_VERTICES 4
/**
* Run the vertex shader on all vertices in the vertex queue.
// 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);
}