dd.h revision 093dc9e548537e6c77e33064a584f849ad90dfa5
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
38struct gl_buffer_object;
39struct gl_context;
40struct gl_display_list;
41struct gl_framebuffer;
42struct gl_pixelstore_attrib;
43struct gl_program;
44struct gl_renderbuffer;
45struct gl_renderbuffer_attachment;
46struct gl_shader;
47struct gl_shader_program;
48struct gl_texture_image;
49struct 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 */
79struct 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, GLenum target, GLint level,
288                        GLenum format, GLenum type, GLvoid *pixels,
289                        struct gl_texture_object *texObj,
290                        struct gl_texture_image *texImage );
291
292   /**
293    * Called by glCopyTexSubImage1D().
294    *
295    * Drivers should use a fallback routine from texstore.c if needed.
296    */
297   void (*CopyTexSubImage1D)( struct gl_context *ctx, GLenum target, GLint level,
298                              GLint xoffset,
299                              GLint x, GLint y, GLsizei width );
300   /**
301    * Called by glCopyTexSubImage2D().
302    *
303    * Drivers should use a fallback routine from texstore.c if needed.
304    */
305   void (*CopyTexSubImage2D)( struct gl_context *ctx, GLenum target, GLint level,
306                              GLint xoffset, GLint yoffset,
307                              GLint x, GLint y,
308                              GLsizei width, GLsizei height );
309   /**
310    * Called by glCopyTexSubImage3D().
311    *
312    * Drivers should use a fallback routine from texstore.c if needed.
313    */
314   void (*CopyTexSubImage3D)( struct gl_context *ctx, GLenum target, GLint level,
315                              GLint xoffset, GLint yoffset, GLint zoffset,
316                              GLint x, GLint y,
317                              GLsizei width, GLsizei height );
318
319   /**
320    * Called by glGenerateMipmap() or when GL_GENERATE_MIPMAP_SGIS is enabled.
321    */
322   void (*GenerateMipmap)(struct gl_context *ctx, GLenum target,
323                          struct gl_texture_object *texObj);
324
325   /**
326    * Called by glTexImage[123]D when user specifies a proxy texture
327    * target.
328    *
329    * \return GL_TRUE if the proxy test passes, or GL_FALSE if the test fails.
330    */
331   GLboolean (*TestProxyTexImage)(struct gl_context *ctx, GLenum target,
332                                  GLint level, GLint internalFormat,
333                                  GLenum format, GLenum type,
334                                  GLint width, GLint height,
335                                  GLint depth, GLint border);
336   /*@}*/
337
338
339   /**
340    * \name Compressed texture functions
341    */
342   /*@{*/
343
344   /**
345    * Called by glCompressedTexImage1D().
346    *
347    * \param target user specified.
348    * \param format user specified.
349    * \param type user specified.
350    * \param pixels user specified.
351    * \param packing indicates the image packing of pixels.
352    * \param texObj is the target texture object.
353    * \param texImage is the target texture image.  It will have the texture \p
354    * width, \p height, \p depth, \p border and \p internalFormat information.
355    *
356    * \a retainInternalCopy is returned by this function and indicates whether
357    * core Mesa should keep an internal copy of the texture image.
358    */
359   void (*CompressedTexImage1D)( struct gl_context *ctx, GLenum target,
360                                 GLint level, GLint internalFormat,
361                                 GLsizei width, GLint border,
362                                 GLsizei imageSize, const GLvoid *data,
363                                 struct gl_texture_object *texObj,
364                                 struct gl_texture_image *texImage );
365   /**
366    * Called by glCompressedTexImage2D().
367    *
368    * \sa dd_function_table::CompressedTexImage1D.
369    */
370   void (*CompressedTexImage2D)( struct gl_context *ctx, GLenum target,
371                                 GLint level, GLint internalFormat,
372                                 GLsizei width, GLsizei height, GLint border,
373                                 GLsizei imageSize, const GLvoid *data,
374                                 struct gl_texture_object *texObj,
375                                 struct gl_texture_image *texImage );
376   /**
377    * Called by glCompressedTexImage3D().
378    *
379    * \sa dd_function_table::CompressedTexImage3D.
380    */
381   void (*CompressedTexImage3D)( struct gl_context *ctx, GLenum target,
382                                 GLint level, GLint internalFormat,
383                                 GLsizei width, GLsizei height, GLsizei depth,
384                                 GLint border,
385                                 GLsizei imageSize, const GLvoid *data,
386                                 struct gl_texture_object *texObj,
387                                 struct gl_texture_image *texImage );
388
389   /**
390    * Called by glCompressedTexSubImage1D().
391    *
392    * \param target user specified.
393    * \param level user specified.
394    * \param xoffset user specified.
395    * \param yoffset user specified.
396    * \param zoffset user specified.
397    * \param width user specified.
398    * \param height user specified.
399    * \param depth user specified.
400    * \param imageSize user specified.
401    * \param data user specified.
402    * \param texObj is the target texture object.
403    * \param texImage is the target texture image.  It will have the texture \p
404    * width, \p height, \p depth, \p border and \p internalFormat information.
405    */
406   void (*CompressedTexSubImage1D)(struct gl_context *ctx, GLenum target, GLint level,
407                                   GLint xoffset, GLsizei width,
408                                   GLenum format,
409                                   GLsizei imageSize, const GLvoid *data,
410                                   struct gl_texture_object *texObj,
411                                   struct gl_texture_image *texImage);
412   /**
413    * Called by glCompressedTexSubImage2D().
414    *
415    * \sa dd_function_table::CompressedTexImage3D.
416    */
417   void (*CompressedTexSubImage2D)(struct gl_context *ctx, GLenum target, GLint level,
418                                   GLint xoffset, GLint yoffset,
419                                   GLsizei width, GLint height,
420                                   GLenum format,
421                                   GLsizei imageSize, const GLvoid *data,
422                                   struct gl_texture_object *texObj,
423                                   struct gl_texture_image *texImage);
424   /**
425    * Called by glCompressedTexSubImage3D().
426    *
427    * \sa dd_function_table::CompressedTexImage3D.
428    */
429   void (*CompressedTexSubImage3D)(struct gl_context *ctx, GLenum target, GLint level,
430                                   GLint xoffset, GLint yoffset, GLint zoffset,
431                                   GLsizei width, GLint height, GLint depth,
432                                   GLenum format,
433                                   GLsizei imageSize, const GLvoid *data,
434                                   struct gl_texture_object *texObj,
435                                   struct gl_texture_image *texImage);
436
437
438   /**
439    * Called by glGetCompressedTexImage.
440    */
441   void (*GetCompressedTexImage)(struct gl_context *ctx, GLenum target, GLint level,
442                                 GLvoid *img,
443                                 struct gl_texture_object *texObj,
444                                 struct gl_texture_image *texImage);
445
446   /*@}*/
447
448   /**
449    * \name Texture object functions
450    */
451   /*@{*/
452
453   /**
454    * Called by glBindTexture().
455    */
456   void (*BindTexture)( struct gl_context *ctx, GLenum target,
457                        struct gl_texture_object *tObj );
458
459   /**
460    * Called to allocate a new texture object.
461    * A new gl_texture_object should be returned.  The driver should
462    * attach to it any device-specific info it needs.
463    */
464   struct gl_texture_object * (*NewTextureObject)( struct gl_context *ctx, GLuint name,
465                                                   GLenum target );
466   /**
467    * Called when a texture object is about to be deallocated.
468    *
469    * Driver should delete the gl_texture_object object and anything
470    * hanging off of it.
471    */
472   void (*DeleteTexture)( struct gl_context *ctx, struct gl_texture_object *tObj );
473
474   /**
475    * Called to allocate a new texture image object.
476    */
477   struct gl_texture_image * (*NewTextureImage)( struct gl_context *ctx );
478
479   /**
480    * Called to free tImage->Data.
481    */
482   void (*FreeTextureImageBuffer)( struct gl_context *ctx, struct gl_texture_image *tImage );
483
484   /** Map a slice of a texture image into user space.
485    * \param texImage  the texture image
486    * \param slice  the 3D image slice or array texture slice
487    * \param x, y, w, h  region of interest
488    * \param mode  bitmask of GL_MAP_READ_BIT, GL_MAP_WRITE_BIT
489    * \param mapOut  returns start of mapping of region of interest
490    * \param rowStrideOut  returns row stride (in bytes)
491    */
492   void (*MapTextureImage)(struct gl_context *ctx,
493			   struct gl_texture_image *texImage,
494			   GLuint slice,
495			   GLuint x, GLuint y, GLuint w, GLuint h,
496			   GLbitfield mode,
497			   GLubyte **mapOut, GLint *rowStrideOut);
498
499   void (*UnmapTextureImage)(struct gl_context *ctx,
500			     struct gl_texture_image *texImage,
501			     GLuint slice);
502
503   /** Map texture image data into user space */
504   void (*MapTexture)( struct gl_context *ctx, struct gl_texture_object *tObj );
505   /** Unmap texture images from user space */
506   void (*UnmapTexture)( struct gl_context *ctx, struct gl_texture_object *tObj );
507
508   /**
509    * Note: no context argument.  This function doesn't initially look
510    * like it belongs here, except that the driver is the only entity
511    * that knows for sure how the texture memory is allocated - via
512    * the above callbacks.  There is then an argument that the driver
513    * knows what memcpy paths might be fast.  Typically this is invoked with
514    *
515    * to -- a pointer into texture memory allocated by NewTextureImage() above.
516    * from -- a pointer into client memory or a mesa temporary.
517    * sz -- nr bytes to copy.
518    */
519   void* (*TextureMemCpy)( void *to, const void *from, size_t sz );
520
521   /**
522    * Called by glAreTextureResident().
523    */
524   GLboolean (*IsTextureResident)( struct gl_context *ctx,
525                                   struct gl_texture_object *t );
526   /*@}*/
527
528
529   /**
530    * \name Vertex/fragment program functions
531    */
532   /*@{*/
533   /** Bind a vertex/fragment program */
534   void (*BindProgram)(struct gl_context *ctx, GLenum target, struct gl_program *prog);
535   /** Allocate a new program */
536   struct gl_program * (*NewProgram)(struct gl_context *ctx, GLenum target, GLuint id);
537   /** Delete a program */
538   void (*DeleteProgram)(struct gl_context *ctx, struct gl_program *prog);
539   /**
540    * Notify driver that a program string (and GPU code) has been specified
541    * or modified.  Return GL_TRUE or GL_FALSE to indicate if the program is
542    * supported by the driver.
543    */
544   GLboolean (*ProgramStringNotify)(struct gl_context *ctx, GLenum target,
545                                    struct gl_program *prog);
546
547   /** Query if program can be loaded onto hardware */
548   GLboolean (*IsProgramNative)(struct gl_context *ctx, GLenum target,
549				struct gl_program *prog);
550
551   /*@}*/
552
553   /**
554    * \name GLSL shader/program functions.
555    */
556   /*@{*/
557   /**
558    * Called when a shader program is linked.
559    *
560    * This gives drivers an opportunity to clone the IR and make their
561    * own transformations on it for the purposes of code generation.
562    */
563   GLboolean (*LinkShader)(struct gl_context *ctx, struct gl_shader_program *shader);
564   /*@}*/
565
566   /**
567    * \name State-changing functions.
568    *
569    * \note drawing functions are above.
570    *
571    * These functions are called by their corresponding OpenGL API functions.
572    * They are \e also called by the gl_PopAttrib() function!!!
573    * May add more functions like these to the device driver in the future.
574    */
575   /*@{*/
576   /** Specify the alpha test function */
577   void (*AlphaFunc)(struct gl_context *ctx, GLenum func, GLfloat ref);
578   /** Set the blend color */
579   void (*BlendColor)(struct gl_context *ctx, const GLfloat color[4]);
580   /** Set the blend equation */
581   void (*BlendEquationSeparate)(struct gl_context *ctx, GLenum modeRGB, GLenum modeA);
582   void (*BlendEquationSeparatei)(struct gl_context *ctx, GLuint buffer,
583                                  GLenum modeRGB, GLenum modeA);
584   /** Specify pixel arithmetic */
585   void (*BlendFuncSeparate)(struct gl_context *ctx,
586                             GLenum sfactorRGB, GLenum dfactorRGB,
587                             GLenum sfactorA, GLenum dfactorA);
588   void (*BlendFuncSeparatei)(struct gl_context *ctx, GLuint buffer,
589                              GLenum sfactorRGB, GLenum dfactorRGB,
590                              GLenum sfactorA, GLenum dfactorA);
591   /** Specify clear values for the color buffers */
592   void (*ClearColor)(struct gl_context *ctx,
593                      const union gl_color_union color);
594   /** Specify the clear value for the depth buffer */
595   void (*ClearDepth)(struct gl_context *ctx, GLclampd d);
596   /** Specify the clear value for the stencil buffer */
597   void (*ClearStencil)(struct gl_context *ctx, GLint s);
598   /** Specify a plane against which all geometry is clipped */
599   void (*ClipPlane)(struct gl_context *ctx, GLenum plane, const GLfloat *equation );
600   /** Enable and disable writing of frame buffer color components */
601   void (*ColorMask)(struct gl_context *ctx, GLboolean rmask, GLboolean gmask,
602                     GLboolean bmask, GLboolean amask );
603   void (*ColorMaskIndexed)(struct gl_context *ctx, GLuint buf, GLboolean rmask,
604                            GLboolean gmask, GLboolean bmask, GLboolean amask);
605   /** Cause a material color to track the current color */
606   void (*ColorMaterial)(struct gl_context *ctx, GLenum face, GLenum mode);
607   /** Specify whether front- or back-facing facets can be culled */
608   void (*CullFace)(struct gl_context *ctx, GLenum mode);
609   /** Define front- and back-facing polygons */
610   void (*FrontFace)(struct gl_context *ctx, GLenum mode);
611   /** Specify the value used for depth buffer comparisons */
612   void (*DepthFunc)(struct gl_context *ctx, GLenum func);
613   /** Enable or disable writing into the depth buffer */
614   void (*DepthMask)(struct gl_context *ctx, GLboolean flag);
615   /** Specify mapping of depth values from NDC to window coordinates */
616   void (*DepthRange)(struct gl_context *ctx, GLclampd nearval, GLclampd farval);
617   /** Specify the current buffer for writing */
618   void (*DrawBuffer)( struct gl_context *ctx, GLenum buffer );
619   /** Specify the buffers for writing for fragment programs*/
620   void (*DrawBuffers)( struct gl_context *ctx, GLsizei n, const GLenum *buffers );
621   /** Enable or disable server-side gl capabilities */
622   void (*Enable)(struct gl_context *ctx, GLenum cap, GLboolean state);
623   /** Specify fog parameters */
624   void (*Fogfv)(struct gl_context *ctx, GLenum pname, const GLfloat *params);
625   /** Specify implementation-specific hints */
626   void (*Hint)(struct gl_context *ctx, GLenum target, GLenum mode);
627   /** Set light source parameters.
628    * Note: for GL_POSITION and GL_SPOT_DIRECTION, params will have already
629    * been transformed to eye-space.
630    */
631   void (*Lightfv)(struct gl_context *ctx, GLenum light,
632		   GLenum pname, const GLfloat *params );
633   /** Set the lighting model parameters */
634   void (*LightModelfv)(struct gl_context *ctx, GLenum pname, const GLfloat *params);
635   /** Specify the line stipple pattern */
636   void (*LineStipple)(struct gl_context *ctx, GLint factor, GLushort pattern );
637   /** Specify the width of rasterized lines */
638   void (*LineWidth)(struct gl_context *ctx, GLfloat width);
639   /** Specify a logical pixel operation for color index rendering */
640   void (*LogicOpcode)(struct gl_context *ctx, GLenum opcode);
641   void (*PointParameterfv)(struct gl_context *ctx, GLenum pname,
642                            const GLfloat *params);
643   /** Specify the diameter of rasterized points */
644   void (*PointSize)(struct gl_context *ctx, GLfloat size);
645   /** Select a polygon rasterization mode */
646   void (*PolygonMode)(struct gl_context *ctx, GLenum face, GLenum mode);
647   /** Set the scale and units used to calculate depth values */
648   void (*PolygonOffset)(struct gl_context *ctx, GLfloat factor, GLfloat units);
649   /** Set the polygon stippling pattern */
650   void (*PolygonStipple)(struct gl_context *ctx, const GLubyte *mask );
651   /* Specifies the current buffer for reading */
652   void (*ReadBuffer)( struct gl_context *ctx, GLenum buffer );
653   /** Set rasterization mode */
654   void (*RenderMode)(struct gl_context *ctx, GLenum mode );
655   /** Define the scissor box */
656   void (*Scissor)(struct gl_context *ctx, GLint x, GLint y, GLsizei w, GLsizei h);
657   /** Select flat or smooth shading */
658   void (*ShadeModel)(struct gl_context *ctx, GLenum mode);
659   /** OpenGL 2.0 two-sided StencilFunc */
660   void (*StencilFuncSeparate)(struct gl_context *ctx, GLenum face, GLenum func,
661                               GLint ref, GLuint mask);
662   /** OpenGL 2.0 two-sided StencilMask */
663   void (*StencilMaskSeparate)(struct gl_context *ctx, GLenum face, GLuint mask);
664   /** OpenGL 2.0 two-sided StencilOp */
665   void (*StencilOpSeparate)(struct gl_context *ctx, GLenum face, GLenum fail,
666                             GLenum zfail, GLenum zpass);
667   /** Control the generation of texture coordinates */
668   void (*TexGen)(struct gl_context *ctx, GLenum coord, GLenum pname,
669		  const GLfloat *params);
670   /** Set texture environment parameters */
671   void (*TexEnv)(struct gl_context *ctx, GLenum target, GLenum pname,
672                  const GLfloat *param);
673   /** Set texture parameters */
674   void (*TexParameter)(struct gl_context *ctx, GLenum target,
675                        struct gl_texture_object *texObj,
676                        GLenum pname, const GLfloat *params);
677   /** Set the viewport */
678   void (*Viewport)(struct gl_context *ctx, GLint x, GLint y, GLsizei w, GLsizei h);
679   /*@}*/
680
681
682   /**
683    * \name Vertex/pixel buffer object functions
684    */
685   /*@{*/
686   void (*BindBuffer)( struct gl_context *ctx, GLenum target,
687		       struct gl_buffer_object *obj );
688
689   struct gl_buffer_object * (*NewBufferObject)( struct gl_context *ctx, GLuint buffer,
690						 GLenum target );
691
692   void (*DeleteBuffer)( struct gl_context *ctx, struct gl_buffer_object *obj );
693
694   GLboolean (*BufferData)( struct gl_context *ctx, GLenum target, GLsizeiptrARB size,
695                            const GLvoid *data, GLenum usage,
696                            struct gl_buffer_object *obj );
697
698   void (*BufferSubData)( struct gl_context *ctx, GLintptrARB offset,
699			  GLsizeiptrARB size, const GLvoid *data,
700			  struct gl_buffer_object *obj );
701
702   void (*GetBufferSubData)( struct gl_context *ctx,
703			     GLintptrARB offset, GLsizeiptrARB size,
704			     GLvoid *data, struct gl_buffer_object *obj );
705
706   void (*CopyBufferSubData)( struct gl_context *ctx,
707                              struct gl_buffer_object *src,
708                              struct gl_buffer_object *dst,
709                              GLintptr readOffset, GLintptr writeOffset,
710                              GLsizeiptr size );
711
712   /* May return NULL if MESA_MAP_NOWAIT_BIT is set in access:
713    */
714   void * (*MapBufferRange)( struct gl_context *ctx, GLintptr offset,
715                             GLsizeiptr length, GLbitfield access,
716                             struct gl_buffer_object *obj);
717
718   void (*FlushMappedBufferRange)(struct gl_context *ctx,
719                                  GLintptr offset, GLsizeiptr length,
720                                  struct gl_buffer_object *obj);
721
722   GLboolean (*UnmapBuffer)( struct gl_context *ctx,
723			     struct gl_buffer_object *obj );
724   /*@}*/
725
726   /**
727    * \name Functions for GL_APPLE_object_purgeable
728    */
729   /*@{*/
730   /* variations on ObjectPurgeable */
731   GLenum (*BufferObjectPurgeable)( struct gl_context *ctx, struct gl_buffer_object *obj, GLenum option );
732   GLenum (*RenderObjectPurgeable)( struct gl_context *ctx, struct gl_renderbuffer *obj, GLenum option );
733   GLenum (*TextureObjectPurgeable)( struct gl_context *ctx, struct gl_texture_object *obj, GLenum option );
734
735   /* variations on ObjectUnpurgeable */
736   GLenum (*BufferObjectUnpurgeable)( struct gl_context *ctx, struct gl_buffer_object *obj, GLenum option );
737   GLenum (*RenderObjectUnpurgeable)( struct gl_context *ctx, struct gl_renderbuffer *obj, GLenum option );
738   GLenum (*TextureObjectUnpurgeable)( struct gl_context *ctx, struct gl_texture_object *obj, GLenum option );
739   /*@}*/
740
741   /**
742    * \name Functions for GL_EXT_framebuffer_{object,blit}.
743    */
744   /*@{*/
745   struct gl_framebuffer * (*NewFramebuffer)(struct gl_context *ctx, GLuint name);
746   struct gl_renderbuffer * (*NewRenderbuffer)(struct gl_context *ctx, GLuint name);
747   void (*BindFramebuffer)(struct gl_context *ctx, GLenum target,
748                           struct gl_framebuffer *drawFb,
749                           struct gl_framebuffer *readFb);
750   void (*FramebufferRenderbuffer)(struct gl_context *ctx,
751                                   struct gl_framebuffer *fb,
752                                   GLenum attachment,
753                                   struct gl_renderbuffer *rb);
754   void (*RenderTexture)(struct gl_context *ctx,
755                         struct gl_framebuffer *fb,
756                         struct gl_renderbuffer_attachment *att);
757   void (*FinishRenderTexture)(struct gl_context *ctx,
758                               struct gl_renderbuffer_attachment *att);
759   void (*ValidateFramebuffer)(struct gl_context *ctx,
760                               struct gl_framebuffer *fb);
761   /*@}*/
762   void (*BlitFramebuffer)(struct gl_context *ctx,
763                           GLint srcX0, GLint srcY0, GLint srcX1, GLint srcY1,
764                           GLint dstX0, GLint dstY0, GLint dstX1, GLint dstY1,
765                           GLbitfield mask, GLenum filter);
766
767   /**
768    * \name Query objects
769    */
770   /*@{*/
771   struct gl_query_object * (*NewQueryObject)(struct gl_context *ctx, GLuint id);
772   void (*DeleteQuery)(struct gl_context *ctx, struct gl_query_object *q);
773   void (*BeginQuery)(struct gl_context *ctx, struct gl_query_object *q);
774   void (*EndQuery)(struct gl_context *ctx, struct gl_query_object *q);
775   void (*CheckQuery)(struct gl_context *ctx, struct gl_query_object *q);
776   void (*WaitQuery)(struct gl_context *ctx, struct gl_query_object *q);
777   /*@}*/
778
779
780   /**
781    * \name Vertex Array objects
782    */
783   /*@{*/
784   struct gl_array_object * (*NewArrayObject)(struct gl_context *ctx, GLuint id);
785   void (*DeleteArrayObject)(struct gl_context *ctx, struct gl_array_object *obj);
786   void (*BindArrayObject)(struct gl_context *ctx, struct gl_array_object *obj);
787   /*@}*/
788
789   /**
790    * \name GLSL-related functions (ARB extensions and OpenGL 2.x)
791    */
792   /*@{*/
793   struct gl_shader *(*NewShader)(struct gl_context *ctx, GLuint name, GLenum type);
794   void (*DeleteShader)(struct gl_context *ctx, struct gl_shader *shader);
795   struct gl_shader_program *(*NewShaderProgram)(struct gl_context *ctx, GLuint name);
796   void (*DeleteShaderProgram)(struct gl_context *ctx,
797                               struct gl_shader_program *shProg);
798   void (*UseProgram)(struct gl_context *ctx, struct gl_shader_program *shProg);
799   /*@}*/
800
801
802   /**
803    * \name Support for multiple T&L engines
804    */
805   /*@{*/
806
807   /**
808    * Bitmask of state changes that require the current T&L module to be
809    * validated, using ValidateTnlModule() below.
810    */
811   GLuint NeedValidate;
812
813   /**
814    * Validate the current T&L module.
815    *
816    * This is called directly after UpdateState() when a state change that has
817    * occurred matches the dd_function_table::NeedValidate bitmask above.  This
818    * ensures all computed values are up to date, thus allowing the driver to
819    * decide if the current T&L module needs to be swapped out.
820    *
821    * This must be non-NULL if a driver installs a custom T&L module and sets
822    * the dd_function_table::NeedValidate bitmask, but may be NULL otherwise.
823    */
824   void (*ValidateTnlModule)( struct gl_context *ctx, GLuint new_state );
825
826   /**
827    * Set by the driver-supplied T&L engine.
828    *
829    * Set to PRIM_OUTSIDE_BEGIN_END when outside glBegin()/glEnd().
830    */
831   GLuint CurrentExecPrimitive;
832
833   /**
834    * Current state of an in-progress compilation.
835    *
836    * May take on any of the additional values PRIM_OUTSIDE_BEGIN_END,
837    * PRIM_INSIDE_UNKNOWN_PRIM or PRIM_UNKNOWN defined above.
838    */
839   GLuint CurrentSavePrimitive;
840
841
842#define FLUSH_STORED_VERTICES 0x1
843#define FLUSH_UPDATE_CURRENT  0x2
844   /**
845    * Set by the driver-supplied T&L engine whenever vertices are buffered
846    * between glBegin()/glEnd() objects or __struct gl_contextRec::Current is not
847    * updated.
848    *
849    * The dd_function_table::FlushVertices call below may be used to resolve
850    * these conditions.
851    */
852   GLuint NeedFlush;
853   GLuint SaveNeedFlush;
854
855
856   /* Called prior to any of the GLvertexformat functions being
857    * called.  Paired with Driver.FlushVertices().
858    */
859   void (*BeginVertices)( struct gl_context *ctx );
860
861   /**
862    * If inside glBegin()/glEnd(), it should ASSERT(0).  Otherwise, if
863    * FLUSH_STORED_VERTICES bit in \p flags is set flushes any buffered
864    * vertices, if FLUSH_UPDATE_CURRENT bit is set updates
865    * __struct gl_contextRec::Current and gl_light_attrib::Material
866    *
867    * Note that the default T&L engine never clears the
868    * FLUSH_UPDATE_CURRENT bit, even after performing the update.
869    */
870   void (*FlushVertices)( struct gl_context *ctx, GLuint flags );
871   void (*SaveFlushVertices)( 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    * \name GL_ARB_sync interfaces
917    */
918   /*@{*/
919   struct gl_sync_object * (*NewSyncObject)(struct gl_context *, GLenum);
920   void (*FenceSync)(struct gl_context *, struct gl_sync_object *, GLenum, GLbitfield);
921   void (*DeleteSyncObject)(struct gl_context *, struct gl_sync_object *);
922   void (*CheckSync)(struct gl_context *, struct gl_sync_object *);
923   void (*ClientWaitSync)(struct gl_context *, struct gl_sync_object *,
924			  GLbitfield, GLuint64);
925   void (*ServerWaitSync)(struct gl_context *, struct gl_sync_object *,
926			  GLbitfield, GLuint64);
927   /*@}*/
928
929   /** GL_NV_conditional_render */
930   void (*BeginConditionalRender)(struct gl_context *ctx, struct gl_query_object *q,
931                                  GLenum mode);
932   void (*EndConditionalRender)(struct gl_context *ctx, struct gl_query_object *q);
933
934   /**
935    * \name GL_OES_draw_texture interface
936    */
937   /*@{*/
938   void (*DrawTex)(struct gl_context *ctx, GLfloat x, GLfloat y, GLfloat z,
939                   GLfloat width, GLfloat height);
940   /*@}*/
941
942   /**
943    * \name GL_OES_EGL_image interface
944    */
945   void (*EGLImageTargetTexture2D)(struct gl_context *ctx, GLenum target,
946				   struct gl_texture_object *texObj,
947				   struct gl_texture_image *texImage,
948				   GLeglImageOES image_handle);
949   void (*EGLImageTargetRenderbufferStorage)(struct gl_context *ctx,
950					     struct gl_renderbuffer *rb,
951					     void *image_handle);
952
953   /**
954    * \name GL_EXT_transform_feedback interface
955    */
956   struct gl_transform_feedback_object *
957        (*NewTransformFeedback)(struct gl_context *ctx, GLuint name);
958   void (*DeleteTransformFeedback)(struct gl_context *ctx,
959                                   struct gl_transform_feedback_object *obj);
960   void (*BeginTransformFeedback)(struct gl_context *ctx, GLenum mode,
961                                  struct gl_transform_feedback_object *obj);
962   void (*EndTransformFeedback)(struct gl_context *ctx,
963                                struct gl_transform_feedback_object *obj);
964   void (*PauseTransformFeedback)(struct gl_context *ctx,
965                                  struct gl_transform_feedback_object *obj);
966   void (*ResumeTransformFeedback)(struct gl_context *ctx,
967                                   struct gl_transform_feedback_object *obj);
968   void (*DrawTransformFeedback)(struct gl_context *ctx, GLenum mode,
969                                 struct gl_transform_feedback_object *obj);
970
971   /**
972    * \name GL_NV_texture_barrier interface
973    */
974   void (*TextureBarrier)(struct gl_context *ctx);
975
976   /**
977    * \name GL_ARB_sampler_objects
978    */
979   struct gl_sampler_object * (*NewSamplerObject)(struct gl_context *ctx,
980                                                  GLuint name);
981   void (*DeleteSamplerObject)(struct gl_context *ctx,
982                               struct gl_sampler_object *samp);
983};
984
985
986/**
987 * Transform/Clip/Lighting interface
988 *
989 * Drivers present a reduced set of the functions possible in
990 * glBegin()/glEnd() objects.  Core mesa provides translation stubs for the
991 * remaining functions to map down to these entry points.
992 *
993 * These are the initial values to be installed into dispatch by
994 * mesa.  If the T&L driver wants to modify the dispatch table
995 * while installed, it must do so itself.  It would be possible for
996 * the vertexformat to install its own initial values for these
997 * functions, but this way there is an obvious list of what is
998 * expected of the driver.
999 *
1000 * If the driver wants to hook in entry points other than those
1001 * listed, it must restore them to their original values in
1002 * the disable() callback, below.
1003 */
1004typedef struct {
1005   /**
1006    * \name Vertex
1007    */
1008   /*@{*/
1009   void (GLAPIENTRYP ArrayElement)( GLint );
1010   void (GLAPIENTRYP Color3f)( GLfloat, GLfloat, GLfloat );
1011   void (GLAPIENTRYP Color3fv)( const GLfloat * );
1012   void (GLAPIENTRYP Color4f)( GLfloat, GLfloat, GLfloat, GLfloat );
1013   void (GLAPIENTRYP Color4fv)( const GLfloat * );
1014   void (GLAPIENTRYP EdgeFlag)( GLboolean );
1015   void (GLAPIENTRYP EvalCoord1f)( GLfloat );
1016   void (GLAPIENTRYP EvalCoord1fv)( const GLfloat * );
1017   void (GLAPIENTRYP EvalCoord2f)( GLfloat, GLfloat );
1018   void (GLAPIENTRYP EvalCoord2fv)( const GLfloat * );
1019   void (GLAPIENTRYP EvalPoint1)( GLint );
1020   void (GLAPIENTRYP EvalPoint2)( GLint, GLint );
1021   void (GLAPIENTRYP FogCoordfEXT)( GLfloat );
1022   void (GLAPIENTRYP FogCoordfvEXT)( const GLfloat * );
1023   void (GLAPIENTRYP Indexf)( GLfloat );
1024   void (GLAPIENTRYP Indexfv)( const GLfloat * );
1025   void (GLAPIENTRYP Materialfv)( GLenum face, GLenum pname, const GLfloat * );
1026   void (GLAPIENTRYP MultiTexCoord1fARB)( GLenum, GLfloat );
1027   void (GLAPIENTRYP MultiTexCoord1fvARB)( GLenum, const GLfloat * );
1028   void (GLAPIENTRYP MultiTexCoord2fARB)( GLenum, GLfloat, GLfloat );
1029   void (GLAPIENTRYP MultiTexCoord2fvARB)( GLenum, const GLfloat * );
1030   void (GLAPIENTRYP MultiTexCoord3fARB)( GLenum, GLfloat, GLfloat, GLfloat );
1031   void (GLAPIENTRYP MultiTexCoord3fvARB)( GLenum, const GLfloat * );
1032   void (GLAPIENTRYP MultiTexCoord4fARB)( GLenum, GLfloat, GLfloat, GLfloat, GLfloat );
1033   void (GLAPIENTRYP MultiTexCoord4fvARB)( GLenum, const GLfloat * );
1034   void (GLAPIENTRYP Normal3f)( GLfloat, GLfloat, GLfloat );
1035   void (GLAPIENTRYP Normal3fv)( const GLfloat * );
1036   void (GLAPIENTRYP SecondaryColor3fEXT)( GLfloat, GLfloat, GLfloat );
1037   void (GLAPIENTRYP SecondaryColor3fvEXT)( const GLfloat * );
1038   void (GLAPIENTRYP TexCoord1f)( GLfloat );
1039   void (GLAPIENTRYP TexCoord1fv)( const GLfloat * );
1040   void (GLAPIENTRYP TexCoord2f)( GLfloat, GLfloat );
1041   void (GLAPIENTRYP TexCoord2fv)( const GLfloat * );
1042   void (GLAPIENTRYP TexCoord3f)( GLfloat, GLfloat, GLfloat );
1043   void (GLAPIENTRYP TexCoord3fv)( const GLfloat * );
1044   void (GLAPIENTRYP TexCoord4f)( GLfloat, GLfloat, GLfloat, GLfloat );
1045   void (GLAPIENTRYP TexCoord4fv)( const GLfloat * );
1046   void (GLAPIENTRYP Vertex2f)( GLfloat, GLfloat );
1047   void (GLAPIENTRYP Vertex2fv)( const GLfloat * );
1048   void (GLAPIENTRYP Vertex3f)( GLfloat, GLfloat, GLfloat );
1049   void (GLAPIENTRYP Vertex3fv)( const GLfloat * );
1050   void (GLAPIENTRYP Vertex4f)( GLfloat, GLfloat, GLfloat, GLfloat );
1051   void (GLAPIENTRYP Vertex4fv)( const GLfloat * );
1052   void (GLAPIENTRYP CallList)( GLuint );
1053   void (GLAPIENTRYP CallLists)( GLsizei, GLenum, const GLvoid * );
1054   void (GLAPIENTRYP Begin)( GLenum );
1055   void (GLAPIENTRYP End)( void );
1056   void (GLAPIENTRYP PrimitiveRestartNV)( void );
1057   /* GL_NV_vertex_program */
1058   void (GLAPIENTRYP VertexAttrib1fNV)( GLuint index, GLfloat x );
1059   void (GLAPIENTRYP VertexAttrib1fvNV)( GLuint index, const GLfloat *v );
1060   void (GLAPIENTRYP VertexAttrib2fNV)( GLuint index, GLfloat x, GLfloat y );
1061   void (GLAPIENTRYP VertexAttrib2fvNV)( GLuint index, const GLfloat *v );
1062   void (GLAPIENTRYP VertexAttrib3fNV)( GLuint index, GLfloat x, GLfloat y, GLfloat z );
1063   void (GLAPIENTRYP VertexAttrib3fvNV)( GLuint index, const GLfloat *v );
1064   void (GLAPIENTRYP VertexAttrib4fNV)( GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w );
1065   void (GLAPIENTRYP VertexAttrib4fvNV)( GLuint index, const GLfloat *v );
1066   /* GL_ARB_vertex_program */
1067   void (GLAPIENTRYP VertexAttrib1fARB)( GLuint index, GLfloat x );
1068   void (GLAPIENTRYP VertexAttrib1fvARB)( GLuint index, const GLfloat *v );
1069   void (GLAPIENTRYP VertexAttrib2fARB)( GLuint index, GLfloat x, GLfloat y );
1070   void (GLAPIENTRYP VertexAttrib2fvARB)( GLuint index, const GLfloat *v );
1071   void (GLAPIENTRYP VertexAttrib3fARB)( GLuint index, GLfloat x, GLfloat y, GLfloat z );
1072   void (GLAPIENTRYP VertexAttrib3fvARB)( GLuint index, const GLfloat *v );
1073   void (GLAPIENTRYP VertexAttrib4fARB)( GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w );
1074   void (GLAPIENTRYP VertexAttrib4fvARB)( GLuint index, const GLfloat *v );
1075
1076   /* GL_EXT_gpu_shader4 / GL 3.0 */
1077   void (GLAPIENTRYP VertexAttribI1i)( GLuint index, GLint x);
1078   void (GLAPIENTRYP VertexAttribI2i)( GLuint index, GLint x, GLint y);
1079   void (GLAPIENTRYP VertexAttribI3i)( GLuint index, GLint x, GLint y, GLint z);
1080   void (GLAPIENTRYP VertexAttribI4i)( GLuint index, GLint x, GLint y, GLint z, GLint w);
1081   void (GLAPIENTRYP VertexAttribI2iv)( GLuint index, const GLint *v);
1082   void (GLAPIENTRYP VertexAttribI3iv)( GLuint index, const GLint *v);
1083   void (GLAPIENTRYP VertexAttribI4iv)( GLuint index, const GLint *v);
1084
1085   void (GLAPIENTRYP VertexAttribI1ui)( GLuint index, GLuint x);
1086   void (GLAPIENTRYP VertexAttribI2ui)( GLuint index, GLuint x, GLuint y);
1087   void (GLAPIENTRYP VertexAttribI3ui)( GLuint index, GLuint x, GLuint y, GLuint z);
1088   void (GLAPIENTRYP VertexAttribI4ui)( GLuint index, GLuint x, GLuint y, GLuint z, GLuint w);
1089   void (GLAPIENTRYP VertexAttribI2uiv)( GLuint index, const GLuint *v);
1090   void (GLAPIENTRYP VertexAttribI3uiv)( GLuint index, const GLuint *v);
1091   void (GLAPIENTRYP VertexAttribI4uiv)( GLuint index, const GLuint *v);
1092
1093   /* GL_ARB_vertex_type_10_10_10_2_rev / GL3.3 */
1094   void (GLAPIENTRYP VertexP2ui)( GLenum type, GLuint value );
1095   void (GLAPIENTRYP VertexP2uiv)( GLenum type, const GLuint *value);
1096
1097   void (GLAPIENTRYP VertexP3ui)( GLenum type, GLuint value );
1098   void (GLAPIENTRYP VertexP3uiv)( GLenum type, const GLuint *value);
1099
1100   void (GLAPIENTRYP VertexP4ui)( GLenum type, GLuint value );
1101   void (GLAPIENTRYP VertexP4uiv)( GLenum type, const GLuint *value);
1102
1103   void (GLAPIENTRYP TexCoordP1ui)( GLenum type, GLuint coords );
1104   void (GLAPIENTRYP TexCoordP1uiv)( GLenum type, const GLuint *coords );
1105
1106   void (GLAPIENTRYP TexCoordP2ui)( GLenum type, GLuint coords );
1107   void (GLAPIENTRYP TexCoordP2uiv)( GLenum type, const GLuint *coords );
1108
1109   void (GLAPIENTRYP TexCoordP3ui)( GLenum type, GLuint coords );
1110   void (GLAPIENTRYP TexCoordP3uiv)( GLenum type, const GLuint *coords );
1111
1112   void (GLAPIENTRYP TexCoordP4ui)( GLenum type, GLuint coords );
1113   void (GLAPIENTRYP TexCoordP4uiv)( GLenum type, const GLuint *coords );
1114
1115   void (GLAPIENTRYP MultiTexCoordP1ui)( GLenum texture, GLenum type, GLuint coords );
1116   void (GLAPIENTRYP MultiTexCoordP1uiv)( GLenum texture, GLenum type, const GLuint *coords );
1117   void (GLAPIENTRYP MultiTexCoordP2ui)( GLenum texture, GLenum type, GLuint coords );
1118   void (GLAPIENTRYP MultiTexCoordP2uiv)( GLenum texture, GLenum type, const GLuint *coords );
1119   void (GLAPIENTRYP MultiTexCoordP3ui)( GLenum texture, GLenum type, GLuint coords );
1120   void (GLAPIENTRYP MultiTexCoordP3uiv)( GLenum texture, GLenum type, const GLuint *coords );
1121   void (GLAPIENTRYP MultiTexCoordP4ui)( GLenum texture, GLenum type, GLuint coords );
1122   void (GLAPIENTRYP MultiTexCoordP4uiv)( GLenum texture, GLenum type, const GLuint *coords );
1123
1124   void (GLAPIENTRYP NormalP3ui)( GLenum type, GLuint coords );
1125   void (GLAPIENTRYP NormalP3uiv)( GLenum type, const GLuint *coords );
1126
1127   void (GLAPIENTRYP ColorP3ui)( GLenum type, GLuint color );
1128   void (GLAPIENTRYP ColorP3uiv)( GLenum type, const GLuint *color );
1129
1130   void (GLAPIENTRYP ColorP4ui)( GLenum type, GLuint color );
1131   void (GLAPIENTRYP ColorP4uiv)( GLenum type, const GLuint *color );
1132
1133   void (GLAPIENTRYP SecondaryColorP3ui)( GLenum type, GLuint color );
1134   void (GLAPIENTRYP SecondaryColorP3uiv)( GLenum type, const GLuint *color );
1135
1136   void (GLAPIENTRYP VertexAttribP1ui)( GLuint index, GLenum type,
1137					GLboolean normalized, GLuint value);
1138   void (GLAPIENTRYP VertexAttribP2ui)( GLuint index, GLenum type,
1139					GLboolean normalized, GLuint value);
1140   void (GLAPIENTRYP VertexAttribP3ui)( GLuint index, GLenum type,
1141					GLboolean normalized, GLuint value);
1142   void (GLAPIENTRYP VertexAttribP4ui)( GLuint index, GLenum type,
1143					GLboolean normalized, GLuint value);
1144   void (GLAPIENTRYP VertexAttribP1uiv)( GLuint index, GLenum type,
1145					GLboolean normalized,
1146					 const GLuint *value);
1147   void (GLAPIENTRYP VertexAttribP2uiv)( GLuint index, GLenum type,
1148					GLboolean normalized,
1149					 const GLuint *value);
1150   void (GLAPIENTRYP VertexAttribP3uiv)( GLuint index, GLenum type,
1151					GLboolean normalized,
1152					 const GLuint *value);
1153   void (GLAPIENTRYP VertexAttribP4uiv)( GLuint index, GLenum type,
1154					 GLboolean normalized,
1155					 const GLuint *value);
1156
1157   /*@}*/
1158
1159   void (GLAPIENTRYP Rectf)( GLfloat, GLfloat, GLfloat, GLfloat );
1160
1161   /**
1162    * \name Array
1163    */
1164   /*@{*/
1165   void (GLAPIENTRYP DrawArrays)( GLenum mode, GLint start, GLsizei count );
1166   void (GLAPIENTRYP DrawElements)( GLenum mode, GLsizei count, GLenum type,
1167			 const GLvoid *indices );
1168   void (GLAPIENTRYP DrawRangeElements)( GLenum mode, GLuint start,
1169			      GLuint end, GLsizei count,
1170			      GLenum type, const GLvoid *indices );
1171   void (GLAPIENTRYP MultiDrawElementsEXT)( GLenum mode, const GLsizei *count,
1172					    GLenum type,
1173					    const GLvoid **indices,
1174					    GLsizei primcount);
1175   void (GLAPIENTRYP DrawElementsBaseVertex)( GLenum mode, GLsizei count,
1176					      GLenum type,
1177					      const GLvoid *indices,
1178					      GLint basevertex );
1179   void (GLAPIENTRYP DrawRangeElementsBaseVertex)( GLenum mode, GLuint start,
1180						   GLuint end, GLsizei count,
1181						   GLenum type,
1182						   const GLvoid *indices,
1183						   GLint basevertex);
1184   void (GLAPIENTRYP MultiDrawElementsBaseVertex)( GLenum mode,
1185						   const GLsizei *count,
1186						   GLenum type,
1187						   const GLvoid **indices,
1188						   GLsizei primcount,
1189						   const GLint *basevertex);
1190   void (GLAPIENTRYP DrawArraysInstanced)(GLenum mode, GLint first,
1191                                          GLsizei count, GLsizei primcount);
1192   void (GLAPIENTRYP DrawElementsInstanced)(GLenum mode, GLsizei count,
1193                                            GLenum type, const GLvoid *indices,
1194                                            GLsizei primcount);
1195   void (GLAPIENTRYP DrawElementsInstancedBaseVertex)(GLenum mode, GLsizei count,
1196                                            GLenum type, const GLvoid *indices,
1197                                            GLsizei primcount, GLint basevertex);
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 */
1219