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
diff options
context:
space:
mode:
authorBrecht Van Lommel <brechtvanlommel@pandora.be>2012-11-30 11:27:17 +0400
committerBrecht Van Lommel <brechtvanlommel@pandora.be>2012-11-30 11:27:17 +0400
commitceedd5bd35273c27225f84cde2948e5b774e92fe (patch)
treedc379b6280c39aa81b1c9dd9f1c163570902c1cc /intern/cycles/kernel/svm/svm_texture.h
parentad2b41bc4bae3b0406ce6fcee69be581b0e96105 (diff)
Fix cycles CUDA sm 1.3 build with 32 bit compiler, tweaked voronoi
and brick code so that it can be uninlined.
Diffstat (limited to 'intern/cycles/kernel/svm/svm_texture.h')
-rw-r--r--intern/cycles/kernel/svm/svm_texture.h37
1 files changed, 14 insertions, 23 deletions
diff --git a/intern/cycles/kernel/svm/svm_texture.h b/intern/cycles/kernel/svm/svm_texture.h
index 6c22d98e0df..a4f6691435c 100644
--- a/intern/cycles/kernel/svm/svm_texture.h
+++ b/intern/cycles/kernel/svm/svm_texture.h
@@ -42,8 +42,12 @@ __device float voronoi_distance(NodeDistanceMetric distance_metric, float3 d, fl
/* Voronoi / Worley like */
-__device_noinline void voronoi(float3 p, NodeDistanceMetric distance_metric, float e, float da[4], float3 pa[4])
+__device_noinline float4 voronoi_Fn(float3 p, float e, int n1, int n2)
{
+ float da[4];
+ float3 pa[4];
+ NodeDistanceMetric distance_metric = NODE_VORONOI_DISTANCE_SQUARED;
+
/* returns distances in da and point coords in pa */
int xx, yy, zz, xi, yi, zi;
@@ -105,33 +109,20 @@ __device_noinline void voronoi(float3 p, NodeDistanceMetric distance_metric, flo
}
}
}
-}
-
-__device float voronoi_Fn(float3 p, int n)
-{
- float da[4];
- float3 pa[4];
-
- voronoi(p, NODE_VORONOI_DISTANCE_SQUARED, 0, da, pa);
-
- return da[n];
-}
-__device float voronoi_FnFn(float3 p, int n1, int n2)
-{
- float da[4];
- float3 pa[4];
+ float4 result = make_float4(pa[n1].x, pa[n1].y, pa[n1].z, da[n1]);
- voronoi(p, NODE_VORONOI_DISTANCE_SQUARED, 0, da, pa);
+ if(n2 != -1)
+ result = make_float4(pa[n2].x, pa[n2].y, pa[n2].z, da[n2]) - result;
- return da[n2] - da[n1];
+ return result;
}
-__device float voronoi_F1(float3 p) { return voronoi_Fn(p, 0); }
-__device float voronoi_F2(float3 p) { return voronoi_Fn(p, 1); }
-__device float voronoi_F3(float3 p) { return voronoi_Fn(p, 2); }
-__device float voronoi_F4(float3 p) { return voronoi_Fn(p, 3); }
-__device float voronoi_F1F2(float3 p) { return voronoi_FnFn(p, 0, 1); }
+__device float voronoi_F1(float3 p) { return voronoi_Fn(p, 0.0f, 0, -1).w; }
+__device float voronoi_F2(float3 p) { return voronoi_Fn(p, 0.0f, 1, -1).w; }
+__device float voronoi_F3(float3 p) { return voronoi_Fn(p, 0.0f, 2, -1).w; }
+__device float voronoi_F4(float3 p) { return voronoi_Fn(p, 0.0f, 3, -1).w; }
+__device float voronoi_F1F2(float3 p) { return voronoi_Fn(p, 0.0f, 0, 1).w; }
__device float voronoi_Cr(float3 p)
{