From 1a7ec317efb2570db3fc5123a2e9b74b54df8147 Mon Sep 17 00:00:00 2001 From: Chia-I Wu Date: Thu, 18 Jun 2009 13:42:22 +0800 Subject: intel: Fix migration from sys_buffer in intel_bufferobj_buffer. intel_bufferobj_subdata is called to migrate data from sys_buffer, and it expects only one of buffer or sys_buffer is non-NULL. Signed-off-by: Chia-I Wu Signed-off-by: Eric Anholt --- src/mesa/drivers/dri/intel/intel_buffer_objects.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'src/mesa/drivers') diff --git a/src/mesa/drivers/dri/intel/intel_buffer_objects.c b/src/mesa/drivers/dri/intel/intel_buffer_objects.c index 1f10dec0a4..010000309b 100644 --- a/src/mesa/drivers/dri/intel/intel_buffer_objects.c +++ b/src/mesa/drivers/dri/intel/intel_buffer_objects.c @@ -300,15 +300,19 @@ intel_bufferobj_buffer(struct intel_context *intel, } if (intel_obj->buffer == NULL) { + void *sys_buffer = intel_obj->sys_buffer; + + /* only one of buffer and sys_buffer could be non-NULL */ intel_bufferobj_alloc_buffer(intel, intel_obj); + intel_obj->sys_buffer = NULL; + intel_bufferobj_subdata(&intel->ctx, GL_ARRAY_BUFFER_ARB, 0, intel_obj->Base.Size, - intel_obj->sys_buffer, + sys_buffer, &intel_obj->Base); - _mesa_free(intel_obj->sys_buffer); - intel_obj->sys_buffer = NULL; + _mesa_free(sys_buffer); } return intel_obj->buffer; -- cgit v1.2.3