diff options
author | Clément Foucault <foucault.clem@gmail.com> | 2020-08-10 02:43:50 +0300 |
---|---|---|
committer | Clément Foucault <foucault.clem@gmail.com> | 2020-08-13 15:20:24 +0300 |
commit | e0f5f95e66999765df05ddf0e4b5452a34875cf6 (patch) | |
tree | af9617035d7523c853a5aa8350246ac4ae1aefca /source/blender/gpu/GPU_batch.h | |
parent | 157f2a20e6bd539604a0d5ff48a4b7741eb1952b (diff) |
DRW: InstanceData: Remove hacks of batch freeing callback
We instead use a handle reference counter on the GPUVertBufs used by
the instancing batches. This make sure that if an update happens on the
GPUVertBuf used to contruct the batch, they will never have the same
memory address than the previously allocated ones (since they are still
pending deletion thanks to the refcounter).
This avoid the linear search to update the GPUBatch in the case a
batch is deleted (which was even a bad option since they could be only
cleared)
Diffstat (limited to 'source/blender/gpu/GPU_batch.h')
-rw-r--r-- | source/blender/gpu/GPU_batch.h | 7 |
1 files changed, 0 insertions, 7 deletions
diff --git a/source/blender/gpu/GPU_batch.h b/source/blender/gpu/GPU_batch.h index 7d18fe739d4..e2bf6a87a0f 100644 --- a/source/blender/gpu/GPU_batch.h +++ b/source/blender/gpu/GPU_batch.h @@ -89,11 +89,6 @@ typedef struct GPUBatch { uint32_t *vao_ids; } dynamic_vaos; }; - - /* XXX This is the only solution if we want to have some data structure using - * batches as key to identify nodes. We must destroy these nodes with this callback. */ - void (*free_callback)(struct GPUBatch *, void *); - void *callback_data; } GPUBatch; enum { @@ -118,8 +113,6 @@ void GPU_batch_discard(GPUBatch *); /* verts & elem are not discarded */ void GPU_batch_vao_cache_clear(GPUBatch *); -void GPU_batch_callback_free_set(GPUBatch *, void (*callback)(GPUBatch *, void *), void *); - void GPU_batch_instbuf_set(GPUBatch *, GPUVertBuf *, bool own_vbo); /* Instancing */ void GPU_batch_elembuf_set(GPUBatch *batch, GPUIndexBuf *elem, bool own_ibo); |