@@ -18,6 +18,13 @@ struct sub_functor {
18
18
}
19
19
};
20
20
21
+ struct lerp_functor {
22
+ template <typename T>
23
+ inline T operator ()(const T a, const T b) {
24
+ return static_cast <T>(b);
25
+ }
26
+ };
27
+
21
28
struct add_alpha_functor {
22
29
template <typename T>
23
30
inline T operator ()(const T a, const T b, const T alpha) {
@@ -222,6 +229,13 @@ struct complex_lerp_alpha_functor {
222
229
}
223
230
};
224
231
232
+ struct complex_lerp_functor {
233
+ template <typename T>
234
+ inline T operator ()(const T a, const T b) {
235
+ return T (b.x , b.y );
236
+ }
237
+ };
238
+
225
239
REGISTER_BINARY_OP (copysign, long , float );
226
240
REGISTER_BINARY_OP (copysign, int , float );
227
241
REGISTER_BINARY_OP (copysign, float , float );
@@ -268,6 +282,14 @@ REGISTER_BINARY_OP(sub, short, short);
268
282
REGISTER_BINARY_OP (sub, uchar, uchar);
269
283
REGISTER_BINARY_OP (sub, char , char );
270
284
REGISTER_BINARY_OP (sub, bool , bool );
285
+ REGISTER_BINARY_OP (lerp, long , long );
286
+ REGISTER_BINARY_OP (lerp, int , int );
287
+ REGISTER_BINARY_OP (lerp, float , float );
288
+ REGISTER_BINARY_OP (lerp, half, half);
289
+ REGISTER_BINARY_OP (lerp, short , short );
290
+ REGISTER_BINARY_OP (lerp, uchar, uchar);
291
+ REGISTER_BINARY_OP (lerp, char , char );
292
+ REGISTER_BINARY_OP (lerp, bool , bool );
271
293
REGISTER_BINARY_ALPHA_OP (add_alpha, long , long );
272
294
REGISTER_BINARY_ALPHA_OP (add_alpha, int , int );
273
295
REGISTER_BINARY_ALPHA_OP (add_alpha, float , float );
@@ -308,6 +330,7 @@ REGISTER_BINARY_OP(hermite_polynomial_h, bfloat, bfloat);
308
330
REGISTER_BINARY_OP (hermite_polynomial_he, bfloat, bfloat);
309
331
REGISTER_BINARY_OP (add, bfloat, bfloat);
310
332
REGISTER_BINARY_OP (sub, bfloat, bfloat);
333
+ REGISTER_BINARY_OP (lerp, bfloat, bfloat);
311
334
REGISTER_BINARY_ALPHA_OP (add_alpha, bfloat, bfloat);
312
335
REGISTER_BINARY_ALPHA_OP (sub_alpha, bfloat, bfloat);
313
336
REGISTER_BINARY_ALPHA_OP (lerp_alpha, bfloat, bfloat);
@@ -324,6 +347,8 @@ REGISTER_BINARY_OP(add, float2, float2);
324
347
REGISTER_BINARY_OP (add, half2, half2);
325
348
REGISTER_BINARY_OP (sub, float2, float2);
326
349
REGISTER_BINARY_OP (sub, half2, half2);
350
+ REGISTER_BINARY_OP (lerp, float2, float2);
351
+ REGISTER_BINARY_OP (lerp, half2, half2);
327
352
REGISTER_BINARY_ALPHA_OP (complex_add_alpha, float2, float2);
328
353
REGISTER_BINARY_ALPHA_OP (complex_add_alpha, half2, half2);
329
354
REGISTER_BINARY_ALPHA_OP (complex_sub_alpha, float2, float2);
0 commit comments