diff options
author | bobo1on1 <bobo1on1@svn> | 2010-05-21 18:02:30 +0000 |
---|---|---|
committer | bobo1on1 <bobo1on1@svn> | 2010-05-21 18:02:30 +0000 |
commit | 9e5c4c5df61ace4370c924fe0528700ecc762426 (patch) | |
tree | d68cd79acf8debc4a4b38ba2cf8776a8d0e37ba7 /system/shaders | |
parent | d99129093df52d32ac3df63f85b9575ef57241bf (diff) |
fixed: usage of GL_TEXTURE_1D/GL_TEXTURE_2D in VideoFilterShader.cpp
git-svn-id: https://xbmc.svn.sourceforge.net/svnroot/xbmc/trunk@30386 568bbfeb-2a22-0410-94d2-cc84cf5bfa90
Diffstat (limited to 'system/shaders')
-rw-r--r-- | system/shaders/convolution-4x4.glsl | 26 | ||||
-rw-r--r-- | system/shaders/convolution-6x6.glsl | 26 |
2 files changed, 36 insertions, 16 deletions
diff --git a/system/shaders/convolution-4x4.glsl b/system/shaders/convolution-4x4.glsl index fa3f8c11ec..c02578f874 100644 --- a/system/shaders/convolution-4x4.glsl +++ b/system/shaders/convolution-4x4.glsl @@ -1,8 +1,13 @@ uniform sampler2D img; -uniform sampler1D kernelTex; uniform vec2 stepxy; uniform float m_stretch; +#if (USE1DTEXTURE) + uniform sampler1D kernelTex; +#else + uniform sampler2D kernelTex; +#endif + //nvidia's half is a 16 bit float and can bring some speed improvements //without affecting quality #ifndef __GLSL_CG_DATA_TYPES @@ -11,17 +16,22 @@ uniform float m_stretch; #define half4 vec4 #endif -#if (HAS_FLOAT_TEXTURE) half4 weight(float pos) { - return texture1D(kernelTex, pos); -} +#if (HAS_FLOAT_TEXTURE) + #if (USE1DTEXTURE) + return texture1D(kernelTex, pos); + #else + return texture2D(kernelTex, vec2(pos, 0.5)); + #endif #else -half4 weight(float pos) -{ - return texture1D(kernelTex, pos) * 2.0 - 1.0; -} + #if (USE1DTEXTURE) + return texture1D(kernelTex, pos) * 2.0 - 1.0; + #else + return texture2D(kernelTex, vec2(pos, 0.5)) * 2.0 - 1.0; + #endif #endif +} vec2 stretch(vec2 pos) { diff --git a/system/shaders/convolution-6x6.glsl b/system/shaders/convolution-6x6.glsl index f37dd6105a..a455076e0b 100644 --- a/system/shaders/convolution-6x6.glsl +++ b/system/shaders/convolution-6x6.glsl @@ -1,8 +1,13 @@ uniform sampler2D img; -uniform sampler1D kernelTex; uniform vec2 stepxy; uniform float m_stretch; +#if (USE1DTEXTURE) + uniform sampler1D kernelTex; +#else + uniform sampler2D kernelTex; +#endif + //nvidia's half is a 16 bit float and can bring some speed improvements //without affecting quality #ifndef __GLSL_CG_DATA_TYPES @@ -11,17 +16,22 @@ uniform float m_stretch; #define half4 vec4 #endif -#if (HAS_FLOAT_TEXTURE) half3 weight(float pos) { - return texture1D(kernelTex, pos).rgb; -} +#if (HAS_FLOAT_TEXTURE) + #if (USE1DTEXTURE) + return texture1D(kernelTex, pos).rgb; + #else + return texture2D(kernelTex, vec2(pos, 0.5)).rgb; + #endif #else -half3 weight(float pos) -{ - return texture1D(kernelTex, pos).rgb * 2.0 - 1.0; -} + #if (USE1DTEXTURE) + return texture1D(kernelTex, pos).rgb * 2.0 - 1.0; + #else + return texture2D(kernelTex, vec2(pos, 0.5)).rgb * 2.0 - 1.0; + #endif #endif +} vec2 stretch(vec2 pos) { |