From f3c84a322d46a80e624707a7e16b5caed31fb5b0 Mon Sep 17 00:00:00 2001 From: wm4 Date: Wed, 28 Jan 2015 13:36:07 +0100 Subject: 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. --- video/out/gl_common.c | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) (limited to 'video/out/gl_common.c') 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, -- cgit v1.2.3