feat: basic triangle rendering
This commit is contained in:
parent
f215c10d0e
commit
43f8f46021
11 changed files with 1828 additions and 67 deletions
26
build.rs
Normal file
26
build.rs
Normal file
|
@ -0,0 +1,26 @@
|
|||
use std::{env, process::Command};
|
||||
|
||||
fn main() {
|
||||
println!("cargo::rerun-if-changed=shaders");
|
||||
let outdir = env::var("OUT_DIR").unwrap();
|
||||
let vert = Command::new("glslc")
|
||||
.args(["shaders/shader.vert", "-o", &format!("{outdir}/vert.spv")])
|
||||
.output()
|
||||
.expect("Failed to execute 'glslc'");
|
||||
let frag = Command::new("glslc")
|
||||
.args(["shaders/shader.frag", "-o", &format!("{outdir}/frag.spv")])
|
||||
.output()
|
||||
.expect("Failed to execute 'glslc'");
|
||||
if !vert.status.success() {
|
||||
panic!(
|
||||
"Failed to compile vertex shader: {}",
|
||||
String::from_utf8(vert.stderr).unwrap()
|
||||
)
|
||||
}
|
||||
if !frag.status.success() {
|
||||
panic!(
|
||||
"Failed to compile fragment shader: {}",
|
||||
String::from_utf8(frag.stderr).unwrap()
|
||||
)
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue