From: Eric Anholt Date: Fri, 25 Sep 2009 03:03:21 +0000 (-0700) Subject: i915: Fix GetBufferSubData in the case of a system-memory BO. X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=126d62edd18f22ff9e744efea81e0383cd0a19c5;p=mesa.git i915: Fix GetBufferSubData in the case of a system-memory BO. Bug #23760 (crashes in wine) --- diff --git a/src/mesa/drivers/dri/intel/intel_buffer_objects.c b/src/mesa/drivers/dri/intel/intel_buffer_objects.c index 2e6b77824df..db0de0343a8 100644 --- a/src/mesa/drivers/dri/intel/intel_buffer_objects.c +++ b/src/mesa/drivers/dri/intel/intel_buffer_objects.c @@ -209,7 +209,10 @@ intel_bufferobj_get_subdata(GLcontext * ctx, struct intel_buffer_object *intel_obj = intel_buffer_object(obj); assert(intel_obj); - dri_bo_get_subdata(intel_obj->buffer, offset, size, data); + if (intel_obj->sys_buffer) + memcpy(data, (char *)intel_obj->sys_buffer + offset, size); + else + dri_bo_get_subdata(intel_obj->buffer, offset, size, data); }