<feed xmlns='http://www.w3.org/2005/Atom'>
<title>slang.git/tests/cross-compile/fmod.slang.expected.txt, branch master</title>
<subtitle>Making it easier to work with shaders</subtitle>
<id>https://git.yummers.dev/slang.git/atom?h=master</id>
<link rel='self' href='https://git.yummers.dev/slang.git/atom?h=master'/>
<link rel='alternate' type='text/html' href='https://git.yummers.dev/slang.git/'/>
<updated>2020-05-11T21:57:05+00:00</updated>
<entry>
<title>Add GLSL translation for HLSL fmod() (#1342)</title>
<updated>2020-05-11T21:57:05+00:00</updated>
<author>
<name>Tim Foley</name>
<email>tfoleyNV@users.noreply.github.com</email>
</author>
<published>2020-05-11T21:57:05+00:00</published>
<link rel='alternate' type='text/html' href='https://git.yummers.dev/slang.git/commit/?id=f5dfa1ed6a51809e8593f5f2abc292ab39f35dcb'/>
<id>urn:sha1:f5dfa1ed6a51809e8593f5f2abc292ab39f35dcb</id>
<content type='text'>
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`).</content>
</entry>
</feed>
