From 01ac1b3060a094646d2d5fab32099a8cfffba9e4 Mon Sep 17 00:00:00 2001 From: Edward O'Callaghan Date: Tue, 7 Feb 2017 22:05:06 +1100 Subject: src/shaders: Add GLSL sourcecode Signed-off-by: Edward O'Callaghan --- src/shaders/triangle.frag | 9 +++++++++ src/shaders/triangle.vs | 18 ++++++++++++++++++ 2 files changed, 27 insertions(+) create mode 100644 src/shaders/triangle.frag create mode 100644 src/shaders/triangle.vs (limited to 'src') 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); +} -- cgit v1.2.3