Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/intern
diff options
context:
space:
mode:
authorPatrick Mours <pmours@nvidia.com>2019-08-26 15:12:20 +0300
committerBrecht Van Lommel <brechtvanlommel@gmail.com>2019-08-26 15:13:00 +0300
commit81e2fdcd1d8a338f678ac1a4ae61ae5717836376 (patch)
tree84423d2d8ebbc6ebc7ead8fbcec041de90c9f91f /intern
parent7b150e87675dbf6466a4bd89f2242346624758c2 (diff)
Cleanup: simplify perlin noise function definition
Ref D5363
Diffstat (limited to 'intern')
-rw-r--r--intern/cycles/kernel/svm/svm_noise.h7
1 files changed, 2 insertions, 5 deletions
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)