[SPIR-V] Fix crash in GetAttributeAtVertex impl.#6459
Merged
Conversation
Some SPIR-V types are not direct translations of an AST type, hence they don't have an AST type attached to it. The code didn't checked for this possibility when visiting all variables. Fixes microsoft#2955 Signed-off-by: Nathan Gauër <brioche@google.com>
sudonatalie
approved these changes
Mar 26, 2024
Collaborator
sudonatalie
left a comment
There was a problem hiding this comment.
TBH I don't know for sure if the "If it required expansion, it should be done already." is true, but since it only affects shaders that would otherwise crash and this bug is super hairy, LGTM. Thanks for investigating this!
cassiebeckley
approved these changes
Mar 26, 2024
Collaborator
Author
|
The reason is: Because we created this struct from scratch to contain the multiple constants we have, there is no AST type to match against. Hence why this condition: if there is no AST type, it means it's a "synthetic" type we created in the backend. |
This was referenced Mar 29, 2024
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 join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Some SPIR-V types are not direct translations of an AST type, hence they don't have an AST type attached to it.
The code didn't checked for this possibility when visiting all variables.
Fixes #2955