Skip to content

spirv-val: Validate runtime-array structs by use site#6723

Open
Guang-035 wants to merge 1 commit into
KhronosGroup:mainfrom
Guang-035:relax-VUID-StandaloneSpirv-OpTypeRuntimeArray-04680
Open

spirv-val: Validate runtime-array structs by use site#6723
Guang-035 wants to merge 1 commit into
KhronosGroup:mainfrom
Guang-035:relax-VUID-StandaloneSpirv-OpTypeRuntimeArray-04680

Conversation

@Guang-035

@Guang-035 Guang-035 commented Jun 3, 2026

Copy link
Copy Markdown
Contributor

Motivation:
VUID-StandaloneSpirv-OpTypeRuntimeArray-04680 is use-site dependent, so checking every OpTypeStruct containing OpTypeRuntimeArray at declaration time rejects valid descriptor heap qualifier wrappers.

Solution:
Validate the relevant cases where the struct is instantiated or accessed:

  • OpVariable: StorageBuffer variables must use Block-decorated structs.
  • OpTypePointer: PhysicalStorageBuffer pointees must use Block-decorated structs.
  • OpBufferPointerEXT: runtime-array struct pointees must use StorageBuffer.
  • OpUntypedAccessChainKHR: UniformConstant runtime-array structs must be accessed from ResourceHeapEXT or SamplerHeapEXT base variables.

See the updated spec discussion at: https://gitlab.khronos.org/vulkan/vulkan/-/merge_requests/8263

note - this goes along with #6748

@Guang-035
Guang-035 force-pushed the relax-VUID-StandaloneSpirv-OpTypeRuntimeArray-04680 branch from c331485 to 98828dc Compare July 7, 2026 10:24
@Guang-035 Guang-035 changed the title spirv-val: Relax RuntimeArray struct Block requirement spirv-val: Allow descriptor heap image qualifier wrappers without Block Jul 7, 2026
VUID-StandaloneSpirv-OpTypeRuntimeArray-04680 is use-site dependent, so
checking every OpTypeStruct containing OpTypeRuntimeArray at declaration time
rejects valid descriptor heap qualifier wrappers.

Validate the relevant cases where the struct is instantiated or accessed:
- OpVariable: StorageBuffer variables must use Block-decorated structs.
- OpTypePointer: PhysicalStorageBuffer pointees must use Block-decorated
  structs.
- OpBufferPointerEXT: runtime-array struct pointees must use StorageBuffer.
- OpUntypedAccessChainKHR: UniformConstant runtime-array structs must be
  accessed from ResourceHeapEXT or SamplerHeapEXT base variables.
@Guang-035
Guang-035 force-pushed the relax-VUID-StandaloneSpirv-OpTypeRuntimeArray-04680 branch from 98828dc to c374c15 Compare July 20, 2026 07:55
@Guang-035 Guang-035 changed the title spirv-val: Allow descriptor heap image qualifier wrappers without Block spirv-val: Validate runtime-array structs by use site Jul 20, 2026

@spencer-lunarg spencer-lunarg left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  1. Remove the Draft status
  2. Looks good to me, paired with #6748
  3. Will need @alan-baker review as well (as I know he has #6792 brewing)

@Guang-035
Guang-035 marked this pull request as ready for review July 21, 2026 02:42
@Guang-035

Copy link
Copy Markdown
Contributor Author
  1. Remove the Draft status
  2. Looks good to me, paired with spirv-val: Fix 11805 to allow Uniform BufferBlock #6748
  3. Will need @alan-baker review as well (as I know he has [val] Explicit layout refactor #6792 brewing)

Hello @spencer-lunarg, thanks for the reminder. I have marked the PR as ready for review. I agree this should be considered together with #6748. This PR also unblocks KhronosGroup/glslang#4329, which currently fails validation without this change.

Hello @alan-baker, could you please take a look when you have a chance? I would appreciate your feedback.

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.

2 participants