eglglessink: GLSL: Assorted fixes to optimized code

- Don't copy over opos as it's already a vec2
- Fix index order access at frag_YUY2_YVYU_UYVY_prog
This commit is contained in:
Reynaldo H. Verdejo Pinochet 2012-10-10 12:18:27 -03:00 committed by Sebastian Dröge
parent 73d865091c
commit 5c2b1dc631

View file

@ -225,7 +225,7 @@ static const char *frag_AYUV_prog = {
"void main(void) {"
" float r,g,b;"
" vec3 yuv;"
" yuv = texture2D(tex,opos.xy).gba;"
" yuv = texture2D(tex,opos).gba;"
" yuv += offset;"
" r = dot(yuv, rcoeff);"
" g = dot(yuv, gcoeff);"
@ -246,9 +246,8 @@ static const char *frag_YUY2_YVYU_UYVY_prog = {
"void main(void) {"
" float r, g, b;"
" vec3 yuv;"
" vec2 oposxy = vec2(opos.x, opos.y);"
" yuv.x = texture2D(Ytex,oposxy).x;"
" yuv.yz = texture2D(UVtex,oposxy).yz;"
" yuv.x = texture2D(Ytex,opos).%c;"
" yuv.yz = texture2D(UVtex,opos).%c%c;"
" yuv += offset;"
" r = dot(yuv, rcoeff);"
" g = dot(yuv, gcoeff);"
@ -271,10 +270,9 @@ static const char *frag_PLANAR_YUV_prog = {
"void main(void) {"
" float r,g,b;"
" vec3 yuv;"
" vec2 nxy = opos.xy;"
" yuv.x=texture2D(Ytex,nxy).r;"
" yuv.y=texture2D(Utex,nxy).r;"
" yuv.z=texture2D(Vtex,nxy).r;"
" yuv.x=texture2D(Ytex,opos).r;"
" yuv.y=texture2D(Utex,opos).r;"
" yuv.z=texture2D(Vtex,opos).r;"
" yuv += offset;"
" r = dot(yuv, rcoeff);"
" g = dot(yuv, gcoeff);"
@ -295,10 +293,9 @@ static const char *frag_NV12_NV21_prog = {
"void main(void) {"
" float r,g,b;"
" vec3 yuv;"
" vec2 nxy = opos.xy;"
" yuv.x=texture2D(Ytex,nxy).r;"
" yuv.y=texture2D(UVtex,nxy).%c;"
" yuv.z=texture2D(UVtex,nxy).%c;"
" yuv.x=texture2D(Ytex,opos).r;"
" yuv.y=texture2D(UVtex,opos).%c;"
" yuv.z=texture2D(UVtex,opos).%c;"
" yuv += offset;"
" r = dot(yuv, rcoeff);"
" g = dot(yuv, gcoeff);"