diff options
| author | Robert Stepinski <rob.stepinski@gmail.com> | 2019-03-20 17:13:48 -0400 |
|---|---|---|
| committer | Tim Foley <tfoleyNV@users.noreply.github.com> | 2019-03-20 14:13:48 -0700 |
| commit | fb29281b9061eb5e9b75d1362f2c824d01a8b3d4 (patch) | |
| tree | b3fee168100eff3357169afbe9b698a3d97f7164 /source/slang/hlsl.meta.slang | |
| parent | 662fcca6d3156d7645761ac967038e5ff068fe99 (diff) | |
Add support for scalar rcp() intrinsic for GLSL (#918)
Diffstat (limited to 'source/slang/hlsl.meta.slang')
| -rw-r--r-- | source/slang/hlsl.meta.slang | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/source/slang/hlsl.meta.slang b/source/slang/hlsl.meta.slang index a12e45c36..40bd02597 100644 --- a/source/slang/hlsl.meta.slang +++ b/source/slang/hlsl.meta.slang @@ -1133,7 +1133,11 @@ __generic<T : __BuiltinFloatingPointType, let N : int> vector<T,N> radians(vecto __generic<T : __BuiltinFloatingPointType, let N : int, let M : int> matrix<T,N,M> radians(matrix<T,N,M> x); // Approximate reciprocal -__generic<T : __BuiltinFloatingPointType> T rcp(T x); +__generic<T : __BuiltinFloatingPointType> +__target_intrinsic(glsl, "1.0/($0)") +T rcp(T x); + +// TODO: vector and matrix approx. reciprocals needto be deconstructed for GLSL __generic<T : __BuiltinFloatingPointType, let N : int> vector<T,N> rcp(vector<T,N> x); __generic<T : __BuiltinFloatingPointType, let N : int, let M : int> matrix<T,N,M> rcp(matrix<T,N,M> x); |
