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

Validation for relaxed control barrier with storage class semantics #5984

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

natgavrilenko
Copy link

@natgavrilenko natgavrilenko commented Feb 4, 2025

This commit aligns OpControlBarrier semantics validation with the Vulkan memory model. It disallows combining a relaxed memory order with non-zero storage class semantics in the Vulkan target environment. To my knowledge, this combination is not generated by any compiler.

@natgavrilenko natgavrilenko marked this pull request as ready for review February 6, 2025 08:50
if (opcode == spv::Op::OpControlBarrier && value) {
if (!num_memory_order_set_bits) {
return _.diag(SPV_ERROR_INVALID_DATA, inst)
<< _.VkErrorID(4649) << spvOpcodeString(opcode)
Copy link
Contributor

Choose a reason for hiding this comment

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

This VUID does not exist. There needs to be a Vulkan-Docs PR to add this rule, at which point a VUID will be assigned.

Copy link
Author

Choose a reason for hiding this comment

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

Copy link
Contributor

@spencer-lunarg spencer-lunarg Feb 12, 2025

Choose a reason for hiding this comment

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

it might take awhile (like 2 or 3 weeks) to get the VUID in and upstreamed, I am happy to come back here and apply it, but for the short term, just remove VkErrorID() here, and the 4649 stuff everywhere else

Copy link
Author

Choose a reason for hiding this comment

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

I think waiting 2–3 weeks should be fine. The main change in this PR is adding a new validation rule, and without the new VUID, there wouldn’t be much left.

natgavrilenko pushed a commit to natgavrilenko/Vulkan-Docs that referenced this pull request Feb 11, 2025
Add a new VUID for a relaxed control barrier with non-zero storage
class semantics. PR in SPIRV-Tools:
KhronosGroup/SPIRV-Tools#5984

Signed-off-by: Natalia Gavrilenko <[email protected]>
natgavrilenko added a commit to natgavrilenko/Vulkan-Docs that referenced this pull request Feb 11, 2025
Add a new VUID for a relaxed control barrier with non-zero storage
class semantics. PR in SPIRV-Tools:
KhronosGroup/SPIRV-Tools#5984

Signed-off-by: Natalia Gavrilenko <[email protected]>
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.

3 participants