-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Replace
Attr::SpvDebugLine
with a better basic debug source locatio…
…n attribute. (#9) Partially modeled on a subset of the [`NonSemantic.Shader.DebugInfo.100`](https://htmlpreview.github.io/?https://github.com/KhronosGroup/SPIRV-Registry/blob/main/nonsemantic/NonSemantic.Shader.DebugInfo.100.html) SPIR-V extended instruction set, but more with Rust-GPU's needs in mind, this extends the existing `file:line:col` debuginfo to support both: - ranges (within a single file - comparable to rustc's internal `Span`) - "inlined at" debuginfo (call site debug location + callee name) - more expressive than `NonSemantic.Shader.DebugInfo.100` in one key way: for some reason, that extension only seems to allow distinguishing call sites *by line number* which seems borderline incorrect (wrt DWARF) There is nothing in the `spirt` library itself that can create such extended debuginfo (even though in theory e.g. `NonSemantic.Shader.DebugInfo.100` support could do that), and instead Rust-GPU is expected to produce it by converting its own custom instructions. The Rust-GPU side of this already exists since it's part of the polaris/lodestar demo branches (IIRC this specifically happened for recursion emulation, where `FuncCall` being outside `Block`s meant). --- Example from a relatively messy inlining stack: ![image](https://github.com/user-attachments/assets/a69718d6-65a1-4749-bea6-27842417daa5) Ideally large amounts of deduplication could be done by having a "debug context tracker" in `print` that only needs to show *changes* (i.e. entering/leaving a group of inlined instructions, and individual location debuginfo that could still differ between instructions), but that's not done in this PR. The status quo on the Rust-GPU side was already quite verbose, and arguably worse than this at times (or at least more "syntaxful"), so this will do for the time being.
- Loading branch information
Showing
6 changed files
with
260 additions
and
86 deletions.
There are no files selected for viewing
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
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
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
Oops, something went wrong.