Bug 24320 - glXQueryDrawable returns 0 for all attributes except GLX_FBCONFIG_ID
Summary: glXQueryDrawable returns 0 for all attributes except GLX_FBCONFIG_ID
Status: RESOLVED FIXED
Alias: None
Product: Mesa
Classification: Unclassified
Component: GLX (show other bugs)
Version: 7.5
Hardware: Other Linux (All)
: medium normal
Assignee: mesa-dev
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2009-10-05 07:11 UTC by Andrey Tsyvarev
Modified: 2009-11-09 07:32 UTC (History)
0 users

See Also:
i915 platform:
i915 features:


Attachments
reproduce bug for GLXWindow (2.21 KB, text/plain)
2009-10-05 07:11 UTC, Andrey Tsyvarev
Details
glxinfo output (9.92 KB, text/plain)
2009-10-07 07:46 UTC, Andrey Tsyvarev
Details
glxinfo output without additional environment variables (9.19 KB, text/plain)
2009-10-07 07:49 UTC, Andrey Tsyvarev
Details

Description Andrey Tsyvarev 2009-10-05 07:11:37 UTC
Created attachment 30077 [details]
reproduce bug for GLXWindow

According to the description of glXQueryDrawable(), it should return attribute value for GLXDrawable, passed it as parameter.
But for all attributes except GLX_FBCONFIG_ID it returns 0.
E.g., it returns 0 for GLX_WIDTH and GLX_HEIGHT attributes for all drawables type, while drawables have non-zero sizes.
Also the function always returns 0 for GLX_LARGEST_PBUFFER and GLX_PRESERVED_CONTENTS attributes of GLXPbuffer.
Comment 1 Brian Paul 2009-10-06 08:23:09 UTC
One quick thing to check:  Do you have GLX 1.3 or later?  glXQueryDrawable() is a 1.3 function.  Run 'glxinfo' and check the "GLX version" line.
Comment 2 Andrey Tsyvarev 2009-10-07 02:48:00 UTC
GLX version, shown by glxinfo, is 1.4.

X server is Xvfb, native for Ubuntu 8.10. Normally, it corresponds with Mesa 6.2(GLX version 1.2), but when runnning with LD_LIBRARY_PATH pointed to Mesa 7.5, GLX version for server becomes 1.4. May be, the problem in that?

But the most of others GLX 1.3 functions works well, including functions which works with GLXFBConfig.
Even this function, glXQueryDrawable, works correctly for GLX_FBCONFIG_ID attribute.
Comment 3 Corbin Simpson 2009-10-07 05:41:01 UTC
Ian and I discussed this last week. We were not reporting GLX 1.4 until very recently (the patch just came in a few days ago) so I'm a bit skeptical that you're actually getting GLX 1.4 on the server and not just the client, unless you're using binary drivers.

Yes, some of the functions work correctly, including EXT_texture_from_pixmap functions, but I'm told that that is a "feature" of our glXGetProcAddress, which always returns a somewhat valid pointer, even for functions that probably shouldn't be there.

Could you attach your glxinfo?
Comment 4 Andrey Tsyvarev 2009-10-07 07:46:47 UTC
Created attachment 30141 [details]
glxinfo output

GLX 1.4 on the server is only when LD_LIBRARY_PATH pointed to Mesa 7.5 library, compiled with --with-driver=xlib(only software implementation). As I understand, this variant of GLX library is actually fully implemented on the client side, so it doesn't depend on X server at all, and may returns any server side parameters.

Really, GLX version of server is 1.2(as I noted in the previouse post).

I understand, that for GLX 1.2 using of GLX 1.3 commands leads, strictly speaking, to an unspecified behaviour. But:

-if this variant of GLX implementation is really fully client side, why does it depend on server's GLX version?
-if it depends on server's GLX, why it returns wrong GLX version for the server? Moreover, how can library user test, whether he is allowed to use GLX 1.3 commands?
Comment 5 Andrey Tsyvarev 2009-10-07 07:49:47 UTC
Created attachment 30142 [details]
glxinfo output without additional environment variables

"Real" version of the GLX on the server.
Comment 6 Brian Paul 2009-10-07 08:44:55 UTC
OK, there's a few bugs in the fake GLX code here.  I've committed fixes to the Mesa 7.6 branch.

For the real GLX case (the second glxinfo) you've only got GLX 1.2 (the lesser of the client and server versions) to glXQueryDrawable() isn't available.

Can you test Mesa 7.6 from git?
Comment 7 Brian Paul 2009-11-09 07:32:32 UTC
Fixed with commit c3eef6021a06d728aa4c8b882264f554f2d4b801 and 0526100a5cbd928fa28d38abdafd6beb024b0828.  No follow-up since so closing now.


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.