aboutsummaryrefslogtreecommitdiff
path: root/src/frontend/qt_sdl/main_shaders.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/frontend/qt_sdl/main_shaders.h')
-rw-r--r--src/frontend/qt_sdl/main_shaders.h28
1 files changed, 9 insertions, 19 deletions
diff --git a/src/frontend/qt_sdl/main_shaders.h b/src/frontend/qt_sdl/main_shaders.h
index 7c4feec..2e57e59 100644
--- a/src/frontend/qt_sdl/main_shaders.h
+++ b/src/frontend/qt_sdl/main_shaders.h
@@ -21,12 +21,8 @@
const char* kScreenVS = R"(#version 140
-layout(std140) uniform uConfig
-{
- vec2 uScreenSize;
- uint u3DScale;
- uint uFilterMode;
-};
+uniform vec2 uScreenSize;
+uniform mat2x3 uTransform;
in vec2 vPosition;
in vec2 vTexcoord;
@@ -36,7 +32,10 @@ smooth out vec2 fTexcoord;
void main()
{
vec4 fpos;
- fpos.xy = ((vPosition * 2.0) / uScreenSize) - 1.0;
+
+ fpos.xy = vec3(vPosition, 1.0) * uTransform;
+
+ fpos.xy = ((fpos.xy * 2.0) / uScreenSize) - 1.0;
fpos.y *= -1;
fpos.z = 0.0;
fpos.w = 1.0;
@@ -48,14 +47,7 @@ void main()
const char* kScreenFS = R"(#version 140
-layout(std140) uniform uConfig
-{
- vec2 uScreenSize;
- uint u3DScale;
- uint uFilterMode;
-};
-
-uniform usampler2D ScreenTex;
+uniform sampler2D ScreenTex;
smooth in vec2 fTexcoord;
@@ -63,11 +55,9 @@ out vec4 oColor;
void main()
{
- ivec4 pixel = ivec4(texelFetch(ScreenTex, ivec2(fTexcoord), 0));
-
- // TODO: filters
+ vec4 pixel = texture2D(ScreenTex, fTexcoord);
- oColor = vec4(vec3(pixel.bgr) / 255.0, 1.0);
+ oColor = vec4(pixel.bgr, 1.0);
}
)";