Mesa (master): i915g: Call draw_set_mapped_vertex_buffer from draw_vbo

Stephane Marchesin marcheu at kemper.freedesktop.org
Sat Oct 6 19:08:59 UTC 2012


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

Author: Stéphane Marchesin <marcheu at chromium.org>
Date:   Sat Oct  6 13:08:36 2012 -0700

i915g: Call draw_set_mapped_vertex_buffer from draw_vbo

This regressed with the draw rework. Fixes glest and vdrift crash.

---

 src/gallium/drivers/i915/i915_context.c |   18 +++++++++++++++++-
 src/gallium/drivers/i915/i915_state.c   |   14 --------------
 2 files changed, 17 insertions(+), 15 deletions(-)

diff --git a/src/gallium/drivers/i915/i915_context.c b/src/gallium/drivers/i915/i915_context.c
index 42d90ff..0ee6c0e 100644
--- a/src/gallium/drivers/i915/i915_context.c
+++ b/src/gallium/drivers/i915/i915_context.c
@@ -54,7 +54,7 @@ i915_draw_vbo(struct pipe_context *pipe, const struct pipe_draw_info *info)
    struct i915_context *i915 = i915_context(pipe);
    struct draw_context *draw = i915->draw;
    const void *mapped_indices = NULL;
-
+   unsigned i;
 
    /*
     * Ack vs contants here, helps ipers a lot.
@@ -65,6 +65,16 @@ i915_draw_vbo(struct pipe_context *pipe, const struct pipe_draw_info *info)
       i915_update_derived(i915);
 
    /*
+    * Map vertex buffers
+    */
+   for (i = 0; i < i915->nr_vertex_buffers; i++) {
+      const void *buf = i915->vertex_buffers[i].user_buffer;
+      if (!buf)
+            buf = i915_buffer(i915->vertex_buffers[i].buffer)->data;
+      draw_set_mapped_vertex_buffer(draw, i, buf);
+   }
+
+   /*
     * Map index buffer, if present
     */
    if (info->indexed) {
@@ -92,6 +102,12 @@ i915_draw_vbo(struct pipe_context *pipe, const struct pipe_draw_info *info)
     */
    draw_vbo(i915->draw, info);
 
+   /*
+    * unmap vertex/index buffers
+    */
+   for (i = 0; i < i915->nr_vertex_buffers; i++) {
+      draw_set_mapped_vertex_buffer(i915->draw, i, NULL);
+   }
    if (mapped_indices)
       draw_set_indexes(draw, NULL, 0);
 
diff --git a/src/gallium/drivers/i915/i915_state.c b/src/gallium/drivers/i915/i915_state.c
index 74a5df4..aa2971c 100644
--- a/src/gallium/drivers/i915/i915_state.c
+++ b/src/gallium/drivers/i915/i915_state.c
@@ -936,24 +936,10 @@ static void i915_set_vertex_buffers(struct pipe_context *pipe,
    util_copy_vertex_buffers(i915->vertex_buffers,
                             &i915->nr_vertex_buffers,
                             buffers, count);
-#if 0
-   /* XXX doesn't look like this is needed */
-   /* unmap old */
-   for (i = 0; i < i915->num_vertex_buffers; i++) {
-      draw_set_mapped_vertex_buffer(draw, i, NULL);
-   }
-#endif
 
    /* pass-through to draw module */
    draw_set_vertex_buffers(draw, count, buffers);
 
-   /* map new */
-   for (i = 0; i < count; i++) {
-      const void *buf = buffers[i].user_buffer;
-      if (!buf)
-            buf = i915_buffer(buffers[i].buffer)->data;
-      draw_set_mapped_vertex_buffer(draw, i, buf);
-   }
 }
 
 static void *




More information about the mesa-commit mailing list