KhronosGroup / KhronosGroup/SPIRV-Tools
spirv-val: pointer being the Result <id> of the OpBitcast instruction
- Dominant language
- C++
- Stars
- 1.4k
- Forks
- 709
- Avg merge
- 1d 22h
- Merged PRs (30d)
- 28
Description
@s-perron and @alan-baker, according to the SPIR-V specification, if neither the `VariablePointers` nor `VariablePointersStorageBuffer` capabilities are declared, a pointer can be the `Result ` of only the following instructions:
- `OpVariable`
- `OpAccessChain`
- `OpInBoundsAccessChain`
- `OpFunctionParameter`
- `OpImageTexelPointer`
- `OpCopyObject`
However, currently `spirv-val` allows a pointer to be the `Result ` of the `OpBitcast` instruction, even without the `VariablePointers` and `VariablePointersStorageBuffer` capabilities.
Contributor guide
Research direction
Start at the spirv-val validation path for OpBitcast and trace how pointer result types are checked against the VariablePointers and VariablePointersStorageBuffer capabilities. Add a regression case showing that an invalid pointer result is rejected without those capabilities, then run the relevant validator tests to confirm the specified pointer-producing instructions remain accepted.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- cpp
- Domain
- compilers
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100