KhronosGroup / KhronosGroup/SPIRV-Tools

Shader.DebugInfo.100 DebugGlobalVariable using DebugExpression

Open
#6,469 2 comments 0 reactions 1 assignee Claimed by @dnovillo View on GitHub
component:validation
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

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.