more work on GL_ARB_texture_compression
[mesa.git] / src / mesa / main / dd.h
index aae4d714733bb862d93560f0d27c6a7f6f2b97e5..106d99d780f4963d8e4ddf8e27b291098c62f51b 100644 (file)
@@ -1,10 +1,9 @@
-/* $Id: dd.h,v 1.2 1999/09/18 20:41:22 keithw Exp $ */
 
 /*
  * Mesa 3-D graphics library
- * Version:  3.1
+ * Version:  3.3
  * 
- * Copyright (C) 1999  Brian Paul   All Rights Reserved.
+ * Copyright (C) 1999-2000  Brian Paul   All Rights Reserved.
  * 
  * Permission is hereby granted, free of charge, to any person obtaining a
  * copy of this software and associated documentation files (the "Software"),
@@ -63,10 +62,10 @@ struct gl_pipeline_stage;
  * The optional functions provide ways to take advantage of special hardware
  * or optimized algorithms.
  *
- * The function pointers in the dd_function_table struct are first
- * initialized in the "MakeCurrent" function.  The "MakeCurrent" function
- * is a little different in each device driver.  See the X/Mesa, GLX, or
- * OS/Mesa drivers for examples.
+ * The function pointers in the dd_function_table struct should first be
+ * initialized in the driver's "MakeCurrent" function.  The "MakeCurrent"
+ * function is a little different in each device driver.  See the X/Mesa,
+ * GLX, or OS/Mesa drivers for examples.
  *
  * Later, Mesa may call the dd_function_table's UpdateState() function.
  * This function should initialize the dd_function_table's pointers again.
@@ -81,7 +80,8 @@ struct gl_pipeline_stage;
  * for an example.
  *
  * For more information about writing a device driver see the ddsample.c
- * file and other device drivers (xmesa[123].c, osmesa.c, etc) for examples.
+ * file and other device drivers (X/xmesa[1234].c, OSMesa/osmesa.c, etc)
+ * for examples.
  *
  *
  * Look below in the dd_function_table struct definition for descriptions
@@ -117,6 +117,15 @@ struct gl_pipeline_stage;
 
 
 
+/* Mask bits sent to the driver Clear() function */
+#define DD_FRONT_LEFT_BIT  FRONT_LEFT_BIT         /* 1 */
+#define DD_FRONT_RIGHT_BIT FRONT_RIGHT_BIT        /* 2 */
+#define DD_BACK_LEFT_BIT   BACK_LEFT_BIT          /* 4 */
+#define DD_BACK_RIGHT_BIT  BACK_RIGHT_BIT         /* 8 */
+#define DD_DEPTH_BIT       GL_DEPTH_BUFFER_BIT    /* 0x00000100 */
+#define DD_STENCIL_BIT     GL_STENCIL_BUFFER_BIT  /* 0x00000400 */
+#define DD_ACCUM_BIT       GL_ACCUM_BUFFER_BIT    /* 0x00000200 */
+
 
 
 /*
@@ -129,12 +138,10 @@ struct dd_function_table {
     *** every device driver.                                           ***
     **********************************************************************/
 
-   const char * (*RendererString)(void);
-   /*
-    * Return a string which uniquely identifies this device driver.
-    * The string should contain no whitespace.  Examples: "X11" "OffScreen"
-    * "MSWindows" "SVGA".
-    * NOTE: This function will be obsolete in favor of GetString in the future!
+   const GLubyte * (*GetString)( GLcontext *ctx, GLenum name );
+   /* Return a string as needed by glGetString().
+    * Only the GL_RENDERER token must be implemented.  Otherwise,
+    * NULL can be returned.
     */
 
    void (*UpdateState)( GLcontext *ctx );
@@ -147,39 +154,45 @@ struct dd_function_table {
    void (*ClearIndex)( GLcontext *ctx, GLuint index );
    /*
     * Called whenever glClearIndex() is called.  Set the index for clearing
-    * the color buffer.
+    * the color buffer when in color index mode.
     */
 
    void (*ClearColor)( GLcontext *ctx, GLubyte red, GLubyte green,
                                         GLubyte blue, GLubyte alpha );
    /*
     * Called whenever glClearColor() is called.  Set the color for clearing
-    * the color buffer.
+    * the color buffer when in RGBA mode.
     */
 
    GLbitfield (*Clear)( GLcontext *ctx, GLbitfield mask, GLboolean all,
                         GLint x, GLint y, GLint width, GLint height );
    /* Clear the color/depth/stencil/accum buffer(s).
-    * 'mask' indicates which buffers need to be cleared.  Return a bitmask
-    *    indicating which buffers weren't cleared by the driver function.
-    * If 'all' is true then the clear the whole buffer, else clear the
-    *    region defined by (x,y,width,height).
+    * 'mask' is a bitmask of the DD_*_BIT values defined above that indicates
+    * which buffers need to be cleared.  The driver should clear those
+    * buffers then return a new bitmask indicating which buffers should be
+    * cleared by software Mesa.
+    * If 'all' is true then the clear the whole buffer, else clear only the
+    * region defined by (x,y,width,height).
+    * This function must obey the glColorMask, glIndexMask and glStencilMask
+    * settings!  Software Mesa can do masked clears if the device driver can't.
     */
 
    void (*Index)( GLcontext *ctx, GLuint index );
    /*
     * Sets current color index for drawing flat-shaded primitives.
+    * This index should also be used in the "mono" drawing functions.
     */
 
    void (*Color)( GLcontext *ctx,
                   GLubyte red, GLubyte green, GLubyte glue, GLubyte alpha );
    /*
     * Sets current color for drawing flat-shaded primitives.
+    * This color should also be used in the "mono" drawing functions.
     */
 
-   GLboolean (*SetBuffer)( GLcontext *ctx, GLenum buffer );
+   GLboolean (*SetDrawBuffer)( GLcontext *ctx, GLenum buffer );
    /*
-    * Selects the color buffer(s) for reading and writing.
+    * Specifies the current buffer for writing.
     * The following values must be accepted when applicable:
     *    GL_FRONT_LEFT - this buffer always exists
     *    GL_BACK_LEFT - when double buffering
@@ -197,8 +210,18 @@ struct dd_function_table {
     *    GL_NONE - disable buffer write in device driver.
     */
 
-   void (*GetBufferSize)( GLcontext *ctx,
-                          GLuint *width, GLuint *height );
+   void (*SetReadBuffer)( GLcontext *ctx, GLframebuffer *colorBuffer,
+                          GLenum buffer );
+   /*
+    * Specifies the current buffer for reading.
+    * colorBuffer will be one of:
+    *    GL_FRONT_LEFT - this buffer always exists
+    *    GL_BACK_LEFT - when double buffering
+    *    GL_FRONT_RIGHT - when using stereo
+    *    GL_BACK_RIGHT - when using stereo and double buffering
+    */
+
+   void (*GetBufferSize)( GLcontext *ctx, GLuint *width, GLuint *height );
    /*
     * Returns the width and height of the current color buffer.
     */
@@ -214,13 +237,15 @@ struct dd_function_table {
    void (*WriteRGBSpan)( const GLcontext *ctx,
                          GLuint n, GLint x, GLint y,
                          CONST GLubyte rgb[][3], const GLubyte mask[] );
-   /* Write a horizontal run of RGB[A] pixels.  The later version is only
-    * used to accelerate GL_RGB, GL_UNSIGNED_BYTE glDrawPixels() calls.
+   /* Write a horizontal run of RGBA or RGB pixels.
+    * If mask is NULL, draw all pixels.
+    * If mask is not null, only draw pixel [i] when mask [i] is true.
     */
 
    void (*WriteMonoRGBASpan)( const GLcontext *ctx, GLuint n, GLint x, GLint y,
                               const GLubyte mask[] );
-   /* Write a horizontal run of mono-RGBA pixels.
+   /* Write a horizontal run of RGBA pixels all with the color last
+    * specified by the Color function.
     */
 
    void (*WriteRGBAPixels)( const GLcontext *ctx,
@@ -239,12 +264,15 @@ struct dd_function_table {
                           const GLuint index[], const GLubyte mask[] );
    void (*WriteCI8Span)( const GLcontext *ctx, GLuint n, GLint x, GLint y,
                          const GLubyte index[], const GLubyte mask[] );
-   /* Write a horizontal run of CI pixels.  32 or 8bpp.
+   /* Write a horizontal run of CI pixels.  One function is for 32bpp
+    * indexes and the other for 8bpp pixels (the common case).  You mus
+    * implement both for color index mode.
     */
 
    void (*WriteMonoCISpan)( const GLcontext *ctx, GLuint n, GLint x, GLint y,
                             const GLubyte mask[] );
-   /* Write a horizontal run of mono-CI pixels.
+   /* Write a horizontal run of color index pixels using the color index
+    * last specified by the Index() function.
     */
 
    void (*WriteCI32Pixels)( const GLcontext *ctx,
@@ -257,8 +285,8 @@ struct dd_function_table {
    void (*WriteMonoCIPixels)( const GLcontext *ctx,
                               GLuint n, const GLint x[], const GLint y[],
                               const GLubyte mask[] );
-   /*
-    * Write a random array of mono-CI pixels.
+   /* Write a random array of color index pixels using the color index
+    * last specified by the Index() function.
     */
 
 
@@ -297,25 +325,14 @@ struct dd_function_table {
     *** fall-back function.                                            ***
     **********************************************************************/
 
-   const char * (*ExtensionString)( GLcontext *ctx );
-   /* Return a space-separated list of extensions for this driver.
-    * NOTE: This function will be obsolete in favor of GetString in the future!
-    */
-
-   const GLubyte * (*GetString)( GLcontext *ctx, GLenum name );
-   /* Return a string as needed by glGetString().
-    * NOTE: This will replace the ExtensionString and RendererString
-    * functions in the future!
-    */
-
    void (*Finish)( GLcontext *ctx );
    /*
-    * Called whenever glFinish() is called.
+    * This is called whenever glFinish() is called.
     */
 
    void (*Flush)( GLcontext *ctx );
    /*
-    * Called whenever glFlush() is called.
+    * This is called whenever glFlush() is called.
     */
 
    GLboolean (*IndexMask)( GLcontext *ctx, GLuint mask );
@@ -372,64 +389,349 @@ struct dd_function_table {
 
    /***
     *** For supporting hardware Z buffers:
+    *** Either ALL or NONE of these functions must be implemented!
+    *** NOTE that Each depth value is a 32-bit GLuint.  If the depth
+    *** buffer is less than 32 bits deep then the extra upperbits are zero.
     ***/
 
-   void (*AllocDepthBuffer)( GLcontext *ctx );
-   /*
-    * Called when the depth buffer must be allocated or possibly resized.
+   void (*WriteDepthSpan)( GLcontext *ctx, GLuint n, GLint x, GLint y,
+                           const GLdepth depth[], const GLubyte mask[] );
+   /* Write a horizontal span of values into the depth buffer.  Only write
+    * depth[i] value if mask[i] is nonzero.
     */
 
-   GLuint (*DepthTestSpan)( GLcontext *ctx,
-                            GLuint n, GLint x, GLint y, const GLdepth z[],
-                            GLubyte mask[] );
-   void (*DepthTestPixels)( GLcontext *ctx,
-                            GLuint n, const GLint x[], const GLint y[],
-                            const GLdepth z[], GLubyte mask[] );
-   /*
-    * Apply the depth buffer test to an span/array of pixels and return
-    * an updated pixel mask.  This function is not used when accelerated
-    * point, line, polygon functions are used.
+   void (*ReadDepthSpan)( GLcontext *ctx, GLuint n, GLint x, GLint y,
+                          GLdepth depth[] );
+   /* Read a horizontal span of values from the depth buffer.
     */
 
-   void (*ReadDepthSpanFloat)( GLcontext *ctx,
-                               GLuint n, GLint x, GLint y, GLfloat depth[]);
-   void (*ReadDepthSpanInt)( GLcontext *ctx,
-                             GLuint n, GLint x, GLint y, GLdepth depth[] );
-   /*
-    * Return depth values as integers for glReadPixels.
-    * Floats should be returned in the range [0,1].
-    * Ints (GLdepth) values should be in the range [0,MAXDEPTH].
+
+   void (*WriteDepthPixels)( GLcontext *ctx, GLuint n,
+                             const GLint x[], const GLint y[],
+                             const GLdepth depth[], const GLubyte mask[] );
+   /* Write an array of randomly positioned depth values into the
+    * depth buffer.  Only write depth[i] value if mask[i] is nonzero.
+    */
+
+   void (*ReadDepthPixels)( GLcontext *ctx, GLuint n,
+                            const GLint x[], const GLint y[],
+                            GLdepth depth[] );
+   /* Read an array of randomly positioned depth values from the depth buffer.
     */
 
 
+
    /***
-    *** Accelerated point, line, polygon, glDrawPixels and glBitmap functions:
+    *** For supporting hardware stencil buffers:
+    *** Either ALL or NONE of these functions must be implemented!
     ***/
 
-   points_func   PointsFunc;
-   line_func     LineFunc;
-   triangle_func TriangleFunc;
-   quad_func     QuadFunc;
-   rect_func     RectFunc;    
-   
+   void (*WriteStencilSpan)( GLcontext *ctx, GLuint n, GLint x, GLint y,
+                             const GLstencil stencil[], const GLubyte mask[] );
+   /* Write a horizontal span of stencil values into the stencil buffer.
+    * If mask is NULL, write all stencil values.
+    * Else, only write stencil[i] if mask[i] is non-zero.
+    */
+
+   void (*ReadStencilSpan)( GLcontext *ctx, GLuint n, GLint x, GLint y,
+                            GLstencil stencil[] );
+   /* Read a horizontal span of stencil values from the stencil buffer.
+    */
+
+   void (*WriteStencilPixels)( GLcontext *ctx, GLuint n,
+                               const GLint x[], const GLint y[],
+                               const GLstencil stencil[],
+                               const GLubyte mask[] );
+   /* Write an array of stencil values into the stencil buffer.
+    * If mask is NULL, write all stencil values.
+    * Else, only write stencil[i] if mask[i] is non-zero.
+    */
+
+   void (*ReadStencilPixels)( GLcontext *ctx, GLuint n,
+                              const GLint x[], const GLint y[],
+                              GLstencil stencil[] );
+   /* Read an array of stencil values from the stencil buffer.
+    */
+  
+
+   /***
+    *** glDraw/Read/CopyPixels and glBitmap functions:
+    ***/
 
    GLboolean (*DrawPixels)( GLcontext *ctx,
                             GLint x, GLint y, GLsizei width, GLsizei height,
                             GLenum format, GLenum type,
                             const struct gl_pixelstore_attrib *unpack,
                             const GLvoid *pixels );
-   /* Device driver hook for optimized glDrawPixels.  'unpack' describes how
-    * to unpack the source image data.
+   /* This is called by glDrawPixels.
+    * 'unpack' describes how to unpack the source image data.
+    * Return GL_TRUE if the driver succeeds, return GL_FALSE if core Mesa
+    * must do the job.
+    */
+
+   GLboolean (*ReadPixels)( GLcontext *ctx,
+                            GLint x, GLint y, GLsizei width, GLsizei height,
+                            GLenum format, GLenum type,
+                            const struct gl_pixelstore_attrib *unpack,
+                            GLvoid *dest );
+   /* Called by glReadPixels.
+    * Return GL_TRUE if operation completed, else return GL_FALSE.
+    * This function must respect all glPixelTransfer settings.
+    */
+
+   GLboolean (*CopyPixels)( GLcontext *ctx,
+                            GLint srcx, GLint srcy,
+                            GLsizei width, GLsizei height,
+                            GLint dstx, GLint dsty, GLenum type );
+   /* Do a glCopyPixels.  Return GL_TRUE if operation completed, else
+    * return GL_FALSE.  This function must respect all rasterization
+    * state, glPixelTransfer, glPixelZoom, etc.
     */
 
    GLboolean (*Bitmap)( GLcontext *ctx,
                         GLint x, GLint y, GLsizei width, GLsizei height,
                         const struct gl_pixelstore_attrib *unpack,
                         const GLubyte *bitmap );
-   /* Device driver hook for optimized glBitmap.  'unpack' describes how
-    * to unpack the source image data.
+   /* This is called by glBitmap.  Works the same as DrawPixels, above.
+    */
+
+
+   /***
+    *** Texture mapping functions:
+    ***/
+
+   void (*TexImage)( GLcontext *ctx, GLenum target,
+                     struct gl_texture_object *tObj, GLint level,
+                     GLint internalFormat,
+                     const struct gl_texture_image *image );
+   /* XXX this function is obsolete */
+   /* Called whenever a texture object's image is changed.
+    *    texObject is the number of the texture object being changed.
+    *    level indicates the mipmap level.
+    *    internalFormat is the format in which the texture is to be stored.
+    *    image is a pointer to a gl_texture_image struct which contains
+    *       the actual image data.
+    */
+
+   void (*TexSubImage)( GLcontext *ctx, GLenum target,
+                        struct gl_texture_object *tObj, GLint level,
+                        GLint xoffset, GLint yoffset,
+                        GLsizei width, GLsizei height,
+                        GLint internalFormat,
+                        const struct gl_texture_image *image );
+   /* XXX this function is obsolete */
+   /* Called from glTexSubImage() to define a sub-region of a texture.
+    */
+
+
+   GLboolean (*TexImage1D)( GLcontext *ctx, GLenum target, GLint level,
+                            GLenum format, GLenum type, const GLvoid *pixels,
+                            const struct gl_pixelstore_attrib *packing,
+                            struct gl_texture_object *texObj,
+                            struct gl_texture_image *texImage,
+                            GLboolean *retainInternalCopy );
+   GLboolean (*TexImage2D)( GLcontext *ctx, GLenum target, GLint level,
+                            GLenum format, GLenum type, const GLvoid *pixels,
+                            const struct gl_pixelstore_attrib *packing,
+                            struct gl_texture_object *texObj,
+                            struct gl_texture_image *texImage,
+                            GLboolean *retainInternalCopy );
+   GLboolean (*TexImage3D)( GLcontext *ctx, GLenum target, GLint level,
+                            GLenum format, GLenum type, const GLvoid *pixels,
+                            const struct gl_pixelstore_attrib *packing,
+                            struct gl_texture_object *texObj,
+                            struct gl_texture_image *texImage,
+                            GLboolean *retainInternalCopy );
+   /* Called by glTexImage1/2/3D.
+    * Will not be called if any glPixelTransfer operations are enabled.
+    * Arguments:
+    *   <target>, <level>, <format>, <type> and <pixels> are user specified.
+    *   <packing> indicates the image packing of pixels.
+    *   <texObj> is the target texture object.
+    *   <texImage> is the target texture image.  It will have the texture
+    *      width, height, depth, border and internalFormat information.
+    *   <retainInternalCopy> is returned by this function and indicates whether
+    *      core Mesa should keep an internal copy of the texture image.
+    * Return GL_TRUE if operation completed, return GL_FALSE if core Mesa
+    * should do the job.  If GL_FALSE is returned, this function will be
+    * called a second time after the texture image has been unpacked into
+    * GLubytes.  It may be easier for the driver to handle then.
+    */
+
+   GLboolean (*TexSubImage1D)( GLcontext *ctx, GLenum target, GLint level,
+                               GLint xoffset, GLsizei width,
+                               GLenum format, GLenum type,
+                               const GLvoid *pixels,
+                               const struct gl_pixelstore_attrib *packing,
+                               struct gl_texture_object *texObj,
+                               struct gl_texture_image *texImage );
+   GLboolean (*TexSubImage2D)( GLcontext *ctx, GLenum target, GLint level,
+                               GLint xoffset, GLint yoffset,
+                               GLsizei width, GLsizei height,
+                               GLenum format, GLenum type,
+                               const GLvoid *pixels,
+                               const struct gl_pixelstore_attrib *packing,
+                               struct gl_texture_object *texObj,
+                               struct gl_texture_image *texImage );
+   GLboolean (*TexSubImage3D)( GLcontext *ctx, GLenum target, GLint level,
+                               GLint xoffset, GLint yoffset, GLint zoffset,
+                               GLsizei width, GLsizei height, GLint depth,
+                               GLenum format, GLenum type,
+                               const GLvoid *pixels,
+                               const struct gl_pixelstore_attrib *packing,
+                               struct gl_texture_object *texObj,
+                               struct gl_texture_image *texImage );
+   /* Called by glTexSubImage1/2/3D.
+    * Will not be called if any glPixelTransfer operations are enabled.
+    * Arguments:
+    *   <target>, <level>, <xoffset>, <yoffset>, <zoffset>, <width>, <height>,
+    *      <depth>, <format>, <type> and <pixels> are user specified.
+    *   <packing> indicates the image packing of pixels.
+    *   <texObj> is the target texture object.
+    *   <texImage> is the target texture image.  It will have the texture
+    *      width, height, border and internalFormat information.
+    * Return GL_TRUE if operation completed, return GL_FALSE if core Mesa
+    * should do the job.  If GL_FALSE is returned, then TexImage1/2/3D will
+    * be called with the complete texture image.
+    */
+      
+   GLboolean (*CopyTexImage1D)( GLcontext *ctx, GLenum target, GLint level,
+                                GLenum internalFormat, GLint x, GLint y,
+                                GLsizei width, GLint border );
+   GLboolean (*CopyTexImage2D)( GLcontext *ctx, GLenum target, GLint level,
+                                GLenum internalFormat, GLint x, GLint y,
+                                GLsizei width, GLsizei height, GLint border );
+   /* Called by glCopyTexImage1D and glCopyTexImage2D.
+    * Will not be called if any glPixelTransfer operations are enabled.
+    * Return GL_TRUE if operation completed, return GL_FALSE if core Mesa
+    * should do the job.
+    */
+
+   GLboolean (*CopyTexSubImage1D)( GLcontext *ctx, GLenum target, GLint level,
+                                   GLint xoffset,
+                                   GLint x, GLint y, GLsizei width );
+   GLboolean (*CopyTexSubImage2D)( GLcontext *ctx, GLenum target, GLint level,
+                                   GLint xoffset, GLint yoffset,
+                                   GLint x, GLint y,
+                                   GLsizei width, GLsizei height );
+   GLboolean (*CopyTexSubImage3D)( GLcontext *ctx, GLenum target, GLint level,
+                                   GLint xoffset, GLint yoffset, GLint zoffset,
+                                   GLint x, GLint y,
+                                   GLsizei width, GLsizei height );
+   /* Called by glCopyTexSubImage1/2/3D.
+    * Will not be called if any glPixelTransfer operations are enabled.
+    * Return GL_TRUE if operation completed, return GL_FALSE if core Mesa
+    * should do the job.
+    */
+
+   GLvoid *(*GetTexImage)( GLcontext *ctx, GLenum target, GLint level,
+                           const struct gl_texture_object *texObj,
+                           GLenum *formatOut, GLenum *typeOut,
+                           GLboolean *freeImageOut );
+   /* Called by glGetTexImage or by core Mesa when a texture image
+    * is needed for software fallback rendering.
+    * Return the address of the texture image or NULL if failure.
+    * The image must be tightly packed (i.e. row stride = image width)
+    * Return the image's format and type in formatOut and typeOut.
+    * The format and type must be values which are accepted by glTexImage.
+    * Set the freeImageOut flag if the returned image should be deallocated
+    * with FREE() when finished.
+    * The size of the image can be deduced from the target and level.
+    * Core Mesa will perform any image format/type conversions that are needed.
+    */
+
+   GLboolean (*CompressedTexImage1D)( GLcontext *ctx, GLenum target,
+                                      GLint level, const GLvoid *data,
+                                      struct gl_texture_object *texObj,
+                                      struct gl_texture_image *texImage,
+                                      GLboolean *retainInternalCopy);
+   GLboolean (*CompressedTexImage2D)( GLcontext *ctx, GLenum target,
+                                      GLint level, const GLvoid *data,
+                                      struct gl_texture_object *texObj,
+                                      struct gl_texture_image *texImage,
+                                      GLboolean *retainInternalCopy);
+   GLboolean (*CompressedTexImage3D)( GLcontext *ctx, GLenum target,
+                                      GLint level, const GLvoid *data,
+                                      struct gl_texture_object *texObj,
+                                      struct gl_texture_image *texImage,
+                                      GLboolean *retainInternalCopy);
+   /* Called by glCompressedTexImage1/2/3D.
+    * Arguments:
+    *   <target>, <level>, <internalFormat>, <data> are user specified.
+    *   <texObj> is the target texture object.
+    *   <texImage> is the target texture image.  It will have the texture
+    *      width, height, depth, border and internalFormat information.
+    *   <retainInternalCopy> is returned by this function and indicates whether
+    *      core Mesa should keep an internal copy of the texture image.
+    * Return GL_TRUE if operation completed, return GL_FALSE if core Mesa
+    * should do the job.
+    */
+
+
+   void (*TexEnv)( GLcontext *ctx, GLenum target, GLenum pname,
+                   const GLfloat *param );
+   /* Called by glTexEnv*().
+    */
+
+   void (*TexParameter)( GLcontext *ctx, GLenum target,
+                         struct gl_texture_object *texObj,
+                         GLenum pname, const GLfloat *params );
+   /* Called by glTexParameter*().
+    *    <target> is user specified
+    *    <texObj> the texture object to modify
+    *    <pname> is one of GL_TEXTURE_MIN_FILTER, GL_TEXTURE_MAG_FILTER,
+    *       GL_TEXTURE_WRAP_[STR], or GL_TEXTURE_BORDER_COLOR.
+    *    <params> is user specified.
+    */
+
+   void (*BindTexture)( GLcontext *ctx, GLenum target,
+                        struct gl_texture_object *tObj );
+   /* Called by glBindTexture().
+    */
+
+   void (*DeleteTexture)( GLcontext *ctx, struct gl_texture_object *tObj );
+   /* Called when a texture object is about to be deallocated.  Driver
+    * should free anything attached to the DriverData pointers.
+    */
+
+   GLboolean (*IsTextureResident)( GLcontext *ctx, 
+                                   struct gl_texture_object *t );
+   /* Called by glAreTextureResident().
+    */
+
+   void (*PrioritizeTexture)( GLcontext *ctx,  struct gl_texture_object *t,
+                              GLclampf priority );
+   /* Called by glPrioritizeTextures().
+    */
+
+   void (*ActiveTexture)( GLcontext *ctx, GLuint texUnitNumber );
+   /* Called by glActiveTextureARB to set current texture unit.
+    */
+
+   void (*UpdateTexturePalette)( GLcontext *ctx,
+                                 struct gl_texture_object *tObj );
+   /* Called when the texture's color lookup table is changed.
+    * If tObj is NULL then the shared texture palette ctx->Texture.Palette
+    * is to be updated.
     */
 
+
+
+   /***
+    *** Accelerated point, line, polygon, glDrawPixels and glBitmap functions:
+    ***/
+
+   points_func   PointsFunc;
+   line_func     LineFunc;
+   triangle_func TriangleFunc;
+   quad_func     QuadFunc;
+   rect_func     RectFunc;    
+   
+
+   /***
+    *** Transformation/Rendering functions
+    ***/
+
    void (*RenderStart)( GLcontext *ctx );
    void (*RenderFinish)( GLcontext *ctx );
     /* KW: These replace Begin and End, and have more relaxed semantics.
@@ -449,7 +751,6 @@ struct dd_function_table {
     * Note: Deprecated in favour of RegisterPipelineStages, below.
     */
 
-
    render_func *RenderVBClippedTab;
    render_func *RenderVBCulledTab;
    render_func *RenderVBRawTab;
@@ -458,7 +759,6 @@ struct dd_function_table {
     * gl_render_vb() function in vbrender.c for more details.  
     */
 
-
    void (*ReducedPrimitiveChange)( GLcontext *ctx, GLenum primitive );
    /* If registered, this will be called when rendering transitions between
     * points, lines and triangles.  It is not called on transitions between 
@@ -473,7 +773,6 @@ struct dd_function_table {
     * implement DD_TRI_OFFSET.
     */
 
-
    GLboolean (*MultipassFunc)( struct vertex_buffer *VB, GLuint passno );
    /* Driver may request additional render passes by returning GL_TRUE
     * when this function is called.  This function will be called
@@ -484,85 +783,6 @@ struct dd_function_table {
     * This function will be first invoked with passno == 1.
     */
 
-   /***
-    *** Texture mapping functions:
-    ***/
-
-   void (*TexEnv)( GLcontext *ctx, GLenum pname, const GLfloat *param );
-   /*
-    * Called whenever glTexEnv*() is called.
-    * Pname will be one of GL_TEXTURE_ENV_MODE or GL_TEXTURE_ENV_COLOR.
-    * If pname is GL_TEXTURE_ENV_MODE then param will be one
-    * of GL_MODULATE, GL_BLEND, GL_DECAL, or GL_REPLACE.
-    */
-
-   void (*TexImage)( GLcontext *ctx, GLenum target,
-                     struct gl_texture_object *tObj, GLint level,
-                     GLint internalFormat,
-                     const struct gl_texture_image *image );
-   /*
-    * Called whenever a texture object's image is changed.
-    *    texObject is the number of the texture object being changed.
-    *    level indicates the mipmap level.
-    *    internalFormat is the format in which the texture is to be stored.
-    *    image is a pointer to a gl_texture_image struct which contains
-    *       the actual image data.
-    */
-
-   void (*TexSubImage)( GLcontext *ctx, GLenum target,
-                        struct gl_texture_object *tObj, GLint level,
-                        GLint xoffset, GLint yoffset,
-                        GLsizei width, GLsizei height,
-                        GLint internalFormat,
-                        const struct gl_texture_image *image );
-   /*
-    * Called from glTexSubImage() to define a sub-region of a texture.
-    */
-
-   void (*TexParameter)( GLcontext *ctx, GLenum target,
-                         struct gl_texture_object *tObj,
-                         GLenum pname, const GLfloat *params );
-   /*
-    * Called whenever glTexParameter*() is called.
-    *    target is GL_TEXTURE_1D or GL_TEXTURE_2D
-    *    texObject is the texture object to modify
-    *    pname is one of GL_TEXTURE_MIN_FILTER, GL_TEXTURE_MAG_FILTER,
-    *       GL_TEXTURE_WRAP_S, GL_TEXTURE_WRAP_T, or GL_TEXTURE_BORDER_COLOR.
-    *    params is dependant on pname.  See man glTexParameter.
-    */
-
-   void (*BindTexture)( GLcontext *ctx, GLenum target,
-                        struct gl_texture_object *tObj );
-   /*
-    * Called whenever glBindTexture() is called.  This specifies which
-    * texture is to be the current one.  No dirty flags will be set.
-    */
-
-   void (*DeleteTexture)( GLcontext *ctx, struct gl_texture_object *tObj );
-   /*
-    * Called when a texture object is about to be deallocated.  Driver
-    * should free anything attached to the DriverData pointers.
-    */
-
-   void (*UpdateTexturePalette)( GLcontext *ctx,
-                                 struct gl_texture_object *tObj );
-   /*
-    * Called when the texture's color lookup table is changed.
-    * If tObj is NULL then the shared texture palette ctx->Texture.Palette
-    * was changed.
-    */
-
-   void (*UseGlobalTexturePalette)( GLcontext *ctx, GLboolean state );
-   /*
-    * Called via glEnable/Disable(GL_SHARED_TEXTURE_PALETTE_EXT)
-    */
-
-   void (*ActiveTexture)( GLcontext *ctx, GLuint texUnitNumber );
-   /*
-    * Called by glActiveTextureARB to set current texture unit.
-    */
-
-
    /***
     *** NEW in Mesa 3.x
     ***/
@@ -616,7 +836,11 @@ struct dd_function_table {
     * the driver's UpdateState() function must do.
     */
    void (*AlphaFunc)(GLcontext *ctx, GLenum func, GLclampf ref);
+   void (*BlendEquation)(GLcontext *ctx, GLenum mode);
    void (*BlendFunc)(GLcontext *ctx, GLenum sfactor, GLenum dfactor);
+   void (*BlendFuncSeparate)( GLcontext *ctx, GLenum sfactorRGB, 
+                             GLenum dfactorRGB, GLenum sfactorA,
+                             GLenum dfactorA );
    void (*ClearDepth)(GLcontext *ctx, GLclampd d);
    void (*CullFace)(GLcontext *ctx, GLenum mode);
    void (*FrontFace)(GLcontext *ctx, GLenum mode);
@@ -626,7 +850,14 @@ struct dd_function_table {
    void (*Enable)(GLcontext* ctx, GLenum cap, GLboolean state);
    void (*Fogfv)(GLcontext *ctx, GLenum pname, const GLfloat *params);
    void (*Hint)(GLcontext *ctx, GLenum target, GLenum mode);
+   void (*Lightfv)(GLcontext *ctx, GLenum light,
+                  GLenum pname, const GLfloat *params, GLint nparams );
+   void (*LightModelfv)(GLcontext *ctx, GLenum pname, const GLfloat *params);
+   void (*LineStipple)(GLcontext *ctx, GLint factor, GLushort pattern );
+   void (*LineWidth)(GLcontext *ctx, GLfloat width);
+   void (*LogicOpcode)(GLcontext *ctx, GLenum opcode);
    void (*PolygonMode)(GLcontext *ctx, GLenum face, GLenum mode);
+   void (*PolygonStipple)(GLcontext *ctx, const GLubyte *mask );
    void (*Scissor)(GLcontext *ctx, GLint x, GLint y, GLsizei w, GLsizei h);
    void (*ShadeModel)(GLcontext *ctx, GLenum mode);
    void (*ClearStencil)(GLcontext *ctx, GLint s);