[Bf-blender-cvs] [edde48f5784] master: GPUBuffers: Remove wrong assert
Clément Foucault
noreply at git.blender.org
Wed Apr 17 14:32:34 CEST 2019
Commit: edde48f5784452d3b4cc6eb6242aaf0778830ce3
Author: Clément Foucault
Date: Wed Apr 17 01:38:15 2019 +0200
Branches: master
https://developer.blender.org/rBedde48f5784452d3b4cc6eb6242aaf0778830ce3
GPUBuffers: Remove wrong assert
The assert was not true if the pbvh node had no triangle.
Also update the comment to reflect that.
===================================================================
M source/blender/gpu/intern/gpu_buffers.c
===================================================================
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) {
More information about the Bf-blender-cvs
mailing list