Closed chaynabors closed 1 month ago
Update: cloning and removing the check causes my code to work as written at first glance. On one hand I'd propose removing the check. On the other, the generated struct might depend on its decorations. If there's an offset on the zeroth member, you might either want padding or no padding before it. You might choose to support this offset for push constants and not other types but I don't see any way to discriminate against that
Template
main.rs
file that demonstrates the issue: TODOIssue
I have two definitions of push constants, one from my vertex shader, and one from my fragment shader. I'd like to use the types provided by the shader macro with each occupying different push constant memory. It's my understanding that to do this, I have to do something like the following:
note that the offset is defined for the zeroth field in this screenshot from https://docs.vulkan.org/guide/latest/push_constants.html#pc-offsets![image](https://github.com/vulkano-rs/vulkano/assets/25893753/7b7bb76e-9ade-42d6-88a7-dcc999d84545)
relevant code is here https://github.com/vulkano-rs/vulkano/blob/42e4d0b7c3ff742d81339cadfd291257ee864110/vulkano-shaders/src/structs.rs#L850
The shader macro errors out when a shader contains push constants with the zeroth field is decorated with
offset
. Am I misunderstanding something here or is this a bug?