rust-gpu icon indicating copy to clipboard operation
rust-gpu copied to clipboard

Reassigning to f64s doesn't work

Open Icelk opened this issue 3 years ago • 1 comments

Expected Behaviour

Reassigning to a variable should work, just as it does with f32s.

Example & Steps To Reproduce

Run the compute example (just used as it's already set up). Then, add the following lines to the shader code:

let mut test: f64 = 1.0;
test = 2.0;

You have to remove the #[deny(warnings)] at the top.

The shader will fail to compile. This also applies to when the value is read.

System Info

  • Rust: nightly-2022-01-13
  • OS: Arch Linux
  • GPU: Nvidia 1060
  • SPIR-V: no clue, but using latest commit from this repo to build

Compiler error

error: f64 without OpCapability Float64
   --> /home/icelk/.rustup/toolchains/nightly-2022-01-13-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/num/f64.rs:451:5
    |
451 |     pub(crate) const fn abs_private(self) -> f64 {
    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    |
    = note: Stack:
            main_cs

error: No OpEntryPoint instruction was found. This is only allowed if the Linkage capability is being used.
  |
  = note: module `/home/icelk/dev/Rust/fractal-renderer/target/spirv-unknown-vulkan1.1/release/deps/compute_shader.spv.dir/module`

warning: an unknown error occurred
  |
  = note: spirv-opt failed, leaving as unoptimized
  = note: module `/home/icelk/dev/Rust/fractal-renderer/target/spirv-unknown-vulkan1.1/release/deps/compute_shader.spv.dir/module`

error: error:0:0 - No OpEntryPoint instruction was found. This is only allowed if the Linkage capability is being used.
  |
  = note: spirv-val failed
  = note: module `/home/icelk/dev/Rust/fractal-renderer/target/spirv-unknown-vulkan1.1/release/deps/compute_shader.spv.dir/module`

warning: `compute-shader` (lib) generated 1 warning
error: could not compile `compute-shader` due to 3 previous errors; 1 warning emitted

Icelk avatar Feb 10 '22 20:02 Icelk

thanks for reporting!

talked to @oisyn which will try and repo and see can get this, sounded like the float64 capability was not enabled

repi avatar Jul 05 '22 13:07 repi