diff options
author | Clément Foucault <foucault.clem@gmail.com> | 2019-04-17 02:38:15 +0300 |
---|---|---|
committer | Clément Foucault <foucault.clem@gmail.com> | 2019-04-17 15:32:18 +0300 |
commit | edde48f5784452d3b4cc6eb6242aaf0778830ce3 (patch) | |
tree | 8204074fb535a10de89ae94b845680a2e04a0e3e /source/blender/gpu/intern | |
parent | f3b7b7eb0c3b434301f02718e5304144892c3e0a (diff) |
GPUBuffers: Remove wrong assert
The assert was not true if the pbvh node had no triangle.
Also update the comment to reflect that.
Diffstat (limited to 'source/blender/gpu/intern')
-rw-r--r-- | source/blender/gpu/intern/gpu_buffers.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/source/blender/gpu/intern/gpu_buffers.c b/source/blender/gpu/intern/gpu_buffers.c index 743e43014a0..2b678876cde 100644 --- a/source/blender/gpu/intern/gpu_buffers.c +++ b/source/blender/gpu/intern/gpu_buffers.c @@ -150,7 +150,7 @@ static void gpu_pbvh_batch_init(GPU_PBVH_Buffers *buffers, GPUPrimType prim) if (buffers->triangles == NULL) { buffers->triangles = GPU_batch_create(prim, buffers->vert_buf, - /* can be NULL */ + /* can be NULL if buffer is empty */ buffers->index_buf); } @@ -160,7 +160,10 @@ static void gpu_pbvh_batch_init(GPU_PBVH_Buffers *buffers, GPUPrimType prim) if (buffers->lines == NULL) { BLI_assert(buffers->index_lines_buf != NULL); - buffers->lines = GPU_batch_create(GPU_PRIM_LINES, buffers->vert_buf, buffers->index_lines_buf); + buffers->lines = GPU_batch_create(GPU_PRIM_LINES, + buffers->vert_buf, + /* can be NULL if buffer is empty */ + buffers->index_lines_buf); } if ((buffers->lines_fast == NULL) && buffers->index_lines_buf_fast) { |