Skip to content

rust-gpu v0.6.1

Compare
Choose a tag to compare
@oisyn oisyn released this 20 Mar 16:19
· 157 commits to main since this release

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