gfx-rs / wgpu

A cross-platform, safe, pure-Rust graphics API.
https://wgpu.rs
Apache License 2.0
12.54k stars 918 forks source link

type of X doesn't match.. #6487

Open rcoreilly opened 2 hours ago

rcoreilly commented 2 hours ago

The latest https://github.com/gfx-rs/wgpu/releases/tag/v23.0.0 release highlights this naga WGSL parsing error:

fn gimme_a_float() -> f32 {
  return 42; // fails in Naga, but standard WGSL happily converts to `f32`
}

this is the single most annoying "feature" of the current framework, IMO. I couldn't find the issue that is tracking it. Any chance it could receive some urgent attention? Thanks!

rcoreilly commented 2 hours ago

ps. It occurs in simple direct assignments as well, e.g.,

var<storage, read_write> Neurons: array<f32>;
...
Neurons[x,y] = 0;