-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Closed
Description
Description
When compiling this code with rust-gpu, I get valid spirv asm. I then pass it to naga to translate to metal (as I am on macOS) and I get these errors:
float _e11563 = function_119(metal::float2(_e7495 * 7.6543, _e7496 * 7.6543));
^
program_source:16276:67: error: as_type cast from 'long' to 'metal::uint' (aka 'unsigned int') is not allowed
int _e13236 = as_type<int>(as_type<uint>(1) + as_type<uint>((_e13226 == _e13226) ? ((_e13226 > as_type<float>(1325400063u)) ? 2147483647 : ((_e13226 < as_type<float>(3472883712u)) ? -2147483648 : naga_f2i32(_e13226))) : 0));
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
program_source:16304:67: error: as_type cast from 'long' to 'metal::uint' (aka 'unsigned int') is not allowed
int _e13273 = as_type<int>(as_type<uint>(1) + as_type<uint>((_e13263 == _e13263) ? ((_e13263 > as_type<float>(1325400063u)) ? 2147483647 : ((_e13263 < as_type<float>(3472883712u)) ? -2147483648 : naga_f2i32(_e13263))) : 0));
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Repro steps
It's a bit convoluted...
- Checkout Update deps Rust-GPU/rust-gpu-shadertoys#33
- Patch in Reduce repo MSRV from 1.85 to 1.84 #7425
- In
build.rs, remove the check that turns it off on macos or inshaders/lib.rs, delete everything in the match except21 => filtering_procedurals::Inputs
I'll work on getting the raw spirv.
Note I tested with the change from #7422 by @jamienicol and it still was not fixed.
Expected vs observed behavior
The shader to translate to metal code that compiles.
Platform
macOS, latest master of wgpu
Metadata
Metadata
Assignees
Labels
No labels
Type
Projects
Status
Done