Mesa (master): draw: fix point/line/tri flushing bug in vbuf code

Brian Paul brianp at kemper.freedesktop.org
Fri Apr 22 13:01:31 PDT 2011


Module: Mesa
Branch: master
Commit: 931432fea69c29b4029ff23613468c8ad2c0181e
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=931432fea69c29b4029ff23613468c8ad2c0181e

Author: Brian Paul <brianp at vmware.com>
Date:   Fri Apr 22 13:37:10 2011 -0600

draw: fix point/line/tri flushing bug in vbuf code

Need to reset the point/line/tri functions to point to the "first"
versions whenever we flush vertices.  Fixes unfilled polygon rendering
errors seen in demos/samples/logo.c.  See comments for more info.

NOTE: This is a candidate for the 7.10 branch.

---

 src/gallium/auxiliary/draw/draw_pipe_vbuf.c |   14 ++++++++++----
 1 files changed, 10 insertions(+), 4 deletions(-)

diff --git a/src/gallium/auxiliary/draw/draw_pipe_vbuf.c b/src/gallium/auxiliary/draw/draw_pipe_vbuf.c
index 58c5858..61ae466 100644
--- a/src/gallium/auxiliary/draw/draw_pipe_vbuf.c
+++ b/src/gallium/auxiliary/draw/draw_pipe_vbuf.c
@@ -341,6 +341,16 @@ vbuf_flush_vertices( struct vbuf_stage *vbuf )
       vbuf->max_vertices = vbuf->nr_vertices = 0;
       vbuf->vertex_ptr = vbuf->vertices = NULL;
    }
+
+   /* Reset point/line/tri function pointers.
+    * If (for example) we transition from points to tris and back to points
+    * again, we need to call the vbuf_first_point() function again to flush
+    * the triangles before drawing more points.  This can happen when drawing
+    * with front polygon mode = filled and back polygon mode = line or point.
+    */
+   vbuf->stage.point = vbuf_first_point;
+   vbuf->stage.line = vbuf_first_line;
+   vbuf->stage.tri = vbuf_first_tri;
 }
    
 
@@ -378,10 +388,6 @@ vbuf_flush( struct draw_stage *stage, unsigned flags )
    struct vbuf_stage *vbuf = vbuf_stage( stage );
 
    vbuf_flush_vertices( vbuf );
-
-   stage->point = vbuf_first_point;
-   stage->line = vbuf_first_line;
-   stage->tri = vbuf_first_tri;
 }
 
 



More information about the mesa-commit mailing list