diff options
author | Brecht Van Lommel <brechtvanlommel@gmail.com> | 2019-03-05 16:54:54 +0300 |
---|---|---|
committer | Stefan Werner <stefan.werner@tangent-animation.com> | 2019-03-05 16:55:21 +0300 |
commit | db7f9a70b0addd17a2f8a8d87c0b4d77d78b536e (patch) | |
tree | 46a8b0a62f146a17a2e764159b58a6f0c66e01f6 /intern/cycles/util | |
parent | a325bc6bf3e6dace5d1e15330650ea532052c9fc (diff) |
Cycles: Added Float2 attribute type.
Float2 are now a new type for attributes in Cycles. Before, the choices
for attribute storage were float and float3, the latter padded to
float4. This meant that UV maps were inflated to twice the size
necessary.
Reviewers: brecht, sergey
Reviewed By: brecht
Subscribers: #cycles
Tags: #cycles
Differential Revision: https://developer.blender.org/D4409
Diffstat (limited to 'intern/cycles/util')
-rw-r--r-- | intern/cycles/util/util_math_float2.h | 6 | ||||
-rw-r--r-- | intern/cycles/util/util_param.h | 2 |
2 files changed, 8 insertions, 0 deletions
diff --git a/intern/cycles/util/util_math_float2.h b/intern/cycles/util/util_math_float2.h index e937509367f..6fe8e3b4115 100644 --- a/intern/cycles/util/util_math_float2.h +++ b/intern/cycles/util/util_math_float2.h @@ -220,6 +220,12 @@ ccl_device_inline float2 interp(const float2& a, const float2& b, float t) { return a + t*(b - a); } + +ccl_device_inline float2 mix(const float2& a, const float2& b, float t) +{ + return a + t*(b - a); +} + #endif /* !__KERNEL_OPENCL__ */ CCL_NAMESPACE_END diff --git a/intern/cycles/util/util_param.h b/intern/cycles/util/util_param.h index 4453c66aae2..03815486429 100644 --- a/intern/cycles/util/util_param.h +++ b/intern/cycles/util/util_param.h @@ -28,6 +28,8 @@ CCL_NAMESPACE_BEGIN OIIO_NAMESPACE_USING +static constexpr TypeDesc TypeFloat2(TypeDesc::FLOAT, TypeDesc::VEC2); + CCL_NAMESPACE_END #endif /* __UTIL_PARAM_H__ */ |