vulkano
vulkano copied to clipboard
A struct with an aray in a glsl shader will crash vulkano-shaders
= help: message: called `Option::unwrap()` on a `None` value
happens on src/structs.rs:526
is this a fixed length array? Can you provide the binding code used in your shader with the struct declaration.
Yes sorry I should have said that. It was a fixed length array, I can easily reproduce the bug by pasting the following comment in the vulkan-shaders documentation and running cargo test:
mod vs {
vulkano_shaders::shader!{
ty: "vertex",
src: "
#version 450
layout(location = 0) in vec3 position;
struct A {
vec3 ar[3];
};
void main() {
A a;
gl_Position = vec4(a.ar[0], 1.0);
}"
}
}
# fn main() {}
The struct has to be used in order for the error to appear.
@AustinJ235 any idea?
If it were a vec4 instead would it work? Might be a stride issue.
I've tried a vec4 array with 4 elements and the same happens
Does this problem still occur with the newest version of Vulkano?
Does this problem still occur with the newest version of Vulkano?
I'm able to reproduce it in the latest version cloned from master
This was fixed in #1945.