From 5a63cb07dec5296513a7170a19d588ade94fdf43 Mon Sep 17 00:00:00 2001 From: Tim Foley Date: Fri, 21 Jul 2017 13:48:12 -0700 Subject: [PATCH] Map HLSL `frac()` to GLSL `fract()` --- source/slang/slang-stdlib.cpp | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/source/slang/slang-stdlib.cpp b/source/slang/slang-stdlib.cpp index 60b69818c0..2a0d2abb24 100644 --- a/source/slang/slang-stdlib.cpp +++ b/source/slang/slang-stdlib.cpp @@ -560,9 +560,20 @@ __generic __intrinsic vector f __generic __intrinsic matrix fmod(matrix x, matrix y); // Fractional part -__generic __intrinsic T frac(T x); -__generic __intrinsic vector frac(vector x); -__generic __intrinsic matrix frac(matrix x); +__generic +__intrinsic(glsl, fract) +__intrinsic +T frac(T x); + +__generic +__intrinsic(glsl, fract) +__intrinsic +vector frac(vector x); + +__generic +__intrinsic(glsl, fract) +__intrinsic +matrix frac(matrix x); // Split float into mantissa and exponent __generic __intrinsic T frexp(T x, out T exp);