aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/video_core/renderer_opengl/gl_shaders.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/video_core/renderer_opengl/gl_shaders.h')
-rw-r--r--src/video_core/renderer_opengl/gl_shaders.h39
1 files changed, 39 insertions, 0 deletions
diff --git a/src/video_core/renderer_opengl/gl_shaders.h b/src/video_core/renderer_opengl/gl_shaders.h
new file mode 100644
index 00000000..f84424c4
--- /dev/null
+++ b/src/video_core/renderer_opengl/gl_shaders.h
@@ -0,0 +1,39 @@
+// Copyright 2014 Citra Emulator Project
+// Licensed under GPLv2
+// Refer to the license.txt file included.
+
+#pragma once
+
+namespace GLShaders {
+
+static const char g_vertex_shader[] = R"(
+#version 330 core
+layout(location = 0) in vec3 position;
+layout(location = 1) in vec2 texCoord;
+
+out vec2 UV;
+
+mat3 window_scale = mat3(
+ vec3(1.0, 0.0, 0.0),
+ vec3(0.0, 5.0/6.0, 0.0), // TODO(princesspeachum): replace hard-coded aspect with uniform
+ vec3(0.0, 0.0, 1.0)
+ );
+
+void main() {
+ gl_Position.xyz = window_scale * position;
+ gl_Position.w = 1.0;
+
+ UV = texCoord;
+})";
+
+static const char g_fragment_shader[] = R"(
+#version 330 core
+in vec2 UV;
+out vec3 color;
+uniform sampler2D sampler;
+
+void main() {
+ color = texture(sampler, UV).rgb;
+})";
+
+}