mirror of
https://github.com/baldurk/renderdoc.git
synced 2026-08-28 17:36:36 +00:00
Improve robustness of fbconfig selection for cloned GL context (glX)
The glXGetConfig(..., GLX_FBCONFIG_ID, &fbcfgID) call does not work reliably on many implementations. In this case, all available fbconfigs are queried and the first one is chosen, but this might be incompatible to the visual of the window, resulting in a failure when the cloned context is made current for the first time (issue: #2898). This adds a fallback to query the fbconfig ID from the GL context if querying it from the VisualInfo failed.
This commit is contained in:
@@ -81,6 +81,10 @@ class GLXPlatform : public GLPlatform
|
||||
{
|
||||
int fbcfgID = -1;
|
||||
GLX.glXGetConfig(share.dpy, share.cfg, GLX_FBCONFIG_ID, &fbcfgID);
|
||||
|
||||
if(fbcfgID == -1)
|
||||
GLX.glXQueryContext(share.dpy, share.ctx, GLX_FBCONFIG_ID, &fbcfgID);
|
||||
|
||||
if(fbcfgID != -1)
|
||||
{
|
||||
visAttribs[i++] = GLX_FBCONFIG_ID;
|
||||
|
||||
Reference in New Issue
Block a user