summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorEdward O'Callaghan <funfunctor@folklore1984.net>2017-02-07 22:05:06 +1100
committerEdward O'Callaghan <funfunctor@folklore1984.net>2017-02-07 22:05:06 +1100
commit01ac1b3060a094646d2d5fab32099a8cfffba9e4 (patch)
tree9a3886eb75df0637edd23a9f68c9f3c97c35b02a /src
parentfd1f26b416cf7b2bb8cd47acca7e097a48a2ff06 (diff)
src/shaders: Add GLSL sourcecode
Signed-off-by: Edward O'Callaghan <funfunctor@folklore1984.net>
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);
+}