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

Fix layout validation #5015

Merged
merged 2 commits into from
Dec 16, 2022
Merged

Conversation

alan-baker
Copy link
Contributor

Fixes #5010

  • Unless scalar block layout is enabled, no member can reside at an offset between the end of the previous member that is a struct or array and the next multiple of that alignment
  • Tested against Vulkan CTS

Fixes KhronosGroup#5010

* Unless scalar block layout is enabled, no member can reside at an
  offset between the end of the previous member that is a struct or
  array and the next multiple of that alignment
dneto0
dneto0 previously approved these changes Dec 16, 2022
@@ -547,6 +547,8 @@ spv_result_t checkLayout(uint32_t struct_id, const char* storage_class_str,
hasImproperStraddle(id, offset, constraint, constraints, vstate))
return fail(memberIdx)
<< "is an improperly straddling vector at offset " << offset;
if (ordered_member_idx > 0) {
Copy link
Collaborator

Choose a reason for hiding this comment

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

This does nothing.
Please remove.

(spv::Op::OpTypeArray == opcode || spv::Op::OpTypeStruct == opcode)) {
// Uniform block rules don't permit anything in the padding of a struct
// or array.
// Non-scalar block layout rules don't permit anything in the padding of
Copy link
Collaborator

Choose a reason for hiding this comment

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

Yep, that's what the spec says.

@dneto0
Copy link
Collaborator

dneto0 commented Dec 16, 2022

CI-windows-msvc-2015-release-bazel has been failing consistently for unrelated reasons. #5022

@dneto0 dneto0 merged commit 5a78d79 into KhronosGroup:master Dec 16, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Push constant nested struct alignment/padding issue
2 participants