-
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 custom_insts
for our own OpExtInst
s, and use it for some debuginfo.
#1064
Merged
Conversation
This file contains 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
…starting location.
VZout
approved these changes
Jun 1, 2023
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.
fancy!
also learned some new rust :p if let [Operand::IdRef(target), ..] = inst.operands[..] {
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.
This PR introduces a Rust-GPU-specific custom "extended instruction set" (
OpExtInstImport
/OpExtInst
- note that unlike the requirements imposed by the SPIR-V specification, we're only concerned aboutrspirv
/spirt
compatibility, as long as we always rewrite such instructions before the final SPIR-V output).Longer-term, we'll likely want such custom instructions for more advanced usecases (e.g. one idea being floated around was adding our own
OpAbort
that gets transformed to standard SPIR-V), and the debuginfo needs will likely get superseded by adoptingNonSemantic.Shader.DebugInfo.100
, but for now this is easier for some debuginfo.The main feature this PR adds is the ability to have location ranges, not just the starting point:
The other feature is inline stack frames, e.g. most of this
--no-early-report-zombies
output is new:(actually, it used to not even report the zombies, because the decorations were being lost)
The more flexible debuginfo is only used internally, and replaced with standard SPIR-V
OpLine
/OpNoLine
instructions (or rather, the SPIR-T attribute thatspirt::spv::lift
maps toOpLine
/OpNoLine
) after all possible (zombie or SPIR-T) diagnostics have been emitted, to maximize our diagnostics quality.