Unclaimed project
Are you a maintainer of rust-gpu? Claim this project to take control of your public changelog and roadmap.
Changelog
🐉 Making Rust a first-class language and ecosystem for GPU shaders 🚧
A new minor release containing the fix (#1006) for a bug (#1002) causing incorrect SPIR-V to be generated when issuing a OpReturnValue instruction inside an asm! block of a function that gets inlined.
Affected API functions of spirv-std are:
IndexedUnchecked::index_unchecked() for [T] and [T; N]IndexedUnchecked::index_unchecked_mut() for [T] and [T; N]AccelerationStrucutre::from_u64()AccelerationStructure::from_vec()RuntimeArray::index()RuntimeArray::index_mut()This bug got triggered by a new inlining codepath in rustc's MIR and was introduced somewhere before the release of 0.4.0 and remained undetected until now.
A workaround for previous versions of rust-gpu is to compile your shaders without optimizations in general, e.g. by calling release(false) on your SpirvBuilder object, or by making sure the following environment variable is set as such: RUSTGPU_RUSTFLAGS=-Zmir-opt-level=0