KhronosGroup / KhronosGroup/SPIRV-Tools
Shader.DebugInfo.100 DebugGlobalVariable using DebugExpression
- Dominant language
- C++
- Stars
- 1.4k
- Forks
- 709
- Avg merge
- 1d 22h
- Merged PRs (30d)
- 28
Description
In the [DebugGlobalVariable spec](https://github.com/KhronosGroup/SPIRV-Registry/blob/main/nonsemantic/NonSemantic.Shader.DebugInfo.100.asciidoc#DebugGlobalVariable) it says
> **Variable** can hold two kinds of values. First it can hold the of the source global variable or constant that is described by this instruction. If the variable is optimized out, this operand can be the of a [DebugExpression](https://github.com/KhronosGroup/SPIRV-Registry/blob/main/nonsemantic/NonSemantic.Shader.DebugInfo.100.asciidoc#DebugExpression) instruction that contains the constant value of the variable that was optimized out. Otherwise this operand must be [DebugInfoNone](https://github.com/KhronosGroup/SPIRV-Registry/blob/main/nonsemantic/NonSemantic.Shader.DebugInfo.100.asciidoc#DebugInfoNone).
I was trying to find an example of it using `DebugExpression`, but looking at `spirv-val` it doesn't even allow `DebugExpression`, it only allows
- `OpVariable` result ID
- `DebugInfoNone`
- `OpConstant` (and variants)
So not sure if the spec is wrong or spirv-val
cc @dnovillo as you are probably knee deep in this stuff
Contributor guide
Assessment
This issue has not been assessed yet.