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

spirv-val: Add OpPtrAccessChain Base checks #4965

Merged
merged 5 commits into from
Oct 24, 2022

Conversation

sjfricke
Copy link
Contributor

adds VUID-StandaloneSpirv-Base-04707 and the SPIR-V spec for Shader saying

Each OpPtrAccessChain must have a Base whose type is decorated with ArrayStride.

Copy link
Contributor

@alan-baker alan-baker left a comment

Choose a reason for hiding this comment

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

The ArrayStride check is too restrictive.

source/val/validate_memory.cpp Outdated Show resolved Hide resolved
source/val/validate_memory.cpp Outdated Show resolved Hide resolved
Copy link
Contributor

@alan-baker alan-baker left a comment

Choose a reason for hiding this comment

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

I don't think the build failures are caused by this change.

source/val/validate_memory.cpp Outdated Show resolved Hide resolved
Comment on lines 1449 to 1453
} else if (base_type_storage_class ==
SpvStorageClassPhysicalStorageBuffer) {
if (_.addressing_model() != SpvAddressingModelPhysicalStorageBuffer64) {
Copy link
Contributor

Choose a reason for hiding this comment

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

This feels like the wrong spot for this check. This probably belongs in the validation of OpTypePointer.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

So the VUID was for a OpPtrAccessChain who's Base's is using PhysicalStorageBuffer so I guess not sure how I would be able to check that in OpTypePointer

Copy link
Contributor

Choose a reason for hiding this comment

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

Well in the SPIR-V spec for the physical storage buffer rules it says:

If the addressing model is not PhysicalStorageBuffer64, then the PhysicalStorageBuffer storage class must not be used.

That's why I suggested OpTypePointer. It will catch more cases.

Copy link
Contributor

Choose a reason for hiding this comment

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

Ok I see, I agree, I think the VUID-StandaloneSpirv-Base-04707 probably could just be reworded, going to remove this check from this PR (and make a new PR with it in OpTypePointer and have more tests aimmed towards that) and going to remove the VUID label as it will probably get a new one after my purposed spec clarification

@alan-baker alan-baker merged commit 0ebf830 into KhronosGroup:master Oct 24, 2022
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.

None yet

4 participants