Skip to content

spirv-opt: Handle OpTypeCooperativeMatrixNV in fix-storage-class access chains - #6982

Merged
s-perron merged 1 commit into
KhronosGroup:mainfrom
apollo-2006:fix-storage-class-coopmat-nv
Oct 30, 2026
Merged

s-perron merged 1 commit into
KhronosGroup:mainfrom
apollo-2006:fix-storage-class-coopmat-nv

Conversation

@apollo-2006

Copy link
Copy Markdown
Contributor

Same as #6971, but for NV cooperative matrices. WalkAccessChainType didn't step into OpTypeCooperativeMatrixNV, so --fix-storage-class turned a correct pointer-to-component access chain into a pointer to the whole matrix:

OpAccessChain result type <id> (OpTypeCooperativeMatrixNV) does not match the type that results from indexing into the base <id> (OpTypeFloat)

glslang's spv.coopmat.comp and spv.intcoopmat.comp hit this. Added the case next to the KHR one, with a test :)

…ss chains

WalkAccessChainType did not step into OpTypeCooperativeMatrixNV, so
fix-storage-class rewrote a correct pointer-to-component access chain
into a pointer to the whole matrix:

    %59 = OpAccessChain %_ptr_Function_32 %m_1 %int_1

which spirv-val rejects. glslang's spv.coopmat.comp and
spv.intcoopmat.comp hit this. Treat it like OpTypeCooperativeMatrixKHR.
@s-perron
s-perron enabled auto-merge (squash) October 30, 2026 15:45
@s-perron
s-perron merged commit ee5c848 into KhronosGroup:main Oct 30, 2026
26 of 27 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants