Add custom_insts
for our own OpExtInst
s, and use it for some debuginfo.
#1064
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.