From 1eef329725932b9c6b6fc8df6aa9764860baeba1 Mon Sep 17 00:00:00 2001 From: "Reynaldo H. Verdejo Pinochet" Date: Mon, 8 Oct 2012 12:10:25 -0300 Subject: [PATCH] eglglessink: Refactor REORDER shader. Avoid unneededly calling texture2D() 3 consecutive times. --- ext/eglgles/gsteglglessink.c | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/ext/eglgles/gsteglglessink.c b/ext/eglgles/gsteglglessink.c index a1472c72ab..05f551e650 100644 --- a/ext/eglgles/gsteglglessink.c +++ b/ext/eglgles/gsteglglessink.c @@ -161,11 +161,8 @@ static const char *frag_REORDER_prog = { "uniform sampler2D tex;" "void main(void)" "{" - " float r, g, b;" - " r = texture2D(tex, opos).%c;" - " g = texture2D(tex, opos).%c;" - " b = texture2D(tex, opos).%c;" - " gl_FragColor = vec4(r, g, b, 1.0);" + " vec4 t = texture2D(tex, opos);" + " gl_FragColor = vec4(t.%c, t.%c, t.%c, 1.0);" "}" };