From ae1bfb6427cc10a851c80e020cbdc210fe238d85 Mon Sep 17 00:00:00 2001 From: Eric Anholt Date: Thu, 2 Jul 2009 18:02:44 -0700 Subject: [PATCH] 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. --- src/mesa/drivers/dri/intel/intel_buffer_objects.c | 3 +++ src/mesa/drivers/dri/intel/intel_regions.c | 2 ++ 2 files changed, 5 insertions(+) diff --git a/src/mesa/drivers/dri/intel/intel_buffer_objects.c b/src/mesa/drivers/dri/intel/intel_buffer_objects.c index 9408b0c351f..9600557f2cc 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 97a0aa592f7..7525cd9c4d7 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) -- 2.30.2