initial commit
This commit is contained in:
13
examples/compile.rs
Normal file
13
examples/compile.rs
Normal file
@@ -0,0 +1,13 @@
|
||||
use shade_runner as sr;
|
||||
use std::path::PathBuf;
|
||||
|
||||
fn main() {
|
||||
let project_root = std::env::current_dir().expect("failed to get root directory");
|
||||
let mut vert_path = project_root.clone();
|
||||
vert_path.push(PathBuf::from("examples/shaders/vert.glsl"));
|
||||
let mut frag_path = project_root.clone();
|
||||
frag_path.push(PathBuf::from("examples/shaders/frag.glsl"));
|
||||
let shader = sr::load(vert_path, frag_path).expect("Failed to compile");
|
||||
let vulkano_entry = sr::parse(&shader);
|
||||
dbg!(vulkano_entry);
|
||||
}
|
||||
7
examples/shaders/frag.glsl
Normal file
7
examples/shaders/frag.glsl
Normal file
@@ -0,0 +1,7 @@
|
||||
#version 450
|
||||
|
||||
layout(location = 0) out vec4 f_color;
|
||||
|
||||
void main() {
|
||||
f_color = vec4(0.0, 0.5, 1.0, 1.0);
|
||||
}
|
||||
10
examples/shaders/vert.glsl
Normal file
10
examples/shaders/vert.glsl
Normal file
@@ -0,0 +1,10 @@
|
||||
#version 450
|
||||
|
||||
layout(location = 0) in vec2 position;
|
||||
|
||||
void main() {
|
||||
vec2 p = position;
|
||||
p.x += 0.2;
|
||||
gl_Position = vec4(p, 0.0, 1.0);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user