-
Notifications
You must be signed in to change notification settings - Fork 244
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Some shaders that compiled in 0.8 are erring in 0.9 #1089
Comments
any ideas @eddyb ? |
@repi sorry, this got discussed on the Discord but I forgot to post a reply here as well. The problem is that 0.8, and perhaps earlier versions too (0.7? unsure how far back it goes), are actually in the wrong here, at least in the short term. That is, we had allowed code we didn't intend to, to compile. The reason is MIR inlining: it got enabled by default, and IIRC even made more aggressive, upstream, and it wasn't obvious right away how damaging it could be to us (I think the first hint was debug builds sometimes erroring). 0.9 closed this hole, but the damage had been done in some codebases, if they had used previous versions. For this specific example I'm not even sure what's triggering it, my plan for a while has been to add our own validation (that can generate SPIR-T diagnostics, and thus get far more context information than But "helping users tweak their code to bypass a limitation" is only a short-term solution. |
After compiling my shaders with I then made this one line change:
and now my shaders compile and validate. |
Hello. I am facing a similar issue when updating to 0.9:
When I run with the flags suggested in the comment just above this one, I get an ICE
Project: https://github.com/pema99/rust-path-tracer/tree/wgpu19 (happens after bumping the spirv-builder dep from 0.8.0 to 0.9.0) Any ideas on how I can debug this? |
@pema99 Maybe try bisecting your source for instances where functions or structs are using references. It's tedious but that's all I've got. |
I'm guessing it's one of these two causing issues. Are you not allowed to store references in structs at all? pub struct FixedVec<T, const CAPACITY: usize> {
pub data: [T; CAPACITY],
pub len: u32,
} pub struct BVHReference<'a> {
pub nodes: &'a [BVHNode],
} |
It was actually this:
|
That's a very similar situation to mine. I had to deref |
Figured out why #[inline]
fn eq(&self, other: &&B) -> bool {
PartialEq::eq(*self, *other)
}
#[inline]
fn ne(&self, other: &&B) -> bool {
PartialEq::ne(*self, *other)
} If it was using the operators, it would look like In Rust-GPU It's unfortunate, and both versions will eventually work, but the version you were using with |
Expected Behaviour
Shaders should compile.
Example & Steps To Reproduce
Shaders that previously compiled in 0.8 are no longer compiling when bumping
rust-gpu
,spirv-std
andspirv-builder
to 0.9.Specifically the shaders in question all give some form of this error:
git clone https://github.com/schell/renderling --branch chore/bump-rust-gpu-0.9
cd renderling/shaders
cargo run --release
System Info
Apple M1
macOS 13.4.1 (22F82)
spirv-val
The text was updated successfully, but these errors were encountered: