From 1659d5974eceb45a8ed4c3cbf06630322cb258e7 Mon Sep 17 00:00:00 2001 From: Jonathan Li Date: Sun, 25 Oct 2015 14:02:16 +0000 Subject: [PATCH] gsdx-ogl: Fix scanline, diagonal, triangular TV shaders PSin.p is normalised, so integer conversions won't work. Use gl_FragCoord instead. --- plugins/GSdx/res/glsl/convert.glsl | 6 +++--- plugins/GSdx/res/glsl_source.h | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/plugins/GSdx/res/glsl/convert.glsl b/plugins/GSdx/res/glsl/convert.glsl index 269ae707dc..18bd32aeeb 100644 --- a/plugins/GSdx/res/glsl/convert.glsl +++ b/plugins/GSdx/res/glsl/convert.glsl @@ -326,7 +326,7 @@ vec4 ps_scanlines(uint i) void ps_main5() // scanlines { - highp uvec4 p = uvec4(PSin_p); + highp uvec4 p = uvec4(gl_FragCoord); vec4 c = ps_scanlines(p.y % 2u); @@ -337,7 +337,7 @@ void ps_main5() // scanlines #ifdef ps_main6 void ps_main6() // diagonal { - highp uvec4 p = uvec4(PSin_p); + highp uvec4 p = uvec4(gl_FragCoord); vec4 c = ps_crt((p.x + (p.y % 3u)) % 3u); @@ -348,7 +348,7 @@ void ps_main6() // diagonal #ifdef ps_main8 void ps_main8() // triangular { - highp uvec4 p = uvec4(PSin_p); + highp uvec4 p = uvec4(gl_FragCoord); vec4 c = ps_crt(((p.x + ((p.y >> 1u) & 1u) * 3u) >> 1u) % 3u); diff --git a/plugins/GSdx/res/glsl_source.h b/plugins/GSdx/res/glsl_source.h index 7c51bcf9fe..6678ec833c 100644 --- a/plugins/GSdx/res/glsl_source.h +++ b/plugins/GSdx/res/glsl_source.h @@ -351,7 +351,7 @@ static const char* convert_glsl = "\n" "void ps_main5() // scanlines\n" "{\n" - " highp uvec4 p = uvec4(PSin_p);\n" + " highp uvec4 p = uvec4(gl_FragCoord);\n" "\n" " vec4 c = ps_scanlines(p.y % 2u);\n" "\n" @@ -362,7 +362,7 @@ static const char* convert_glsl = "#ifdef ps_main6\n" "void ps_main6() // diagonal\n" "{\n" - " highp uvec4 p = uvec4(PSin_p);\n" + " highp uvec4 p = uvec4(gl_FragCoord);\n" "\n" " vec4 c = ps_crt((p.x + (p.y % 3u)) % 3u);\n" "\n" @@ -373,7 +373,7 @@ static const char* convert_glsl = "#ifdef ps_main8\n" "void ps_main8() // triangular\n" "{\n" - " highp uvec4 p = uvec4(PSin_p);\n" + " highp uvec4 p = uvec4(gl_FragCoord);\n" "\n" " vec4 c = ps_crt(((p.x + ((p.y >> 1u) & 1u) * 3u) >> 1u) % 3u);\n" "\n"