Bug 62999 - glXChooseFBConfig with GLX_DRAWABLE_TYPE, GLX_DONT_CARE fails
glXChooseFBConfig with GLX_DRAWABLE_TYPE, GLX_DONT_CARE fails
Status: RESOLVED DUPLICATE of bug 47478
Product: Mesa
Classification: Unclassified
Component: GLX
unspecified
Other All
: medium normal
Assigned To: mesa-dev
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2013-04-01 16:36 UTC by Alexander Monakov
Modified: 2013-04-01 19:18 UTC (History)
0 users

See Also:
i915 platform:
i915 features:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Alexander Monakov 2013-04-01 16:36:43 UTC
The following aborts, indicating a wrong implementation of GLX spec.  This is minimized from failing startup of Rage under Wine.


#include <GL/glx.h>
#include <assert.h>

int main()
{
  int n;
  glXChooseFBConfig(XOpenDisplay(NULL), 0, (int[]){GLX_DRAWABLE_TYPE, GLX_DONT_CARE, 0}, &n);
  assert(n);
}
Comment 1 Brian Paul 2013-04-01 18:08:10 UTC
Can you attach the output of glxinfo?
Comment 2 Alexander Monakov 2013-04-01 18:21:12 UTC
(In reply to comment #1)
> Can you attach the output of glxinfo?

I don't want to sound arrogant, but I fail to see how that would be relevant.

In http://cgit.freedesktop.org/mesa/mesa/tree/src/glx/glxcmds.c, fbconfigs_compatible() fails to follow the GLX specification, which says:

    If GLX_DONT_CARE is specified as an attribute value,
    then the attribute will not be checked.

MATCH_EXACT and MATCH_MASK don't check a->param for GLX_DONT_CARE.
Comment 3 gurketsky 2013-04-01 18:33:06 UTC
Dupe of bug 47478 .
Comment 4 gurketsky 2013-04-01 18:34:07 UTC

*** This bug has been marked as a duplicate of bug 47478 ***
Comment 5 Brian Paul 2013-04-01 18:52:46 UTC
(In reply to comment #2)
> (In reply to comment #1)
> > Can you attach the output of glxinfo?
> 
> I don't want to sound arrogant, but I fail to see how that would be relevant.
> 
> In http://cgit.freedesktop.org/mesa/mesa/tree/src/glx/glxcmds.c,
> fbconfigs_compatible() fails to follow the GLX specification, which says:
> 
>     If GLX_DONT_CARE is specified as an attribute value,
>     then the attribute will not be checked.
> 
> MATCH_EXACT and MATCH_MASK don't check a->param for GLX_DONT_CARE.

There are three implementations of GLX in the Mesa tree:
src/glx/  (for DRI drivers)
src/mesa/drivers/x11/  (for legacy swrast)
src/gallium/state_trackers/glx/xlib/  (for llvmpipe/softpipe)

The output of glxinfo would tell me which one you're using.
Comment 6 Alexander Monakov 2013-04-01 18:56:30 UTC
Thanks for the explanation.  I was talking, of course, about the first (DRI).  I was assuming you ran the testcase and saw the failure.
Comment 7 Alexander Monakov 2013-04-01 19:18:32 UTC

*** This bug has been marked as a duplicate of bug 47478 ***