summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLionel Landwerlin <llandwerlin@gmail.com>2016-03-20 16:21:47 +0000
committerLionel Landwerlin <llandwerlin@gmail.com>2016-03-20 16:22:00 +0000
commit88e58b0bc401aa7a72cfb27239aaa8d360e7986d (patch)
treef42a4e2af921f540dfbf74bb19dd6d2b28fd8e3a
parent767225ebba3034bdcf16ae8101146495deb7d679 (diff)
downloadclutter-gst-88e58b0bc401aa7a72cfb27239aaa8d360e7986d.tar.gz
shaders: modify cg shaders rather than generated files
-rw-r--r--clutter-gst/shaders/I420.cg6
-rw-r--r--clutter-gst/shaders/I420.h16
-rw-r--r--clutter-gst/shaders/I420.pso24
-rw-r--r--clutter-gst/shaders/YV12.cg7
-rw-r--r--clutter-gst/shaders/YV12.h16
-rw-r--r--clutter-gst/shaders/YV12.pso24
6 files changed, 46 insertions, 47 deletions
diff --git a/clutter-gst/shaders/I420.cg b/clutter-gst/shaders/I420.cg
index 6950afe..0bd86bd 100644
--- a/clutter-gst/shaders/I420.cg
+++ b/clutter-gst/shaders/I420.cg
@@ -39,9 +39,9 @@ I420_output I420_main (I420_input IN)
{
I420_output OUT;
- float y = 1.1640625 * (tex2D (IN.Y_tex, IN.Y).g - 0.0625);
- float u = tex2D (IN.U_tex, IN.Y).g - 0.5;
- float v = tex2D (IN.V_tex, IN.Y).g - 0.5;
+ float y = 1.1640625 * (tex2D (IN.Y_tex, IN.Y).a - 0.0625);
+ float u = tex2D (IN.U_tex, IN.Y).a - 0.5;
+ float v = tex2D (IN.V_tex, IN.Y).a - 0.5;
OUT.color.r = y + 1.59765625 * v;
OUT.color.g = y - 0.390625 * u - 0.8125 * v;
diff --git a/clutter-gst/shaders/I420.h b/clutter-gst/shaders/I420.h
index a3e35c4..c6135fd 100644
--- a/clutter-gst/shaders/I420.h
+++ b/clutter-gst/shaders/I420.h
@@ -9,27 +9,27 @@
* This define is the size of the shader in bytes. More precisely it's the
* sum of strlen() of every string in the array.
*/
-#define I420_FP_SZ 572
+#define I420_FP_SZ 564
static const char *I420_fp[] =
{
"!!ARBfp1.0\n",
- "PARAM c[2] = { { 1.1640625, 0.5, 2.015625, 0.0625 },\n",
- "{ 0.390625, 0, 1.5976562, 0.8125 } };\n",
+ "PARAM c[2] = { { 1.1640625, 0.0625, 2.015625, 0.5 },\n",
+ "{ 0.390625, 0.8125, 1.5976562 } };\n",
"TEMP R0;\n",
"TEMP R1;\n",
"TEX R1.w, fragment.texcoord[0], texture[0], 2D;\n",
- "ADD R0.x, R1.w, -c[0].w;\n",
+ "ADD R0.x, R1.w, -c[0].y;\n",
"TEX R0.w, fragment.texcoord[0], texture[2], 2D;\n",
"TEX R1.w, fragment.texcoord[0], texture[1], 2D;\n",
"MUL R0.x, R0, c[0];\n",
- "ADD R0.y, R1.w, -c[0];\n",
+ "ADD R0.y, R1.w, -c[0].w;\n",
"MAD R0.z, R0.y, c[0], R0.x;\n",
- "ADD R0.w, R0, -c[0].y;\n",
"MAD R0.y, -R0, c[1].x, R0.x;\n",
+ "ADD R0.w, R0, -c[0];\n",
"MAD R0.x, R0.w, c[1].z, R0;\n",
- "MAD R0.w, -R0, c[1], R0.y;\n",
- "MUL result.color.xyz, fragment.color.primary.w, R0.xwzy;\n",
+ "MAD R0.y, -R0.w, c[1], R0;\n",
+ "MUL result.color.xyz, fragment.color.primary.w, R0;\n",
"MOV result.color.w, fragment.color.primary;\n",
"END\n",
NULL
diff --git a/clutter-gst/shaders/I420.pso b/clutter-gst/shaders/I420.pso
index bd01d38..549916e 100644
--- a/clutter-gst/shaders/I420.pso
+++ b/clutter-gst/shaders/I420.pso
@@ -1,9 +1,9 @@
!!ARBfp1.0
-# cgc version 3.0.0016, build date Feb 10 2011
+# cgc version 3.1.0013, build date Apr 24 2012
# command line args: -profile arbfp1
# source file: I420.cg
#vendor NVIDIA Corporation
-#version 3.0.0.16
+#version 3.1.0.13
#profile arbfp1
#program I420_main
#semantic I420_main.IN
@@ -19,17 +19,17 @@ PARAM c[2] = { { 1.1640625, 0.0625, 2.015625, 0.5 },
{ 0.390625, 0.8125, 1.5976562 } };
TEMP R0;
TEMP R1;
-TEX R1.y, fragment.texcoord[0], texture[0], 2D;
-ADD R0.x, R1.y, -c[0].y;
-TEX R0.y, fragment.texcoord[0], texture[2], 2D;
-TEX R1.y, fragment.texcoord[0], texture[1], 2D;
+TEX R1.w, fragment.texcoord[0], texture[0], 2D;
+ADD R0.x, R1.w, -c[0].y;
+TEX R0.w, fragment.texcoord[0], texture[2], 2D;
+TEX R1.w, fragment.texcoord[0], texture[1], 2D;
MUL R0.x, R0, c[0];
-ADD R0.w, R1.y, -c[0];
-MAD R0.z, R0.w, c[0], R0.x;
-ADD R0.y, R0, -c[0].w;
-MAD R0.w, -R0, c[1].x, R0.x;
-MAD R0.x, R0.y, c[1].z, R0;
-MAD R0.y, -R0, c[1], R0.w;
+ADD R0.y, R1.w, -c[0].w;
+MAD R0.z, R0.y, c[0], R0.x;
+MAD R0.y, -R0, c[1].x, R0.x;
+ADD R0.w, R0, -c[0];
+MAD R0.x, R0.w, c[1].z, R0;
+MAD R0.y, -R0.w, c[1], R0;
MUL result.color.xyz, fragment.color.primary.w, R0;
MOV result.color.w, fragment.color.primary;
END
diff --git a/clutter-gst/shaders/YV12.cg b/clutter-gst/shaders/YV12.cg
index df70903..ffd6bcd 100644
--- a/clutter-gst/shaders/YV12.cg
+++ b/clutter-gst/shaders/YV12.cg
@@ -39,9 +39,9 @@ YV12_output YV12_main (YV12_input IN)
{
YV12_output OUT;
- float y = 1.1640625 * (tex2D (IN.Y_tex, IN.Y).g - 0.0625);
- float u = tex2D (IN.U_tex, IN.Y).g - 0.5;
- float v = tex2D (IN.V_tex, IN.Y).g - 0.5;
+ float y = 1.1640625 * (tex2D (IN.Y_tex, IN.Y).a - 0.0625);
+ float u = tex2D (IN.U_tex, IN.Y).a - 0.5;
+ float v = tex2D (IN.V_tex, IN.Y).a - 0.5;
OUT.color.r = y + 1.59765625 * v;
OUT.color.g = y - 0.390625 * u - 0.8125 * v;
@@ -51,4 +51,3 @@ YV12_output YV12_main (YV12_input IN)
return OUT;
}
-
diff --git a/clutter-gst/shaders/YV12.h b/clutter-gst/shaders/YV12.h
index 36cade6..9b56b51 100644
--- a/clutter-gst/shaders/YV12.h
+++ b/clutter-gst/shaders/YV12.h
@@ -9,27 +9,27 @@
* This define is the size of the shader in bytes. More precisely it's the
* sum of strlen() of every string in the array.
*/
-#define YV12_FP_SZ 572
+#define YV12_FP_SZ 564
static const char *YV12_fp[] =
{
"!!ARBfp1.0\n",
- "PARAM c[2] = { { 1.1640625, 0.5, 2.015625, 0.0625 },\n",
- "{ 0.390625, 0, 1.5976562, 0.8125 } };\n",
+ "PARAM c[2] = { { 1.1640625, 0.0625, 2.015625, 0.5 },\n",
+ "{ 0.390625, 0.8125, 1.5976562 } };\n",
"TEMP R0;\n",
"TEMP R1;\n",
"TEX R1.w, fragment.texcoord[0], texture[0], 2D;\n",
- "ADD R0.x, R1.w, -c[0].w;\n",
+ "ADD R0.x, R1.w, -c[0].y;\n",
"TEX R0.w, fragment.texcoord[0], texture[1], 2D;\n",
"TEX R1.w, fragment.texcoord[0], texture[2], 2D;\n",
"MUL R0.x, R0, c[0];\n",
- "ADD R0.y, R1.w, -c[0];\n",
+ "ADD R0.y, R1.w, -c[0].w;\n",
"MAD R0.z, R0.y, c[0], R0.x;\n",
- "ADD R0.w, R0, -c[0].y;\n",
"MAD R0.y, -R0, c[1].x, R0.x;\n",
+ "ADD R0.w, R0, -c[0];\n",
"MAD R0.x, R0.w, c[1].z, R0;\n",
- "MAD R0.w, -R0, c[1], R0.y;\n",
- "MUL result.color.xyz, fragment.color.primary.w, R0.xwzy;\n",
+ "MAD R0.y, -R0.w, c[1], R0;\n",
+ "MUL result.color.xyz, fragment.color.primary.w, R0;\n",
"MOV result.color.w, fragment.color.primary;\n",
"END\n",
NULL
diff --git a/clutter-gst/shaders/YV12.pso b/clutter-gst/shaders/YV12.pso
index e43f5e0..de22001 100644
--- a/clutter-gst/shaders/YV12.pso
+++ b/clutter-gst/shaders/YV12.pso
@@ -1,9 +1,9 @@
!!ARBfp1.0
-# cgc version 3.0.0016, build date Feb 10 2011
+# cgc version 3.1.0013, build date Apr 24 2012
# command line args: -profile arbfp1
# source file: YV12.cg
#vendor NVIDIA Corporation
-#version 3.0.0.16
+#version 3.1.0.13
#profile arbfp1
#program YV12_main
#semantic YV12_main.IN
@@ -19,17 +19,17 @@ PARAM c[2] = { { 1.1640625, 0.0625, 2.015625, 0.5 },
{ 0.390625, 0.8125, 1.5976562 } };
TEMP R0;
TEMP R1;
-TEX R1.y, fragment.texcoord[0], texture[0], 2D;
-ADD R0.x, R1.y, -c[0].y;
-TEX R0.y, fragment.texcoord[0], texture[1], 2D;
-TEX R1.y, fragment.texcoord[0], texture[2], 2D;
+TEX R1.w, fragment.texcoord[0], texture[0], 2D;
+ADD R0.x, R1.w, -c[0].y;
+TEX R0.w, fragment.texcoord[0], texture[1], 2D;
+TEX R1.w, fragment.texcoord[0], texture[2], 2D;
MUL R0.x, R0, c[0];
-ADD R0.w, R1.y, -c[0];
-MAD R0.z, R0.w, c[0], R0.x;
-ADD R0.y, R0, -c[0].w;
-MAD R0.w, -R0, c[1].x, R0.x;
-MAD R0.x, R0.y, c[1].z, R0;
-MAD R0.y, -R0, c[1], R0.w;
+ADD R0.y, R1.w, -c[0].w;
+MAD R0.z, R0.y, c[0], R0.x;
+MAD R0.y, -R0, c[1].x, R0.x;
+ADD R0.w, R0, -c[0];
+MAD R0.x, R0.w, c[1].z, R0;
+MAD R0.y, -R0.w, c[1], R0;
MUL result.color.xyz, fragment.color.primary.w, R0;
MOV result.color.w, fragment.color.primary;
END