aboutsummaryrefslogtreecommitdiff
path: root/system/shaders
diff options
context:
space:
mode:
authorbobo1on1 <bobo1on1@svn>2010-01-29 22:35:50 +0000
committerbobo1on1 <bobo1on1@svn>2010-01-29 22:35:50 +0000
commit1ac36123e4f2aab5ab1609b4dbedcd797b38bbd3 (patch)
treeebdbf5deecc3f9d3bb7f35386103f59903061674 /system/shaders
parentc8bad273373a5337432609309208b8859f66c3af (diff)
changed: always use the alpha component of the V plane, and for nv12 bind the UV texture to GL_TEXTURE1 and GL_TEXTURE2, this way yv12 and nv12 can be rendered with the same shaders
git-svn-id: https://xbmc.svn.sourceforge.net/svnroot/xbmc/trunk@27285 568bbfeb-2a22-0410-94d2-cc84cf5bfa90
Diffstat (limited to 'system/shaders')
-rw-r--r--system/shaders/nv12rgb_basic_2d.arb24
-rw-r--r--system/shaders/nv12rgb_basic_rect.arb24
-rw-r--r--system/shaders/yuv2rgb_basic.glsl2
-rw-r--r--system/shaders/yuv2rgb_basic_2d.arb3
-rw-r--r--system/shaders/yuv2rgb_basic_rect.arb3
-rw-r--r--system/shaders/yuv2rgb_bob.glsl2
6 files changed, 6 insertions, 52 deletions
diff --git a/system/shaders/nv12rgb_basic_2d.arb b/system/shaders/nv12rgb_basic_2d.arb
deleted file mode 100644
index def3698187..0000000000
--- a/system/shaders/nv12rgb_basic_2d.arb
+++ /dev/null
@@ -1,24 +0,0 @@
-!!ARBfp1.0
-PARAM c[4] =
-{{1.0, -0.0625, 1.1643835, 1.1383928},
-{-0.5, 0.0, -0.187, 1.8556},
-{1.5701, -0.4664, 0.0, 0.0},
-{ -0.5, 0.0, 0.187, -1.8556}
-};
-TEMP T0;
-TEMP T1;
-TEMP yuv;
-TEX T0.x, fragment.texcoord[0], texture[0], 2D;
-ADD yuv.x, T0.x, c[0].y;
-MUL yuv.x, yuv.x, c[0].z;
-TEX T0.xw, fragment.texcoord[1], texture[1], 2D;
-ADD yuv.z, T0.x, c[0].y;
-MUL yuv.z, yuv.z, c[0].w;
-ADD yuv.z, yuv.z, c[1].x;
-ADD yuv.y, T0.w, c[0].y;
-MUL yuv.y, yuv.y, c[0].w;
-ADD yuv.y, yuv.y, c[3].x;
-MAD T1.xyz, yuv.z, c[1].yzww, yuv.x;
-MAD result.color.xyz, yuv.y, c[2], T1;
-MOV result.color.w, fragment.color.w;
-END
diff --git a/system/shaders/nv12rgb_basic_rect.arb b/system/shaders/nv12rgb_basic_rect.arb
deleted file mode 100644
index e2298c0c01..0000000000
--- a/system/shaders/nv12rgb_basic_rect.arb
+++ /dev/null
@@ -1,24 +0,0 @@
-!!ARBfp1.0
-PARAM c[4] =
-{{1.0, -0.0625, 1.1643835, 1.1383928},
-{-0.5, 0.0, -0.187, 1.8556},
-{1.5701, -0.4664, 0.0, 0.0},
-{ -0.5, 0.0, 0.187, -1.8556}
-};
-TEMP T0;
-TEMP T1;
-TEMP yuv;
-TEX T0.x, fragment.texcoord[0], texture[0], RECT;
-ADD yuv.x, T0.x, c[0].y;
-MUL yuv.x, yuv.x, c[0].z;
-TEX T0.xw, fragment.texcoord[1], texture[1], RECT;
-ADD yuv.z, T0.x, c[0].y;
-MUL yuv.z, yuv.z, c[0].w;
-ADD yuv.z, yuv.z, c[1].x;
-ADD yuv.y, T0.w, c[0].y;
-MUL yuv.y, yuv.y, c[0].w;
-ADD yuv.y, yuv.y, c[3].x;
-MAD T1.xyz, yuv.z, c[1].yzww, yuv.x;
-MAD result.color.xyz, yuv.y, c[2], T1;
-MOV result.color.w, fragment.color.w;
-END
diff --git a/system/shaders/yuv2rgb_basic.glsl b/system/shaders/yuv2rgb_basic.glsl
index 49fdf633a5..5928ab5235 100644
--- a/system/shaders/yuv2rgb_basic.glsl
+++ b/system/shaders/yuv2rgb_basic.glsl
@@ -19,7 +19,7 @@ void main()
vec4 yuv, rgb;
yuv.rgba = vec4( texture2D(m_sampY, m_cordY).r
, texture2D(m_sampU, m_cordU).r
- , texture2D(m_sampV, m_cordV).r
+ , texture2D(m_sampV, m_cordV).a
, 1.0 );
rgb = m_yuvmat * yuv;
diff --git a/system/shaders/yuv2rgb_basic_2d.arb b/system/shaders/yuv2rgb_basic_2d.arb
index d37d3ff8bd..1819bbb20d 100644
--- a/system/shaders/yuv2rgb_basic_2d.arb
+++ b/system/shaders/yuv2rgb_basic_2d.arb
@@ -4,7 +4,8 @@ TEMP R0;
TEMP R1;
TEX R0.x, fragment.texcoord[0], texture[0], 2D;
TEX R0.y, fragment.texcoord[1], texture[1], 2D;
-TEX R0.z, fragment.texcoord[2], texture[2], 2D;
+TEX R0.w, fragment.texcoord[2], texture[2], 2D;
+MOV R0.z, R0.w;
DPH R1.r, R0, yuvmat[0];
DPH R1.g, R0, yuvmat[1];
DPH R1.b, R0, yuvmat[2];
diff --git a/system/shaders/yuv2rgb_basic_rect.arb b/system/shaders/yuv2rgb_basic_rect.arb
index 82588a0080..b202d40e93 100644
--- a/system/shaders/yuv2rgb_basic_rect.arb
+++ b/system/shaders/yuv2rgb_basic_rect.arb
@@ -4,7 +4,8 @@ TEMP R0;
TEMP R1;
TEX R0.x, fragment.texcoord[0], texture[0], RECT;
TEX R0.y, fragment.texcoord[1], texture[1], RECT;
-TEX R0.z, fragment.texcoord[2], texture[2], RECT;
+TEX R0.w, fragment.texcoord[2], texture[2], RECT;
+MOV R0.z, R0.w;
DPH R1.r, R0, yuvmat[0];
DPH R1.g, R0, yuvmat[1];
DPH R1.b, R0, yuvmat[2];
diff --git a/system/shaders/yuv2rgb_bob.glsl b/system/shaders/yuv2rgb_bob.glsl
index c5901c766c..6418a205bf 100644
--- a/system/shaders/yuv2rgb_bob.glsl
+++ b/system/shaders/yuv2rgb_bob.glsl
@@ -36,7 +36,7 @@ void main()
yuv.rgba = vec4( texture2D(m_sampY, offsetY).r
, texture2D(m_sampU, offsetU).r
- , texture2D(m_sampV, offsetV).r
+ , texture2D(m_sampV, offsetV).a
, 1.0);
rgb = m_yuvmat * yuv;
rgb.a = gl_Color.a;