This repository was archived by the owner on Oct 31, 2025. It is now read-only.
Replace spirv_std::storage_class::X<T> with T/&mut T and #[spirv(x)] &T/&mut T.#443
Merged
XAMPPRocky merged 3 commits intoEmbarkStudios:mainfrom Mar 23, 2021
LykenSol:new-style-entry-interfac
Merged
Replace spirv_std::storage_class::X<T> with T/&mut T and #[spirv(x)] &T/&mut T.#443XAMPPRocky merged 3 commits intoEmbarkStudios:mainfrom LykenSol:new-style-entry-interfac
XAMPPRocky merged 3 commits intoEmbarkStudios:mainfrom
LykenSol:new-style-entry-interfac
Conversation
khyperia
approved these changes
Feb 23, 2021
Contributor
khyperia
left a comment
There was a problem hiding this comment.
Looks hecking great! @hrydgard and I had a conversation in discord, path forward seems to be to make inputs be by-value, and then in a follow-up, do the annoyingly complex work of making outputs be returned via tuple or struct or whatever.
This comment has been minimized.
This comment has been minimized.
Closed
Contributor
Author
|
@khyperia FWIW this is ready for a re-review, but I can't figure out what's wrong with the CI. |
Member
|
I'm going to re-run and temporarily disable auto-merge |
Member
|
Yeah, it was an issue with GitHub Actions, the PR passes. |
XAMPPRocky
approved these changes
Mar 23, 2021
Comment on lines
+301
to
+302
| // FIXME(eddyb) should we just remove all 5 of these storage class | ||
| // attributes, instead of disallowing them here? |
Member
There was a problem hiding this comment.
Would there ever be a need to use these attributes in spirv-std? If not, I agree that we should remove them.
khyperia
approved these changes
Mar 23, 2021
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This is my pre-#416 branch, I started this as part of #414, but only later realized I don't need it.It's easier than I expected because, once again, I was able to mostly reuse existing logic (attribute parsing in this case).As it's currently implemented, rules are:
&Tand&mut Tare allowed as entry parameter types, with explicit storage class attributes&mut MaybeUninitialized<T>instead of&mut T, but ideally we can use-> Tinstead forOutput&Timmutable but it should also check thatT: FreezeTdefaults toInput,&mut Tdefaults toOutput, and those storage classes cannot be explicitly specified#[spirv(...)]attribute on the parameter, e.g. this line insky-shader:UniformConstant, andPushContantstorage classes only allow&T(i.e. not&mut T) typesPrivate,FunctionandGenericstorage classes cannot be specified at allThis works and passes tests, but I'm opening it as a draft because it should wait on a decision regarding #416, especially around theOutputstorage class and whether we should use a->style, support bundling them instructs etc.EDIT: updated to reflect PR changes, i.e.
Inputnot taking references anymore.