summaryrefslogtreecommitdiffstats
path: root/tests/cross-compile/fmod.slang.expected.txt
Commit message (Collapse)AuthorAge
* Add GLSL translation for HLSL fmod() (#1342)Tim Foley2020-05-11
The existing code was assuming `fmod()` was available as a builtin in GLSL, which isn't true. It also isn't possible to translate the HLSL `fmod()` to the GLSL `mod()` since the two have slightly different semantics. This change introduces a definition for `fmod(x,y)` that amounts to `x - y*trunc(x/y)` which should agree with the HLSL version except in corner cases (e.g., there are some cases where the HLSL version returns `-0` and this one will return `0`).