diff options
author | wm4 <wm4@nowhere> | 2015-01-28 13:36:07 +0100 |
---|---|---|
committer | wm4 <wm4@nowhere> | 2015-01-28 13:36:07 +0100 |
commit | f3c84a322d46a80e624707a7e16b5caed31fb5b0 (patch) | |
tree | c2d20b7e2ffd72326a98911088d079fd1ae5c837 /video/out/gl_common.c | |
parent | 631c256819a0162f50f7986bd129c52897e86139 (diff) | |
download | mpv-f3c84a322d46a80e624707a7e16b5caed31fb5b0.tar.bz2 mpv-f3c84a322d46a80e624707a7e16b5caed31fb5b0.tar.xz |
vo_opengl: fix display of ARGB ith color management enabled
PNG uses a different component order from GL_RGBA, so we upload the
surface using the "wrong" order, and then fix it in the shader. This
breaks if a sRGB texture (GL_SRGB) is used: the hardware will not touch
the alpha channel, which means that the B component is not adjusted,
leading to incorrect output.
Just remove the use of sRGB textures completely. It might lead to a
slight slow down when playing RGB with color management enabled, but
with this combination of obscure use case with minor performance impact
it's not a meaningful disadvantage.
Unfortunately this also means that alpha is handled incorrectly with our
own color management, but alpha isn't so important and can be fixed
later. (0.0 and 1.0 are unchanged by the transfer function, so it
"mostly" works.)
Fixes #1530.
Diffstat (limited to 'video/out/gl_common.c')
-rw-r--r-- | video/out/gl_common.c | 10 |
1 files changed, 1 insertions, 9 deletions
diff --git a/video/out/gl_common.c b/video/out/gl_common.c index 2bb824a9f1..20d68fd029 100644 --- a/video/out/gl_common.c +++ b/video/out/gl_common.c @@ -91,7 +91,6 @@ struct feature { static const struct feature features[] = { {MPGL_CAP_FB, "Framebuffers"}, {MPGL_CAP_VAO, "VAOs"}, - {MPGL_CAP_SRGB_TEX, "sRGB textures"}, {MPGL_CAP_FLOAT_TEX, "Float textures"}, {MPGL_CAP_TEX_RG, "RG textures"}, {MPGL_CAP_1ST_CLASS_ARRAYS, "1st class shader arrays"}, @@ -224,8 +223,7 @@ static const struct gl_functions gl_functions[] = { { .ver_core = 300, .ver_es_core = 300, - .provides = MPGL_CAP_SRGB_TEX | MPGL_CAP_3D_TEX | - MPGL_CAP_1ST_CLASS_ARRAYS, + .provides = MPGL_CAP_3D_TEX | MPGL_CAP_1ST_CLASS_ARRAYS, .functions = (const struct gl_function[]) { DEF_FN(GetStringi), // for ES 3.0 @@ -285,12 +283,6 @@ static const struct gl_functions gl_functions[] = { {0} } }, - // sRGB textures, extension in GL 2.x, core in GL 3.x core. - { - .ver_core = 300, - .extension = "GL_EXT_texture_sRGB", - .provides = MPGL_CAP_SRGB_TEX, - }, // Float textures, extension in GL 2.x, core in GL 3.x core. { .ver_core = 300, |