From 9708e5bba9ea413288fa76ede33c94e186b353db Mon Sep 17 00:00:00 2001
From: Vicki Pfau <vi@endrift.com>
Date: Sat, 17 Jun 2017 18:08:44 -0700
Subject: [PATCH] Res: Fix some shader woes

---
 res/shaders/agb001.shader/manifest.ini | 4 ++--
 res/shaders/ags001.shader/manifest.ini | 8 ++++----
 res/shaders/fish.shader/fish.fs        | 8 ++------
 res/shaders/wiiu.shader/manifest.ini   | 4 ++--
 4 files changed, 10 insertions(+), 14 deletions(-)

diff --git a/res/shaders/agb001.shader/manifest.ini b/res/shaders/agb001.shader/manifest.ini
index 62280af9f..4c1a8f5b3 100644
--- a/res/shaders/agb001.shader/manifest.ini
+++ b/res/shaders/agb001.shader/manifest.ini
@@ -7,5 +7,5 @@ passes=1
 [pass.0]
 fragmentShader=agb001.fs
 blend=1
-width=960
-height=640
+width=-4
+height=-4
diff --git a/res/shaders/ags001.shader/manifest.ini b/res/shaders/ags001.shader/manifest.ini
index 85398cce6..2d5b7c491 100644
--- a/res/shaders/ags001.shader/manifest.ini
+++ b/res/shaders/ags001.shader/manifest.ini
@@ -7,13 +7,13 @@ passes=2
 [pass.0]
 fragmentShader=ags001.fs
 blend=1
-width=960
-height=640
+width=-4
+height=-4
 
 [pass.1]
 fragmentShader=ags001-light.fs
-width=960
-height=640
+width=-4
+height=-4
 
 [pass.1.uniform.lightBrightness]
 type=float
diff --git a/res/shaders/fish.shader/fish.fs b/res/shaders/fish.shader/fish.fs
index 7d750fd7b..96a1b5f46 100644
--- a/res/shaders/fish.shader/fish.fs
+++ b/res/shaders/fish.shader/fish.fs
@@ -23,19 +23,15 @@
    THE SOFTWARE.
 */
 
-precision highp float;
-
 varying vec2 texCoord;
 uniform sampler2D tex;
 uniform vec2 texSize;
 
 uniform float similarity_threshold;
 
-#define screen_res 240,160
-
 vec4 texel_fetch(sampler2D t, ivec2 c)   // because GLSL TexelFetch is not supported
   {
-    return texture2D(tex,   (2 * vec2(c) + vec2(1,1)) / (2 * vec2(screen_res)) );
+    return texture2D(tex,   (2 * vec2(c) + vec2(1,1)) / (2 * texSize) );
   }
 
 float pixel_brightness(vec4 pixel)
@@ -140,7 +136,7 @@ vec4 interpolate_diagonal(vec4 a, vec4 b, vec4 c, vec4 d)
 
 void main()
   {
-    ivec2 pixel_coords2 = ivec2(texCoord * vec2(screen_res) * 2);
+    ivec2 pixel_coords2 = ivec2(texCoord * texSize * 2);
     ivec2 pixel_coords = pixel_coords2 / 2;
 
     bool x_even = mod(pixel_coords2.x,2) == 0;
diff --git a/res/shaders/wiiu.shader/manifest.ini b/res/shaders/wiiu.shader/manifest.ini
index 2b92c1d74..e69751ed3 100644
--- a/res/shaders/wiiu.shader/manifest.ini
+++ b/res/shaders/wiiu.shader/manifest.ini
@@ -7,5 +7,5 @@ passes=1
 [pass.0]
 fragmentShader=wiiu.fs
 blend=1
-width=960
-height=640
+width=-4
+height=-4