[cogl] cogl-gst: Use alpha textures instead of luminance textures
- From: Neil Roberts <nroberts src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [cogl] cogl-gst: Use alpha textures instead of luminance textures
- Date: Mon, 15 Apr 2013 12:45:25 +0000 (UTC)
commit ca1666860a325fa4d2362cdd38297d6281e997d8
Author: Neil Roberts <neil linux intel com>
Date: Wed Apr 10 16:27:57 2013 +0100
cogl-gst: Use alpha textures instead of luminance textures
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.
Reviewed-by: Robert Bragg <robert linux intel com>
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 bc11f18..49d4671 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 414cc06..5b17e53 100644
--- a/cogl-gst/cogl-gst-video-sink.c
+++ b/cogl-gst/cogl-gst-video-sink.c
@@ -428,7 +428,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;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]