glcolorconvert: Prefer xRGB formats if downstream supports it and the input is not an alpha format
Based on discussions on IRC earlier.
11:26 <Company> slomo: oh yeah, GTK gained xrgb formats at some point, no idea when, so detecting that when not using alpha would avoid that mess for apps like snapshot
[...]
11:29 <ystreet00> gstgl kinda always prefers RGBA textures over RGBx atm
11:30 <slomo> ystreet00: yeah was going to ask about that. can we make glupload prefer RGB if downstream handles it and the input is not an alpha format?
11:30 <Company> GL doesn't have the RGBx concept, or?
11:30 <Company> you need to manually carry that information
11:31 <Company> and setup GL_ONE alpha swizzle on the texture
11:32 <ystreet00> gstreamer does have RGBx formats which are represented in gstgl as a RGBA texture with the alpha channel undefined
11:32 <ystreet00> you also want to do this in glcolorconvert and not glupload
11:33 <Company> you don't set a swizzle?
11:33 <Company> I think GTK assumes that a swizzle is set, but I don't remember
11:34 <Company> otherwise we'd need different shaders when blending from it, and that'd be more work
11:35 <ystreet00[m]> we do not set a swizzle
11:36 <Company> so you do custom shaders?
11:36 <ystreet00> yes
11:36 <Company> any reason for that?
11:36 <Company> supporting old GLES that didn't have swizzles?
11:36 <ystreet00> I don't remember off the top of my head about GLES 2.0 support for swizzles
11:37 <Company> I think it doesn't
11:37 <ystreet00> we already had the shader templating infrastructure for different YUV layouts, so more or less reused that for RGBA vs RGBx differences as well
11:37 <Company> that makes sense
11:38 <Company> GLES 2.0 doesn't have swizzles
11:39 <Company> the new renderer doesn't support GLES 2.0 and I think the old one just treats those formats as unsupported then
Edited by Nicolas Dufresne