Skip to content

Commit

Permalink
Merge pull request #135 from tfoleyNV/falcor-hashed-alpha-fixups
Browse files Browse the repository at this point in the history
Map HLSL `frac()` to GLSL `fract()`
  • Loading branch information
Tim Foley authored Jul 21, 2017
2 parents 6992d0e + 5a63cb0 commit 30fbf64
Showing 1 changed file with 14 additions and 3 deletions.
17 changes: 14 additions & 3 deletions source/slang/slang-stdlib.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -560,9 +560,20 @@ __generic<T : __BuiltinFloatingPointType, let N : int> __intrinsic vector<T,N> f
__generic<T : __BuiltinFloatingPointType, let N : int, let M : int> __intrinsic matrix<T,N,M> fmod(matrix<T,N,M> x, matrix<T,N,M> y);
// Fractional part
__generic<T : __BuiltinFloatingPointType> __intrinsic T frac(T x);
__generic<T : __BuiltinFloatingPointType, let N : int> __intrinsic vector<T,N> frac(vector<T,N> x);
__generic<T : __BuiltinFloatingPointType, let N : int, let M : int> __intrinsic matrix<T,N,M> frac(matrix<T,N,M> x);
__generic<T : __BuiltinFloatingPointType>
__intrinsic(glsl, fract)
__intrinsic
T frac(T x);
__generic<T : __BuiltinFloatingPointType, let N : int>
__intrinsic(glsl, fract)
__intrinsic
vector<T,N> frac(vector<T,N> x);
__generic<T : __BuiltinFloatingPointType, let N : int, let M : int>
__intrinsic(glsl, fract)
__intrinsic
matrix<T,N,M> frac(matrix<T,N,M> x);
// Split float into mantissa and exponent
__generic<T : __BuiltinFloatingPointType> __intrinsic T frexp(T x, out T exp);
Expand Down

0 comments on commit 30fbf64

Please sign in to comment.