Provide mechanism to hook in custom vertex shader cache flush function
authorIan Romanick <idr@us.ibm.com>
Tue, 29 Jan 2008 19:43:04 +0000 (11:43 -0800)
committerIan Romanick <idr@us.ibm.com>
Thu, 31 Jan 2008 04:14:51 +0000 (20:14 -0800)
src/mesa/pipe/draw/draw_context.c
src/mesa/pipe/draw/draw_prim.c
src/mesa/pipe/draw/draw_private.h

index 711bcd0..87f4969 100644 (file)
@@ -78,6 +78,8 @@ struct draw_context *draw_create( void )
         draw->vcache.vertex[i] = (struct vertex_header *)(tmp + i * size);
    }
 
+   draw->shader_queue_flush = draw_vertex_shader_queue_flush;
+
    draw->convert_wide_points = TRUE;
    draw->convert_wide_lines = TRUE;
 
index 41b3fdd..5840021 100644 (file)
@@ -127,7 +127,7 @@ void draw_do_flush( struct draw_context *draw, unsigned flags )
 
    if (flags >= DRAW_FLUSH_SHADER_QUEUE) {
       if (draw->vs.queue_nr)
-        draw_vertex_shader_queue_flush(draw);
+         (*draw->shader_queue_flush)(draw);
 
       if (flags >= DRAW_FLUSH_PRIM_QUEUE) {
         if (draw->pq.queue_nr)
index 21de400..fea6d94 100644 (file)
@@ -240,6 +240,11 @@ struct draw_context
       unsigned queue_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 {