GNOME Bugzilla – Bug 663127
[PATCH] cogl-winsys-glx: fix fallback to RGB visuals
Last modified: 2011-11-04 16:43:28 UTC
Created attachment 200368 [details] [review] cogl-winsys-glx: fix fallback to RGB visuals A comment says that if RGBA visuals not found, we fall back to using an RGB config. But it's not happened in fact. This patch fixes the failure with the Nouveau classic Mesa driver, if RGBA visuals requested, but not found. If you accept this fix, please apply it for both master and cogl-1.8 branch.
Created attachment 200402 [details] [review] cogl: fallback to non-transparent stages if unsupported thanks for jumping in and making a patch! I think though clutter should probably handle this fallback not cogl, because cogl doesn't know if such a fallback is really acceptable. Currently the only fallback similar to this that we handle in cogl is for egl to fallback when no stencil buffer is found but generally we would rather not second guess what is acceptable as a fallback - even for the stencil buffer case I'd rather have apis like clutter handle that at some point. Can you perhaps point to the comment you refer to that says if RGBA visuals not found, we fall back to using an RGB config? I wonder if that was a comment in clutter not cogl? That comment should probably updated if it's in cogl. I've scrapped together a patch that tries to do the fallback in clutter instead, It'd be good to hear if that works for you too.
Thanks, your patch for clutter solves also this problem! The misleading comment can be found in file cogl-winsys-glx.c line 562: http://git.gnome.org/browse/cogl/tree/cogl/winsys/cogl-winsys-glx.c#n562
Review of attachment 200402 [details] [review]: looks good to me. we might want to revisit the GError usage in a later commit, since Clutter should not just relay Cogl GError domains in this case.
(In reply to comment #2) > Thanks, your patch for clutter solves also this problem! > > The misleading comment can be found in file cogl-winsys-glx.c line 562: > http://git.gnome.org/browse/cogl/tree/cogl/winsys/cogl-winsys-glx.c#n562 ah right, yeah looking at the code it doesn't look like it actually tries to fallback though it probably did at some point, we should remove that comment. thanks for testing the patch, I've landed it in master as: commit db53ca382c5db10fa19f93761b8f898b20a4534f Author: Robert Bragg <robert@linux.intel.com> Date: Tue Nov 1 13:42:40 2011 +0000 cogl: fallback to non-transparent stages if unsupported If our check of the CoglOnscreenTemplate during initialization fails then we disable the request for an alpha component in the swap chain and try the check again. Reviewed-by: Neil Roberts <neil@linux.intel.com> Reviewed-by: Emmanuele Bassi <ebassi@linux.intel.com> I will also cherry-pick the patch for the 1.8 branch
*** Bug 663411 has been marked as a duplicate of this bug. ***