summaryrefslogtreecommitdiffstats
path: root/src/video_core/host_shaders
diff options
context:
space:
mode:
authorReinUsesLisp <reinuseslisp@airmail.cc>2020-12-30 05:44:09 +0100
committerReinUsesLisp <reinuseslisp@airmail.cc>2020-12-30 05:44:09 +0100
commit5169ce9fcd6240f5aaa639786e82f6589d917907 (patch)
tree40ad76d86fa12e9f5a127f7553f215d8f45d9aaf /src/video_core/host_shaders
parenthost_shaders: Add pitch linear upload compute shader (diff)
downloadyuzu-5169ce9fcd6240f5aaa639786e82f6589d917907.tar
yuzu-5169ce9fcd6240f5aaa639786e82f6589d917907.tar.gz
yuzu-5169ce9fcd6240f5aaa639786e82f6589d917907.tar.bz2
yuzu-5169ce9fcd6240f5aaa639786e82f6589d917907.tar.lz
yuzu-5169ce9fcd6240f5aaa639786e82f6589d917907.tar.xz
yuzu-5169ce9fcd6240f5aaa639786e82f6589d917907.tar.zst
yuzu-5169ce9fcd6240f5aaa639786e82f6589d917907.zip
Diffstat (limited to 'src/video_core/host_shaders')
-rw-r--r--src/video_core/host_shaders/CMakeLists.txt1
-rw-r--r--src/video_core/host_shaders/full_screen_triangle.vert29
2 files changed, 30 insertions, 0 deletions
diff --git a/src/video_core/host_shaders/CMakeLists.txt b/src/video_core/host_shaders/CMakeLists.txt
index 1983e7dc9..5770c4761 100644
--- a/src/video_core/host_shaders/CMakeLists.txt
+++ b/src/video_core/host_shaders/CMakeLists.txt
@@ -1,6 +1,7 @@
set(SHADER_FILES
block_linear_unswizzle_2d.comp
block_linear_unswizzle_3d.comp
+ full_screen_triangle.vert
opengl_present.frag
opengl_present.vert
pitch_unswizzle.comp
diff --git a/src/video_core/host_shaders/full_screen_triangle.vert b/src/video_core/host_shaders/full_screen_triangle.vert
new file mode 100644
index 000000000..452ad6502
--- /dev/null
+++ b/src/video_core/host_shaders/full_screen_triangle.vert
@@ -0,0 +1,29 @@
+// Copyright 2020 yuzu Emulator Project
+// Licensed under GPLv2 or any later version
+// Refer to the license.txt file included.
+
+#version 450
+
+#ifdef VULKAN
+#define BEGIN_PUSH_CONSTANTS layout(push_constant) uniform PushConstants {
+#define END_PUSH_CONSTANTS };
+#define UNIFORM(n)
+#else // ^^^ Vulkan ^^^ // vvv OpenGL vvv
+#define BEGIN_PUSH_CONSTANTS
+#define END_PUSH_CONSTANTS
+#define UNIFORM(n) layout (location = n) uniform
+#endif
+
+BEGIN_PUSH_CONSTANTS
+UNIFORM(0) vec2 tex_scale;
+UNIFORM(1) vec2 tex_offset;
+END_PUSH_CONSTANTS
+
+layout(location = 0) out vec2 texcoord;
+
+void main() {
+ float x = float((gl_VertexIndex & 1) << 2);
+ float y = float((gl_VertexIndex & 2) << 1);
+ gl_Position = vec4(x - 1.0, y - 1.0, 0.0, 1.0);
+ texcoord = fma(vec2(x, y) / 2.0, tex_scale, tex_offset);
+}