GPUBatch: Add GPU_batch_clear to clear batches without freeing
This commit is contained in:
@@ -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);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user