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)
committerBen Skeggs <skeggsb@gmail.com>
Fri, 15 Feb 2008 02:50:26 +0000 (13:50 +1100)
src/mesa/pipe/draw/draw_context.c
src/mesa/pipe/draw/draw_prim.c
src/mesa/pipe/draw/draw_private.h

index 711bcd02f6f8c8befa426f71347fad74ca3ca834..87f4969983a947808d59768f64699b0e305c3328 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 41b3fddcc101e2dbcdd731229c47d55fd3f82f73..58400213d7698b48d603d0c955efb8d9342b82e3 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 21de4006769579a4be9a913c05a5ac678e611af4..fea6d94ed8616e447891225cac86d290449aa570 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 {