KhronosGroup / KhronosGroup/SPIRV-Tools
Add comment on disassembling OpName
- Dominant language
- C++
- Stars
- 1.4k
- Forks
- 709
- Avg merge
- 1d 22h
- Merged PRs (30d)
- 28
Description
When working in code manipulating SPIR-V with raw IDs it's useful to have the spirv-dis output to one side so I can see what is going on in the module. Unfortunately it can be annoying sometimes to match up IDs that have been named, because the disassembler shows up as this:
```
OpName %push "push"
OpName %param_0 "param"
OpName %param_1 "param"
...
%135 = OpLabel
%138 = OpLoad %uint %push
OpStore %param_0 %138
```
Which doesn't give me any clues about what `%push` or `%param_0` are as IDs. I can use --raw-ids but then I lose a lot of readability and I end up having to try and ping-pong back and forth.
Would it be possible (even under an option) to output an additional comment no each OpName line showing what ID was for what name?
```
OpName %push "push" ; %push = %50
OpName %param_0 "param" ; %param_0 = %71
OpName %param_1 "param" ; %param_1 = %72
...
%135 = OpLabel
%138 = OpLoad %uint %push
OpStore %param_0 %138
```
Contributor guide
Assessment
This issue has not been assessed yet.