From: Ian R. <id...@us...> - 2004-02-16 21:29:10
|
On Sunday I researched what it would take to migrate the libglx.a-libGLcore.a interface to match the (new) libGL.so-*_dri.so interface. Much to my surprise, I don't think it will be as difficult as I had first thought. There are a few issues. 1. Right now libGLcore has several entry-points for getting GLX visual information into the driver. The file programs/Xserver/GL/mesa/X/xf86glx.c contains all of this interface. The interface functions are __MESA_initVisuals, __MESA_setVisualConfigs, and __MESA_screenProbe. __MESA_screenProbe is analogous to __driCreateNewScreen. The other two functions server part of the purpose of __driCreateNewScreen, but they also do some work not related to the driver. They create a list of X (not GLX) visuals to give back to the X server. That functionality should be moved into libglx.a. 2. Mesa's X11 driver, which is the basis of libGLcore, depends on information from an X VisualInfo. Most of the uses can be eliminated trivially, but the depth / nplanes and ColomapEntries / colormap_size fields are another story. The problem here is that the __driCreateNewScreen doesn't, and can't, provide VIsualInfo structures to the driver. 3. libglx.a calls functions in directly instead of using a dispatch table. Let me clarify this a bit. On the client-side, the symbol glVertex3f is libGL.so. When an app calls that function, it looks up the "real" function and calls it. On the server-side, the symbol glVertex3f is in libGLcore.so (i.e., the driver). When a glVertex3f protocol message comes in, libglx.a calls this function directly. This function then may (or may not, as in the case of the Mac OS X libGLcore.a) do a dispatch table look-up. What should happen is the protocol functions should do the dispatch table look-up and call the function from the table. Those are the big issues that I could find. The rest of it just looks like changing function parameters and data structures, or moving code from libGLcore to libglx. I've attached a patch that removes some of the dependance on the VisualInfo structure and removes some redundant fields from the mesa_visual structure. Unless there are objections, I will commit this soon. I've only tested this with stand-alone Mesa so far. |