GPUBatch: Use custom allocator

This is needed for the new GPU abstraction.
This commit is contained in:
2020-08-06 01:00:02 +02:00
parent 0063d1befc
commit 0255f1e022
4 changed files with 15 additions and 8 deletions

View File

@@ -85,12 +85,17 @@ void GPU_batch_vao_cache_clear(GPUBatch *batch)
batch->context = NULL;
}
GPUBatch *GPU_batch_calloc(uint count)
{
return (GPUBatch *)MEM_callocN(sizeof(GPUBatch) * count, "GPUBatch");
}
GPUBatch *GPU_batch_create_ex(GPUPrimType prim_type,
GPUVertBuf *verts,
GPUIndexBuf *elem,
uint owns_flag)
{
GPUBatch *batch = (GPUBatch *)MEM_callocN(sizeof(GPUBatch), "GPUBatch");
GPUBatch *batch = GPU_batch_calloc(1);
GPU_batch_init_ex(batch, prim_type, verts, elem, owns_flag);
return batch;
}