working generating camera rays from view and proj matrices

This commit is contained in:
Piotrek
2021-04-15 08:55:26 +02:00
parent 8094d8168d
commit b52193df28
10 changed files with 51 additions and 44 deletions
+8 -3
View File
@@ -58,9 +58,14 @@ fn main() {
let mut compiler = shaderc::Compiler::new().expect("Unable to create shader compiler");
for shader in shaders {
println!("cargo:rerun-if-changed={}", shader.src_path.as_os_str().to_str().unwrap());
let compiled = compiler.compile_into_spirv(&shader.source, shader.kind, &shader.src_path.to_str().unwrap(), "main", Some(&options))
.expect("Shader error:");
write(shader.spv_path, compiled.as_binary_u8()).unwrap();
let result = compiler.compile_into_spirv(&shader.source, shader.kind, &shader.src_path.to_str().unwrap(), "main", Some(&options));
match result {
Err(err) => { panic!("Failed: {}", err); },
Ok(data) => {
write(shader.spv_path, data.as_binary_u8()).unwrap();
}
}
}
// Rebuild if any of the cginc change