Add build.rs
This commit is contained in:
@@ -1,3 +1,5 @@
|
||||
#!/bin/bash
|
||||
|
||||
glslangValidator --spirv-val --spirv-dis -g0 -S frag --target-env vulkan1.3 --quiet src/trace.frag.glsl > src/trace.spv-dis
|
||||
sed -i '/%11 =/,/OpFunctionEnd/d' src/trace.spv-dis
|
||||
sed -i 's/%11\b/%1000/g' src/trace.spv-dis
|
||||
|
||||
@@ -0,0 +1,27 @@
|
||||
use std::{fs::read_dir, io::Write, process::Command};
|
||||
|
||||
fn main() {
|
||||
//let mut output = std::fs::File::create("output.txt").unwrap();
|
||||
println!("cargo:rerun-if-changed=build.rs");
|
||||
println!("cargo:rerun-if-changed=Cargo.lock");
|
||||
let paths = read_dir("src").unwrap();
|
||||
for path in paths {
|
||||
if let Ok(path) = path {
|
||||
if path
|
||||
.path()
|
||||
.extension()
|
||||
.map(|ext| ext == "glsl")
|
||||
.unwrap_or(false)
|
||||
{
|
||||
println!("cargo::rerun-if-changed={}", path.path().display());
|
||||
//writeln!(output, "cargo::rerun-if-changed={}",
|
||||
// path.path().display()).unwrap();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Command::new("bash")
|
||||
.arg("assemble_trace.sh")
|
||||
.status()
|
||||
.expect("Failed to assemble header shaders");
|
||||
}
|
||||
Reference in New Issue
Block a user