diff options
| author | Jay Kwak <82421531+jkwak-work@users.noreply.github.com> | 2024-01-23 16:57:44 -0800 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-01-23 16:57:44 -0800 |
| commit | 4d217907665180537ea217f9f2213c9d53a22b99 (patch) | |
| tree | 02de5405c4fc4cd3cdd3b4ef4496b7c33a4e9728 /docs/user-guide | |
| parent | af91e770f99da18ae97d6b601c706343cece11e9 (diff) | |
Fix incorrect behavior of operator% (#3470)
* Fix incorrect behavior of operator%
Fixes #1059.
This change fixes the incorrect translation of "operator%" from
HLSL to SPIRV.
The issue stems from the fact that the behavior of "operator%" in
GLSL differs from that in HLSL. In HLSL it behaves as "remainder"
where as it behaves as "modulus" in GLSL.
We have been using SpvOpFMod for operator% when Slang compiles
from HLSL to SPRIV, which is incorrect. This change switches it
to SpvOpFRem.
The tests are slightly modified to reveal any potential issues.
* Change output type of test/compute/frem
For testing the operator%, we are using "int" as the output type of the
test, "test/compute/frem.slang".
Since the operands are in float type, it is more preferable to have a
float type as the resulting type. This can be done with an option,
"-output-using-type".
---------
Co-authored-by: Yong He <yonghe@outlook.com>
Diffstat (limited to 'docs/user-guide')
0 files changed, 0 insertions, 0 deletions
