[Bf-blender-cvs] [f700aa67ac6] master: Geometry Nodes: Fix Assert in Duplicate Elements

Johnny Matthews noreply at git.blender.org
Mon Jun 6 18:15:40 CEST 2022


Commit: f700aa67ac67ac1e5996618074f32df30dfccccd
Author: Johnny Matthews
Date:   Mon Jun 6 11:10:27 2022 -0500
Branches: master
https://developer.blender.org/rBf700aa67ac67ac1e5996618074f32df30dfccccd

Geometry Nodes: Fix Assert in Duplicate Elements

The original assert did not take into account the offset size in the loop being -1. The tests were then run in non-debug mode, so while the mesh regressions still passed, the false positive asserts that happened were not caught.

Differential Revision: https://developer.blender.org/D15136

===================================================================

M	source/blender/nodes/geometry/nodes/node_geo_duplicate_elements.cc

===================================================================

diff --git a/source/blender/nodes/geometry/nodes/node_geo_duplicate_elements.cc b/source/blender/nodes/geometry/nodes/node_geo_duplicate_elements.cc
index cde40319388..691f341b518 100644
--- a/source/blender/nodes/geometry/nodes/node_geo_duplicate_elements.cc
+++ b/source/blender/nodes/geometry/nodes/node_geo_duplicate_elements.cc
@@ -98,7 +98,7 @@ static void threaded_slice_fill(Span<int> offsets,
                                 MutableSpan<T> dst)
 {
   BLI_assert(offsets.last() == dst.size());
-  BLI_assert(selection.size() == offsets.size());
+  BLI_assert(selection.size() == offsets.size() - 1);
   threading::parallel_for(IndexRange(offsets.size() - 1), 512, [&](IndexRange range) {
     for (const int i : range) {
       dst.slice(range_for_offsets_index(offsets, i)).fill(src[selection[i]]);



More information about the Bf-blender-cvs mailing list