KhronosGroup / KhronosGroup/SPIRV-Tools

OpPtrAccessChain on Function storage class not enabled by VariablePointers* capability

Open
#1,585 0 comments 0 reactions 0 assignees View on GitHub
component:validation
Dominant language
C++
Stars
1.4k
Forks
709
Avg merge
1d 22h
Merged PRs (30d)
28

Description

See example in https://github.com/google/clspv/issues/135

The module uses Logical addressing module plus VariablePointers capability. But it also has OpPtrAccessChain on a pointer to Function storage class:

`%31 = OpPtrAccessChain %_ptr_Function_uint %29 %uint_1 `

VariablePointers* capability only permits ptr-access-chain on Workgroup or StorageBuffer storage class.

The validator should check the storage class for this rule.

Contributor guide

Open the contributing guide

Research direction

Start with the SPIR-V validator's handling of OpPtrAccessChain and the VariablePointers capability rule described in this issue. Reproduce the supplied module pattern with a pointer to Function storage class, then confirm that validation rejects it when only VariablePointers is enabled.

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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.