Fix T54455, T56053, T55564: Cycles OpenCL build error after recent changes.

This commit is contained in:
Brecht Van Lommel
2018-07-20 19:07:35 +02:00
parent 710a059549
commit a6f750dd41
2 changed files with 7 additions and 6 deletions

View File

@@ -52,7 +52,7 @@ ccl_device void voronoi_neighbors(float3 p, NodeVoronoiDistanceMetric distance,
case NODE_VORONOI_CHEBYCHEV:
d = max3(fabs(vp - p));
break;
case NODE_VORONOI_MINKOWSKI:
case NODE_VORONOI_MINKOWSKI: {
float3 n = fabs(vp - p);
if(e == 0.5f) {
d = sqr(reduce_add(sqrt(n)));
@@ -61,6 +61,7 @@ ccl_device void voronoi_neighbors(float3 p, NodeVoronoiDistanceMetric distance,
d = powf(reduce_add(pow3(n, e)), 1.0f/e);
}
break;
}
}
/* To keep the shortest four distances and associated points we have to keep them in sorted order. */

View File

@@ -280,11 +280,6 @@ ccl_device_inline float3 sqrt(const float3& a)
#endif
}
ccl_device_inline float3 pow3(const float3& a, float e)
{
return make_float3(powf(a.x, e), powf(a.y, e), powf(a.z, e));
}
ccl_device_inline float3 mix(const float3& a, const float3& b, float t)
{
return a + t*(b - a);
@@ -382,6 +377,11 @@ ccl_device_inline bool isequal_float3(const float3 a, const float3 b)
#endif
}
ccl_device_inline float3 pow3(float3 v, float e)
{
return make_float3(powf(v.x, e), powf(v.y, e), powf(v.z, e));
}
ccl_device_inline float3 exp3(float3 v)
{
return make_float3(expf(v.x), expf(v.y), expf(v.z));