OSDN Git Service

intel: Flush the batch when we're about to subdata into a VBO.
authorEric Anholt <eric@anholt.net>
Thu, 24 Sep 2009 23:15:52 +0000 (16:15 -0700)
committerEric Anholt <eric@anholt.net>
Thu, 24 Sep 2009 23:24:46 +0000 (16:24 -0700)
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
src/mesa/drivers/dri/intel/intel_clear.c

index c55c5c4..7f6fb66 100644 (file)
@@ -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);
+   }
 }
 
 
index 9010b91..1b0e221 100644 (file)
@@ -173,7 +173,6 @@ intelClear(GLcontext *ctx, GLbitfield mask)
       }
 
       _mesa_meta_clear(&intel->ctx, tri_mask);
-      intel_batchbuffer_flush(intel->batch);
    }
 
    if (swrast_mask) {