Skip to content

spirv-opt: Add LegalizeMultidimArrayPass#6535

Open
s-perron wants to merge 2 commits intoKhronosGroup:mainfrom
s-perron:legalize_multidim_arrays
Open

spirv-opt: Add LegalizeMultidimArrayPass#6535
s-perron wants to merge 2 commits intoKhronosGroup:mainfrom
s-perron:legalize_multidim_arrays

Conversation

@s-perron
Copy link
Collaborator

@s-perron s-perron commented Feb 4, 2026

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

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
@s-perron s-perron requested review from Keenuts and luciechoi February 4, 2026 20:46
- 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.
@s-perron s-perron requested a review from Keenuts February 6, 2026 16:36
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.

[SPIR-V] Arrays of arrays of resources are unsupported

2 participants