i915: Fix GetBufferSubData in the case of a system-memory BO.
authorEric Anholt <eric@anholt.net>
Fri, 25 Sep 2009 03:03:21 +0000 (20:03 -0700)
committerEric Anholt <eric@anholt.net>
Fri, 25 Sep 2009 03:04:42 +0000 (20:04 -0700)
Bug #23760 (crashes in wine)

src/mesa/drivers/dri/intel/intel_buffer_objects.c

index 2e6b77824dfa46e70ec8180babe41ae53d94fd22..db0de0343a8e85f30ccd9cd6f16e23f94569f1c8 100644 (file)
@@ -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);
 }