summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorEric Anholt <eric@anholt.net>2009-07-02 18:02:44 -0700
committerEric Anholt <eric@anholt.net>2009-07-02 18:53:56 -0700
commitae1bfb6427cc10a851c80e020cbdc210fe238d85 (patch)
treecfa3db97b6dc97a97ce5c142932526463c2fbad6 /src
parent9a0b570ab64169cee66f848d97d65f22c43d13ec (diff)
intel: Flush when mapping buffer objects so writes don't get reordered.
While GEM covers this for execution it knows about, it doesn't know about the batchbuffer we're preparing. Fixes piglit vbo-map-remap.c testcase.
Diffstat (limited to 'src')
-rw-r--r--src/mesa/drivers/dri/intel/intel_buffer_objects.c3
-rw-r--r--src/mesa/drivers/dri/intel/intel_regions.c2
2 files changed, 5 insertions, 0 deletions
diff --git a/src/mesa/drivers/dri/intel/intel_buffer_objects.c b/src/mesa/drivers/dri/intel/intel_buffer_objects.c
index 9408b0c351..9600557f2c 100644
--- a/src/mesa/drivers/dri/intel/intel_buffer_objects.c
+++ b/src/mesa/drivers/dri/intel/intel_buffer_objects.c
@@ -243,6 +243,9 @@ intel_bufferobj_map(GLcontext * ctx,
return obj->Pointer;
}
+ if (!read_only)
+ intelFlush(ctx);
+
if (intel_obj->region)
intel_bufferobj_cow(intel, intel_obj);
diff --git a/src/mesa/drivers/dri/intel/intel_regions.c b/src/mesa/drivers/dri/intel/intel_regions.c
index 97a0aa592f..7525cd9c4d 100644
--- a/src/mesa/drivers/dri/intel/intel_regions.c
+++ b/src/mesa/drivers/dri/intel/intel_regions.c
@@ -111,6 +111,8 @@ debug_backtrace(void)
GLubyte *
intel_region_map(struct intel_context *intel, struct intel_region *region)
{
+ intelFlush(&intel->ctx);
+
_DBG("%s %p\n", __FUNCTION__, region);
if (!region->map_refcount++) {
if (region->pbo)