simplify shaders to have fewer tmp vars. in case of dumb shader compilers.

SVN revision: 46327
This commit is contained in:
Carsten Haitzler 2010-02-20 04:37:22 +00:00
parent 7e08e3f23c
commit c26d5bc2bc
7 changed files with 22 additions and 28 deletions

View File

@ -3,7 +3,6 @@
"#endif\n"
"attribute vec4 vertex;\n"
"attribute vec4 color;\n"
"attribute vec2 tex_coord;\n"
"uniform mat4 mvp;\n"
"varying vec4 col;\n"
"void main()\n"

View File

@ -3,7 +3,6 @@ precision mediump float;
#endif
attribute vec4 vertex;
attribute vec4 color;
attribute vec2 tex_coord;
uniform mat4 mvp;
varying vec4 col;
void main()

View File

@ -12,8 +12,7 @@
" 0.00000, -0.34410, 1.77200, 0.00000,\n"
" 1.40200, -0.71410, 0.00000, 0.00000,\n"
" -0.77380, 0.45630, -0.95880, 1.00000);\n"
" vec4 yuv = vec4(texture2D(tex, tex_c.xy).r,\n"
" texture2D(texu, tex_c2.xy).r,\n"
" texture2D(texv, tex_c3.xy).r, 1.0);\n"
" gl_FragColor = (yuv2rgb * yuv) * col;\n"
" gl_FragColor = (yuv2rgb * vec4(texture2D(tex, tex_c.xy).r,\n"
" texture2D(texu, tex_c2.xy).r,\n"
" texture2D(texv, tex_c3.xy).r, 1.0)) * col;\n"
"}\n"

View File

@ -12,8 +12,7 @@ void main()
0.00000, -0.34410, 1.77200, 0.00000,
1.40200, -0.71410, 0.00000, 0.00000,
-0.77380, 0.45630, -0.95880, 1.00000);
vec4 yuv = vec4(texture2D(tex, tex_c.xy).r,
texture2D(texu, tex_c2.xy).r,
texture2D(texv, tex_c3.xy).r, 1.0);
gl_FragColor = (yuv2rgb * yuv) * col;
gl_FragColor = (yuv2rgb * vec4(texture2D(tex, tex_c.xy).r,
texture2D(texu, tex_c2.xy).r,
texture2D(texv, tex_c3.xy).r, 1.0)) * col;
}

View File

@ -11,8 +11,7 @@
" 0.00000, -0.34410, 1.77200, 0.00000,\n"
" 1.40200, -0.71410, 0.00000, 0.00000,\n"
" -0.77380, 0.45630, -0.95880, 1.00000);\n"
" vec4 yuv = vec4(texture2D(tex, tex_c.xy).r,\n"
" texture2D(texu, tex_c2.xy).r,\n"
" texture2D(texv, tex_c3.xy).r, 1.0);\n"
" gl_FragColor = (yuv2rgb * yuv);\n"
" gl_FragColor = yuv2rgb * vec4(texture2D(tex, tex_c.xy).r,\n"
" texture2D(texu, tex_c2.xy).r,\n"
" texture2D(texv, tex_c3.xy).r, 1.0);\n"
"}\n"

View File

@ -11,8 +11,7 @@ void main()
0.00000, -0.34410, 1.77200, 0.00000,
1.40200, -0.71410, 0.00000, 0.00000,
-0.77380, 0.45630, -0.95880, 1.00000);
vec4 yuv = vec4(texture2D(tex, tex_c.xy).r,
texture2D(texu, tex_c2.xy).r,
texture2D(texv, tex_c3.xy).r, 1.0);
gl_FragColor = (yuv2rgb * yuv);
gl_FragColor = yuv2rgb * vec4(texture2D(tex, tex_c.xy).r,
texture2D(texu, tex_c2.xy).r,
texture2D(texv, tex_c3.xy).r, 1.0);
}

View File

@ -1,19 +1,19 @@
0x20205350, 0xffff0008, 0x00000048, 0x01020000, 0x0000000c, 0x00000007,
0x00000000, 0x00000000, 0x00000003, 0x00000000, 0x00000000, 0x00000003,
0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000022, 0x00000000,
0x00000000, 0x02025400, 0x23782050, 0x00000000, 0x00000000, 0x0100e407,
0x307820e4, 0x00000000, 0x01000000, 0x02025400, 0x23782150, 0x00000000,
0x01000000, 0x0101e407, 0x307821e4, 0x00000000, 0x02000000, 0x02025400,
0x00000000, 0x02065400, 0x23782050, 0x00000000, 0x00000000, 0x0100e407,
0x307820e4, 0x00000000, 0x01000000, 0x02065400, 0x23782150, 0x00000000,
0x01000000, 0x0101e407, 0x307821e4, 0x00000000, 0x02000000, 0x02065400,
0x23782250, 0x00000000, 0x02000000, 0x0102e407, 0x307822e4, 0x00000000,
0x00000000, 0x02030001, 0x237823e4, 0x00000000, 0x01e40103, 0x02040001,
0x2ef823e4, 0x00000000, 0x02e40103, 0x02050001, 0x2ef823e4, 0x00000000,
0x00000000, 0x02060000, 0x20f824e4, 0x00000000, 0x02e40103, 0x01040002,
0x00000000, 0x02020001, 0x237823e4, 0x00000000, 0x01e40103, 0x02030001,
0x2ef823e4, 0x00000000, 0x02e40103, 0x02040001, 0x2ef823e4, 0x00000000,
0x00000000, 0x02050000, 0x20f824e4, 0x00000000, 0x06e40103, 0x01040002,
0x2efa10e4, 0x00000000, 0x00000000, 0x00000000, 0x1e000000, 0x00000000,
0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x3f800000, 0x3f800000,
0x3f800000, 0x3f800000, 0x3f800000, 0x00000000, 0x00000000, 0x00000000,
0x3f94fdf4, 0x3f94fdf4, 0x3f94fdf4, 0x00000000, 0x00000000, 0xbeb02de0,
0x3fe2d0e5, 0x00000000, 0x3fb374bc, 0xbf36cf42, 0x00000000, 0x00000000,
0xbf4617c2, 0x3ee9a027, 0xbf7573eb, 0x3f800000, 0x0000000e, 0x00000005,
0x3f800000, 0x3f800000, 0x3f94fdf4, 0x3f94fdf4, 0x3f94fdf4, 0x00000000,
0x00000000, 0xbeb02de0, 0x3fe2d0e5, 0x00000000, 0x3fb374bc, 0xbf36cf42,
0x00000000, 0x00000000, 0xbf4617c2, 0x3ee9a027, 0xbf7573eb, 0x3f800000,
0x3f800000, 0x00000000, 0x00000000, 0x00000000, 0x0000000e, 0x00000005,
0x00000003, 0x00000000, 0x00000000, 0x00000014, 0x00000006, 0x00000003,
0x00000000, 0x00000004, 0x0000001b, 0x00000006, 0x00000003, 0x00000000,
0x00000008, 0x00000000, 0x00000003, 0x0000000f, 0x00030005, 0x00000000,