From 5c2b1dc631c1ddb82b1bfa5f5822fa7322e5cb06 Mon Sep 17 00:00:00 2001 From: "Reynaldo H. Verdejo Pinochet" Date: Wed, 10 Oct 2012 12:18:27 -0300 Subject: [PATCH] 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 --- ext/eglgles/gsteglglessink.c | 21 +++++++++------------ 1 file changed, 9 insertions(+), 12 deletions(-) diff --git a/ext/eglgles/gsteglglessink.c b/ext/eglgles/gsteglglessink.c index c549520..43b67e6 100644 --- a/ext/eglgles/gsteglglessink.c +++ b/ext/eglgles/gsteglglessink.c @@ -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);" -- 2.7.4