Continue vulkan c++ tutorial
Some checks failed
Build legacy Nix package on Ubuntu / build (push) Failing after 0s
Some checks failed
Build legacy Nix package on Ubuntu / build (push) Failing after 0s
This commit is contained in:
parent
81e4212d8e
commit
b2d28ef408
9 changed files with 156 additions and 3 deletions
24
build.rs
Normal file
24
build.rs
Normal file
|
@ -0,0 +1,24 @@
|
|||
use std::process::Command;
|
||||
|
||||
fn main() {
|
||||
for shader in glob::glob("res/shaders/*").unwrap().filter_map(Result::ok) {
|
||||
if !shader.is_file() {
|
||||
continue;
|
||||
}
|
||||
|
||||
let shader_file_name = shader.to_str().unwrap();
|
||||
|
||||
let mut command = Command::new("glslc");
|
||||
command.arg(&shader);
|
||||
|
||||
let out_file = match shader.extension().unwrap().to_str().unwrap() {
|
||||
"vert" => shader_file_name.replace(".vert", ".vert.spv"),
|
||||
"frag" => shader_file_name.replace(".frag", ".frag.spv"),
|
||||
_ => continue,
|
||||
};
|
||||
|
||||
command.arg("-o");
|
||||
command.arg(out_file);
|
||||
command.output().unwrap();
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue