GPUBuffers: Remove wrong assert

The assert was not true if the pbvh node had no triangle.

Also update the comment to reflect that.
This commit is contained in:
Clément Foucault 2019-04-17 01:38:15 +02:00
parent f3b7b7eb0c
commit edde48f578
Notes: blender-bot 2023-02-14 00:20:19 +01:00
Referenced by commit d10205c1a7, GPUBuffers: Fix wrong assert
1 changed files with 5 additions and 2 deletions

View File

@ -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) {