unsigned post_nr;
} vs;
- /**
- * Run the vertex shader on all vertices in the vertex queue.
- */
- void (*shader_queue_flush)(struct draw_context *draw);
-
/* Prim pipeline queue:
*/
struct {
extern void draw_vertex_cache_unreference( struct draw_context *draw );
extern void draw_vertex_cache_reset_vertex_ids( struct draw_context *draw );
-extern void draw_vertex_shader_queue_flush( struct draw_context *draw );
extern void draw_update_vertex_fetch( struct draw_context *draw );
#include "draw_context.h"
#include "draw_vs.h"
-/**
- * Run the vertex shader on all vertices in the vertex queue.
- * Called by the draw module when the vertx cache needs to be flushed.
- */
-void
-draw_vertex_shader_queue_flush(struct draw_context *draw)
-{
- struct draw_vertex_shader *shader = draw->vertex_shader;
- unsigned i;
-
- assert(draw->vs.queue_nr != 0);
-
- /* XXX: do this on statechange:
- */
- shader->prepare( shader, 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 += MAX_SHADER_VERTICES) {
- unsigned elts[MAX_SHADER_VERTICES];
- int j, n = MIN2(MAX_SHADER_VERTICES, draw->vs.queue_nr - i);
- struct vertex_header *dests =
- draw_header_from_block(draw->vs.vertex_cache,
- MAX_VERTEX_ALLOCATION, i);
-
- for (j = 0; j < n; j++) {
- elts[j] = draw->vs.elts[i + j];
- }
-
- for ( ; j < MAX_SHADER_VERTICES; j++) {
- elts[j] = elts[0];
- }
-
- assert(n > 0);
- assert(n <= MAX_SHADER_VERTICES);
-
-// shader->run(shader, draw, elts, n, dests, MAX_VERTEX_ALLOCATION);
- }
-
- draw->vs.post_nr = draw->vs.queue_nr;
- draw->vs.queue_nr = 0;
-}
struct draw_vertex_shader *