You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Replace Attr::SpvDebugLine with a better basic debug source location 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:

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.
0 commit comments