dd.h revision d47a6ada9ca9670c60fc141fabadf40c63031c08
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 texture target, the
193    * user-provided source image format and type and the desired internal
194    * format.  In some cases, srcFormat and srcType can be GL_NONE.
195    * Note:  target may be GL_TEXTURE_CUBE_MAP, but never
196    * GL_TEXTURE_CUBE_MAP_[POSITIVE/NEGATIVE]_[XYZ].
197    * Called by glTexImage(), etc.
198    */
199   gl_format (*ChooseTextureFormat)( struct gl_context *ctx,
200                                     GLenum target, GLint internalFormat,
201                                     GLenum srcFormat, GLenum srcType );
202
203   /**
204    * Called by glTexImage[123]D() and glCopyTexImage[12]D()
205    * Allocate texture memory and copy the user's image to the buffer.
206    * The gl_texture_image fields, etc. will be fully initialized.
207    * The parameters are the same as glTexImage3D(), plus:
208    * \param dims  1, 2, or 3 indicating glTexImage1/2/3D()
209    * \param packing describes how to unpack the source data.
210    * \param texImage is the destination texture image.
211    */
212   void (*TexImage)(struct gl_context *ctx, GLuint dims,
213                    struct gl_texture_image *texImage,
214                    GLenum format, GLenum type, const GLvoid *pixels,
215                    const struct gl_pixelstore_attrib *packing);
216
217   /**
218    * Called by glTexSubImage[123]D().
219    * Replace a subset of the target texture with new texel data.
220    */
221   void (*TexSubImage)(struct gl_context *ctx, GLuint dims,
222                       struct gl_texture_image *texImage,
223                       GLint xoffset, GLint yoffset, GLint zoffset,
224                       GLsizei width, GLsizei height, GLint depth,
225                       GLenum format, GLenum type,
226                       const GLvoid *pixels,
227                       const struct gl_pixelstore_attrib *packing);
228
229
230   /**
231    * Called by glGetTexImage().
232    */
233   void (*GetTexImage)( struct gl_context *ctx,
234                        GLenum format, GLenum type, GLvoid *pixels,
235                        struct gl_texture_image *texImage );
236
237   /**
238    * Called by glCopyTex[Sub]Image[123]D().
239    */
240   void (*CopyTexSubImage)(struct gl_context *ctx, GLuint dims,
241                           struct gl_texture_image *texImage,
242                           GLint xoffset, GLint yoffset, GLint zoffset,
243                           struct gl_renderbuffer *rb,
244                           GLint x, GLint y,
245                           GLsizei width, GLsizei height);
246
247   /**
248    * Called by glGenerateMipmap() or when GL_GENERATE_MIPMAP_SGIS is enabled.
249    */
250   void (*GenerateMipmap)(struct gl_context *ctx, GLenum target,
251                          struct gl_texture_object *texObj);
252
253   /**
254    * Called by glTexImage[123]D when user specifies a proxy texture
255    * target.
256    *
257    * \return GL_TRUE if the proxy test passes, or GL_FALSE if the test fails.
258    */
259   GLboolean (*TestProxyTexImage)(struct gl_context *ctx, GLenum target,
260                                  GLint level, GLint internalFormat,
261                                  GLenum format, GLenum type,
262                                  GLint width, GLint height,
263                                  GLint depth, GLint border);
264   /*@}*/
265
266
267   /**
268    * \name Compressed texture functions
269    */
270   /*@{*/
271
272   /**
273    * Called by glCompressedTexImage[123]D().
274    */
275   void (*CompressedTexImage)(struct gl_context *ctx, GLuint dims,
276                              struct gl_texture_image *texImage,
277                              GLsizei imageSize, const GLvoid *data);
278
279   /**
280    * Called by glCompressedTexSubImage[123]D().
281    */
282   void (*CompressedTexSubImage)(struct gl_context *ctx, GLuint dims,
283                                 struct gl_texture_image *texImage,
284                                 GLint xoffset, GLint yoffset, GLint zoffset,
285                                 GLsizei width, GLint height, GLint depth,
286                                 GLenum format,
287                                 GLsizei imageSize, const GLvoid *data);
288
289   /**
290    * Called by glGetCompressedTexImage.
291    */
292   void (*GetCompressedTexImage)(struct gl_context *ctx,
293                                 struct gl_texture_image *texImage,
294                                 GLvoid *data);
295   /*@}*/
296
297   /**
298    * \name Texture object / image functions
299    */
300   /*@{*/
301
302   /**
303    * Called by glBindTexture().
304    */
305   void (*BindTexture)( struct gl_context *ctx, GLenum target,
306                        struct gl_texture_object *tObj );
307
308   /**
309    * Called to allocate a new texture object.  Drivers will usually
310    * allocate/return a subclass of gl_texture_object.
311    */
312   struct gl_texture_object * (*NewTextureObject)(struct gl_context *ctx,
313                                                  GLuint name, GLenum target);
314   /**
315    * Called to delete/free a texture object.  Drivers should free the
316    * object and any image data it contains.
317    */
318   void (*DeleteTexture)(struct gl_context *ctx,
319                         struct gl_texture_object *texObj);
320
321   /** Called to allocate a new texture image object. */
322   struct gl_texture_image * (*NewTextureImage)(struct gl_context *ctx);
323
324   /** Called to free a texture image object returned by NewTextureImage() */
325   void (*DeleteTextureImage)(struct gl_context *ctx,
326                              struct gl_texture_image *);
327
328   /** Called to allocate memory for a single texture image */
329   GLboolean (*AllocTextureImageBuffer)(struct gl_context *ctx,
330                                        struct gl_texture_image *texImage);
331
332   /** Free the memory for a single texture image */
333   void (*FreeTextureImageBuffer)(struct gl_context *ctx,
334                                  struct gl_texture_image *texImage);
335
336   /** Map a slice of a texture image into user space.
337    * Note: for GL_TEXTURE_1D_ARRAY, height must be 1, y must be 0 and slice
338    * indicates the 1D array index.
339    * \param texImage  the texture image
340    * \param slice  the 3D image slice or array texture slice
341    * \param x, y, w, h  region of interest
342    * \param mode  bitmask of GL_MAP_READ_BIT, GL_MAP_WRITE_BIT and
343    *              GL_MAP_INVALIDATE_RANGE_BIT (if writing)
344    * \param mapOut  returns start of mapping of region of interest
345    * \param rowStrideOut  returns row stride (in bytes)
346    */
347   void (*MapTextureImage)(struct gl_context *ctx,
348			   struct gl_texture_image *texImage,
349			   GLuint slice,
350			   GLuint x, GLuint y, GLuint w, GLuint h,
351			   GLbitfield mode,
352			   GLubyte **mapOut, GLint *rowStrideOut);
353
354   void (*UnmapTextureImage)(struct gl_context *ctx,
355			     struct gl_texture_image *texImage,
356			     GLuint slice);
357
358   /** For GL_ARB_texture_storage.  Allocate memory for whole mipmap stack.
359    * All the gl_texture_images in the texture object will have their
360    * dimensions, format, etc. initialized already.
361    */
362   GLboolean (*AllocTextureStorage)(struct gl_context *ctx,
363                                    struct gl_texture_object *texObj,
364                                    GLsizei levels, GLsizei width,
365                                    GLsizei height, GLsizei depth);
366
367   /**
368    * Map a renderbuffer into user space.
369    * \param mode  bitmask of GL_MAP_READ_BIT, GL_MAP_WRITE_BIT and
370    *              GL_MAP_INVALIDATE_RANGE_BIT (if writing)
371    */
372   void (*MapRenderbuffer)(struct gl_context *ctx,
373			   struct gl_renderbuffer *rb,
374			   GLuint x, GLuint y, GLuint w, GLuint h,
375			   GLbitfield mode,
376			   GLubyte **mapOut, GLint *rowStrideOut);
377
378   void (*UnmapRenderbuffer)(struct gl_context *ctx,
379			     struct gl_renderbuffer *rb);
380
381   /*@}*/
382
383
384   /**
385    * \name Vertex/fragment program functions
386    */
387   /*@{*/
388   /** Bind a vertex/fragment program */
389   void (*BindProgram)(struct gl_context *ctx, GLenum target, struct gl_program *prog);
390   /** Allocate a new program */
391   struct gl_program * (*NewProgram)(struct gl_context *ctx, GLenum target, GLuint id);
392   /** Delete a program */
393   void (*DeleteProgram)(struct gl_context *ctx, struct gl_program *prog);
394   /**
395    * Notify driver that a program string (and GPU code) has been specified
396    * or modified.  Return GL_TRUE or GL_FALSE to indicate if the program is
397    * supported by the driver.
398    */
399   GLboolean (*ProgramStringNotify)(struct gl_context *ctx, GLenum target,
400                                    struct gl_program *prog);
401
402   /** Query if program can be loaded onto hardware */
403   GLboolean (*IsProgramNative)(struct gl_context *ctx, GLenum target,
404				struct gl_program *prog);
405
406   /*@}*/
407
408   /**
409    * \name GLSL shader/program functions.
410    */
411   /*@{*/
412   /**
413    * Called when a shader program is linked.
414    *
415    * This gives drivers an opportunity to clone the IR and make their
416    * own transformations on it for the purposes of code generation.
417    */
418   GLboolean (*LinkShader)(struct gl_context *ctx, struct gl_shader_program *shader);
419   /*@}*/
420
421   /**
422    * \name State-changing functions.
423    *
424    * \note drawing functions are above.
425    *
426    * These functions are called by their corresponding OpenGL API functions.
427    * They are \e also called by the gl_PopAttrib() function!!!
428    * May add more functions like these to the device driver in the future.
429    */
430   /*@{*/
431   /** Specify the alpha test function */
432   void (*AlphaFunc)(struct gl_context *ctx, GLenum func, GLfloat ref);
433   /** Set the blend color */
434   void (*BlendColor)(struct gl_context *ctx, const GLfloat color[4]);
435   /** Set the blend equation */
436   void (*BlendEquationSeparate)(struct gl_context *ctx, GLenum modeRGB, GLenum modeA);
437   void (*BlendEquationSeparatei)(struct gl_context *ctx, GLuint buffer,
438                                  GLenum modeRGB, GLenum modeA);
439   /** Specify pixel arithmetic */
440   void (*BlendFuncSeparate)(struct gl_context *ctx,
441                             GLenum sfactorRGB, GLenum dfactorRGB,
442                             GLenum sfactorA, GLenum dfactorA);
443   void (*BlendFuncSeparatei)(struct gl_context *ctx, GLuint buffer,
444                              GLenum sfactorRGB, GLenum dfactorRGB,
445                              GLenum sfactorA, GLenum dfactorA);
446   /** Specify a plane against which all geometry is clipped */
447   void (*ClipPlane)(struct gl_context *ctx, GLenum plane, const GLfloat *equation );
448   /** Enable and disable writing of frame buffer color components */
449   void (*ColorMask)(struct gl_context *ctx, GLboolean rmask, GLboolean gmask,
450                     GLboolean bmask, GLboolean amask );
451   void (*ColorMaskIndexed)(struct gl_context *ctx, GLuint buf, GLboolean rmask,
452                            GLboolean gmask, GLboolean bmask, GLboolean amask);
453   /** Cause a material color to track the current color */
454   void (*ColorMaterial)(struct gl_context *ctx, GLenum face, GLenum mode);
455   /** Specify whether front- or back-facing facets can be culled */
456   void (*CullFace)(struct gl_context *ctx, GLenum mode);
457   /** Define front- and back-facing polygons */
458   void (*FrontFace)(struct gl_context *ctx, GLenum mode);
459   /** Specify the value used for depth buffer comparisons */
460   void (*DepthFunc)(struct gl_context *ctx, GLenum func);
461   /** Enable or disable writing into the depth buffer */
462   void (*DepthMask)(struct gl_context *ctx, GLboolean flag);
463   /** Specify mapping of depth values from NDC to window coordinates */
464   void (*DepthRange)(struct gl_context *ctx, GLclampd nearval, GLclampd farval);
465   /** Specify the current buffer for writing */
466   void (*DrawBuffer)( struct gl_context *ctx, GLenum buffer );
467   /** Specify the buffers for writing for fragment programs*/
468   void (*DrawBuffers)( struct gl_context *ctx, GLsizei n, const GLenum *buffers );
469   /** Enable or disable server-side gl capabilities */
470   void (*Enable)(struct gl_context *ctx, GLenum cap, GLboolean state);
471   /** Specify fog parameters */
472   void (*Fogfv)(struct gl_context *ctx, GLenum pname, const GLfloat *params);
473   /** Specify implementation-specific hints */
474   void (*Hint)(struct gl_context *ctx, GLenum target, GLenum mode);
475   /** Set light source parameters.
476    * Note: for GL_POSITION and GL_SPOT_DIRECTION, params will have already
477    * been transformed to eye-space.
478    */
479   void (*Lightfv)(struct gl_context *ctx, GLenum light,
480		   GLenum pname, const GLfloat *params );
481   /** Set the lighting model parameters */
482   void (*LightModelfv)(struct gl_context *ctx, GLenum pname, const GLfloat *params);
483   /** Specify the line stipple pattern */
484   void (*LineStipple)(struct gl_context *ctx, GLint factor, GLushort pattern );
485   /** Specify the width of rasterized lines */
486   void (*LineWidth)(struct gl_context *ctx, GLfloat width);
487   /** Specify a logical pixel operation for color index rendering */
488   void (*LogicOpcode)(struct gl_context *ctx, GLenum opcode);
489   void (*PointParameterfv)(struct gl_context *ctx, GLenum pname,
490                            const GLfloat *params);
491   /** Specify the diameter of rasterized points */
492   void (*PointSize)(struct gl_context *ctx, GLfloat size);
493   /** Select a polygon rasterization mode */
494   void (*PolygonMode)(struct gl_context *ctx, GLenum face, GLenum mode);
495   /** Set the scale and units used to calculate depth values */
496   void (*PolygonOffset)(struct gl_context *ctx, GLfloat factor, GLfloat units);
497   /** Set the polygon stippling pattern */
498   void (*PolygonStipple)(struct gl_context *ctx, const GLubyte *mask );
499   /* Specifies the current buffer for reading */
500   void (*ReadBuffer)( struct gl_context *ctx, GLenum buffer );
501   /** Set rasterization mode */
502   void (*RenderMode)(struct gl_context *ctx, GLenum mode );
503   /** Define the scissor box */
504   void (*Scissor)(struct gl_context *ctx, GLint x, GLint y, GLsizei w, GLsizei h);
505   /** Select flat or smooth shading */
506   void (*ShadeModel)(struct gl_context *ctx, GLenum mode);
507   /** OpenGL 2.0 two-sided StencilFunc */
508   void (*StencilFuncSeparate)(struct gl_context *ctx, GLenum face, GLenum func,
509                               GLint ref, GLuint mask);
510   /** OpenGL 2.0 two-sided StencilMask */
511   void (*StencilMaskSeparate)(struct gl_context *ctx, GLenum face, GLuint mask);
512   /** OpenGL 2.0 two-sided StencilOp */
513   void (*StencilOpSeparate)(struct gl_context *ctx, GLenum face, GLenum fail,
514                             GLenum zfail, GLenum zpass);
515   /** Control the generation of texture coordinates */
516   void (*TexGen)(struct gl_context *ctx, GLenum coord, GLenum pname,
517		  const GLfloat *params);
518   /** Set texture environment parameters */
519   void (*TexEnv)(struct gl_context *ctx, GLenum target, GLenum pname,
520                  const GLfloat *param);
521   /** Set texture parameters */
522   void (*TexParameter)(struct gl_context *ctx, GLenum target,
523                        struct gl_texture_object *texObj,
524                        GLenum pname, const GLfloat *params);
525   /** Set the viewport */
526   void (*Viewport)(struct gl_context *ctx, GLint x, GLint y, GLsizei w, GLsizei h);
527   /*@}*/
528
529
530   /**
531    * \name Vertex/pixel buffer object functions
532    */
533   /*@{*/
534   void (*BindBuffer)( struct gl_context *ctx, GLenum target,
535		       struct gl_buffer_object *obj );
536
537   struct gl_buffer_object * (*NewBufferObject)( struct gl_context *ctx, GLuint buffer,
538						 GLenum target );
539
540   void (*DeleteBuffer)( struct gl_context *ctx, struct gl_buffer_object *obj );
541
542   GLboolean (*BufferData)( struct gl_context *ctx, GLenum target, GLsizeiptrARB size,
543                            const GLvoid *data, GLenum usage,
544                            struct gl_buffer_object *obj );
545
546   void (*BufferSubData)( struct gl_context *ctx, GLintptrARB offset,
547			  GLsizeiptrARB size, const GLvoid *data,
548			  struct gl_buffer_object *obj );
549
550   void (*GetBufferSubData)( struct gl_context *ctx,
551			     GLintptrARB offset, GLsizeiptrARB size,
552			     GLvoid *data, struct gl_buffer_object *obj );
553
554   void (*CopyBufferSubData)( struct gl_context *ctx,
555                              struct gl_buffer_object *src,
556                              struct gl_buffer_object *dst,
557                              GLintptr readOffset, GLintptr writeOffset,
558                              GLsizeiptr size );
559
560   /* May return NULL if MESA_MAP_NOWAIT_BIT is set in access:
561    */
562   void * (*MapBufferRange)( struct gl_context *ctx, GLintptr offset,
563                             GLsizeiptr length, GLbitfield access,
564                             struct gl_buffer_object *obj);
565
566   void (*FlushMappedBufferRange)(struct gl_context *ctx,
567                                  GLintptr offset, GLsizeiptr length,
568                                  struct gl_buffer_object *obj);
569
570   GLboolean (*UnmapBuffer)( struct gl_context *ctx,
571			     struct gl_buffer_object *obj );
572   /*@}*/
573
574   /**
575    * \name Functions for GL_APPLE_object_purgeable
576    */
577   /*@{*/
578   /* variations on ObjectPurgeable */
579   GLenum (*BufferObjectPurgeable)( struct gl_context *ctx, struct gl_buffer_object *obj, GLenum option );
580   GLenum (*RenderObjectPurgeable)( struct gl_context *ctx, struct gl_renderbuffer *obj, GLenum option );
581   GLenum (*TextureObjectPurgeable)( struct gl_context *ctx, struct gl_texture_object *obj, GLenum option );
582
583   /* variations on ObjectUnpurgeable */
584   GLenum (*BufferObjectUnpurgeable)( struct gl_context *ctx, struct gl_buffer_object *obj, GLenum option );
585   GLenum (*RenderObjectUnpurgeable)( struct gl_context *ctx, struct gl_renderbuffer *obj, GLenum option );
586   GLenum (*TextureObjectUnpurgeable)( struct gl_context *ctx, struct gl_texture_object *obj, GLenum option );
587   /*@}*/
588
589   /**
590    * \name Functions for GL_EXT_framebuffer_{object,blit}.
591    */
592   /*@{*/
593   struct gl_framebuffer * (*NewFramebuffer)(struct gl_context *ctx, GLuint name);
594   struct gl_renderbuffer * (*NewRenderbuffer)(struct gl_context *ctx, GLuint name);
595   void (*BindFramebuffer)(struct gl_context *ctx, GLenum target,
596                           struct gl_framebuffer *drawFb,
597                           struct gl_framebuffer *readFb);
598   void (*FramebufferRenderbuffer)(struct gl_context *ctx,
599                                   struct gl_framebuffer *fb,
600                                   GLenum attachment,
601                                   struct gl_renderbuffer *rb);
602   void (*RenderTexture)(struct gl_context *ctx,
603                         struct gl_framebuffer *fb,
604                         struct gl_renderbuffer_attachment *att);
605   void (*FinishRenderTexture)(struct gl_context *ctx,
606                               struct gl_renderbuffer_attachment *att);
607   void (*ValidateFramebuffer)(struct gl_context *ctx,
608                               struct gl_framebuffer *fb);
609   /*@}*/
610   void (*BlitFramebuffer)(struct gl_context *ctx,
611                           GLint srcX0, GLint srcY0, GLint srcX1, GLint srcY1,
612                           GLint dstX0, GLint dstY0, GLint dstX1, GLint dstY1,
613                           GLbitfield mask, GLenum filter);
614
615   /**
616    * \name Query objects
617    */
618   /*@{*/
619   struct gl_query_object * (*NewQueryObject)(struct gl_context *ctx, GLuint id);
620   void (*DeleteQuery)(struct gl_context *ctx, struct gl_query_object *q);
621   void (*BeginQuery)(struct gl_context *ctx, struct gl_query_object *q);
622   void (*EndQuery)(struct gl_context *ctx, struct gl_query_object *q);
623   void (*CheckQuery)(struct gl_context *ctx, struct gl_query_object *q);
624   void (*WaitQuery)(struct gl_context *ctx, struct gl_query_object *q);
625   /*@}*/
626
627
628   /**
629    * \name Vertex Array objects
630    */
631   /*@{*/
632   struct gl_array_object * (*NewArrayObject)(struct gl_context *ctx, GLuint id);
633   void (*DeleteArrayObject)(struct gl_context *ctx, struct gl_array_object *obj);
634   void (*BindArrayObject)(struct gl_context *ctx, struct gl_array_object *obj);
635   /*@}*/
636
637   /**
638    * \name GLSL-related functions (ARB extensions and OpenGL 2.x)
639    */
640   /*@{*/
641   struct gl_shader *(*NewShader)(struct gl_context *ctx, GLuint name, GLenum type);
642   void (*DeleteShader)(struct gl_context *ctx, struct gl_shader *shader);
643   struct gl_shader_program *(*NewShaderProgram)(struct gl_context *ctx, GLuint name);
644   void (*DeleteShaderProgram)(struct gl_context *ctx,
645                               struct gl_shader_program *shProg);
646   void (*UseProgram)(struct gl_context *ctx, struct gl_shader_program *shProg);
647   /*@}*/
648
649
650   /**
651    * \name Support for multiple T&L engines
652    */
653   /*@{*/
654
655   /**
656    * Set by the driver-supplied T&L engine.
657    *
658    * Set to PRIM_OUTSIDE_BEGIN_END when outside glBegin()/glEnd().
659    */
660   GLuint CurrentExecPrimitive;
661
662   /**
663    * Current state of an in-progress compilation.
664    *
665    * May take on any of the additional values PRIM_OUTSIDE_BEGIN_END,
666    * PRIM_INSIDE_UNKNOWN_PRIM or PRIM_UNKNOWN defined above.
667    */
668   GLuint CurrentSavePrimitive;
669
670
671#define FLUSH_STORED_VERTICES 0x1
672#define FLUSH_UPDATE_CURRENT  0x2
673   /**
674    * Set by the driver-supplied T&L engine whenever vertices are buffered
675    * between glBegin()/glEnd() objects or __struct gl_contextRec::Current is not
676    * updated.
677    *
678    * The dd_function_table::FlushVertices call below may be used to resolve
679    * these conditions.
680    */
681   GLuint NeedFlush;
682   GLuint SaveNeedFlush;
683
684
685   /* Called prior to any of the GLvertexformat functions being
686    * called.  Paired with Driver.FlushVertices().
687    */
688   void (*BeginVertices)( struct gl_context *ctx );
689
690   /**
691    * If inside glBegin()/glEnd(), it should ASSERT(0).  Otherwise, if
692    * FLUSH_STORED_VERTICES bit in \p flags is set flushes any buffered
693    * vertices, if FLUSH_UPDATE_CURRENT bit is set updates
694    * __struct gl_contextRec::Current and gl_light_attrib::Material
695    *
696    * Note that the default T&L engine never clears the
697    * FLUSH_UPDATE_CURRENT bit, even after performing the update.
698    */
699   void (*FlushVertices)( struct gl_context *ctx, GLuint flags );
700   void (*SaveFlushVertices)( struct gl_context *ctx );
701
702   /**
703    * \brief Hook for drivers to prepare for a glBegin/glEnd block
704    *
705    * This hook is called in vbo_exec_Begin() before any action, including
706    * state updates, occurs.
707    */
708   void (*PrepareExecBegin)( struct gl_context *ctx );
709
710   /**
711    * Give the driver the opportunity to hook in its own vtxfmt for
712    * compiling optimized display lists.  This is called on each valid
713    * glBegin() during list compilation.
714    */
715   GLboolean (*NotifySaveBegin)( struct gl_context *ctx, GLenum mode );
716
717   /**
718    * Notify driver that the special derived value _NeedEyeCoords has
719    * changed.
720    */
721   void (*LightingSpaceChange)( struct gl_context *ctx );
722
723   /**
724    * Called by glNewList().
725    *
726    * Let the T&L component know what is going on with display lists
727    * in time to make changes to dispatch tables, etc.
728    */
729   void (*NewList)( struct gl_context *ctx, GLuint list, GLenum mode );
730   /**
731    * Called by glEndList().
732    *
733    * \sa dd_function_table::NewList.
734    */
735   void (*EndList)( struct gl_context *ctx );
736
737   /**
738    * Called by glCallList(s).
739    *
740    * Notify the T&L component before and after calling a display list.
741    */
742   void (*BeginCallList)( struct gl_context *ctx,
743			  struct gl_display_list *dlist );
744   /**
745    * Called by glEndCallList().
746    *
747    * \sa dd_function_table::BeginCallList.
748    */
749   void (*EndCallList)( struct gl_context *ctx );
750
751   /**@}*/
752
753   /**
754    * \name GL_ARB_sync interfaces
755    */
756   /*@{*/
757   struct gl_sync_object * (*NewSyncObject)(struct gl_context *, GLenum);
758   void (*FenceSync)(struct gl_context *, struct gl_sync_object *, GLenum, GLbitfield);
759   void (*DeleteSyncObject)(struct gl_context *, struct gl_sync_object *);
760   void (*CheckSync)(struct gl_context *, struct gl_sync_object *);
761   void (*ClientWaitSync)(struct gl_context *, struct gl_sync_object *,
762			  GLbitfield, GLuint64);
763   void (*ServerWaitSync)(struct gl_context *, struct gl_sync_object *,
764			  GLbitfield, GLuint64);
765   /*@}*/
766
767   /** GL_NV_conditional_render */
768   void (*BeginConditionalRender)(struct gl_context *ctx, struct gl_query_object *q,
769                                  GLenum mode);
770   void (*EndConditionalRender)(struct gl_context *ctx, struct gl_query_object *q);
771
772   /**
773    * \name GL_OES_draw_texture interface
774    */
775   /*@{*/
776   void (*DrawTex)(struct gl_context *ctx, GLfloat x, GLfloat y, GLfloat z,
777                   GLfloat width, GLfloat height);
778   /*@}*/
779
780   /**
781    * \name GL_OES_EGL_image interface
782    */
783   void (*EGLImageTargetTexture2D)(struct gl_context *ctx, GLenum target,
784				   struct gl_texture_object *texObj,
785				   struct gl_texture_image *texImage,
786				   GLeglImageOES image_handle);
787   void (*EGLImageTargetRenderbufferStorage)(struct gl_context *ctx,
788					     struct gl_renderbuffer *rb,
789					     void *image_handle);
790
791   /**
792    * \name GL_EXT_transform_feedback interface
793    */
794   struct gl_transform_feedback_object *
795        (*NewTransformFeedback)(struct gl_context *ctx, GLuint name);
796   void (*DeleteTransformFeedback)(struct gl_context *ctx,
797                                   struct gl_transform_feedback_object *obj);
798   void (*BeginTransformFeedback)(struct gl_context *ctx, GLenum mode,
799                                  struct gl_transform_feedback_object *obj);
800   void (*EndTransformFeedback)(struct gl_context *ctx,
801                                struct gl_transform_feedback_object *obj);
802   void (*PauseTransformFeedback)(struct gl_context *ctx,
803                                  struct gl_transform_feedback_object *obj);
804   void (*ResumeTransformFeedback)(struct gl_context *ctx,
805                                   struct gl_transform_feedback_object *obj);
806
807   /**
808    * \name GL_NV_texture_barrier interface
809    */
810   void (*TextureBarrier)(struct gl_context *ctx);
811
812   /**
813    * \name GL_ARB_sampler_objects
814    */
815   struct gl_sampler_object * (*NewSamplerObject)(struct gl_context *ctx,
816                                                  GLuint name);
817   void (*DeleteSamplerObject)(struct gl_context *ctx,
818                               struct gl_sampler_object *samp);
819
820   /**
821    * \name Return a timestamp in nanoseconds as defined by GL_ARB_timer_query.
822    * This should be equivalent to glGetInteger64v(GL_TIMESTAMP);
823    */
824   uint64_t (*GetTimestamp)(struct gl_context *ctx);
825};
826
827
828/**
829 * Transform/Clip/Lighting interface
830 *
831 * Drivers present a reduced set of the functions possible in
832 * glBegin()/glEnd() objects.  Core mesa provides translation stubs for the
833 * remaining functions to map down to these entry points.
834 *
835 * These are the initial values to be installed into dispatch by
836 * mesa.  If the T&L driver wants to modify the dispatch table
837 * while installed, it must do so itself.  It would be possible for
838 * the vertexformat to install its own initial values for these
839 * functions, but this way there is an obvious list of what is
840 * expected of the driver.
841 *
842 * If the driver wants to hook in entry points other than those
843 * listed, it must restore them to their original values in
844 * the disable() callback, below.
845 */
846typedef struct {
847   /**
848    * \name Vertex
849    */
850   /*@{*/
851   void (GLAPIENTRYP ArrayElement)( GLint );
852   void (GLAPIENTRYP Color3f)( GLfloat, GLfloat, GLfloat );
853   void (GLAPIENTRYP Color3fv)( const GLfloat * );
854   void (GLAPIENTRYP Color4f)( GLfloat, GLfloat, GLfloat, GLfloat );
855   void (GLAPIENTRYP Color4fv)( const GLfloat * );
856   void (GLAPIENTRYP EdgeFlag)( GLboolean );
857   void (GLAPIENTRYP EvalCoord1f)( GLfloat );
858   void (GLAPIENTRYP EvalCoord1fv)( const GLfloat * );
859   void (GLAPIENTRYP EvalCoord2f)( GLfloat, GLfloat );
860   void (GLAPIENTRYP EvalCoord2fv)( const GLfloat * );
861   void (GLAPIENTRYP EvalPoint1)( GLint );
862   void (GLAPIENTRYP EvalPoint2)( GLint, GLint );
863   void (GLAPIENTRYP FogCoordfEXT)( GLfloat );
864   void (GLAPIENTRYP FogCoordfvEXT)( const GLfloat * );
865   void (GLAPIENTRYP Indexf)( GLfloat );
866   void (GLAPIENTRYP Indexfv)( const GLfloat * );
867   void (GLAPIENTRYP Materialfv)( GLenum face, GLenum pname, const GLfloat * );
868   void (GLAPIENTRYP MultiTexCoord1fARB)( GLenum, GLfloat );
869   void (GLAPIENTRYP MultiTexCoord1fvARB)( GLenum, const GLfloat * );
870   void (GLAPIENTRYP MultiTexCoord2fARB)( GLenum, GLfloat, GLfloat );
871   void (GLAPIENTRYP MultiTexCoord2fvARB)( GLenum, const GLfloat * );
872   void (GLAPIENTRYP MultiTexCoord3fARB)( GLenum, GLfloat, GLfloat, GLfloat );
873   void (GLAPIENTRYP MultiTexCoord3fvARB)( GLenum, const GLfloat * );
874   void (GLAPIENTRYP MultiTexCoord4fARB)( GLenum, GLfloat, GLfloat, GLfloat, GLfloat );
875   void (GLAPIENTRYP MultiTexCoord4fvARB)( GLenum, const GLfloat * );
876   void (GLAPIENTRYP Normal3f)( GLfloat, GLfloat, GLfloat );
877   void (GLAPIENTRYP Normal3fv)( const GLfloat * );
878   void (GLAPIENTRYP SecondaryColor3fEXT)( GLfloat, GLfloat, GLfloat );
879   void (GLAPIENTRYP SecondaryColor3fvEXT)( const GLfloat * );
880   void (GLAPIENTRYP TexCoord1f)( GLfloat );
881   void (GLAPIENTRYP TexCoord1fv)( const GLfloat * );
882   void (GLAPIENTRYP TexCoord2f)( GLfloat, GLfloat );
883   void (GLAPIENTRYP TexCoord2fv)( const GLfloat * );
884   void (GLAPIENTRYP TexCoord3f)( GLfloat, GLfloat, GLfloat );
885   void (GLAPIENTRYP TexCoord3fv)( const GLfloat * );
886   void (GLAPIENTRYP TexCoord4f)( GLfloat, GLfloat, GLfloat, GLfloat );
887   void (GLAPIENTRYP TexCoord4fv)( const GLfloat * );
888   void (GLAPIENTRYP Vertex2f)( GLfloat, GLfloat );
889   void (GLAPIENTRYP Vertex2fv)( const GLfloat * );
890   void (GLAPIENTRYP Vertex3f)( GLfloat, GLfloat, GLfloat );
891   void (GLAPIENTRYP Vertex3fv)( const GLfloat * );
892   void (GLAPIENTRYP Vertex4f)( GLfloat, GLfloat, GLfloat, GLfloat );
893   void (GLAPIENTRYP Vertex4fv)( const GLfloat * );
894   void (GLAPIENTRYP CallList)( GLuint );
895   void (GLAPIENTRYP CallLists)( GLsizei, GLenum, const GLvoid * );
896   void (GLAPIENTRYP Begin)( GLenum );
897   void (GLAPIENTRYP End)( void );
898   void (GLAPIENTRYP PrimitiveRestartNV)( void );
899   /* GL_NV_vertex_program */
900   void (GLAPIENTRYP VertexAttrib1fNV)( GLuint index, GLfloat x );
901   void (GLAPIENTRYP VertexAttrib1fvNV)( GLuint index, const GLfloat *v );
902   void (GLAPIENTRYP VertexAttrib2fNV)( GLuint index, GLfloat x, GLfloat y );
903   void (GLAPIENTRYP VertexAttrib2fvNV)( GLuint index, const GLfloat *v );
904   void (GLAPIENTRYP VertexAttrib3fNV)( GLuint index, GLfloat x, GLfloat y, GLfloat z );
905   void (GLAPIENTRYP VertexAttrib3fvNV)( GLuint index, const GLfloat *v );
906   void (GLAPIENTRYP VertexAttrib4fNV)( GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w );
907   void (GLAPIENTRYP VertexAttrib4fvNV)( GLuint index, const GLfloat *v );
908   /* GL_ARB_vertex_program */
909   void (GLAPIENTRYP VertexAttrib1fARB)( GLuint index, GLfloat x );
910   void (GLAPIENTRYP VertexAttrib1fvARB)( GLuint index, const GLfloat *v );
911   void (GLAPIENTRYP VertexAttrib2fARB)( GLuint index, GLfloat x, GLfloat y );
912   void (GLAPIENTRYP VertexAttrib2fvARB)( GLuint index, const GLfloat *v );
913   void (GLAPIENTRYP VertexAttrib3fARB)( GLuint index, GLfloat x, GLfloat y, GLfloat z );
914   void (GLAPIENTRYP VertexAttrib3fvARB)( GLuint index, const GLfloat *v );
915   void (GLAPIENTRYP VertexAttrib4fARB)( GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w );
916   void (GLAPIENTRYP VertexAttrib4fvARB)( GLuint index, const GLfloat *v );
917
918   /* GL_EXT_gpu_shader4 / GL 3.0 */
919   void (GLAPIENTRYP VertexAttribI1i)( GLuint index, GLint x);
920   void (GLAPIENTRYP VertexAttribI2i)( GLuint index, GLint x, GLint y);
921   void (GLAPIENTRYP VertexAttribI3i)( GLuint index, GLint x, GLint y, GLint z);
922   void (GLAPIENTRYP VertexAttribI4i)( GLuint index, GLint x, GLint y, GLint z, GLint w);
923   void (GLAPIENTRYP VertexAttribI2iv)( GLuint index, const GLint *v);
924   void (GLAPIENTRYP VertexAttribI3iv)( GLuint index, const GLint *v);
925   void (GLAPIENTRYP VertexAttribI4iv)( GLuint index, const GLint *v);
926
927   void (GLAPIENTRYP VertexAttribI1ui)( GLuint index, GLuint x);
928   void (GLAPIENTRYP VertexAttribI2ui)( GLuint index, GLuint x, GLuint y);
929   void (GLAPIENTRYP VertexAttribI3ui)( GLuint index, GLuint x, GLuint y, GLuint z);
930   void (GLAPIENTRYP VertexAttribI4ui)( GLuint index, GLuint x, GLuint y, GLuint z, GLuint w);
931   void (GLAPIENTRYP VertexAttribI2uiv)( GLuint index, const GLuint *v);
932   void (GLAPIENTRYP VertexAttribI3uiv)( GLuint index, const GLuint *v);
933   void (GLAPIENTRYP VertexAttribI4uiv)( GLuint index, const GLuint *v);
934
935   /* GL_ARB_vertex_type_10_10_10_2_rev / GL3.3 */
936   void (GLAPIENTRYP VertexP2ui)( GLenum type, GLuint value );
937   void (GLAPIENTRYP VertexP2uiv)( GLenum type, const GLuint *value);
938
939   void (GLAPIENTRYP VertexP3ui)( GLenum type, GLuint value );
940   void (GLAPIENTRYP VertexP3uiv)( GLenum type, const GLuint *value);
941
942   void (GLAPIENTRYP VertexP4ui)( GLenum type, GLuint value );
943   void (GLAPIENTRYP VertexP4uiv)( GLenum type, const GLuint *value);
944
945   void (GLAPIENTRYP TexCoordP1ui)( GLenum type, GLuint coords );
946   void (GLAPIENTRYP TexCoordP1uiv)( GLenum type, const GLuint *coords );
947
948   void (GLAPIENTRYP TexCoordP2ui)( GLenum type, GLuint coords );
949   void (GLAPIENTRYP TexCoordP2uiv)( GLenum type, const GLuint *coords );
950
951   void (GLAPIENTRYP TexCoordP3ui)( GLenum type, GLuint coords );
952   void (GLAPIENTRYP TexCoordP3uiv)( GLenum type, const GLuint *coords );
953
954   void (GLAPIENTRYP TexCoordP4ui)( GLenum type, GLuint coords );
955   void (GLAPIENTRYP TexCoordP4uiv)( GLenum type, const GLuint *coords );
956
957   void (GLAPIENTRYP MultiTexCoordP1ui)( GLenum texture, GLenum type, GLuint coords );
958   void (GLAPIENTRYP MultiTexCoordP1uiv)( GLenum texture, GLenum type, const GLuint *coords );
959   void (GLAPIENTRYP MultiTexCoordP2ui)( GLenum texture, GLenum type, GLuint coords );
960   void (GLAPIENTRYP MultiTexCoordP2uiv)( GLenum texture, GLenum type, const GLuint *coords );
961   void (GLAPIENTRYP MultiTexCoordP3ui)( GLenum texture, GLenum type, GLuint coords );
962   void (GLAPIENTRYP MultiTexCoordP3uiv)( GLenum texture, GLenum type, const GLuint *coords );
963   void (GLAPIENTRYP MultiTexCoordP4ui)( GLenum texture, GLenum type, GLuint coords );
964   void (GLAPIENTRYP MultiTexCoordP4uiv)( GLenum texture, GLenum type, const GLuint *coords );
965
966   void (GLAPIENTRYP NormalP3ui)( GLenum type, GLuint coords );
967   void (GLAPIENTRYP NormalP3uiv)( GLenum type, const GLuint *coords );
968
969   void (GLAPIENTRYP ColorP3ui)( GLenum type, GLuint color );
970   void (GLAPIENTRYP ColorP3uiv)( GLenum type, const GLuint *color );
971
972   void (GLAPIENTRYP ColorP4ui)( GLenum type, GLuint color );
973   void (GLAPIENTRYP ColorP4uiv)( GLenum type, const GLuint *color );
974
975   void (GLAPIENTRYP SecondaryColorP3ui)( GLenum type, GLuint color );
976   void (GLAPIENTRYP SecondaryColorP3uiv)( GLenum type, const GLuint *color );
977
978   void (GLAPIENTRYP VertexAttribP1ui)( GLuint index, GLenum type,
979					GLboolean normalized, GLuint value);
980   void (GLAPIENTRYP VertexAttribP2ui)( GLuint index, GLenum type,
981					GLboolean normalized, GLuint value);
982   void (GLAPIENTRYP VertexAttribP3ui)( GLuint index, GLenum type,
983					GLboolean normalized, GLuint value);
984   void (GLAPIENTRYP VertexAttribP4ui)( GLuint index, GLenum type,
985					GLboolean normalized, GLuint value);
986   void (GLAPIENTRYP VertexAttribP1uiv)( GLuint index, GLenum type,
987					GLboolean normalized,
988					 const GLuint *value);
989   void (GLAPIENTRYP VertexAttribP2uiv)( GLuint index, GLenum type,
990					GLboolean normalized,
991					 const GLuint *value);
992   void (GLAPIENTRYP VertexAttribP3uiv)( GLuint index, GLenum type,
993					GLboolean normalized,
994					 const GLuint *value);
995   void (GLAPIENTRYP VertexAttribP4uiv)( GLuint index, GLenum type,
996					 GLboolean normalized,
997					 const GLuint *value);
998
999   /*@}*/
1000
1001   void (GLAPIENTRYP Rectf)( GLfloat, GLfloat, GLfloat, GLfloat );
1002
1003   /**
1004    * \name Array
1005    */
1006   /*@{*/
1007   void (GLAPIENTRYP DrawArrays)( GLenum mode, GLint start, GLsizei count );
1008   void (GLAPIENTRYP DrawElements)( GLenum mode, GLsizei count, GLenum type,
1009			 const GLvoid *indices );
1010   void (GLAPIENTRYP DrawRangeElements)( GLenum mode, GLuint start,
1011			      GLuint end, GLsizei count,
1012			      GLenum type, const GLvoid *indices );
1013   void (GLAPIENTRYP MultiDrawElementsEXT)( GLenum mode, const GLsizei *count,
1014					    GLenum type,
1015					    const GLvoid **indices,
1016					    GLsizei primcount);
1017   void (GLAPIENTRYP DrawElementsBaseVertex)( GLenum mode, GLsizei count,
1018					      GLenum type,
1019					      const GLvoid *indices,
1020					      GLint basevertex );
1021   void (GLAPIENTRYP DrawRangeElementsBaseVertex)( GLenum mode, GLuint start,
1022						   GLuint end, GLsizei count,
1023						   GLenum type,
1024						   const GLvoid *indices,
1025						   GLint basevertex);
1026   void (GLAPIENTRYP MultiDrawElementsBaseVertex)( GLenum mode,
1027						   const GLsizei *count,
1028						   GLenum type,
1029						   const GLvoid * const *indices,
1030						   GLsizei primcount,
1031						   const GLint *basevertex);
1032   void (GLAPIENTRYP DrawArraysInstanced)(GLenum mode, GLint first,
1033                                          GLsizei count, GLsizei primcount);
1034   void (GLAPIENTRYP DrawArraysInstancedBaseInstance)(GLenum mode, GLint first,
1035                                                      GLsizei count, GLsizei primcount,
1036                                                      GLuint baseinstance);
1037   void (GLAPIENTRYP DrawElementsInstanced)(GLenum mode, GLsizei count,
1038                                            GLenum type, const GLvoid *indices,
1039                                            GLsizei primcount);
1040   void (GLAPIENTRYP DrawElementsInstancedBaseInstance)(GLenum mode, GLsizei count,
1041                                                        GLenum type, const GLvoid *indices,
1042                                                        GLsizei primcount, GLuint baseinstance);
1043   void (GLAPIENTRYP DrawElementsInstancedBaseVertex)(GLenum mode, GLsizei count,
1044                                            GLenum type, const GLvoid *indices,
1045                                            GLsizei primcount, GLint basevertex);
1046   void (GLAPIENTRYP DrawElementsInstancedBaseVertexBaseInstance)(GLenum mode, GLsizei count,
1047                                                                  GLenum type, const GLvoid *indices,
1048                                                                  GLsizei primcount, GLint basevertex,
1049                                                                  GLuint baseinstance);
1050   void (GLAPIENTRYP DrawTransformFeedback)(GLenum mode, GLuint name);
1051   void (GLAPIENTRYP DrawTransformFeedbackStream)(GLenum mode, GLuint name,
1052                                                  GLuint stream);
1053   void (GLAPIENTRYP DrawTransformFeedbackInstanced)(GLenum mode, GLuint name,
1054                                                     GLsizei primcount);
1055   void (GLAPIENTRYP DrawTransformFeedbackStreamInstanced)(GLenum mode,
1056                                                           GLuint name,
1057                                                           GLuint stream,
1058                                                           GLsizei primcount);
1059   /*@}*/
1060
1061   /**
1062    * \name Eval
1063    *
1064    * If you don't support eval, fallback to the default vertex format
1065    * on receiving an eval call and use the pipeline mechanism to
1066    * provide partial T&L acceleration.
1067    *
1068    * Mesa will provide a set of helper functions to do eval within
1069    * accelerated vertex formats, eventually...
1070    */
1071   /*@{*/
1072   void (GLAPIENTRYP EvalMesh1)( GLenum mode, GLint i1, GLint i2 );
1073   void (GLAPIENTRYP EvalMesh2)( GLenum mode, GLint i1, GLint i2, GLint j1, GLint j2 );
1074   /*@}*/
1075
1076} GLvertexformat;
1077
1078
1079#endif /* DD_INCLUDED */
1080