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