Repository navigation
spirv-opt: Handle OpTypeVectorIdEXT in fix-storage-class access chains - #6971
Merged
s-perron merged 1 commit intoOct 14, 2026
Merged
Conversation
s-perron
approved these changes
Oct 14, 2026
s-perron
enabled auto-merge (squash)
October 14, 2026 16:07
s-perron
pushed a commit
that referenced
this pull request
Oct 30, 2026
…ss chains (#6982) 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 :)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
--fix-storage-class(and so--legalize-hlsl) turns valid long-vector SPIR-V invalid:WalkAccessChainTypesteps into the element type for vectors, arrays, matrices and coop matrices, but notOpTypeVectorIdEXT, so it "fixes" a correct pointer-to-component into a pointer to the whole vector. This adds the missing case. I noticed it running glslang'sspv.longVectorSpecConst.compandspv.coopvec.compthrough spirv-opt.Added
FixStorageClassTest.AccessChainIntoLongVector, and test_opt passes. A few other passes probably need the same case too, happy to look into those if that's useful :)