I'm not sure if this problem is with GetAllFBConfigs in pbutil.c or with the implementation of glXChooseFBConfigSGIX in the open-source libGL. Either way, when GetAllFBConfigs uses glXChooseFBConfigSGIX with the attributes { GLX_RENDER_TYPE, 0, GLX_DRAWABLE_TYPE, 0, None }, no fbconfigs are returned. However, changing the attributes to { GLX_DEPTH_SIZE, 0, None } seems to work as expected on the open-source libGL. I haven't had a chance to test this yet with Nvidia's libGL. Which piece of code has the problem?
Created attachment 2338 [details] [review] Allow pbinfo to work without GLX_SGIX_pbuffer As-is, pbinfo won't work unless either GLX 1.3 or both GLX_SGIX_fbconfig and GLX_SGIX_pbuffer are available. This hacky patch allows it to run with either GLX 1.3 or GLX_SGIX_fbconfig (wihtout also needing GLX_SGIX_pbuffer). Without this patch, pbinfo can't be used with the open-source DRI drivers to reproduce this bug.
I found that glXGetChooseFBConfigSGIX() is supposed to return a list of all fbconfigs if the attribList pointer is NULL. In stand-alone Mesa, this resulted in a crash. I've fixed the Fake/Xlib driver to do the right thing. You should check what the DRI libGL does with a NULL pointer. I'm checking in updates to pbutil.[ch] to call glXChooseFBConfigSGIX() with NULL in the GetAllFBConfigs() routine. That might fix your problem in the initial bug report. Do you want your "hacky patch" applied as-is, or are you looking for something cleaner?
Looking at the extension spec, I believe that Brian has the right solution for this bug. As it turns out, the DRI libGL *also* causes a segv when a NULL pointer is passed to glXChooseFBConfigSGIX. I've filed bug #2917 for that. As for my hacky-patch, I'm going to continue working on it for a bit. When I get something a little cleaner, and I *am* getting there, I'll go ahead and commit it. Thanks for following up on this.
With Brian's changes and bug #2917 being fixed, I'm closing this as fixed.
Mass version move, cvs -> git
Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.