diff options
| author | Tim Foley <tfoleyNV@users.noreply.github.com> | 2020-05-11 14:57:05 -0700 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2020-05-11 14:57:05 -0700 |
| commit | f5dfa1ed6a51809e8593f5f2abc292ab39f35dcb (patch) | |
| tree | 1ed0ec39036e65241e64be40ff07a418a23d891c /tools/slang-cpp-extractor | |
| parent | 798f3bc2236ce81499b05662dc11e7c071e7cde8 (diff) | |
Add GLSL translation for HLSL fmod() (#1342)
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`).
Diffstat (limited to 'tools/slang-cpp-extractor')
0 files changed, 0 insertions, 0 deletions
