-
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
Add arrays of buffer descriptors #1148
base: main
Are you sure you want to change the base?
Conversation
…g an invalid struct from a slice
… with disabled specializer error reporting
@@ -2005,7 +2005,8 @@ impl<'a, S: Specialization> InferCx<'a, S> { | |||
} | |||
|
|||
if let Err(e) = self.equate_match_findings(m) { | |||
e.report(inst); | |||
// temporarily disabled, arrays of buffer descriptors cause errors here | |||
// e.report(inst); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I cannot figure out why the specializer is upset about my changes (or what exactly it does in the first place). For now I've just disabled the error reporting, and the spirv emitted looks fine. So I assume this is a bug / missing feature in the specializer rather than my PR?
Any help would be appreciated :D
About concerns about breaking change, To me that warning is basically same as |
Sorry if you didn't see this PR (which I should've landed a while back, oops!): Crucially, it fully disambiguates the existence of a "buffer resource", and while it doesn't require it in the simple case, it is pretty important semantically. The reason the SPIR-V types are weird and Using pointers (and ignoring the missing length for the outer one), the type of an array of buffer would be something like Also, as another aside, for mutable buffers, the correct type would have to be something like But for now, #1014 should work without breaking changes or ambiguous situations etc. |
This PR adds support for arrays of buffer descriptors, and represents them like this in rust-gpu:
This is a breaking change to how RuntimeArray operates. However, on all previous versions using it in such a way would result in a warning similarly to below. So I'm hoping this should have discouraged anyone from using it like that, and this change does not actually break anyone' code.
But while trying to record that warning, I've noticed that even with a
#![deny(warnings)]
in thelib.rs
of my shader crate, it would still only emit as a warning, thus when building via a build script not even show up to the end user.Background
Currently we can represent the following glsl buffer declarations in rust-gpu:
While we can have arrays of image or sampler descriptors, we cannot represent arrays of buffer descriptors, like we can in glsl. The proposed syntax for rust-gpu at the very top of this PR equals the following in glsl: