You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Oct 31, 2025. It is now read-only.
Repository navigation
This repository was archived by the owner on Oct 31, 2025. It is now read-only.
PushConstant not being OpTypeStruct is invalid on Vulkan hosts #362
Quoth Baldur (hope he doesn't mind I post it here):
BTW I also noticed some invalid SPIR-V in your shader which may also affect this, you have a PushConstant storage class variable defined that is not an OpTypeStruct. All uniforms and push constant variables must be struct pointers with explicitly laid out structs.
Thank you for your issue! While I'm not doubting that is the case, I cannot find any reference in the SPIR-V spec that lays out that requirement. Perhaps they could expand further? @baldurk
Composite objects in the UniformConstant, Uniform, and PushConstant Storage Classes must be explicitly laid out. The following apply to all the aggregate and matrix types describing such an object, recursively through their nested types
Where composite is defined as "An aggregate, a matrix, or a vector.", which would imply to me that this is not a requirement for those storage classes containing scalars.
changed the title [-]Slightly invalid SPIR-V (PushConstant not OpTypeStruct), according to BaldurK[/-][+]PushConstant not being OpTypeStruct is invalid on Vulkan hosts[/+]on Jan 5, 2021
Activity
XAMPPRocky commentedon Jan 5, 2021
Thank you for your issue! While I'm not doubting that is the case, I cannot find any reference in the SPIR-V spec that lays out that requirement. Perhaps they could expand further? @baldurk
The closest thing I could find is the following:
Where composite is defined as "An aggregate, a matrix, or a vector.", which would imply to me that this is not a requirement for those storage classes containing scalars.
msiglreith commentedon Jan 5, 2021
@XAMPPRocky That's probably referred to using Vulkan as host which comes with its own set of requirements and constraints:
https://vulkan.lunarg.com/doc/view/1.2.131.1/mac/chunked_spec/chap14.html#interfaces-resources-pushconst
hrydgard commentedon Jan 5, 2021
That's a good catch @msiglreith !
Given how we want to use rust-gpu, having an option to, or at least initially, always following Vulkan's extra rules seems like the way to go.
[-]Slightly invalid SPIR-V (PushConstant not OpTypeStruct), according to BaldurK[/-][+]PushConstant not being OpTypeStruct is invalid on Vulkan hosts[/+]khyperia commentedon Oct 28, 2021
I believe this was fixed by two things:
FnAbis to remove unsupportedPassModes, via query hooks. #766#[spirv(push_constant)] asdf: &f32) - fixed by wrapping everything in a struct Deprecate#[spirv(block)]and auto-wrap in "interface blocks" instead. #576