summaryrefslogtreecommitdiff
path: root/src/mesa
diff options
context:
space:
mode:
authorEric Anholt <eric@anholt.net>2008-01-09 14:30:09 -0800
committerEric Anholt <eric@anholt.net>2008-01-09 14:41:55 -0800
commit4225876bf03dfe6d4b291eed9c00e37e949f8148 (patch)
tree46d30fc398cc77b19bfd6cdaad5fdc33f3027f12 /src/mesa
parent7da98d7ebaf4475812f2ce44062d50bee393faf7 (diff)
[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.
Diffstat (limited to 'src/mesa')
-rw-r--r--src/mesa/drivers/dri/intel/intel_buffer_objects.c11
1 files 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 89b489e28a..bd1b2ca1b1 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);