summaryrefslogtreecommitdiff
path: root/src/mesa/drivers/dri/intel
diff options
context:
space:
mode:
authorChia-I Wu <olvaffe@gmail.com>2009-06-18 13:42:22 +0800
committerEric Anholt <eric@anholt.net>2009-06-19 16:43:45 -0700
commit1a7ec317efb2570db3fc5123a2e9b74b54df8147 (patch)
tree37e9c1b30aed6f97af3689e4b61681b7a5d84c75 /src/mesa/drivers/dri/intel
parent402df41c1c7655439d22efead08153dc29fe2afd (diff)
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 <olvaffe@gmail.com> Signed-off-by: Eric Anholt <eric@anholt.net>
Diffstat (limited to 'src/mesa/drivers/dri/intel')
-rw-r--r--src/mesa/drivers/dri/intel/intel_buffer_objects.c10
1 files changed, 7 insertions, 3 deletions
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;