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

A struct with an aray in a glsl shader will crash vulkano-shaders #1683

Closed
pac85 opened this issue Aug 26, 2021 · 8 comments
Closed

A struct with an aray in a glsl shader will crash vulkano-shaders #1683

pac85 opened this issue Aug 26, 2021 · 8 comments

Comments

@pac85
Copy link
Contributor

pac85 commented Aug 26, 2021

= help: message: called `Option::unwrap()` on a `None` value

happens on src/structs.rs:526

@AustinJ235
Copy link
Member

AustinJ235 commented Aug 26, 2021

is this a fixed length array? Can you provide the binding code used in your shader with the struct declaration.

@pac85
Copy link
Contributor Author

pac85 commented Sep 4, 2021

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.

@Rua
Copy link
Contributor

Rua commented Sep 30, 2021

@AustinJ235 any idea?

@AustinJ235
Copy link
Member

If it were a vec4 instead would it work? Might be a stride issue.

@pac85
Copy link
Contributor Author

pac85 commented Oct 6, 2021

I've tried a vec4 array with 4 elements and the same happens

@Rua
Copy link
Contributor

Rua commented May 14, 2022

Does this problem still occur with the newest version of Vulkano?

@pac85
Copy link
Contributor Author

pac85 commented May 16, 2022

Does this problem still occur with the newest version of Vulkano?

I'm able to reproduce it in the latest version cloned from master

@marc0246
Copy link
Contributor

marc0246 commented Jul 7, 2023

This was fixed in #1945.

@marc0246 marc0246 closed this as completed Jul 7, 2023
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

No branches or pull requests

4 participants