WGSL float % translates into incorrect spirv op code #1652
Labels
area: back-end
Outputs of shader conversion
kind: bug
Something isn't working
lang: SPIR-V
Binary SPIR-V input and output
Description
WGSL spec says:
While looking at the shader code in RenderDoc when using Vulkan backend I can see that the modulo operation was translated to:
Repro steps
Use float % operator in WGSL shader where the first argument is a negative value.
Expected vs observed behavior
The result of the % operation should be a negative value, but it is a positive value, because OpFMod is used instead of OpFRem.
Platform
Using wgpu 0.12.0 on Linux (Arch linux if it matters).
The text was updated successfully, but these errors were encountered: