Mesa (master): llvmpipe: Unmapping vertex/ index buffers does NOT flush draw module anymore.

Jose Fonseca jrfonseca at kemper.freedesktop.org
Mon Dec 28 14:54:50 PST 2009


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

Author: José Fonseca <jfonseca at vmware.com>
Date:   Mon Dec 28 22:52:41 2009 +0000

llvmpipe: Unmapping vertex/index buffers does NOT flush draw module anymore.

Not since 6094e79f4e3350d123c7532b1c73faa60834a62d.

Drivers now need to flush draw module explicitely (which explains why
all those previous commits adding draw_flushes calls were necessary).

This is a good thing, but it's tricky to get this right in face of user buffers
(it's not even clear who has the responsibility to flush when a user buffer
is seen -- statetracker or pipe driver), so just force flush (temporarily)
since it's not a bottleneck now.

---

 src/gallium/drivers/llvmpipe/lp_draw_arrays.c |    8 +++++++-
 1 files changed, 7 insertions(+), 1 deletions(-)

diff --git a/src/gallium/drivers/llvmpipe/lp_draw_arrays.c b/src/gallium/drivers/llvmpipe/lp_draw_arrays.c
index 2299566..a96c2ca 100644
--- a/src/gallium/drivers/llvmpipe/lp_draw_arrays.c
+++ b/src/gallium/drivers/llvmpipe/lp_draw_arrays.c
@@ -103,7 +103,7 @@ llvmpipe_draw_range_elements(struct pipe_context *pipe,
    draw_arrays(draw, mode, start, count);
 
    /*
-    * unmap vertex/index buffers - will cause draw module to flush
+    * unmap vertex/index buffers
     */
    for (i = 0; i < lp->num_vertex_buffers; i++) {
       draw_set_mapped_vertex_buffer(draw, i, NULL);
@@ -112,6 +112,12 @@ llvmpipe_draw_range_elements(struct pipe_context *pipe,
       draw_set_mapped_element_buffer(draw, 0, NULL);
    }
 
+   /*
+    * TODO: Flush only when a user vertex/index buffer is present
+    * (or even better, modify draw module to do this
+    * internally when this condition is seen?)
+    */
+   draw_flush(draw);
 
    /* Note: leave drawing surfaces mapped */
 



More information about the mesa-commit mailing list