diff options
author | fritsch <Peter.Fruehberger@gmail.com> | 2020-07-18 14:24:51 +0200 |
---|---|---|
committer | fritsch <Peter.Fruehberger@gmail.com> | 2020-07-18 14:51:26 +0200 |
commit | 3b13f21015829596d5de9d84317b71e9f730d261 (patch) | |
tree | eabc75ef8c23ecd9494dcba648c94bec54bfcc4d /system/shaders | |
parent | 7b97a46f39897c62cc211b306e755e1ac43b925d (diff) |
GL-Shaders: Remove nvidia special handling
Diffstat (limited to 'system/shaders')
-rw-r--r-- | system/shaders/GL/1.2/gl_convolution-4x4.glsl | 18 | ||||
-rw-r--r-- | system/shaders/GL/1.2/gl_convolution-6x6.glsl | 24 | ||||
-rw-r--r-- | system/shaders/GL/1.5/gl_convolution-4x4.glsl | 18 | ||||
-rw-r--r-- | system/shaders/GL/1.5/gl_convolution-6x6.glsl | 24 |
4 files changed, 26 insertions, 58 deletions
diff --git a/system/shaders/GL/1.2/gl_convolution-4x4.glsl b/system/shaders/GL/1.2/gl_convolution-4x4.glsl index 32d955d8fb..8c974239f6 100644 --- a/system/shaders/GL/1.2/gl_convolution-4x4.glsl +++ b/system/shaders/GL/1.2/gl_convolution-4x4.glsl @@ -25,15 +25,7 @@ uniform float m_alpha; varying vec2 m_cord; uniform sampler1D kernelTex; -//nvidia's half is a 16 bit float and can bring some speed improvements -//without affecting quality -#ifndef __GLSL_CG_DATA_TYPES - #define half float - #define half3 vec3 - #define half4 vec4 -#endif - -half4 weight(float pos) +vec4 weight(float pos) { #if defined(HAS_FLOAT_TEXTURE) return texture1D(kernelTex, pos); @@ -55,12 +47,12 @@ vec2 stretch(vec2 pos) #endif } -half3 pixel(float xpos, float ypos) +vec3 pixel(float xpos, float ypos) { return texture2D(img, vec2(xpos, ypos)).rgb; } -half3 line (float ypos, vec4 xpos, half4 linetaps) +vec3 line (float ypos, vec4 xpos, vec4 linetaps) { return pixel(xpos.r, ypos) * linetaps.r + @@ -75,8 +67,8 @@ vec4 process() vec2 pos = stretch(m_cord) + stepxy * 0.5; vec2 f = fract(pos / stepxy); - half4 linetaps = weight(1.0 - f.x); - half4 columntaps = weight(1.0 - f.y); + vec4 linetaps = weight(1.0 - f.x); + vec4 columntaps = weight(1.0 - f.y); //make sure all taps added together is exactly 1.0, otherwise some (very small) distortion can occur linetaps /= linetaps.r + linetaps.g + linetaps.b + linetaps.a; diff --git a/system/shaders/GL/1.2/gl_convolution-6x6.glsl b/system/shaders/GL/1.2/gl_convolution-6x6.glsl index 01328a0c11..26c9f49e26 100644 --- a/system/shaders/GL/1.2/gl_convolution-6x6.glsl +++ b/system/shaders/GL/1.2/gl_convolution-6x6.glsl @@ -25,15 +25,7 @@ uniform float m_alpha; varying vec2 m_cord; uniform sampler1D kernelTex; -//nvidia's half is a 16 bit float and can bring some speed improvements -//without affecting quality -#ifndef __GLSL_CG_DATA_TYPES - #define half float - #define half3 vec3 - #define half4 vec4 -#endif - -half3 weight(float pos) +vec3 weight(float pos) { #if defined(HAS_FLOAT_TEXTURE) return texture1D(kernelTex, pos).rgb; @@ -55,12 +47,12 @@ vec2 stretch(vec2 pos) #endif } -half3 pixel(float xpos, float ypos) +vec3 pixel(float xpos, float ypos) { return texture2D(img, vec2(xpos, ypos)).rgb; } -half3 line (float ypos, vec3 xpos1, vec3 xpos2, half3 linetaps1, half3 linetaps2) +vec3 line (float ypos, vec3 xpos1, vec3 xpos2, vec3 linetaps1, vec3 linetaps2) { return pixel(xpos1.r, ypos) * linetaps1.r + @@ -77,13 +69,13 @@ vec4 process() vec2 pos = stretch(m_cord) + stepxy * 0.5; vec2 f = fract(pos / stepxy); - half3 linetaps1 = weight((1.0 - f.x) / 2.0); - half3 linetaps2 = weight((1.0 - f.x) / 2.0 + 0.5); - half3 columntaps1 = weight((1.0 - f.y) / 2.0); - half3 columntaps2 = weight((1.0 - f.y) / 2.0 + 0.5); + vec3 linetaps1 = weight((1.0 - f.x) / 2.0); + vec3 linetaps2 = weight((1.0 - f.x) / 2.0 + 0.5); + vec3 columntaps1 = weight((1.0 - f.y) / 2.0); + vec3 columntaps2 = weight((1.0 - f.y) / 2.0 + 0.5); //make sure all taps added together is exactly 1.0, otherwise some (very small) distortion can occur - half sum = linetaps1.r + linetaps1.g + linetaps1.b + linetaps2.r + linetaps2.g + linetaps2.b; + float sum = linetaps1.r + linetaps1.g + linetaps1.b + linetaps2.r + linetaps2.g + linetaps2.b; linetaps1 /= sum; linetaps2 /= sum; sum = columntaps1.r + columntaps1.g + columntaps1.b + columntaps2.r + columntaps2.g + columntaps2.b; diff --git a/system/shaders/GL/1.5/gl_convolution-4x4.glsl b/system/shaders/GL/1.5/gl_convolution-4x4.glsl index 144676ee27..2a6404ee01 100644 --- a/system/shaders/GL/1.5/gl_convolution-4x4.glsl +++ b/system/shaders/GL/1.5/gl_convolution-4x4.glsl @@ -8,15 +8,7 @@ in vec2 m_cord; out vec4 fragColor; uniform sampler1D kernelTex; -//nvidia's half is a 16 bit float and can bring some speed improvements -//without affecting quality -#ifndef __GLSL_CG_DATA_TYPES - #define half float - #define half3 vec3 - #define half4 vec4 -#endif - -half4 weight(float pos) +vec4 weight(float pos) { #if defined(HAS_FLOAT_TEXTURE) return texture(kernelTex, pos); @@ -38,12 +30,12 @@ vec2 stretch(vec2 pos) #endif } -half3 pixel(float xpos, float ypos) +vec3 pixel(float xpos, float ypos) { return texture(img, vec2(xpos, ypos)).rgb; } -half3 line (float ypos, vec4 xpos, half4 linetaps) +vec3 line (float ypos, vec4 xpos, vec4 linetaps) { return pixel(xpos.r, ypos) * linetaps.r + @@ -58,8 +50,8 @@ vec4 process() vec2 pos = stretch(m_cord) + stepxy * 0.5; vec2 f = fract(pos / stepxy); - half4 linetaps = weight(1.0 - f.x); - half4 columntaps = weight(1.0 - f.y); + vec4 linetaps = weight(1.0 - f.x); + vec4 columntaps = weight(1.0 - f.y); //make sure all taps added together is exactly 1.0, otherwise some (very small) distortion can occur linetaps /= linetaps.r + linetaps.g + linetaps.b + linetaps.a; diff --git a/system/shaders/GL/1.5/gl_convolution-6x6.glsl b/system/shaders/GL/1.5/gl_convolution-6x6.glsl index 4af3744ae1..b4410cc184 100644 --- a/system/shaders/GL/1.5/gl_convolution-6x6.glsl +++ b/system/shaders/GL/1.5/gl_convolution-6x6.glsl @@ -8,15 +8,7 @@ in vec2 m_cord; out vec4 fragColor; uniform sampler1D kernelTex; -//nvidia's half is a 16 bit float and can bring some speed improvements -//without affecting quality -#ifndef __GLSL_CG_DATA_TYPES - #define half float - #define half3 vec3 - #define half4 vec4 -#endif - -half3 weight(float pos) +vec3 weight(float pos) { #if defined(HAS_FLOAT_TEXTURE) return texture(kernelTex, pos).rgb; @@ -38,12 +30,12 @@ vec2 stretch(vec2 pos) #endif } -half3 pixel(float xpos, float ypos) +vec3 pixel(float xpos, float ypos) { return texture(img, vec2(xpos, ypos)).rgb; } -half3 line (float ypos, vec3 xpos1, vec3 xpos2, half3 linetaps1, half3 linetaps2) +vec3 line (float ypos, vec3 xpos1, vec3 xpos2, vec3 linetaps1, vec3 linetaps2) { return pixel(xpos1.r, ypos) * linetaps1.r + @@ -60,13 +52,13 @@ vec4 process() vec2 pos = stretch(m_cord) + stepxy * 0.5; vec2 f = fract(pos / stepxy); - half3 linetaps1 = weight((1.0 - f.x) / 2.0); - half3 linetaps2 = weight((1.0 - f.x) / 2.0 + 0.5); - half3 columntaps1 = weight((1.0 - f.y) / 2.0); - half3 columntaps2 = weight((1.0 - f.y) / 2.0 + 0.5); + vec3 linetaps1 = weight((1.0 - f.x) / 2.0); + vec3 linetaps2 = weight((1.0 - f.x) / 2.0 + 0.5); + vec3 columntaps1 = weight((1.0 - f.y) / 2.0); + vec3 columntaps2 = weight((1.0 - f.y) / 2.0 + 0.5); //make sure all taps added together is exactly 1.0, otherwise some (very small) distortion can occur - half sum = linetaps1.r + linetaps1.g + linetaps1.b + linetaps2.r + linetaps2.g + linetaps2.b; + float sum = linetaps1.r + linetaps1.g + linetaps1.b + linetaps2.r + linetaps2.g + linetaps2.b; linetaps1 /= sum; linetaps2 /= sum; sum = columntaps1.r + columntaps1.g + columntaps1.b + columntaps2.r + columntaps2.g + columntaps2.b; |