Possible f32 to u32 conversion bug
Description Using renderdoc, the conversion from f32 to u32 seems wrong in my shader.
Repro steps
_385 = -1.07374E+08
uint _396 = ConvertFToU(_395);
_396 = 4187593120 // Shouldn't this be 0?
Expected vs observed behavior I think the result should be 0u. It's not even u32::MAX, so something's weird.
Extra materials https://gpuweb.github.io/gpuweb/wgsl/#floating-point-conversion
Platform
2024-07-28T20:58:02.528730Z INFO bevy_diagnostic::system_information_diagnostics_plugin::internal: SystemInfo { os: "Windows 11 Home", kernel: "22631", cpu: "AMD Ryzen 5 2600 Six-Core Processor", core_count: "6", memory: "15.9 GiB" }
2024-07-28T20:58:03.450199Z INFO bevy_render::renderer: AdapterInfo { name: "NVIDIA GeForce RTX 3080", vendor: 4318, device: 8710, device_type: DiscreteGpu, driver: "NVIDIA", driver_info: "551.61", backend: Vulkan }
wgpu 0.21
This might be a weird renderdoc bug, not sure. I'd like confirmation though that u32(negative_float) is always 0, or if that's not what the spec is saying.
u32(negative_float) should be 0. But why do the repro steps contain ConvertFToU(_395)? that should be u32(_395).
This might be a weird renderdoc bug, not sure.
It would be worth investigating.
FYI this is naga's spirv output from a wgsl shader.
Any way to get a reproduction on this?