Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

More explicit layout validation #5958

Merged
merged 2 commits into from
Jan 23, 2025

Conversation

alan-baker
Copy link
Contributor

  • Strengthen the checks that Block/BufferBlock cannot be nested in another Block/BufferBlock
    • previously missed arrays
  • Add check that arrays containing a Block/BufferBlock must not be decorated with array stride

Relevant SPIR-V rules:

Block and BufferBlock decorations must not decorate a structure type that is nested at any level inside another structure type decorated with Block or BufferBlock.

(within the explicit layout rules)

Each array type must have an ArrayStride decoration, unless it is an array that contains a structure decorated with Block or BufferBlock, in which case it must not have an ArrayStride decoration.

* Strengthen the checks that Block/BufferBlock cannot be nested in
  another Block/BufferBlock
  * previously missed arrays
* Add check that arrays containing a Block/BufferBlock must not be
  decorated with array stride
@alan-baker alan-baker requested a review from dneto0 January 23, 2025 03:37
@alan-baker
Copy link
Contributor Author

Smoketest failures are all in glslang's HLSL translation.

Copy link
Collaborator

@dneto0 dneto0 left a comment

Choose a reason for hiding this comment

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

Thanks!

source/val/validate_type.cpp Outdated Show resolved Hide resolved
@alan-baker
Copy link
Contributor Author

Found an issue when running against Vulkan CTS. Investigating.

@alan-baker
Copy link
Contributor Author

Found an issue when running against Vulkan CTS. Investigating.

Fixed the issue, CTS is clean now.

@alan-baker alan-baker merged commit e02275e into KhronosGroup:main Jan 23, 2025
21 of 22 checks passed
@alan-baker alan-baker deleted the layout-decoration-val branch January 23, 2025 22:17
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