We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent cd07b9b commit ea31887Copy full SHA for ea31887
include/nbl/builtin/hlsl/complex.hlsl
@@ -17,8 +17,24 @@ namespace nbl
17
namespace hlsl
18
{
19
20
-template<class T>
21
-using complex_t = std::complex<T>;
+template<typename Scalar>
+using complex_t = std::complex<Scalar>;
22
+
23
+// Fast mul by i
24
25
+complex_t<Scalar> rotateLeft(NBL_CONST_REF_ARG(complex_t<Scalar>) value)
26
+{
27
+ complex_t<Scalar> retVal = { -value.imag(), value.real() };
28
+ return retVal;
29
+}
30
31
+// Fast mul by -i
32
33
+complex_t<Scalar> rotateRight(NBL_CONST_REF_ARG(complex_t<Scalar>) value)
34
35
+ complex_t<Scalar> retVal = { value.imag(), -value.real() };
36
37
38
39
}
40
0 commit comments