1
0
mirror of synced 2025-11-09 12:57:13 +00:00

initial commit

This commit is contained in:
Tom Gowan
2019-04-26 13:00:38 +10:00
commit 0755b4f807
16 changed files with 651 additions and 0 deletions

13
examples/compile.rs Normal file
View 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);
}

View 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);
}

View 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);
}