mesa: update comment for MapTextureImage()
[profile/ivi/mesa.git] / src / mesa / main / dd.h
1 /**
2  * \file dd.h
3  * Device driver interfaces.
4  */
5
6 /*
7  * Mesa 3-D graphics library
8  * Version:  6.5.2
9  *
10  * Copyright (C) 1999-2006  Brian Paul   All Rights Reserved.
11  *
12  * Permission is hereby granted, free of charge, to any person obtaining a
13  * copy of this software and associated documentation files (the "Software"),
14  * to deal in the Software without restriction, including without limitation
15  * the rights to use, copy, modify, merge, publish, distribute, sublicense,
16  * and/or sell copies of the Software, and to permit persons to whom the
17  * Software is furnished to do so, subject to the following conditions:
18  *
19  * The above copyright notice and this permission notice shall be included
20  * in all copies or substantial portions of the Software.
21  *
22  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
23  * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
24  * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
25  * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
26  * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
27  * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
28  */
29
30
31 #ifndef DD_INCLUDED
32 #define DD_INCLUDED
33
34 /* THIS FILE ONLY INCLUDED BY mtypes.h !!!!! */
35
36 #include "glheader.h"
37
38 struct gl_buffer_object;
39 struct gl_context;
40 struct gl_display_list;
41 struct gl_framebuffer;
42 struct gl_pixelstore_attrib;
43 struct gl_program;
44 struct gl_renderbuffer;
45 struct gl_renderbuffer_attachment;
46 struct gl_shader;
47 struct gl_shader_program;
48 struct gl_texture_image;
49 struct gl_texture_object;
50
51 /* GL_ARB_vertex_buffer_object */
52 /* Modifies GL_MAP_UNSYNCHRONIZED_BIT to allow driver to fail (return
53  * NULL) if buffer is unavailable for immediate mapping.
54  *
55  * Does GL_MAP_INVALIDATE_RANGE_BIT do this?  It seems so, but it
56  * would require more book-keeping in the driver than seems necessary
57  * at this point.
58  *
59  * Does GL_MAP_INVALDIATE_BUFFER_BIT do this?  Not really -- we don't
60  * want to provoke the driver to throw away the old storage, we will
61  * respect the contents of already referenced data.
62  */
63 #define MESA_MAP_NOWAIT_BIT       0x0040
64
65
66 /**
67  * Device driver function table.
68  * Core Mesa uses these function pointers to call into device drivers.
69  * Most of these functions directly correspond to OpenGL state commands.
70  * Core Mesa will call these functions after error checking has been done
71  * so that the drivers don't have to worry about error testing.
72  *
73  * Vertex transformation/clipping/lighting is patched into the T&L module.
74  * Rasterization functions are patched into the swrast module.
75  *
76  * Note: when new functions are added here, the drivers/common/driverfuncs.c
77  * file should be updated too!!!
78  */
79 struct dd_function_table {
80    /**
81     * Return a string as needed by glGetString().
82     * Only the GL_RENDERER query must be implemented.  Otherwise, NULL can be
83     * returned.
84     */
85    const GLubyte * (*GetString)( struct gl_context *ctx, GLenum name );
86
87    /**
88     * Notify the driver after Mesa has made some internal state changes.  
89     *
90     * This is in addition to any state change callbacks Mesa may already have
91     * made.
92     */
93    void (*UpdateState)( struct gl_context *ctx, GLbitfield new_state );
94
95    /**
96     * Get the width and height of the named buffer/window.
97     *
98     * Mesa uses this to determine when the driver's window size has changed.
99     * XXX OBSOLETE: this function will be removed in the future.
100     */
101    void (*GetBufferSize)( struct gl_framebuffer *buffer,
102                           GLuint *width, GLuint *height );
103
104    /**
105     * Resize the given framebuffer to the given size.
106     * XXX OBSOLETE: this function will be removed in the future.
107     */
108    void (*ResizeBuffers)( struct gl_context *ctx, struct gl_framebuffer *fb,
109                           GLuint width, GLuint height);
110
111    /**
112     * Called whenever an error is generated.  
113     * __struct gl_contextRec::ErrorValue contains the error value.
114     */
115    void (*Error)( struct gl_context *ctx );
116
117    /**
118     * This is called whenever glFinish() is called.
119     */
120    void (*Finish)( struct gl_context *ctx );
121
122    /**
123     * This is called whenever glFlush() is called.
124     */
125    void (*Flush)( struct gl_context *ctx );
126
127    /**
128     * Clear the color/depth/stencil/accum buffer(s).
129     * \param buffers  a bitmask of BUFFER_BIT_* flags indicating which
130     *                 renderbuffers need to be cleared.
131     */
132    void (*Clear)( struct gl_context *ctx, GLbitfield buffers );
133
134    /**
135     * Execute glAccum command.
136     */
137    void (*Accum)( struct gl_context *ctx, GLenum op, GLfloat value );
138
139
140    /**
141     * Execute glRasterPos, updating the ctx->Current.Raster fields
142     */
143    void (*RasterPos)( struct gl_context *ctx, const GLfloat v[4] );
144
145    /**
146     * \name Image-related functions
147     */
148    /*@{*/
149
150    /**
151     * Called by glDrawPixels().
152     * \p unpack describes how to unpack the source image data.
153     */
154    void (*DrawPixels)( struct gl_context *ctx,
155                        GLint x, GLint y, GLsizei width, GLsizei height,
156                        GLenum format, GLenum type,
157                        const struct gl_pixelstore_attrib *unpack,
158                        const GLvoid *pixels );
159
160    /**
161     * Called by glReadPixels().
162     */
163    void (*ReadPixels)( struct gl_context *ctx,
164                        GLint x, GLint y, GLsizei width, GLsizei height,
165                        GLenum format, GLenum type,
166                        const struct gl_pixelstore_attrib *unpack,
167                        GLvoid *dest );
168
169    /**
170     * Called by glCopyPixels().  
171     */
172    void (*CopyPixels)( struct gl_context *ctx, GLint srcx, GLint srcy,
173                        GLsizei width, GLsizei height,
174                        GLint dstx, GLint dsty, GLenum type );
175
176    /**
177     * Called by glBitmap().  
178     */
179    void (*Bitmap)( struct gl_context *ctx,
180                    GLint x, GLint y, GLsizei width, GLsizei height,
181                    const struct gl_pixelstore_attrib *unpack,
182                    const GLubyte *bitmap );
183    /*@}*/
184
185    
186    /**
187     * \name Texture image functions
188     */
189    /*@{*/
190
191    /**
192     * Choose actual hardware texture format given the user-provided source
193     * image format and type and the desired internal format.  In some
194     * cases, srcFormat and srcType can be GL_NONE.
195     * Called by glTexImage(), etc.
196     */
197    gl_format (*ChooseTextureFormat)( struct gl_context *ctx, GLint internalFormat,
198                                      GLenum srcFormat, GLenum srcType );
199
200    /**
201     * Called by glTexImage1D().  Simply copy the source texture data into the
202     * destination texture memory.  The gl_texture_image fields, etc. will be
203     * fully initialized.
204     * The parameters are the same as glTexImage1D(), plus:
205     * \param packing describes how to unpack the source data.
206     * \param texObj is the target texture object.
207     * \param texImage is the target texture image.
208     */
209    void (*TexImage1D)( struct gl_context *ctx, GLenum target, GLint level,
210                        GLint internalFormat,
211                        GLint width, GLint border,
212                        GLenum format, GLenum type, const GLvoid *pixels,
213                        const struct gl_pixelstore_attrib *packing,
214                        struct gl_texture_object *texObj,
215                        struct gl_texture_image *texImage );
216
217    /**
218     * Called by glTexImage2D().
219     * 
220     * \sa dd_function_table::TexImage1D.
221     */
222    void (*TexImage2D)( struct gl_context *ctx, GLenum target, GLint level,
223                        GLint internalFormat,
224                        GLint width, GLint height, GLint border,
225                        GLenum format, GLenum type, const GLvoid *pixels,
226                        const struct gl_pixelstore_attrib *packing,
227                        struct gl_texture_object *texObj,
228                        struct gl_texture_image *texImage );
229    
230    /**
231     * Called by glTexImage3D().
232     * 
233     * \sa dd_function_table::TexImage1D.
234     */
235    void (*TexImage3D)( struct gl_context *ctx, GLenum target, GLint level,
236                        GLint internalFormat,
237                        GLint width, GLint height, GLint depth, GLint border,
238                        GLenum format, GLenum type, const GLvoid *pixels,
239                        const struct gl_pixelstore_attrib *packing,
240                        struct gl_texture_object *texObj,
241                        struct gl_texture_image *texImage );
242
243    /**
244     * Called by glTexSubImage1D().  Replace a subset of the target texture
245     * with new texel data.
246     * \sa dd_function_table::TexImage1D.
247     */
248    void (*TexSubImage1D)( struct gl_context *ctx, GLenum target, GLint level,
249                           GLint xoffset, GLsizei width,
250                           GLenum format, GLenum type,
251                           const GLvoid *pixels,
252                           const struct gl_pixelstore_attrib *packing,
253                           struct gl_texture_object *texObj,
254                           struct gl_texture_image *texImage );
255    
256    /**
257     * Called by glTexSubImage2D().
258     *
259     * \sa dd_function_table::TexSubImage1D.
260     */
261    void (*TexSubImage2D)( struct gl_context *ctx, GLenum target, GLint level,
262                           GLint xoffset, GLint yoffset,
263                           GLsizei width, GLsizei height,
264                           GLenum format, GLenum type,
265                           const GLvoid *pixels,
266                           const struct gl_pixelstore_attrib *packing,
267                           struct gl_texture_object *texObj,
268                           struct gl_texture_image *texImage );
269    
270    /**
271     * Called by glTexSubImage3D().
272     *
273     * \sa dd_function_table::TexSubImage1D.
274     */
275    void (*TexSubImage3D)( struct gl_context *ctx, GLenum target, GLint level,
276                           GLint xoffset, GLint yoffset, GLint zoffset,
277                           GLsizei width, GLsizei height, GLint depth,
278                           GLenum format, GLenum type,
279                           const GLvoid *pixels,
280                           const struct gl_pixelstore_attrib *packing,
281                           struct gl_texture_object *texObj,
282                           struct gl_texture_image *texImage );
283
284    /**
285     * Called by glGetTexImage().
286     */
287    void (*GetTexImage)( struct gl_context *ctx,
288                         GLenum format, GLenum type, GLvoid *pixels,
289                         struct gl_texture_image *texImage );
290
291    /**
292     * Called by glCopyTexSubImage1D().
293     * 
294     * Drivers should use a fallback routine from texstore.c if needed.
295     */
296    void (*CopyTexSubImage1D)( struct gl_context *ctx, GLenum target, GLint level,
297                               GLint xoffset,
298                               GLint x, GLint y, GLsizei width );
299    /**
300     * Called by glCopyTexSubImage2D().
301     * 
302     * Drivers should use a fallback routine from texstore.c if needed.
303     */
304    void (*CopyTexSubImage2D)( struct gl_context *ctx, GLenum target, GLint level,
305                               GLint xoffset, GLint yoffset,
306                               GLint x, GLint y,
307                               GLsizei width, GLsizei height );
308    /**
309     * Called by glCopyTexSubImage3D().
310     * 
311     * Drivers should use a fallback routine from texstore.c if needed.
312     */
313    void (*CopyTexSubImage3D)( struct gl_context *ctx, GLenum target, GLint level,
314                               GLint xoffset, GLint yoffset, GLint zoffset,
315                               GLint x, GLint y,
316                               GLsizei width, GLsizei height );
317
318    /**
319     * Called by glGenerateMipmap() or when GL_GENERATE_MIPMAP_SGIS is enabled.
320     */
321    void (*GenerateMipmap)(struct gl_context *ctx, GLenum target,
322                           struct gl_texture_object *texObj);
323
324    /**
325     * Called by glTexImage[123]D when user specifies a proxy texture
326     * target.  
327     *
328     * \return GL_TRUE if the proxy test passes, or GL_FALSE if the test fails.
329     */
330    GLboolean (*TestProxyTexImage)(struct gl_context *ctx, GLenum target,
331                                   GLint level, GLint internalFormat,
332                                   GLenum format, GLenum type,
333                                   GLint width, GLint height,
334                                   GLint depth, GLint border);
335    /*@}*/
336
337    
338    /**
339     * \name Compressed texture functions
340     */
341    /*@{*/
342
343    /**
344     * Called by glCompressedTexImage1D().
345     *
346     * \param target user specified.
347     * \param format user specified.
348     * \param type user specified.
349     * \param pixels user specified.
350     * \param packing indicates the image packing of pixels.
351     * \param texObj is the target texture object.
352     * \param texImage is the target texture image.  It will have the texture \p
353     * width, \p height, \p depth, \p border and \p internalFormat information.
354     *      
355     * \a retainInternalCopy is returned by this function and indicates whether
356     * core Mesa should keep an internal copy of the texture image.
357     */
358    void (*CompressedTexImage1D)( struct gl_context *ctx, GLenum target,
359                                  GLint level, GLint internalFormat,
360                                  GLsizei width, GLint border,
361                                  GLsizei imageSize, const GLvoid *data,
362                                  struct gl_texture_object *texObj,
363                                  struct gl_texture_image *texImage );
364    /**
365     * Called by glCompressedTexImage2D().
366     *
367     * \sa dd_function_table::CompressedTexImage1D.
368     */
369    void (*CompressedTexImage2D)( struct gl_context *ctx, GLenum target,
370                                  GLint level, GLint internalFormat,
371                                  GLsizei width, GLsizei height, GLint border,
372                                  GLsizei imageSize, const GLvoid *data,
373                                  struct gl_texture_object *texObj,
374                                  struct gl_texture_image *texImage );
375    /**
376     * Called by glCompressedTexImage3D().
377     *
378     * \sa dd_function_table::CompressedTexImage3D.
379     */
380    void (*CompressedTexImage3D)( struct gl_context *ctx, GLenum target,
381                                  GLint level, GLint internalFormat,
382                                  GLsizei width, GLsizei height, GLsizei depth,
383                                  GLint border,
384                                  GLsizei imageSize, const GLvoid *data,
385                                  struct gl_texture_object *texObj,
386                                  struct gl_texture_image *texImage );
387
388    /**
389     * Called by glCompressedTexSubImage1D().
390     * 
391     * \param target user specified.
392     * \param level user specified.
393     * \param xoffset user specified.
394     * \param yoffset user specified.
395     * \param zoffset user specified.
396     * \param width user specified.
397     * \param height user specified.
398     * \param depth user specified.
399     * \param imageSize user specified.
400     * \param data user specified.
401     * \param texObj is the target texture object.
402     * \param texImage is the target texture image.  It will have the texture \p
403     * width, \p height, \p depth, \p border and \p internalFormat information.
404     */
405    void (*CompressedTexSubImage1D)(struct gl_context *ctx, GLenum target, GLint level,
406                                    GLint xoffset, GLsizei width,
407                                    GLenum format,
408                                    GLsizei imageSize, const GLvoid *data,
409                                    struct gl_texture_object *texObj,
410                                    struct gl_texture_image *texImage);
411    /**
412     * Called by glCompressedTexSubImage2D().
413     *
414     * \sa dd_function_table::CompressedTexImage3D.
415     */
416    void (*CompressedTexSubImage2D)(struct gl_context *ctx, GLenum target, GLint level,
417                                    GLint xoffset, GLint yoffset,
418                                    GLsizei width, GLint height,
419                                    GLenum format,
420                                    GLsizei imageSize, const GLvoid *data,
421                                    struct gl_texture_object *texObj,
422                                    struct gl_texture_image *texImage);
423    /**
424     * Called by glCompressedTexSubImage3D().
425     *
426     * \sa dd_function_table::CompressedTexImage3D.
427     */
428    void (*CompressedTexSubImage3D)(struct gl_context *ctx, GLenum target, GLint level,
429                                    GLint xoffset, GLint yoffset, GLint zoffset,
430                                    GLsizei width, GLint height, GLint depth,
431                                    GLenum format,
432                                    GLsizei imageSize, const GLvoid *data,
433                                    struct gl_texture_object *texObj,
434                                    struct gl_texture_image *texImage);
435
436
437    /**
438     * Called by glGetCompressedTexImage.
439     */
440    void (*GetCompressedTexImage)(struct gl_context *ctx, GLenum target, GLint level,
441                                  GLvoid *img,
442                                  struct gl_texture_object *texObj,
443                                  struct gl_texture_image *texImage);
444
445    /*@}*/
446
447    /**
448     * \name Texture object functions
449     */
450    /*@{*/
451
452    /**
453     * Called by glBindTexture().
454     */
455    void (*BindTexture)( struct gl_context *ctx, GLenum target,
456                         struct gl_texture_object *tObj );
457
458    /**
459     * Called to allocate a new texture object.
460     * A new gl_texture_object should be returned.  The driver should
461     * attach to it any device-specific info it needs.
462     */
463    struct gl_texture_object * (*NewTextureObject)( struct gl_context *ctx, GLuint name,
464                                                    GLenum target );
465    /**
466     * Called when a texture object is about to be deallocated.  
467     *
468     * Driver should delete the gl_texture_object object and anything
469     * hanging off of it.
470     */
471    void (*DeleteTexture)( struct gl_context *ctx, struct gl_texture_object *tObj );
472
473    /**
474     * Called to allocate a new texture image object.
475     */
476    struct gl_texture_image * (*NewTextureImage)( struct gl_context *ctx );
477
478    /** Called to free a texture image object returned by NewTextureImage() */
479    void (*DeleteTextureImage)(struct gl_context *ctx,
480                               struct gl_texture_image *);
481
482    /** Called to allocate memory for a single texture image */
483    GLboolean (*AllocTextureImageBuffer)(struct gl_context *ctx,
484                                         struct gl_texture_image *texImage,
485                                         gl_format format, GLsizei width,
486                                         GLsizei height, GLsizei depth);
487
488    /** 
489     * Called to free tImage->Data.
490     */
491    void (*FreeTextureImageBuffer)( struct gl_context *ctx, struct gl_texture_image *tImage );
492
493    /** Map a slice of a texture image into user space.
494     * Note: for GL_TEXTURE_1D_ARRAY, height must be 1, y must be 0 and slice
495     * indicates the 1D array index.
496     * \param texImage  the texture image
497     * \param slice  the 3D image slice or array texture slice
498     * \param x, y, w, h  region of interest
499     * \param mode  bitmask of GL_MAP_READ_BIT, GL_MAP_WRITE_BIT
500     * \param mapOut  returns start of mapping of region of interest
501     * \param rowStrideOut  returns row stride (in bytes)
502     */
503    void (*MapTextureImage)(struct gl_context *ctx,
504                            struct gl_texture_image *texImage,
505                            GLuint slice,
506                            GLuint x, GLuint y, GLuint w, GLuint h,
507                            GLbitfield mode,
508                            GLubyte **mapOut, GLint *rowStrideOut);
509
510    void (*UnmapTextureImage)(struct gl_context *ctx,
511                              struct gl_texture_image *texImage,
512                              GLuint slice);
513
514    /** Map texture image data into user space */
515    void (*MapTexture)( struct gl_context *ctx, struct gl_texture_object *tObj );
516    /** Unmap texture images from user space */
517    void (*UnmapTexture)( struct gl_context *ctx, struct gl_texture_object *tObj );
518
519    /** For GL_ARB_texture_storage.  Allocate memory for whole mipmap stack.
520     * All the gl_texture_images in the texture object will have their
521     * dimensions, format, etc. initialized already.
522     */
523    GLboolean (*AllocTextureStorage)(struct gl_context *ctx,
524                                     struct gl_texture_object *texObj,
525                                     GLsizei levels, GLsizei width,
526                                     GLsizei height, GLsizei depth);
527
528    void (*MapRenderbuffer)(struct gl_context *ctx,
529                            struct gl_renderbuffer *rb,
530                            GLuint x, GLuint y, GLuint w, GLuint h,
531                            GLbitfield mode,
532                            GLubyte **mapOut, GLint *rowStrideOut);
533
534    void (*UnmapRenderbuffer)(struct gl_context *ctx,
535                              struct gl_renderbuffer *rb);
536
537    /*@}*/
538
539
540    /**
541     * \name Vertex/fragment program functions
542     */
543    /*@{*/
544    /** Bind a vertex/fragment program */
545    void (*BindProgram)(struct gl_context *ctx, GLenum target, struct gl_program *prog);
546    /** Allocate a new program */
547    struct gl_program * (*NewProgram)(struct gl_context *ctx, GLenum target, GLuint id);
548    /** Delete a program */
549    void (*DeleteProgram)(struct gl_context *ctx, struct gl_program *prog);   
550    /**
551     * Notify driver that a program string (and GPU code) has been specified
552     * or modified.  Return GL_TRUE or GL_FALSE to indicate if the program is
553     * supported by the driver.
554     */
555    GLboolean (*ProgramStringNotify)(struct gl_context *ctx, GLenum target, 
556                                     struct gl_program *prog);
557
558    /** Query if program can be loaded onto hardware */
559    GLboolean (*IsProgramNative)(struct gl_context *ctx, GLenum target, 
560                                 struct gl_program *prog);
561    
562    /*@}*/
563
564    /**
565     * \name GLSL shader/program functions.
566     */
567    /*@{*/
568    /**
569     * Called when a shader program is linked.
570     *
571     * This gives drivers an opportunity to clone the IR and make their
572     * own transformations on it for the purposes of code generation.
573     */
574    GLboolean (*LinkShader)(struct gl_context *ctx, struct gl_shader_program *shader);
575    /*@}*/
576
577    /**
578     * \name State-changing functions.
579     *
580     * \note drawing functions are above.
581     *
582     * These functions are called by their corresponding OpenGL API functions.
583     * They are \e also called by the gl_PopAttrib() function!!!
584     * May add more functions like these to the device driver in the future.
585     */
586    /*@{*/
587    /** Specify the alpha test function */
588    void (*AlphaFunc)(struct gl_context *ctx, GLenum func, GLfloat ref);
589    /** Set the blend color */
590    void (*BlendColor)(struct gl_context *ctx, const GLfloat color[4]);
591    /** Set the blend equation */
592    void (*BlendEquationSeparate)(struct gl_context *ctx, GLenum modeRGB, GLenum modeA);
593    void (*BlendEquationSeparatei)(struct gl_context *ctx, GLuint buffer,
594                                   GLenum modeRGB, GLenum modeA);
595    /** Specify pixel arithmetic */
596    void (*BlendFuncSeparate)(struct gl_context *ctx,
597                              GLenum sfactorRGB, GLenum dfactorRGB,
598                              GLenum sfactorA, GLenum dfactorA);
599    void (*BlendFuncSeparatei)(struct gl_context *ctx, GLuint buffer,
600                               GLenum sfactorRGB, GLenum dfactorRGB,
601                               GLenum sfactorA, GLenum dfactorA);
602    /** Specify clear values for the color buffers */
603    void (*ClearColor)(struct gl_context *ctx,
604                       const union gl_color_union color);
605    /** Specify the clear value for the depth buffer */
606    void (*ClearDepth)(struct gl_context *ctx, GLclampd d);
607    /** Specify the clear value for the stencil buffer */
608    void (*ClearStencil)(struct gl_context *ctx, GLint s);
609    /** Specify a plane against which all geometry is clipped */
610    void (*ClipPlane)(struct gl_context *ctx, GLenum plane, const GLfloat *equation );
611    /** Enable and disable writing of frame buffer color components */
612    void (*ColorMask)(struct gl_context *ctx, GLboolean rmask, GLboolean gmask,
613                      GLboolean bmask, GLboolean amask );
614    void (*ColorMaskIndexed)(struct gl_context *ctx, GLuint buf, GLboolean rmask,
615                             GLboolean gmask, GLboolean bmask, GLboolean amask);
616    /** Cause a material color to track the current color */
617    void (*ColorMaterial)(struct gl_context *ctx, GLenum face, GLenum mode);
618    /** Specify whether front- or back-facing facets can be culled */
619    void (*CullFace)(struct gl_context *ctx, GLenum mode);
620    /** Define front- and back-facing polygons */
621    void (*FrontFace)(struct gl_context *ctx, GLenum mode);
622    /** Specify the value used for depth buffer comparisons */
623    void (*DepthFunc)(struct gl_context *ctx, GLenum func);
624    /** Enable or disable writing into the depth buffer */
625    void (*DepthMask)(struct gl_context *ctx, GLboolean flag);
626    /** Specify mapping of depth values from NDC to window coordinates */
627    void (*DepthRange)(struct gl_context *ctx, GLclampd nearval, GLclampd farval);
628    /** Specify the current buffer for writing */
629    void (*DrawBuffer)( struct gl_context *ctx, GLenum buffer );
630    /** Specify the buffers for writing for fragment programs*/
631    void (*DrawBuffers)( struct gl_context *ctx, GLsizei n, const GLenum *buffers );
632    /** Enable or disable server-side gl capabilities */
633    void (*Enable)(struct gl_context *ctx, GLenum cap, GLboolean state);
634    /** Specify fog parameters */
635    void (*Fogfv)(struct gl_context *ctx, GLenum pname, const GLfloat *params);
636    /** Specify implementation-specific hints */
637    void (*Hint)(struct gl_context *ctx, GLenum target, GLenum mode);
638    /** Set light source parameters.
639     * Note: for GL_POSITION and GL_SPOT_DIRECTION, params will have already
640     * been transformed to eye-space.
641     */
642    void (*Lightfv)(struct gl_context *ctx, GLenum light,
643                    GLenum pname, const GLfloat *params );
644    /** Set the lighting model parameters */
645    void (*LightModelfv)(struct gl_context *ctx, GLenum pname, const GLfloat *params);
646    /** Specify the line stipple pattern */
647    void (*LineStipple)(struct gl_context *ctx, GLint factor, GLushort pattern );
648    /** Specify the width of rasterized lines */
649    void (*LineWidth)(struct gl_context *ctx, GLfloat width);
650    /** Specify a logical pixel operation for color index rendering */
651    void (*LogicOpcode)(struct gl_context *ctx, GLenum opcode);
652    void (*PointParameterfv)(struct gl_context *ctx, GLenum pname,
653                             const GLfloat *params);
654    /** Specify the diameter of rasterized points */
655    void (*PointSize)(struct gl_context *ctx, GLfloat size);
656    /** Select a polygon rasterization mode */
657    void (*PolygonMode)(struct gl_context *ctx, GLenum face, GLenum mode);
658    /** Set the scale and units used to calculate depth values */
659    void (*PolygonOffset)(struct gl_context *ctx, GLfloat factor, GLfloat units);
660    /** Set the polygon stippling pattern */
661    void (*PolygonStipple)(struct gl_context *ctx, const GLubyte *mask );
662    /* Specifies the current buffer for reading */
663    void (*ReadBuffer)( struct gl_context *ctx, GLenum buffer );
664    /** Set rasterization mode */
665    void (*RenderMode)(struct gl_context *ctx, GLenum mode );
666    /** Define the scissor box */
667    void (*Scissor)(struct gl_context *ctx, GLint x, GLint y, GLsizei w, GLsizei h);
668    /** Select flat or smooth shading */
669    void (*ShadeModel)(struct gl_context *ctx, GLenum mode);
670    /** OpenGL 2.0 two-sided StencilFunc */
671    void (*StencilFuncSeparate)(struct gl_context *ctx, GLenum face, GLenum func,
672                                GLint ref, GLuint mask);
673    /** OpenGL 2.0 two-sided StencilMask */
674    void (*StencilMaskSeparate)(struct gl_context *ctx, GLenum face, GLuint mask);
675    /** OpenGL 2.0 two-sided StencilOp */
676    void (*StencilOpSeparate)(struct gl_context *ctx, GLenum face, GLenum fail,
677                              GLenum zfail, GLenum zpass);
678    /** Control the generation of texture coordinates */
679    void (*TexGen)(struct gl_context *ctx, GLenum coord, GLenum pname,
680                   const GLfloat *params);
681    /** Set texture environment parameters */
682    void (*TexEnv)(struct gl_context *ctx, GLenum target, GLenum pname,
683                   const GLfloat *param);
684    /** Set texture parameters */
685    void (*TexParameter)(struct gl_context *ctx, GLenum target,
686                         struct gl_texture_object *texObj,
687                         GLenum pname, const GLfloat *params);
688    /** Set the viewport */
689    void (*Viewport)(struct gl_context *ctx, GLint x, GLint y, GLsizei w, GLsizei h);
690    /*@}*/
691
692
693    /**
694     * \name Vertex/pixel buffer object functions
695     */
696    /*@{*/
697    void (*BindBuffer)( struct gl_context *ctx, GLenum target,
698                        struct gl_buffer_object *obj );
699
700    struct gl_buffer_object * (*NewBufferObject)( struct gl_context *ctx, GLuint buffer,
701                                                  GLenum target );
702    
703    void (*DeleteBuffer)( struct gl_context *ctx, struct gl_buffer_object *obj );
704
705    GLboolean (*BufferData)( struct gl_context *ctx, GLenum target, GLsizeiptrARB size,
706                             const GLvoid *data, GLenum usage,
707                             struct gl_buffer_object *obj );
708
709    void (*BufferSubData)( struct gl_context *ctx, GLintptrARB offset,
710                           GLsizeiptrARB size, const GLvoid *data,
711                           struct gl_buffer_object *obj );
712
713    void (*GetBufferSubData)( struct gl_context *ctx,
714                              GLintptrARB offset, GLsizeiptrARB size,
715                              GLvoid *data, struct gl_buffer_object *obj );
716
717    void (*CopyBufferSubData)( struct gl_context *ctx,
718                               struct gl_buffer_object *src,
719                               struct gl_buffer_object *dst,
720                               GLintptr readOffset, GLintptr writeOffset,
721                               GLsizeiptr size );
722
723    /* May return NULL if MESA_MAP_NOWAIT_BIT is set in access:
724     */
725    void * (*MapBufferRange)( struct gl_context *ctx, GLintptr offset,
726                              GLsizeiptr length, GLbitfield access,
727                              struct gl_buffer_object *obj);
728
729    void (*FlushMappedBufferRange)(struct gl_context *ctx,
730                                   GLintptr offset, GLsizeiptr length,
731                                   struct gl_buffer_object *obj);
732
733    GLboolean (*UnmapBuffer)( struct gl_context *ctx,
734                              struct gl_buffer_object *obj );
735    /*@}*/
736
737    /**
738     * \name Functions for GL_APPLE_object_purgeable
739     */
740    /*@{*/
741    /* variations on ObjectPurgeable */
742    GLenum (*BufferObjectPurgeable)( struct gl_context *ctx, struct gl_buffer_object *obj, GLenum option );
743    GLenum (*RenderObjectPurgeable)( struct gl_context *ctx, struct gl_renderbuffer *obj, GLenum option );
744    GLenum (*TextureObjectPurgeable)( struct gl_context *ctx, struct gl_texture_object *obj, GLenum option );
745
746    /* variations on ObjectUnpurgeable */
747    GLenum (*BufferObjectUnpurgeable)( struct gl_context *ctx, struct gl_buffer_object *obj, GLenum option );
748    GLenum (*RenderObjectUnpurgeable)( struct gl_context *ctx, struct gl_renderbuffer *obj, GLenum option );
749    GLenum (*TextureObjectUnpurgeable)( struct gl_context *ctx, struct gl_texture_object *obj, GLenum option );
750    /*@}*/
751
752    /**
753     * \name Functions for GL_EXT_framebuffer_{object,blit}.
754     */
755    /*@{*/
756    struct gl_framebuffer * (*NewFramebuffer)(struct gl_context *ctx, GLuint name);
757    struct gl_renderbuffer * (*NewRenderbuffer)(struct gl_context *ctx, GLuint name);
758    void (*BindFramebuffer)(struct gl_context *ctx, GLenum target,
759                            struct gl_framebuffer *drawFb,
760                            struct gl_framebuffer *readFb);
761    void (*FramebufferRenderbuffer)(struct gl_context *ctx, 
762                                    struct gl_framebuffer *fb,
763                                    GLenum attachment,
764                                    struct gl_renderbuffer *rb);
765    void (*RenderTexture)(struct gl_context *ctx,
766                          struct gl_framebuffer *fb,
767                          struct gl_renderbuffer_attachment *att);
768    void (*FinishRenderTexture)(struct gl_context *ctx,
769                                struct gl_renderbuffer_attachment *att);
770    void (*ValidateFramebuffer)(struct gl_context *ctx,
771                                struct gl_framebuffer *fb);
772    /*@}*/
773    void (*BlitFramebuffer)(struct gl_context *ctx,
774                            GLint srcX0, GLint srcY0, GLint srcX1, GLint srcY1,
775                            GLint dstX0, GLint dstY0, GLint dstX1, GLint dstY1,
776                            GLbitfield mask, GLenum filter);
777
778    /**
779     * \name Query objects
780     */
781    /*@{*/
782    struct gl_query_object * (*NewQueryObject)(struct gl_context *ctx, GLuint id);
783    void (*DeleteQuery)(struct gl_context *ctx, struct gl_query_object *q);
784    void (*BeginQuery)(struct gl_context *ctx, struct gl_query_object *q);
785    void (*EndQuery)(struct gl_context *ctx, struct gl_query_object *q);
786    void (*CheckQuery)(struct gl_context *ctx, struct gl_query_object *q);
787    void (*WaitQuery)(struct gl_context *ctx, struct gl_query_object *q);
788    /*@}*/
789
790
791    /**
792     * \name Vertex Array objects
793     */
794    /*@{*/
795    struct gl_array_object * (*NewArrayObject)(struct gl_context *ctx, GLuint id);
796    void (*DeleteArrayObject)(struct gl_context *ctx, struct gl_array_object *obj);
797    void (*BindArrayObject)(struct gl_context *ctx, struct gl_array_object *obj);
798    /*@}*/
799
800    /**
801     * \name GLSL-related functions (ARB extensions and OpenGL 2.x)
802     */
803    /*@{*/
804    struct gl_shader *(*NewShader)(struct gl_context *ctx, GLuint name, GLenum type);
805    void (*DeleteShader)(struct gl_context *ctx, struct gl_shader *shader);
806    struct gl_shader_program *(*NewShaderProgram)(struct gl_context *ctx, GLuint name);
807    void (*DeleteShaderProgram)(struct gl_context *ctx,
808                                struct gl_shader_program *shProg);
809    void (*UseProgram)(struct gl_context *ctx, struct gl_shader_program *shProg);
810    /*@}*/
811
812
813    /**
814     * \name Support for multiple T&L engines
815     */
816    /*@{*/
817
818    /**
819     * Set by the driver-supplied T&L engine.  
820     *
821     * Set to PRIM_OUTSIDE_BEGIN_END when outside glBegin()/glEnd().
822     */
823    GLuint CurrentExecPrimitive;
824
825    /**
826     * Current state of an in-progress compilation.  
827     *
828     * May take on any of the additional values PRIM_OUTSIDE_BEGIN_END,
829     * PRIM_INSIDE_UNKNOWN_PRIM or PRIM_UNKNOWN defined above.
830     */
831    GLuint CurrentSavePrimitive;
832
833
834 #define FLUSH_STORED_VERTICES 0x1
835 #define FLUSH_UPDATE_CURRENT  0x2
836    /**
837     * Set by the driver-supplied T&L engine whenever vertices are buffered
838     * between glBegin()/glEnd() objects or __struct gl_contextRec::Current is not
839     * updated.
840     *
841     * The dd_function_table::FlushVertices call below may be used to resolve
842     * these conditions.
843     */
844    GLuint NeedFlush;
845    GLuint SaveNeedFlush;
846
847
848    /* Called prior to any of the GLvertexformat functions being
849     * called.  Paired with Driver.FlushVertices().
850     */
851    void (*BeginVertices)( struct gl_context *ctx );
852
853    /**
854     * If inside glBegin()/glEnd(), it should ASSERT(0).  Otherwise, if
855     * FLUSH_STORED_VERTICES bit in \p flags is set flushes any buffered
856     * vertices, if FLUSH_UPDATE_CURRENT bit is set updates
857     * __struct gl_contextRec::Current and gl_light_attrib::Material
858     *
859     * Note that the default T&L engine never clears the
860     * FLUSH_UPDATE_CURRENT bit, even after performing the update.
861     */
862    void (*FlushVertices)( struct gl_context *ctx, GLuint flags );
863    void (*SaveFlushVertices)( struct gl_context *ctx );
864
865    /**
866     * \brief Hook for drivers to prepare for a glBegin/glEnd block
867     *
868     * This hook is called in vbo_exec_Begin() before any action, including
869     * state updates, occurs.
870     */
871    void (*PrepareExecBegin)( struct gl_context *ctx );
872
873    /**
874     * Give the driver the opportunity to hook in its own vtxfmt for
875     * compiling optimized display lists.  This is called on each valid
876     * glBegin() during list compilation.
877     */
878    GLboolean (*NotifySaveBegin)( struct gl_context *ctx, GLenum mode );
879
880    /**
881     * Notify driver that the special derived value _NeedEyeCoords has
882     * changed.
883     */
884    void (*LightingSpaceChange)( struct gl_context *ctx );
885
886    /**
887     * Called by glNewList().
888     *
889     * Let the T&L component know what is going on with display lists
890     * in time to make changes to dispatch tables, etc.
891     */
892    void (*NewList)( struct gl_context *ctx, GLuint list, GLenum mode );
893    /**
894     * Called by glEndList().
895     *
896     * \sa dd_function_table::NewList.
897     */
898    void (*EndList)( struct gl_context *ctx );
899
900    /**
901     * Called by glCallList(s).
902     *
903     * Notify the T&L component before and after calling a display list.
904     */
905    void (*BeginCallList)( struct gl_context *ctx, 
906                           struct gl_display_list *dlist );
907    /**
908     * Called by glEndCallList().
909     *
910     * \sa dd_function_table::BeginCallList.
911     */
912    void (*EndCallList)( struct gl_context *ctx );
913
914    /**@}*/
915
916    /**
917     * \name GL_ARB_sync interfaces
918     */
919    /*@{*/
920    struct gl_sync_object * (*NewSyncObject)(struct gl_context *, GLenum);
921    void (*FenceSync)(struct gl_context *, struct gl_sync_object *, GLenum, GLbitfield);
922    void (*DeleteSyncObject)(struct gl_context *, struct gl_sync_object *);
923    void (*CheckSync)(struct gl_context *, struct gl_sync_object *);
924    void (*ClientWaitSync)(struct gl_context *, struct gl_sync_object *,
925                           GLbitfield, GLuint64);
926    void (*ServerWaitSync)(struct gl_context *, struct gl_sync_object *,
927                           GLbitfield, GLuint64);
928    /*@}*/
929
930    /** GL_NV_conditional_render */
931    void (*BeginConditionalRender)(struct gl_context *ctx, struct gl_query_object *q,
932                                   GLenum mode);
933    void (*EndConditionalRender)(struct gl_context *ctx, struct gl_query_object *q);
934
935    /**
936     * \name GL_OES_draw_texture interface
937     */
938    /*@{*/
939    void (*DrawTex)(struct gl_context *ctx, GLfloat x, GLfloat y, GLfloat z,
940                    GLfloat width, GLfloat height);
941    /*@}*/
942
943    /**
944     * \name GL_OES_EGL_image interface
945     */
946    void (*EGLImageTargetTexture2D)(struct gl_context *ctx, GLenum target,
947                                    struct gl_texture_object *texObj,
948                                    struct gl_texture_image *texImage,
949                                    GLeglImageOES image_handle);
950    void (*EGLImageTargetRenderbufferStorage)(struct gl_context *ctx,
951                                              struct gl_renderbuffer *rb,
952                                              void *image_handle);
953
954    /**
955     * \name GL_EXT_transform_feedback interface
956     */
957    struct gl_transform_feedback_object *
958         (*NewTransformFeedback)(struct gl_context *ctx, GLuint name);
959    void (*DeleteTransformFeedback)(struct gl_context *ctx,
960                                    struct gl_transform_feedback_object *obj);
961    void (*BeginTransformFeedback)(struct gl_context *ctx, GLenum mode,
962                                   struct gl_transform_feedback_object *obj);
963    void (*EndTransformFeedback)(struct gl_context *ctx,
964                                 struct gl_transform_feedback_object *obj);
965    void (*PauseTransformFeedback)(struct gl_context *ctx,
966                                   struct gl_transform_feedback_object *obj);
967    void (*ResumeTransformFeedback)(struct gl_context *ctx,
968                                    struct gl_transform_feedback_object *obj);
969
970    /**
971     * \name GL_NV_texture_barrier interface
972     */
973    void (*TextureBarrier)(struct gl_context *ctx);
974
975    /**
976     * \name GL_ARB_sampler_objects
977     */
978    struct gl_sampler_object * (*NewSamplerObject)(struct gl_context *ctx,
979                                                   GLuint name);
980    void (*DeleteSamplerObject)(struct gl_context *ctx,
981                                struct gl_sampler_object *samp);
982 };
983
984
985 /**
986  * Transform/Clip/Lighting interface
987  *
988  * Drivers present a reduced set of the functions possible in
989  * glBegin()/glEnd() objects.  Core mesa provides translation stubs for the
990  * remaining functions to map down to these entry points.
991  *
992  * These are the initial values to be installed into dispatch by
993  * mesa.  If the T&L driver wants to modify the dispatch table
994  * while installed, it must do so itself.  It would be possible for
995  * the vertexformat to install its own initial values for these
996  * functions, but this way there is an obvious list of what is
997  * expected of the driver.
998  *
999  * If the driver wants to hook in entry points other than those
1000  * listed, it must restore them to their original values in
1001  * the disable() callback, below.
1002  */
1003 typedef struct {
1004    /**
1005     * \name Vertex
1006     */
1007    /*@{*/
1008    void (GLAPIENTRYP ArrayElement)( GLint );
1009    void (GLAPIENTRYP Color3f)( GLfloat, GLfloat, GLfloat );
1010    void (GLAPIENTRYP Color3fv)( const GLfloat * );
1011    void (GLAPIENTRYP Color4f)( GLfloat, GLfloat, GLfloat, GLfloat );
1012    void (GLAPIENTRYP Color4fv)( const GLfloat * );
1013    void (GLAPIENTRYP EdgeFlag)( GLboolean );
1014    void (GLAPIENTRYP EvalCoord1f)( GLfloat );
1015    void (GLAPIENTRYP EvalCoord1fv)( const GLfloat * );
1016    void (GLAPIENTRYP EvalCoord2f)( GLfloat, GLfloat );
1017    void (GLAPIENTRYP EvalCoord2fv)( const GLfloat * );
1018    void (GLAPIENTRYP EvalPoint1)( GLint );
1019    void (GLAPIENTRYP EvalPoint2)( GLint, GLint );
1020    void (GLAPIENTRYP FogCoordfEXT)( GLfloat );
1021    void (GLAPIENTRYP FogCoordfvEXT)( const GLfloat * );
1022    void (GLAPIENTRYP Indexf)( GLfloat );
1023    void (GLAPIENTRYP Indexfv)( const GLfloat * );
1024    void (GLAPIENTRYP Materialfv)( GLenum face, GLenum pname, const GLfloat * );
1025    void (GLAPIENTRYP MultiTexCoord1fARB)( GLenum, GLfloat );
1026    void (GLAPIENTRYP MultiTexCoord1fvARB)( GLenum, const GLfloat * );
1027    void (GLAPIENTRYP MultiTexCoord2fARB)( GLenum, GLfloat, GLfloat );
1028    void (GLAPIENTRYP MultiTexCoord2fvARB)( GLenum, const GLfloat * );
1029    void (GLAPIENTRYP MultiTexCoord3fARB)( GLenum, GLfloat, GLfloat, GLfloat );
1030    void (GLAPIENTRYP MultiTexCoord3fvARB)( GLenum, const GLfloat * );
1031    void (GLAPIENTRYP MultiTexCoord4fARB)( GLenum, GLfloat, GLfloat, GLfloat, GLfloat );
1032    void (GLAPIENTRYP MultiTexCoord4fvARB)( GLenum, const GLfloat * );
1033    void (GLAPIENTRYP Normal3f)( GLfloat, GLfloat, GLfloat );
1034    void (GLAPIENTRYP Normal3fv)( const GLfloat * );
1035    void (GLAPIENTRYP SecondaryColor3fEXT)( GLfloat, GLfloat, GLfloat );
1036    void (GLAPIENTRYP SecondaryColor3fvEXT)( const GLfloat * );
1037    void (GLAPIENTRYP TexCoord1f)( GLfloat );
1038    void (GLAPIENTRYP TexCoord1fv)( const GLfloat * );
1039    void (GLAPIENTRYP TexCoord2f)( GLfloat, GLfloat );
1040    void (GLAPIENTRYP TexCoord2fv)( const GLfloat * );
1041    void (GLAPIENTRYP TexCoord3f)( GLfloat, GLfloat, GLfloat );
1042    void (GLAPIENTRYP TexCoord3fv)( const GLfloat * );
1043    void (GLAPIENTRYP TexCoord4f)( GLfloat, GLfloat, GLfloat, GLfloat );
1044    void (GLAPIENTRYP TexCoord4fv)( const GLfloat * );
1045    void (GLAPIENTRYP Vertex2f)( GLfloat, GLfloat );
1046    void (GLAPIENTRYP Vertex2fv)( const GLfloat * );
1047    void (GLAPIENTRYP Vertex3f)( GLfloat, GLfloat, GLfloat );
1048    void (GLAPIENTRYP Vertex3fv)( const GLfloat * );
1049    void (GLAPIENTRYP Vertex4f)( GLfloat, GLfloat, GLfloat, GLfloat );
1050    void (GLAPIENTRYP Vertex4fv)( const GLfloat * );
1051    void (GLAPIENTRYP CallList)( GLuint );
1052    void (GLAPIENTRYP CallLists)( GLsizei, GLenum, const GLvoid * );
1053    void (GLAPIENTRYP Begin)( GLenum );
1054    void (GLAPIENTRYP End)( void );
1055    void (GLAPIENTRYP PrimitiveRestartNV)( void );
1056    /* GL_NV_vertex_program */
1057    void (GLAPIENTRYP VertexAttrib1fNV)( GLuint index, GLfloat x );
1058    void (GLAPIENTRYP VertexAttrib1fvNV)( GLuint index, const GLfloat *v );
1059    void (GLAPIENTRYP VertexAttrib2fNV)( GLuint index, GLfloat x, GLfloat y );
1060    void (GLAPIENTRYP VertexAttrib2fvNV)( GLuint index, const GLfloat *v );
1061    void (GLAPIENTRYP VertexAttrib3fNV)( GLuint index, GLfloat x, GLfloat y, GLfloat z );
1062    void (GLAPIENTRYP VertexAttrib3fvNV)( GLuint index, const GLfloat *v );
1063    void (GLAPIENTRYP VertexAttrib4fNV)( GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w );
1064    void (GLAPIENTRYP VertexAttrib4fvNV)( GLuint index, const GLfloat *v );
1065    /* GL_ARB_vertex_program */
1066    void (GLAPIENTRYP VertexAttrib1fARB)( GLuint index, GLfloat x );
1067    void (GLAPIENTRYP VertexAttrib1fvARB)( GLuint index, const GLfloat *v );
1068    void (GLAPIENTRYP VertexAttrib2fARB)( GLuint index, GLfloat x, GLfloat y );
1069    void (GLAPIENTRYP VertexAttrib2fvARB)( GLuint index, const GLfloat *v );
1070    void (GLAPIENTRYP VertexAttrib3fARB)( GLuint index, GLfloat x, GLfloat y, GLfloat z );
1071    void (GLAPIENTRYP VertexAttrib3fvARB)( GLuint index, const GLfloat *v );
1072    void (GLAPIENTRYP VertexAttrib4fARB)( GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w );
1073    void (GLAPIENTRYP VertexAttrib4fvARB)( GLuint index, const GLfloat *v );
1074
1075    /* GL_EXT_gpu_shader4 / GL 3.0 */
1076    void (GLAPIENTRYP VertexAttribI1i)( GLuint index, GLint x);
1077    void (GLAPIENTRYP VertexAttribI2i)( GLuint index, GLint x, GLint y);
1078    void (GLAPIENTRYP VertexAttribI3i)( GLuint index, GLint x, GLint y, GLint z);
1079    void (GLAPIENTRYP VertexAttribI4i)( GLuint index, GLint x, GLint y, GLint z, GLint w);
1080    void (GLAPIENTRYP VertexAttribI2iv)( GLuint index, const GLint *v);
1081    void (GLAPIENTRYP VertexAttribI3iv)( GLuint index, const GLint *v);
1082    void (GLAPIENTRYP VertexAttribI4iv)( GLuint index, const GLint *v);
1083
1084    void (GLAPIENTRYP VertexAttribI1ui)( GLuint index, GLuint x);
1085    void (GLAPIENTRYP VertexAttribI2ui)( GLuint index, GLuint x, GLuint y);
1086    void (GLAPIENTRYP VertexAttribI3ui)( GLuint index, GLuint x, GLuint y, GLuint z);
1087    void (GLAPIENTRYP VertexAttribI4ui)( GLuint index, GLuint x, GLuint y, GLuint z, GLuint w);
1088    void (GLAPIENTRYP VertexAttribI2uiv)( GLuint index, const GLuint *v);
1089    void (GLAPIENTRYP VertexAttribI3uiv)( GLuint index, const GLuint *v);
1090    void (GLAPIENTRYP VertexAttribI4uiv)( GLuint index, const GLuint *v);
1091
1092    /* GL_ARB_vertex_type_10_10_10_2_rev / GL3.3 */
1093    void (GLAPIENTRYP VertexP2ui)( GLenum type, GLuint value );
1094    void (GLAPIENTRYP VertexP2uiv)( GLenum type, const GLuint *value);
1095
1096    void (GLAPIENTRYP VertexP3ui)( GLenum type, GLuint value );
1097    void (GLAPIENTRYP VertexP3uiv)( GLenum type, const GLuint *value);
1098
1099    void (GLAPIENTRYP VertexP4ui)( GLenum type, GLuint value );
1100    void (GLAPIENTRYP VertexP4uiv)( GLenum type, const GLuint *value);
1101
1102    void (GLAPIENTRYP TexCoordP1ui)( GLenum type, GLuint coords );
1103    void (GLAPIENTRYP TexCoordP1uiv)( GLenum type, const GLuint *coords );
1104
1105    void (GLAPIENTRYP TexCoordP2ui)( GLenum type, GLuint coords );
1106    void (GLAPIENTRYP TexCoordP2uiv)( GLenum type, const GLuint *coords );
1107
1108    void (GLAPIENTRYP TexCoordP3ui)( GLenum type, GLuint coords );
1109    void (GLAPIENTRYP TexCoordP3uiv)( GLenum type, const GLuint *coords );
1110
1111    void (GLAPIENTRYP TexCoordP4ui)( GLenum type, GLuint coords );
1112    void (GLAPIENTRYP TexCoordP4uiv)( GLenum type, const GLuint *coords );
1113
1114    void (GLAPIENTRYP MultiTexCoordP1ui)( GLenum texture, GLenum type, GLuint coords );
1115    void (GLAPIENTRYP MultiTexCoordP1uiv)( GLenum texture, GLenum type, const GLuint *coords );
1116    void (GLAPIENTRYP MultiTexCoordP2ui)( GLenum texture, GLenum type, GLuint coords );
1117    void (GLAPIENTRYP MultiTexCoordP2uiv)( GLenum texture, GLenum type, const GLuint *coords );
1118    void (GLAPIENTRYP MultiTexCoordP3ui)( GLenum texture, GLenum type, GLuint coords );
1119    void (GLAPIENTRYP MultiTexCoordP3uiv)( GLenum texture, GLenum type, const GLuint *coords );
1120    void (GLAPIENTRYP MultiTexCoordP4ui)( GLenum texture, GLenum type, GLuint coords );
1121    void (GLAPIENTRYP MultiTexCoordP4uiv)( GLenum texture, GLenum type, const GLuint *coords );
1122
1123    void (GLAPIENTRYP NormalP3ui)( GLenum type, GLuint coords );
1124    void (GLAPIENTRYP NormalP3uiv)( GLenum type, const GLuint *coords );
1125
1126    void (GLAPIENTRYP ColorP3ui)( GLenum type, GLuint color );
1127    void (GLAPIENTRYP ColorP3uiv)( GLenum type, const GLuint *color );
1128
1129    void (GLAPIENTRYP ColorP4ui)( GLenum type, GLuint color );
1130    void (GLAPIENTRYP ColorP4uiv)( GLenum type, const GLuint *color );
1131
1132    void (GLAPIENTRYP SecondaryColorP3ui)( GLenum type, GLuint color );
1133    void (GLAPIENTRYP SecondaryColorP3uiv)( GLenum type, const GLuint *color );
1134
1135    void (GLAPIENTRYP VertexAttribP1ui)( GLuint index, GLenum type,
1136                                         GLboolean normalized, GLuint value);
1137    void (GLAPIENTRYP VertexAttribP2ui)( GLuint index, GLenum type,
1138                                         GLboolean normalized, GLuint value);
1139    void (GLAPIENTRYP VertexAttribP3ui)( GLuint index, GLenum type,
1140                                         GLboolean normalized, GLuint value);
1141    void (GLAPIENTRYP VertexAttribP4ui)( GLuint index, GLenum type,
1142                                         GLboolean normalized, GLuint value);
1143    void (GLAPIENTRYP VertexAttribP1uiv)( GLuint index, GLenum type,
1144                                         GLboolean normalized,
1145                                          const GLuint *value);
1146    void (GLAPIENTRYP VertexAttribP2uiv)( GLuint index, GLenum type,
1147                                         GLboolean normalized,
1148                                          const GLuint *value);
1149    void (GLAPIENTRYP VertexAttribP3uiv)( GLuint index, GLenum type,
1150                                         GLboolean normalized,
1151                                          const GLuint *value);
1152    void (GLAPIENTRYP VertexAttribP4uiv)( GLuint index, GLenum type,
1153                                          GLboolean normalized,
1154                                          const GLuint *value);
1155
1156    /*@}*/
1157
1158    void (GLAPIENTRYP Rectf)( GLfloat, GLfloat, GLfloat, GLfloat );
1159
1160    /**
1161     * \name Array
1162     */
1163    /*@{*/
1164    void (GLAPIENTRYP DrawArrays)( GLenum mode, GLint start, GLsizei count );
1165    void (GLAPIENTRYP DrawElements)( GLenum mode, GLsizei count, GLenum type,
1166                          const GLvoid *indices );
1167    void (GLAPIENTRYP DrawRangeElements)( GLenum mode, GLuint start,
1168                               GLuint end, GLsizei count,
1169                               GLenum type, const GLvoid *indices );
1170    void (GLAPIENTRYP MultiDrawElementsEXT)( GLenum mode, const GLsizei *count,
1171                                             GLenum type,
1172                                             const GLvoid **indices,
1173                                             GLsizei primcount);
1174    void (GLAPIENTRYP DrawElementsBaseVertex)( GLenum mode, GLsizei count,
1175                                               GLenum type,
1176                                               const GLvoid *indices,
1177                                               GLint basevertex );
1178    void (GLAPIENTRYP DrawRangeElementsBaseVertex)( GLenum mode, GLuint start,
1179                                                    GLuint end, GLsizei count,
1180                                                    GLenum type,
1181                                                    const GLvoid *indices,
1182                                                    GLint basevertex);
1183    void (GLAPIENTRYP MultiDrawElementsBaseVertex)( GLenum mode,
1184                                                    const GLsizei *count,
1185                                                    GLenum type,
1186                                                    const GLvoid **indices,
1187                                                    GLsizei primcount,
1188                                                    const GLint *basevertex);
1189    void (GLAPIENTRYP DrawArraysInstanced)(GLenum mode, GLint first,
1190                                           GLsizei count, GLsizei primcount);
1191    void (GLAPIENTRYP DrawElementsInstanced)(GLenum mode, GLsizei count,
1192                                             GLenum type, const GLvoid *indices,
1193                                             GLsizei primcount);
1194    void (GLAPIENTRYP DrawElementsInstancedBaseVertex)(GLenum mode, GLsizei count,
1195                                             GLenum type, const GLvoid *indices,
1196                                             GLsizei primcount, GLint basevertex);
1197    void (GLAPIENTRYP DrawTransformFeedback)(GLenum mode, GLuint name);
1198    /*@}*/
1199
1200    /**
1201     * \name Eval
1202     *
1203     * If you don't support eval, fallback to the default vertex format
1204     * on receiving an eval call and use the pipeline mechanism to
1205     * provide partial T&L acceleration.
1206     *
1207     * Mesa will provide a set of helper functions to do eval within
1208     * accelerated vertex formats, eventually...
1209     */
1210    /*@{*/
1211    void (GLAPIENTRYP EvalMesh1)( GLenum mode, GLint i1, GLint i2 );
1212    void (GLAPIENTRYP EvalMesh2)( GLenum mode, GLint i1, GLint i2, GLint j1, GLint j2 );
1213    /*@}*/
1214
1215 } GLvertexformat;
1216
1217
1218 #endif /* DD_INCLUDED */