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@gmail.com>2013-11-16 03:17:10 +0400
committerBrecht Van Lommel <brechtvanlommel@gmail.com>2013-11-18 11:48:15 +0400
commitc18712e86814d176433cea781fe1e68715c23bd4 (patch)
treea9aa7a0b34940dceb00f290c720f4a2733819f44 /intern/cycles/kernel/kernel_montecarlo.h
parent6f67f7c18cf2c6224f3e3d796bf0d83d2f098b2e (diff)
Cycles: change __device and similar qualifiers to ccl_device in kernel code.
This to avoids build conflicts with libc++ on FreeBSD, these __ prefixed values are reserved for compilers. I apologize to anyone who has patches or branches and has to go through the pain of merging this change, it may be easiest to do these same replacements in your code and then apply/merge the patch. Ref T37477.
Diffstat (limited to 'intern/cycles/kernel/kernel_montecarlo.h')
-rw-r--r--intern/cycles/kernel/kernel_montecarlo.h24
1 files changed, 12 insertions, 12 deletions
diff --git a/intern/cycles/kernel/kernel_montecarlo.h b/intern/cycles/kernel/kernel_montecarlo.h
index b3d53e00be7..92f3420a218 100644
--- a/intern/cycles/kernel/kernel_montecarlo.h
+++ b/intern/cycles/kernel/kernel_montecarlo.h
@@ -36,7 +36,7 @@
CCL_NAMESPACE_BEGIN
/* distribute uniform xy on [0,1] over unit disk [-1,1] */
-__device void to_unit_disk(float *x, float *y)
+ccl_device void to_unit_disk(float *x, float *y)
{
float phi = M_2PI_F * (*x);
float r = sqrtf(*y);
@@ -47,14 +47,14 @@ __device void to_unit_disk(float *x, float *y)
/* return an orthogonal tangent and bitangent given a normal and tangent that
* may not be exactly orthogonal */
-__device void make_orthonormals_tangent(const float3 N, const float3 T, float3 *a, float3 *b)
+ccl_device void make_orthonormals_tangent(const float3 N, const float3 T, float3 *a, float3 *b)
{
*b = normalize(cross(N, T));
*a = cross(*b, N);
}
/* sample direction with cosine weighted distributed in hemisphere */
-__device_inline void sample_cos_hemisphere(const float3 N,
+ccl_device_inline void sample_cos_hemisphere(const float3 N,
float randu, float randv, float3 *omega_in, float *pdf)
{
to_unit_disk(&randu, &randv);
@@ -66,7 +66,7 @@ __device_inline void sample_cos_hemisphere(const float3 N,
}
/* sample direction uniformly distributed in hemisphere */
-__device_inline void sample_uniform_hemisphere(const float3 N,
+ccl_device_inline void sample_uniform_hemisphere(const float3 N,
float randu, float randv,
float3 *omega_in, float *pdf)
{
@@ -83,7 +83,7 @@ __device_inline void sample_uniform_hemisphere(const float3 N,
}
/* sample direction uniformly distributed in cone */
-__device_inline void sample_uniform_cone(const float3 N, float angle,
+ccl_device_inline void sample_uniform_cone(const float3 N, float angle,
float randu, float randv,
float3 *omega_in, float *pdf)
{
@@ -100,7 +100,7 @@ __device_inline void sample_uniform_cone(const float3 N, float angle,
}
/* sample uniform point on the surface of a sphere */
-__device float3 sample_uniform_sphere(float u1, float u2)
+ccl_device float3 sample_uniform_sphere(float u1, float u2)
{
float z = 1.0f - 2.0f*u1;
float r = sqrtf(fmaxf(0.0f, 1.0f - z*z));
@@ -111,29 +111,29 @@ __device float3 sample_uniform_sphere(float u1, float u2)
return make_float3(x, y, z);
}
-__device float balance_heuristic(float a, float b)
+ccl_device float balance_heuristic(float a, float b)
{
return (a)/(a + b);
}
-__device float balance_heuristic_3(float a, float b, float c)
+ccl_device float balance_heuristic_3(float a, float b, float c)
{
return (a)/(a + b + c);
}
-__device float power_heuristic(float a, float b)
+ccl_device float power_heuristic(float a, float b)
{
return (a*a)/(a*a + b*b);
}
-__device float power_heuristic_3(float a, float b, float c)
+ccl_device float power_heuristic_3(float a, float b, float c)
{
return (a*a)/(a*a + b*b + c*c);
}
/* distribute uniform xy on [0,1] over unit disk [-1,1], with concentric mapping
* to better preserve stratification for some RNG sequences */
-__device float2 concentric_sample_disk(float u1, float u2)
+ccl_device float2 concentric_sample_disk(float u1, float u2)
{
float phi, r;
float a = 2.0f*u1 - 1.0f;
@@ -155,7 +155,7 @@ __device float2 concentric_sample_disk(float u1, float u2)
}
/* sample point in unit polygon with given number of corners and rotation */
-__device float2 regular_polygon_sample(float corners, float rotation, float u, float v)
+ccl_device float2 regular_polygon_sample(float corners, float rotation, float u, float v)
{
/* sample corner number and reuse u */
float corner = floorf(u*corners);