summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2016-05-13 22:03:53 +0200
committerwm4 <wm4@nowhere>2016-05-13 22:07:25 +0200
commit09e07e92c59d30a0a468a1035d19f50aca07caa9 (patch)
tree66d4e28797fcc609027a2927787c8f8a1a40671b
parent7d2c6d60da0bb3340f7a53f45d066a4b27aadb91 (diff)
downloadmpv-09e07e92c59d30a0a468a1035d19f50aca07caa9.tar.bz2
mpv-09e07e92c59d30a0a468a1035d19f50aca07caa9.tar.xz
vo_opengl: drop duplicate LUMINANCE_ALPHA handling
This was supposed to handle the absence of GL_ARB_texture_rg. But it's already handled elsewhere. (init_format() sets texplane.swizzle accordingly.)
-rw-r--r--video/out/opengl/video.c13
1 files changed, 3 insertions, 10 deletions
diff --git a/video/out/opengl/video.c b/video/out/opengl/video.c
index ca10dada27..1116d994d1 100644
--- a/video/out/opengl/video.c
+++ b/video/out/opengl/video.c
@@ -2768,17 +2768,10 @@ bool gl_video_showing_interpolated_frame(struct gl_video *p)
}
// dest = src.<w> (always using 4 components)
-static void packed_fmt_swizzle(char w[5], const struct gl_format *texfmt,
- const struct packed_fmt_entry *fmt)
+static void packed_fmt_swizzle(char w[5], const struct packed_fmt_entry *fmt)
{
- const char *comp = "rgba";
-
- // Normally, we work with GL_RG
- if (texfmt && texfmt->internal_format == GL_LUMINANCE_ALPHA)
- comp = "ragb";
-
for (int c = 0; c < 4; c++)
- w[c] = comp[MPMAX(fmt->components[c] - 1, 0)];
+ w[c] = "rgba"[MPMAX(fmt->components[c] - 1, 0)];
w[4] = '\0';
}
@@ -2859,7 +2852,7 @@ static bool init_format(struct gl_video *p, int fmt, bool test_only)
if (e->fmt == fmt) {
int n_comp = desc.bytes[0] / e->component_size;
plane_format[0] = gl_find_unorm_format(gl, e->component_size, n_comp);
- packed_fmt_swizzle(color_swizzle, plane_format[0], e);
+ packed_fmt_swizzle(color_swizzle, e);
goto supported;
}
}