diff options
author | Jacques Lucke <jacques@blender.org> | 2022-02-22 15:57:05 +0300 |
---|---|---|
committer | Jacques Lucke <jacques@blender.org> | 2022-02-22 15:57:05 +0300 |
commit | 64293a277f3532c2e3048234950be250e1e9e90c (patch) | |
tree | ade889ff405684fcd1d780c143361407a5c1857d /source/blender/gpu | |
parent | 0b4c56b01078b70b294208932d1e1d37a1ab3bd2 (diff) | |
parent | 4e78a7360e451b4e2c99e8fb88d6701bc8f13618 (diff) |
Merge branch 'blender-v3.1-release'
Diffstat (limited to 'source/blender/gpu')
-rw-r--r-- | source/blender/gpu/GPU_batch.h | 1 | ||||
-rw-r--r-- | source/blender/gpu/intern/gpu_batch.cc | 10 |
2 files changed, 11 insertions, 0 deletions
diff --git a/source/blender/gpu/GPU_batch.h b/source/blender/gpu/GPU_batch.h index 803a5825c94..7fad8dd23be 100644 --- a/source/blender/gpu/GPU_batch.h +++ b/source/blender/gpu/GPU_batch.h @@ -119,6 +119,7 @@ int GPU_batch_instbuf_add_ex(GPUBatch *, GPUVertBuf *, bool own_vbo); * Returns the index of verts in the batch. */ int GPU_batch_vertbuf_add_ex(GPUBatch *, GPUVertBuf *, bool own_vbo); +bool GPU_batch_vertbuf_has(GPUBatch *, GPUVertBuf *); #define GPU_batch_vertbuf_add(batch, verts) GPU_batch_vertbuf_add_ex(batch, verts, false) diff --git a/source/blender/gpu/intern/gpu_batch.cc b/source/blender/gpu/intern/gpu_batch.cc index 44e95b1f5f5..32b117dac12 100644 --- a/source/blender/gpu/intern/gpu_batch.cc +++ b/source/blender/gpu/intern/gpu_batch.cc @@ -191,6 +191,16 @@ int GPU_batch_vertbuf_add_ex(GPUBatch *batch, GPUVertBuf *verts, bool own_vbo) return -1; } +bool GPU_batch_vertbuf_has(GPUBatch *batch, GPUVertBuf *verts) +{ + for (uint v = 0; v < GPU_BATCH_VBO_MAX_LEN; v++) { + if (batch->verts[v] == verts) { + return true; + } + } + return false; +} + /** \} */ /* -------------------------------------------------------------------- */ |