KhronosGroup / KhronosGroup/SPIRV-Tools

Incorrect validation of DebugTypePointer: non-trivial base types are not allowed

Open
#5,436 0 comments 0 reactions 1 assignee Claimed by @alan-baker View on GitHub
bug component:validation
Dominant language
C++
Stars
1.4k
Forks
709
Avg merge
1d 22h
Merged PRs (30d)
28

Description

When validating `DebugTypePointer` instructions, the base type is checked to be a trivial type defined by `DebugTypeBasic`. This means that pointers to vectors or matrices are considered invalid, which prevents variables such as `vec4 fragColor` (GLSL) to have debug info emitted.

https://github.com/KhronosGroup/SPIRV-Tools/blob/933db564ca660477b360480b8a1d7589d7c6694e/source/val/validate_extensions.cpp#L3170-L3177

This validation rule is not present in the `NonSemantic.Shader.DebugInfo.100` specification. Potential solutions:
(1) Check that `Base Type` in `DebugTypePointer` could be any debug type instruction.
(2) Simply remove the validation - `ValidateOperandBaseType(_, inst, 5, ext_inst_name)`
(3) Update the specification to reflect the intended behaviour in case pointers to non-trivial types are not allowed

Thanks for reading and checking that!

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.