diff options
author | Clément Foucault <foucault.clem@gmail.com> | 2018-12-14 02:07:59 +0300 |
---|---|---|
committer | Clément Foucault <foucault.clem@gmail.com> | 2018-12-14 18:17:29 +0300 |
commit | c09913e9ddc2d93894549923a90ee471c3a368db (patch) | |
tree | 8b3b62739e8f6c4dc65b21db70b3b632f5140877 /source/blender/gpu/intern | |
parent | 0ee0f0ebf6a9bb1596813788c3b0e5acabaaa4f7 (diff) |
GPUBatch: Add GPU_batch_clear to clear batches without freeing
Diffstat (limited to 'source/blender/gpu/intern')
-rw-r--r-- | source/blender/gpu/intern/gpu_batch.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/source/blender/gpu/intern/gpu_batch.c b/source/blender/gpu/intern/gpu_batch.c index 2cbeeb26924..d70752e9b2f 100644 --- a/source/blender/gpu/intern/gpu_batch.c +++ b/source/blender/gpu/intern/gpu_batch.c @@ -125,7 +125,7 @@ GPUBatch *GPU_batch_duplicate(GPUBatch *batch_src) return batch; } -void GPU_batch_discard(GPUBatch *batch) +void GPU_batch_clear(GPUBatch *batch) { if (batch->owns_flag & GPU_BATCH_OWNS_INDEX) { GPU_indexbuf_discard(batch->elem); @@ -148,6 +148,11 @@ void GPU_batch_discard(GPUBatch *batch) if (batch->free_callback) { batch->free_callback(batch, batch->callback_data); } +} + +void GPU_batch_discard(GPUBatch *batch) +{ + GPU_batch_clear(batch); MEM_freeN(batch); } |