diff options
author | Chris Wilson <chris@chris-wilson.co.uk> | 2011-02-08 20:01:10 +0000 |
---|---|---|
committer | Chris Wilson <chris@chris-wilson.co.uk> | 2011-02-21 12:59:34 +0000 |
commit | e476e122207e6195a16a8c7d2cab90eeba227934 (patch) | |
tree | 7c1a5f31a6078ffd7174f6a04816968f6fc3a382 /src/mesa/drivers/dri/intel/intel_batchbuffer.c | |
parent | d0809d7b15ba58c05bb0b63128c9cf7042304cd2 (diff) |
intel: Pack dynamic draws together
Dynamic arrays have the tendency to be small and so allocating a bo for
each one is overkill and we can exploit many efficiency gains by packing
them together.
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Diffstat (limited to 'src/mesa/drivers/dri/intel/intel_batchbuffer.c')
-rw-r--r-- | src/mesa/drivers/dri/intel/intel_batchbuffer.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/mesa/drivers/dri/intel/intel_batchbuffer.c b/src/mesa/drivers/dri/intel/intel_batchbuffer.c index 67ce8a4da0..28bf42e770 100644 --- a/src/mesa/drivers/dri/intel/intel_batchbuffer.c +++ b/src/mesa/drivers/dri/intel/intel_batchbuffer.c @@ -175,6 +175,12 @@ _intel_batchbuffer_flush(struct intel_batchbuffer *batch, const char *file, if (intel->vtbl.finish_batch) intel->vtbl.finish_batch(intel); + if (intel->upload.bo) { + drm_intel_bo_unreference(intel->upload.bo); + intel->upload.bo = NULL; + intel->upload.offset = 0; + } + /* Check that we didn't just wrap our batchbuffer at a bad time. */ assert(!intel->no_batch_wrap); |