Repository navigation
spirv-opt: Add LegalizeMultidimArrayPass - #6535
Merged
Merged
Conversation
This pass transforms multidimensional arrays of resources (e.g., Texture2D g_Textures[2][3]) into single-dimensional arrays (e.g., Texture2D g_Textures[6]) and updates all access chains that reference them. This transformation is required for Vulkan compatibility, as multidimensional resource arrays are not allowed in some storage classes. Specifically, it helps avoid: - VUID-StandaloneSpirv-Uniform-06807 - VUID-StandaloneSpirv-UniformConstant-04655 Fixes microsoft/DirectXShaderCompiler#7922
Keenuts
reviewed
Feb 5, 2026
- Corrected spelling of 'multidimensional' and 'rejected'. - Updated documentation and help text to recommend running combine-access-chains before this pass. - Added assertion to ensure dimensions are not empty.
Keenuts
approved these changes
Feb 9, 2026
s-perron
enabled auto-merge (squash)
February 11, 2026 14:17
Collaborator
Author
|
The failing macos test are an infrastructure issue not related to this change. Still fails even if I rerun. The smoke test failure is related to this change. DXC tests will have to be updated now that we run the combine access chain pass. |
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.
This pass transforms multidimensional arrays of resources (e.g.,
Texture2D g_Textures[2][3]) into single-dimensional arrays (e.g.,
Texture2D g_Textures[6]) and updates all access chains that reference
them.
This transformation is required for Vulkan compatibility, as multidimensional
resource arrays are not allowed in some storage classes.
Specifically, it helps avoid:
Fixes microsoft/DirectXShaderCompiler#7922