From 4225876bf03dfe6d4b291eed9c00e37e949f8148 Mon Sep 17 00:00:00 2001 From: Eric Anholt Date: Wed, 9 Jan 2008 14:30:09 -0800 Subject: [PATCH] [intel] Re-allocate backing buffer objects on BufferData. This may allow better concurrency (noop in openarena performance now), but is also important for the previous commit -- otherwise, we may end up with BufferData, draw_prims, BufferData and the draw_prims would use the new VBO data instead of old. This could still occur with user-supplied VBOs and poor use of MapBuffer without BufferData. --- src/mesa/drivers/dri/intel/intel_buffer_objects.c | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) diff --git a/src/mesa/drivers/dri/intel/intel_buffer_objects.c b/src/mesa/drivers/dri/intel/intel_buffer_objects.c index 89b489e28a3..bd1b2ca1b14 100644 --- a/src/mesa/drivers/dri/intel/intel_buffer_objects.c +++ b/src/mesa/drivers/dri/intel/intel_buffer_objects.c @@ -135,19 +135,12 @@ intel_bufferobj_data(GLcontext * ctx, if (intel_obj->region) intel_bufferobj_release_region(intel, intel_obj); - /* While it would seem to make sense to always reallocate the buffer here, - * since it should allow us better concurrency between rendering and - * map-cpu write-unmap, doing so was a minor (~10%) performance loss - * for both classic and TTM mode with openarena. That may change with - * improved buffer manager algorithms. - */ - if (intel_obj->buffer != NULL && intel_obj->buffer->size != size) { + if (intel_obj->buffer != NULL) { dri_bo_unreference(intel_obj->buffer); intel_obj->buffer = NULL; } if (size != 0) { - if (intel_obj->buffer == NULL) - intel_bufferobj_alloc_buffer(intel, intel_obj); + intel_bufferobj_alloc_buffer(intel, intel_obj); if (data != NULL) dri_bo_subdata(intel_obj->buffer, 0, size, data); -- 2.30.2