I'm looking into implementing accelerated GLX in XDarwin rootless.
I checked XTools and it doesn't implement remote acceletated GLX. If you run glxinfo in a remote session, it will report that the renderer is Mesa. I want accelerated remote GLX so this may be a handful. If anybody has any suggestions I'm all ears.
There are two ways to implement GLX. One ("indirect") sends the GL commands on the X11 bytestream along with the other X11 commands, and they're decoded at the server end. The other ("direct") routes the client's GL commands out-of-band directly to the GL library, and the X11 bytestream is only used for synchronization.
Indirect mode is slower, but works for all clients. Direct mode is faster, but only works for local clients, because remote clients can't talk to the local OpenGL library. I'm guessing that Tenon has implemented a direct mode solution.
In XFree86, direct mode GLX is only available when DRI (direct screen rendering) is present, which it is not in XDarwin. I don't know how difficult it would be to make DRI work, though I'm guessing it would be hard.
I've made some progress toward an accelerated indirect mode. It probably won't be fast because of the bytestream overhead, but it would get us talking to OpenGL.
Useful GLX files are in xc/lib/GL/, especially xc/lib/GL/include/GL/internal/glcore.h; Xserver/GL/; xc/doc/specs/GL/libGL.txt
Tip: an NSOpenGLContext can be attached to any NSView, not just a special NSOpenGLView, with -[NSOpenGLContext setView:]. You can also draw GL outside of -[NSOpenGLView drawRect:]:
Actually I was wrong before, Tenon does support indirect mode (albiet with crasher bugs). I managed to run glplanets in a remote machine rendering locally, accelerated (no Quartz update flashes). However it wasn't textured.
Anyway the goal is still getting it to work in XDarwin.
I'm not all that interested in DRI because it doesn't accelerate indirect mode (yet).
If I try this, my first version will likely create another, separate window to show the GL. If that works I may leave it to somebody else to get it in the right view since I'm not all that familair with X11 region handling. A generalized way to do this may be useful for other XF4 extensions like that YUV video mode.
BTW I hope XDarwin 1.0 rootless mode will sometime surpass XDarwin 0.5 rootless mode. I find 0.5 to be more reliable and compatible.
How is 0.5 more reliable? 0.5 had crashing bugs that are gone in 1.0. As far as I can tell 1.0 is better all around except for SHAPE and maybe speed.
Pretty stable for me |-\.
Will resizing wmaker windows work once shape support is added? I'd say that's probably the main reason I prefer 0.5
SHAPE and root window drawing both need fb to play nice with the alpha channel, so they'll be done about the same time.
I've succeeded in getting glxgears to draw accelerated into a separate NSWindow. Unfortunately, this required huge hacks. In particular, allocating NSOpenGLContexts from the X server thread crashed and took gdb with it.
Another issue: there's no way to use Mesa for fullscreen and hardware for rootless, unless we compile two different apps.
May I have a copy of the xc/lib/GL/ folder?
It's part of XFree86. You should be able to get it from their anon CVS.
Sign up for the SourceForge newsletter:
You seem to have CSS turned off.
Please don't fill out this field.