Thomas Tanner wrote:

>  First off, we'd need a unified driver API for Mesa.
>  Why has each driver its own API? This is bad.
>  There should be single interface for applications
>  so that they don't need to know the underlying driver.

I think you're off track here.  What exactly do you mean by
"API"?  The API visible to client app developers or the internal
device driver functions?

A Mesa driver (in its current incarnation) basically has two interfaces:

1. There are the functions which implement the device driver hooks
   defined in src/dd.h.  You can name them whatever you want since
   they're private to the driver and are called via function pointers
   which the driver initializes.

2. There is the public interface which connects OpenGL/Mesa to the
   OS / window system.  This interface, by definition, is unique to
   each system.  These are the GLX, WGL, OS/Mesa, SVGA, Glide, etc
   interfaces.



>  Such an abstract interface is required for dynamic
>  loading of drivers since many platforms don't allow
>  unresolved symbols when linking against a library.
> 
>  My proposal:
> 
> typedef struct mesa_visual  *MesaVisual;
> typedef struct mesa_buffer  *MesaBuffer;
> typedef struct mesa_context *MesaContext;
> 
> extern MesaVisual MesaCreateVisual(char *driver, ...);
> extern void MesaDestroyVisual( MesaVisual visual );
> extern MesaBuffer MesaCreateBuffer(MesaVisual visual,
>                                    void *your_window_id);
> extern void MesaDestroyBuffer( MesaBuffer buffer );
> extern MesaContext MesaCreateContext( MesaVisual visual,
>                                       MesaContext sharelist );
> extern void MesaDestroyContext( MesaContext context );
> extern void MesaMakeCurrent( MesaContext context, MesaBuffer buffer );
> extern void MesaSwapBuffers( MesaBuffer buffer );


Do you intend application writers to use this API?  What about
compatibility with other OpenGL implementations?  They certainly
won't have these functions.


I think this discussion of loadable drivers is a bit misguided.
IMHO, the only practical/worthwhile place to implement dynamically
loaded drivers is in the upcoming DRI architecture.  That's where
it makes sense to dynamically load a driver depending on the graphics
card installed.

Let's wait and see what the DRI design suggests for this.

Thomas, If I'm missing your point with this please try to explain
it again.

-Brian

----------------------------------------------------------------------
Brian Paul        Avid Technology / Softimage      [EMAIL PROTECTED]


_______________________________________________
Mesa-dev maillist  -  [EMAIL PROTECTED]
http://lists.mesa3d.org/mailman/listinfo/mesa-dev

Reply via email to