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

It fails with: ralloc.c:95: get_header: Assertion `info->canary == CANARY' failed. Aborted (core dumped) #4

Open
Boscop opened this issue Dec 4, 2020 · 0 comments

Comments

@Boscop
Copy link

Boscop commented Dec 4, 2020

Thanks for this library :)
I'm trying to use it to optimize GLSL that resulted from Rust being compiled to SPIR-V and then to GLSL.
But it fails in this line:

assert(info->canary == CANARY);

GLSL optimization log:
0:63(40): warning: `_77' used uninitialized
0:64(40): warning: `_77' used uninitialized
0:65(40): warning: `_77' used uninitialized
0:70(20): warning: `_71' used uninitialized
0:74(20): warning: `_71' used uninitialized
0:78(20): warning: `_72' used uninitialized
0:89(69): warning: `_100' used uninitialized
0:90(20): warning: `_72' used uninitialized
0:96(20): warning: `_72' used uninitialized
0:107(80): warning: `_101' used uninitialized
0:108(20): warning: `_72' used uninitialized
0:114(20): warning: `_72' used uninitialized
0:120(20): warning: `_72' used uninitialized
0:126(20): warning: `_73' used uninitialized
0:146(20): warning: `_71' used uninitialized

rustoy: glsl-optimizer/src/util/ralloc.c:95: get_header: Assertion `info->canary == CANARY' failed.
Aborted (core dumped)

This is the GLSL code:
https://dpaste.com/5XGJTHTV8
(The same happens when I use #version 120 as compilation target.)

Any idea how to make it work? :)


Btw, I'm calling it through the glslopt crate like this:

pub fn optimize_glsl(glsl: String) -> Result<String> {
    let res = Context::new(Target::OpenGles30).optimize(ShaderType::Fragment, glsl);
    println!("GLSL optimization log:\n{}", res.get_log());
    ensure!(res.get_status(), "GLSL optimization failed. bad status");
    let glsl = res.get_output()?.to_string();
    Ok(glsl)
}
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