summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/shaders/triangle.frag9
-rw-r--r--src/shaders/triangle.vs18
2 files changed, 27 insertions, 0 deletions
diff --git a/src/shaders/triangle.frag b/src/shaders/triangle.frag
new file mode 100644
index 0000000..76dae17
--- /dev/null
+++ b/src/shaders/triangle.frag
@@ -0,0 +1,9 @@
+#version 450
+
+#extension GL_ARB_seperate_shader_objects : enable
+
+layout(location = 0) out vec4 outColor;
+
+void main() {
+ outColor = vec4(1.0 0.0, 0.0, 1.0);
+}
diff --git a/src/shaders/triangle.vs b/src/shaders/triangle.vs
new file mode 100644
index 0000000..ef28c81
--- /dev/null
+++ b/src/shaders/triangle.vs
@@ -0,0 +1,18 @@
+#version 450
+
+Extension GL_ARB_seperate_shader_objects : enable
+
+out gl_PerVertex {
+ vec4 gl_Position;
+};
+
+// Vertex buffers are hard in Vk fuuccck..
+vec2 positions[3] = vec2[](
+ vec2(0.0, -0.5),
+ vec2(0.5, 0.5),
+ vec2(-0.5, 0.5)
+);
+
+void main() {
+ gl_Position = vec4(positions[gl_VertexIndex], 0.0, 1.0);
+}