[Bf-blender-cvs] [81e2fdcd1d8] master: Cleanup: simplify perlin noise function definition

Patrick Mours noreply at git.blender.org
Mon Aug 26 14:26:35 CEST 2019


Commit: 81e2fdcd1d8a338f678ac1a4ae61ae5717836376
Author: Patrick Mours
Date:   Mon Aug 26 14:12:20 2019 +0200
Branches: master
https://developer.blender.org/rB81e2fdcd1d8a338f678ac1a4ae61ae5717836376

Cleanup: simplify perlin noise function definition

Ref D5363

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

M	intern/cycles/kernel/svm/svm_noise.h

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

diff --git a/intern/cycles/kernel/svm/svm_noise.h b/intern/cycles/kernel/svm/svm_noise.h
index dd375af27e5..e03ffa2bc9d 100644
--- a/intern/cycles/kernel/svm/svm_noise.h
+++ b/intern/cycles/kernel/svm/svm_noise.h
@@ -181,9 +181,9 @@ ccl_device_inline ssef scale3_sse(const ssef &result)
 }
 #endif
 
-#ifndef __KERNEL_SSE2__
 ccl_device_noinline_cpu float perlin(float x, float y, float z)
 {
+#ifndef __KERNEL_SSE2__
   int X;
   float fx = floorfrac(x, &X);
   int Y;
@@ -217,10 +217,7 @@ ccl_device_noinline_cpu float perlin(float x, float y, float z)
 
   /* can happen for big coordinates, things even out to 0.0 then anyway */
   return (isfinite(r)) ? r : 0.0f;
-}
 #else
-ccl_device_noinline float perlin(float x, float y, float z)
-{
   ssef xyz = ssef(x, y, z, 0.0f);
   ssei XYZ;
 
@@ -258,8 +255,8 @@ ccl_device_noinline float perlin(float x, float y, float z)
   ssef rinfmask = ((r & infmask) == infmask).m128;  // 0xffffffff if r is inf/-inf/nan else 0
   ssef rfinite = andnot(rinfmask, r);               // 0 if r is inf/-inf/nan else r
   return extract<0>(rfinite);
-}
 #endif
+}
 
 /* perlin noise in range 0..1 */
 ccl_device float noise(float3 p)



More information about the Bf-blender-cvs mailing list