From edde48f5784452d3b4cc6eb6242aaf0778830ce3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cl=C3=A9ment=20Foucault?= Date: Wed, 17 Apr 2019 01:38:15 +0200 Subject: GPUBuffers: Remove wrong assert The assert was not true if the pbvh node had no triangle. Also update the comment to reflect that. --- source/blender/gpu/intern/gpu_buffers.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'source') 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) { -- cgit v1.2.3