[Cogl] [PATCH 1/2] cogl-gst: Use alpha textures instead of luminance textures
Neil Roberts
neil at linux.intel.com
Wed Apr 10 08:38:12 PDT 2013
Luminance textures are not supported on GL3 and as the textures are
accessed via a shader anyway it doesn't seem like it should make much
difference which component the single-component textures are in. Cogl
already has code to fake alpha textures via the texture swizzle
extension on GL3.
---
cogl-gst/cogl-gst-shader.c | 6 +++---
cogl-gst/cogl-gst-video-sink.c | 2 +-
2 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/cogl-gst/cogl-gst-shader.c b/cogl-gst/cogl-gst-shader.c
index 0a81025..7c34376 100644
--- a/cogl-gst/cogl-gst-shader.c
+++ b/cogl-gst/cogl-gst-shader.c
@@ -49,9 +49,9 @@ _cogl_gst_shader_yv12_to_rgba_decl[] =
"vec4\n"
"cogl_gst_sample_video (vec2 UV)\n"
"{\n"
- " float y = 1.1640625 * (texture2D (cogl_sampler0, UV).g - 0.0625);\n"
- " float u = texture2D (cogl_sampler1, UV).g - 0.5;\n"
- " float v = texture2D (cogl_sampler2, UV).g - 0.5;\n"
+ " float y = 1.1640625 * (texture2D (cogl_sampler0, UV).a - 0.0625);\n"
+ " float u = texture2D (cogl_sampler1, UV).a - 0.5;\n"
+ " float v = texture2D (cogl_sampler2, UV).a - 0.5;\n"
" vec4 color;\n"
" color.r = y + 1.59765625 * v;\n"
" color.g = y - 0.390625 * u - 0.8125 * v;\n"
diff --git a/cogl-gst/cogl-gst-video-sink.c b/cogl-gst/cogl-gst-video-sink.c
index f63d7dc..cd61d8e 100644
--- a/cogl-gst/cogl-gst-video-sink.c
+++ b/cogl-gst/cogl-gst-video-sink.c
@@ -436,7 +436,7 @@ cogl_gst_yv12_upload (CoglGstVideoSink *sink,
{
CoglGstVideoSinkPrivate *priv = sink->priv;
GstVideoFrame frame;
- CoglPixelFormat format = COGL_PIXEL_FORMAT_G_8;
+ CoglPixelFormat format = COGL_PIXEL_FORMAT_A_8;
if (!gst_video_frame_map (&frame, &priv->info, buffer, GST_MAP_READ))
goto map_fail;
--
1.7.11.3.g3c3efa5
More information about the Cogl
mailing list