microsoft / microsoft/DirectXShaderCompiler
[SPIR-V] Debug info should use DebugBuildIdentifier and DebugStoragePath with -Fd flag
Nobody has claimed this yet.
- Dominant language
- C++
- Stars
- 3.7k
- Forks
- 900
- Avg merge
- 2d 11h
- Merged PRs (30d)
- 44
Description
This is a request for the NonSemantic.Shader.DebugInfo.100 SPIR-V debug info to use the DebugBuildIdentifier and DebugStoragePath opcodes to support split debuginfo files. For context how it works on the DXIL path:
The -Fd flag allows the user to specify a directory where unstripped debug-info filled copy of the shader will be saved before the actual output via -Fo contains only the stripped shader. (The reverse is -Qembed_debug which is the implicit default, with a warning when not explicitly stated).
The filename in the directory is generated based on a hash of the shader. Depending on the -Zsb or -Zss flags that hash either does or doesn't consider the input shader source or debug info itself - allowing debug info to be potentially shared among shader variants that differ in the source but compile to the same executable instructions. (Note: -Zsb only considering the output shader and not the source/debug info corresponds to the IdentifierPossibleDuplicates flag in DebugBuildIdentifier).
The stripped shader still contains the hash identifier (via DebugBuildIdentifier), and optionally the directory's path on the user's machine (via DebugStoragePath). This allows tools at a later date to look up the unstripped debug shader on disk without needing to keep all the debug info embedded as an application loads it into memory and passes it to the vulkan implementation for processing. The identifier and path are separate to allow for relocation - the user could configure a tool with alternate search directories to locate the same debug file (identified by that hash).
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by tracing the existing DXIL -Fd and debug-info handling, then locate the SPIR-V debug emission path for NonSemantic.Shader.DebugInfo.100. Compare how split debug files, identifiers, storage paths, and -Zsb/-Zss behavior are represented there. Done means SPIR-V supports the requested opcodes and -Fd workflow while preserving the described stripped-shader lookup behavior.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- cpp
- Domain
- compilers
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 25/100