diff options
Diffstat (limited to 'source/blender/blenkernel/intern/pbvh.c')
-rw-r--r-- | source/blender/blenkernel/intern/pbvh.c | 11 |
1 files changed, 1 insertions, 10 deletions
diff --git a/source/blender/blenkernel/intern/pbvh.c b/source/blender/blenkernel/intern/pbvh.c index 330b5922c9a..d73f087a3fe 100644 --- a/source/blender/blenkernel/intern/pbvh.c +++ b/source/blender/blenkernel/intern/pbvh.c @@ -979,16 +979,7 @@ static void pbvh_update_normals_accum_task_cb(void *userdata, const int n) * Not exact equivalent though, since atomicity is only ensured for one component * of the vector at a time, but here it shall not make any sensible difference. */ for (int k = 3; k--; ) { - /* Atomic float addition. - * Note that since collision are unlikely, loop will nearly always run once. */ - float oldval, newval; - uint32_t prevval; - do { - oldval = vnors[v][k]; - newval = oldval + fn[k]; - prevval = atomic_cas_uint32( - (uint32_t *)&vnors[v][k], *(uint32_t *)(&oldval), *(uint32_t *)(&newval)); - } while (UNLIKELY(prevval != *(uint32_t *)(&oldval))); + atomic_add_fl(&vnors[v][k], fn[k]); } } } |