GPUBatch: Add GPU_batch_clear to clear batches without freeing

This commit is contained in:
2018-12-14 00:07:59 +01:00
parent 0ee0f0ebf6
commit c09913e9dd
2 changed files with 7 additions and 1 deletions

View File

@@ -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);
}