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

[glsl-in] Parsing error with layout qualifiers on interface block members #801

Closed
Herschel opened this issue Apr 29, 2021 · 1 comment
Closed

Comments

@Herschel
Copy link

The following is unable to parse the layout(offset = 64) qualifier on the uniform block member:

color.frag.zip

#version 450

layout(location=0) in vec4 frag_color;

// Push constants: matrix + color
layout(push_constant) uniform FragmentPushConstants {
    layout(offset = 64) vec4 mult_color;
    vec4 add_color;
};

layout(location=0) out vec4 out_color;

void main() {
    out_color = mult_color * frag_color + add_color;
}
cargo run --features glsl-in,spv-out -- color.frag color.out.vert.spv

    Finished dev [unoptimized + debuginfo] target(s) in 0.04s
     Running `target\debug\naga.exe color.frag color.out.vert.spv`
[C:\Users\Michael Welsh\.cargo\registry\src\github.com-1ecc6299db9ec823\pp-rs-0.1.0\src\lexer.rs:370] &raw = "450"
[C:\Users\Michael Welsh\.cargo\registry\src\github.com-1ecc6299db9ec823\pp-rs-0.1.0\src\lexer.rs:375] integer_radix = 10
[C:\Users\Michael Welsh\.cargo\registry\src\github.com-1ecc6299db9ec823\pp-rs-0.1.0\src\lexer.rs:376] &raw = "450"
[C:\Users\Michael Welsh\.cargo\registry\src\github.com-1ecc6299db9ec823\pp-rs-0.1.0\src\lexer.rs:370] &raw = "0"
[C:\Users\Michael Welsh\.cargo\registry\src\github.com-1ecc6299db9ec823\pp-rs-0.1.0\src\lexer.rs:375] integer_radix = 10
[C:\Users\Michael Welsh\.cargo\registry\src\github.com-1ecc6299db9ec823\pp-rs-0.1.0\src\lexer.rs:376] &raw = "0"
[C:\Users\Michael Welsh\.cargo\registry\src\github.com-1ecc6299db9ec823\pp-rs-0.1.0\src\lexer.rs:370] &raw = "0"
[C:\Users\Michael Welsh\.cargo\registry\src\github.com-1ecc6299db9ec823\pp-rs-0.1.0\src\lexer.rs:375] integer_radix = 10
[C:\Users\Michael Welsh\.cargo\registry\src\github.com-1ecc6299db9ec823\pp-rs-0.1.0\src\lexer.rs:376] &raw = "0"
[C:\Users\Michael Welsh\.cargo\registry\src\github.com-1ecc6299db9ec823\pp-rs-0.1.0\src\lexer.rs:370] &raw = "0"
[C:\Users\Michael Welsh\.cargo\registry\src\github.com-1ecc6299db9ec823\pp-rs-0.1.0\src\lexer.rs:375] integer_radix = 10
[C:\Users\Michael Welsh\.cargo\registry\src\github.com-1ecc6299db9ec823\pp-rs-0.1.0\src\lexer.rs:376] &raw = "0"
Type [2] 'FragmentPushConstants' is invalid:
        Structure member[0] at 0 and size 16 crosses the structure boundary
thread 'main' panicked at 'called `Option::unwrap()` on a `None` value', bin/naga.rs:230:61
stack backtrace:
   0: std::panicking::begin_panic_handler
             at /rustc/2fd73fabe469357a12c2c974c140f67e7cdd76d0\/library\std\src\panicking.rs:493
   1: core::panicking::panic_fmt
             at /rustc/2fd73fabe469357a12c2c974c140f67e7cdd76d0\/library\core\src\panicking.rs:92
   2: core::panicking::panic
             at /rustc/2fd73fabe469357a12c2c974c140f67e7cdd76d0\/library\core\src\panicking.rs:50
   3: core::option::Option<naga::valid::ModuleInfo*>::unwrap<naga::valid::ModuleInfo*>
             at C:\Users\Michael Welsh\.rustup\toolchains\stable-x86_64-pc-windows-msvc\lib\rustlib\src\rust\library\core\src\option.rs:386
   4: naga::main
             at .\bin\naga.rs:230
   5: core::ops::function::FnOnce::call_once<fn(),tuple<>>
             at C:\Users\Michael Welsh\.rustup\toolchains\stable-x86_64-pc-windows-msvc\lib\rustlib\src\rust\library\core\src\ops\function.rs:227
note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.
error: process didn't exit successfully: `target\debug\naga.exe color.frag color.out.vert.spv` (exit code: 101)

naga @ 93e57ff

@Herschel
Copy link
Author

Looks like this is a dupe of #282, sorry! Closing in favor of that issue.

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

1 participant