google / shaderc-rs

Rust bindings for the shaderc library.
https://docs.rs/shaderc
Apache License 2.0
261 stars 64 forks source link

Problems to compile simple shader #73

Closed jkvargas closed 3 years ago

jkvargas commented 4 years ago

Hey guys, Actually I just need some tips. I am trying to compile a very simple shader using your solution and I am getting an error which using the command line tool glslc I don't have. 2020-04-11 23:22:37.189893+0100 rustgraphics[53825:2886692] flock failed to lock maps file: errno = 35 thread 'main' panicked at 'calledResult::unwrap()on anErrvalue: Render("2 compilation errors:\n/Users/jhonnyvargas/dev/rustgraphics/src/vert.glsl:8: error: \'gl_VertexIndex\' : undeclared identifier\n/Users/jhonnyvargas/dev/rustgraphics/src/vert.glsl:8: error: \'&\' : wrong operand types: no operation \'&\' exists that takes a left-hand operand of type \' temp float\' and a right operand of type \' const int\' (or there is no acceptable conversion)\n")', src/renderer/shader.rs:35:9 stack backtrace:

this is how I am compiling https://github.com/jkvargas/ruststudy/blob/master/src/renderer/shader.rs and this is the shader itself: https://github.com/jkvargas/ruststudy/blob/master/src/vert.glsl

by the way I am on a MacOS 10.15.4 and my toolchain is stable-x86_64-apple-darwin unchanged - rustc 1.42.0 (b8cedc004 2020-03-09)

antiagainst commented 4 years ago

Hey @jkvargas, so I'm looking at your code. Shouldn't this line be using ShaderKind::Vertex? https://github.com/jkvargas/ruststudy/blob/master/src/main.rs#L38

antiagainst commented 3 years ago

Closing given no response for a while.