Mesa (master): intel: Flush the batch when we' re about to subdata into a VBO.

Brian Paul brianp at kemper.freedesktop.org
Fri Sep 25 15:01:42 UTC 2009


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

Author: Eric Anholt <eric at anholt.net>
Date:   Thu Sep 24 16:15:52 2009 -0700

intel: Flush the batch when we're about to subdata into a VBO.

This fixes the clears in openarena with the new metaops clear code, and
the new piglit vbo-subdata-sync test.

Bug #23857.

---

 src/mesa/drivers/dri/intel/intel_buffer_objects.c |    6 +++++-
 src/mesa/drivers/dri/intel/intel_clear.c          |    1 -
 2 files changed, 5 insertions(+), 2 deletions(-)

diff --git a/src/mesa/drivers/dri/intel/intel_buffer_objects.c b/src/mesa/drivers/dri/intel/intel_buffer_objects.c
index c55c5c4..7f6fb66 100644
--- a/src/mesa/drivers/dri/intel/intel_buffer_objects.c
+++ b/src/mesa/drivers/dri/intel/intel_buffer_objects.c
@@ -207,8 +207,12 @@ intel_bufferobj_subdata(GLcontext * ctx,
 
    if (intel_obj->sys_buffer)
       memcpy((char *)intel_obj->sys_buffer + offset, data, size);
-   else
+   else {
+      /* Flush any existing batchbuffer that might reference this data. */
+      intelFlush(ctx);
+
       dri_bo_subdata(intel_obj->buffer, offset, size, data);
+   }
 }
 
 
diff --git a/src/mesa/drivers/dri/intel/intel_clear.c b/src/mesa/drivers/dri/intel/intel_clear.c
index 9010b91..1b0e221 100644
--- a/src/mesa/drivers/dri/intel/intel_clear.c
+++ b/src/mesa/drivers/dri/intel/intel_clear.c
@@ -173,7 +173,6 @@ intelClear(GLcontext *ctx, GLbitfield mask)
       }
 
       _mesa_meta_clear(&intel->ctx, tri_mask);
-      intel_batchbuffer_flush(intel->batch);
    }
 
    if (swrast_mask) {




More information about the mesa-commit mailing list