spirv-val: Validate runtime-array structs by use site#6723
Open
Guang-035 wants to merge 1 commit into
Open
Conversation
Guang-035
force-pushed
the
relax-VUID-StandaloneSpirv-OpTypeRuntimeArray-04680
branch
from
July 7, 2026 10:24
c331485 to
98828dc
Compare
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
force-pushed
the
relax-VUID-StandaloneSpirv-OpTypeRuntimeArray-04680
branch
from
July 20, 2026 07:55
98828dc to
c374c15
Compare
spencer-lunarg
approved these changes
Jul 20, 2026
spencer-lunarg
left a comment
Contributor
There was a problem hiding this comment.
- Remove the Draft status
- Looks good to me, paired with #6748
- Will need @alan-baker review as well (as I know he has #6792 brewing)
Guang-035
marked this pull request as ready for review
July 21, 2026 02:42
Contributor
Author
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. |
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.
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:
See the updated spec discussion at: https://gitlab.khronos.org/vulkan/vulkan/-/merge_requests/8263
note - this goes along with #6748