diff options
author | Brecht Van Lommel <brechtvanlommel@pandora.be> | 2011-05-31 15:31:00 +0400 |
---|---|---|
committer | Brecht Van Lommel <brechtvanlommel@pandora.be> | 2011-05-31 15:31:00 +0400 |
commit | 64c2d5e90e7ec80eb693c814787d8eee393c3bab (patch) | |
tree | 0d3f2be5289ad5f6a09b316d538159854fbb8f92 /intern/cycles/util | |
parent | eedcba7ed57e85b01b4aa5bc106502178835e6ae (diff) |
Cycles: more opencl fixes.
Diffstat (limited to 'intern/cycles/util')
-rw-r--r-- | intern/cycles/util/util_math.h | 24 | ||||
-rw-r--r-- | intern/cycles/util/util_transform.h | 8 |
2 files changed, 16 insertions, 16 deletions
diff --git a/intern/cycles/util/util_math.h b/intern/cycles/util/util_math.h index e6dd00fd86b..1bb3f5b6097 100644 --- a/intern/cycles/util/util_math.h +++ b/intern/cycles/util/util_math.h @@ -345,56 +345,56 @@ __device_inline float average(const float3 a) __device_inline float3 operator-(const float3 a) { - float3 r = {-a.x, -a.y, -a.z}; + float3 r = make_float3(-a.x, -a.y, -a.z); return r; } __device_inline float3 operator*(const float3 a, const float3 b) { - float3 r = {a.x*b.x, a.y*b.y, a.z*b.z}; + float3 r = make_float3(a.x*b.x, a.y*b.y, a.z*b.z); return r; } __device_inline float3 operator*(const float3 a, float f) { - float3 r = {a.x*f, a.y*f, a.z*f}; + float3 r = make_float3(a.x*f, a.y*f, a.z*f); return r; } __device_inline float3 operator*(float f, const float3 a) { - float3 r = {a.x*f, a.y*f, a.z*f}; + float3 r = make_float3(a.x*f, a.y*f, a.z*f); return r; } __device_inline float3 operator/(float f, const float3 a) { - float3 r = {f/a.x, f/a.y, f/a.z}; + float3 r = make_float3(f/a.x, f/a.y, f/a.z); return r; } __device_inline float3 operator/(const float3 a, float f) { float invf = 1.0f/f; - float3 r = {a.x*invf, a.y*invf, a.z*invf}; + float3 r = make_float3(a.x*invf, a.y*invf, a.z*invf); return r; } __device_inline float3 operator/(const float3 a, const float3 b) { - float3 r = {a.x/b.x, a.y/b.y, a.z/b.z}; + float3 r = make_float3(a.x/b.x, a.y/b.y, a.z/b.z); return r; } __device_inline float3 operator+(const float3 a, const float3 b) { - float3 r = {a.x+b.x, a.y+b.y, a.z+b.z}; + float3 r = make_float3(a.x+b.x, a.y+b.y, a.z+b.z); return r; } __device_inline float3 operator-(const float3 a, const float3 b) { - float3 r = {a.x-b.x, a.y-b.y, a.z-b.z}; + float3 r = make_float3(a.x-b.x, a.y-b.y, a.z-b.z); return r; } @@ -446,7 +446,7 @@ __device_inline float dot(const float3 a, const float3 b) __device_inline float3 cross(const float3 a, const float3 b) { - float3 r = {a.y*b.z - a.z*b.y, a.z*b.x - a.x*b.z, a.x*b.y - a.y*b.x}; + float3 r = make_float3(a.y*b.z - a.z*b.y, a.z*b.x - a.x*b.z, a.x*b.y - a.y*b.x); return r; } @@ -486,13 +486,13 @@ __device_inline bool operator!=(const float3 a, const float3 b) __device_inline float3 min(float3 a, float3 b) { - float3 r = {min(a.x, b.x), min(a.y, b.y), min(a.z, b.z)}; + float3 r = make_float3(min(a.x, b.x), min(a.y, b.y), min(a.z, b.z)); return r; } __device_inline float3 max(float3 a, float3 b) { - float3 r = {max(a.x, b.x), max(a.y, b.y), max(a.z, b.z)}; + float3 r = make_float3(max(a.x, b.x), max(a.y, b.y), max(a.z, b.z)); return r; } diff --git a/intern/cycles/util/util_transform.h b/intern/cycles/util/util_transform.h index e2b022dc478..e904674a981 100644 --- a/intern/cycles/util/util_transform.h +++ b/intern/cycles/util/util_transform.h @@ -34,16 +34,16 @@ typedef struct Transform { __device_inline float3 transform(const Transform *t, const float3 a) { - float4 b = {a.x, a.y, a.z, 1.0f}; - float3 c = {dot(t->x, b), dot(t->y, b), dot(t->z, b)}; + float4 b = make_float4(a.x, a.y, a.z, 1.0f); + float3 c = make_float3(dot(t->x, b), dot(t->y, b), dot(t->z, b)); return c/dot(t->w, b); } __device_inline float3 transform_direction(const Transform *t, const float3 a) { - float4 b = {a.x, a.y, a.z, 0.0f}; - float3 c = {dot(t->x, b), dot(t->y, b), dot(t->z, b)}; + float4 b = make_float4(a.x, a.y, a.z, 0.0f); + float3 c = make_float3(dot(t->x, b), dot(t->y, b), dot(t->z, b)); return c; } |