Fix: Zero division exception in ca60419b3a
Pull Request: https://projects.blender.org/blender/blender/pulls/144770
This commit is contained in:
@@ -1353,7 +1353,8 @@ void normals_calc_corners(const Span<float3> vert_positions,
|
||||
}
|
||||
|
||||
const int64_t mean_size = space_offsets.total_size() / space_offsets.size();
|
||||
const int64_t grain_size = math::clamp<int64_t>((1024 * 512) / mean_size, 256, 1024 * 16);
|
||||
const int64_t grain_size = math::clamp<int64_t>(
|
||||
math::safe_divide<int64_t>(1024 * 512, mean_size), 256, 1024 * 16);
|
||||
threading::parallel_for(all_space_groups.index_range(), grain_size, [&](const IndexRange range) {
|
||||
for (const int thread_i : range) {
|
||||
Vector<CornerSpaceGroup, 0> &local_space_groups = all_space_groups[thread_i];
|
||||
|
||||
Reference in New Issue
Block a user