by pdw · 14y ago · 0 comments
There are two things named GLX: First, it's a network protocol for sending OpenGL requests to an X server. Second, it's a library that X clients use to set up an OpenGL context. Traditionally, the GLX library used the GLX protocol, but in these days of client-side rendering the GLX protocol is just unused legacy junk.
Next, Xlib. Xlib is the traditional client library for the X protocol. I'ts a huge unmaintainable non-threadsafe mess, too low-level for application developers but hiding too much of the X protocol for toolkit developers. Everybody hates it.
As an alternative, the X developers created the XCB ("X C Bindings") library. XCB is much smaller than Xlib, is thread-safe and gives toolkit devs very fine control about how they handle X11 communication. XCB-GLX is XCB's implementation of the obsolete GLX protocol. (Most of XCB is auto-generated based on protocol descriptions, so it was little extra effort to include it for completeness.)
Now the GLX library API is still based on Xlib, not on XCB. The X developers however made sure that a single application could simultaneously use both XCB and Xlib, http://xcb.freedesktop.org/MixingCalls/. So that shouldn't be a problem.
I don't understand why Qt5 can't use that, and the article doesn't explain.
It is maybe still possible to use enough of of xlib+nvidia-glx in an XCB app to make things work but I think that's uncharted territory -- and it seems likely to me nvidia's glx expects you to have the other pieces of xlib around, such as using xlib's event queues.
I've done XCB+Xlib+GLX + proprietary graphics drivers, it does work although it's sort of uncharted territory but if you're brave you can make it work. Initialize Xlib as usual, then use XSetEventQueueOwner to enable handling events with XCB and finally do you GLX stuff with the Xlib Display object.
Nvidia needs to just come out and say yes if wayland proves fruitfull we will support it.