summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEric Anholt <eric@anholt.net>2010-04-26 16:37:42 -0700
committerEric Anholt <eric@anholt.net>2010-06-03 17:08:42 -0700
commitf6345606d11fafae41672420cd3f892f065ae52e (patch)
treed18f9f44d034a6e8266488688b5d7c0573e3cb1e
parent462b8bc95efaa89b33c0edd0207efd8333bfb4b1 (diff)
gstgldisplay: Consolidate a texture sample in upload_YUY2_UYVY.
Reduces the shader from 30 to 26 instructions, including removing a texture sample. No significant difference in runtime.
-rw-r--r--gst-libs/gst/gl/gstgldisplay.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/gst-libs/gst/gl/gstgldisplay.c b/gst-libs/gst/gl/gstgldisplay.c
index 8d22b26..7021e41 100644
--- a/gst-libs/gst/gl/gstgldisplay.c
+++ b/gst-libs/gst/gl/gstgldisplay.c
@@ -262,8 +262,9 @@ gst_gl_display_init (GstGLDisplay * display, GstGLDisplayClass * klass)
" fx = gl_TexCoord[0].x;\n"
" fy = gl_TexCoord[0].y;\n"
" y = texture2DRect(Ytex,vec2(fx,fy)).%c;\n"
- " u = texture2DRect(UVtex,vec2(fx*0.5,fy)).%c;\n"
- " v = texture2DRect(UVtex,vec2(fx*0.5,fy)).%c;\n"
+ " vec2 uv = texture2DRect(UVtex,vec2(fx*0.5,fy)).%c%c;\n"
+ " u = uv.x;\n"
+ " v = uv.y;\n"
#else
" fx = v_texCoord.x;\n"
" fy = v_texCoord.y;\n"