Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorClément Foucault <foucault.clem@gmail.com>2020-08-06 02:00:02 +0300
committerClément Foucault <foucault.clem@gmail.com>2020-08-08 02:15:27 +0300
commit0255f1e0225d2eebfd39a9c16d9be299857b9efc (patch)
tree933c619660668a914140615c4dd5153a6c691559 /source/blender/gpu/intern
parent0063d1befc0569d33f1ba01fd33678001cad587a (diff)
GPUBatch: Use custom allocator
This is needed for the new GPU abstraction.
Diffstat (limited to 'source/blender/gpu/intern')
-rw-r--r--source/blender/gpu/intern/gpu_batch.cc7
1 files changed, 6 insertions, 1 deletions
diff --git a/source/blender/gpu/intern/gpu_batch.cc b/source/blender/gpu/intern/gpu_batch.cc
index 9f9adcacfa6..1dd06076d2a 100644
--- a/source/blender/gpu/intern/gpu_batch.cc
+++ b/source/blender/gpu/intern/gpu_batch.cc
@@ -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;
}