-
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
Support for NonReadable, NonWritable #689
Support for NonReadable, NonWritable #689
Comments
Correct me if I'm wrong, but given the impression that rust-gpu does not aim to simply wrap SPIRV and provide a rusty backend, I'd highly prefer the respective |
This nearly works with naga, but we're blocked on EmbarkStudios/rust-gpu#689
@apriori The trouble with that is that argument mutability has only two states: readonly, and read-write. There's no state corresponding to writeonly (NonReadable), and so there needs to be some form of extra annotation for at least that case. |
There is no reason not to mark &T as NonWritable. And spirv-tools can validate these attributes. They could be reflected based on usage, or the user applies an attribute themselves, and it is checked. shaderc validates both of these attributes so it's natural to expect rust-gpu would do the same. |
Has there been any movement on this, or potential for some sort of interim workaround? I've been experimenting with porting bevy's PBR shaders from WGSL to Rust, and - barring any potential complications with |
Took a stab at that, let me know if all fits expectations:
However, The only viable idea I've heard, for how to actually correctly apply (that approach would also remove the need for #1011, and/or could be used in tandem by checking decorations if they already exist: a |
I couldn't find any existing issues tracking adding support for specifying these decorations (or other decorations). Would it make sense for these to be exposed as
spirv
attributes, or as anotherconst
parameter ofImage
, for example? With the latter approach, correct usage of variables with these decorations can be enforced, but it might be complicated slightly by the decorations in SPIR-V being for the variable, not the type itself. I'm also not sure how that approach would work with buffers.It also does not look to be possible currently to work around this with inline assembly, at least for input arguments, as the global
OpVariable
identifiers do not appear to be visible fromasm!{}
.The text was updated successfully, but these errors were encountered: