GLSL/HLSL out pass through the modulus operator on integers #4398
Labels
area: naga back-end
Outputs of naga shader conversion
lang: GLSL
OpenGL Shading Language
lang: HLSL
D3D Shading Language
naga
Shader Translator
type: bug
Something isn't working
"a % b" expression gets passed through form WGSL to GLSL, e.g.
Produces:
Problem is - the semantics of "%" is different. In GLSL it's "x - y * floor(x/y)", while in WGSL it's meant to be "x - y * trunc(x/y)".
Edit: same for HLSL, with a little difference that this is UB:
The text was updated successfully, but these errors were encountered: