Merge branch 'pipe-video' of git://anongit.freedesktop.org/~deathsimple/xvmc-r600...
[profile/ivi/mesa.git] / src / mesa / main / dd.h
1 /**
2  * \file dd.h
3  * Device driver interfaces.
4  */
5
6 /*
7  * Mesa 3-D graphics library
8  * Version:  6.5.2
9  *
10  * Copyright (C) 1999-2006  Brian Paul   All Rights Reserved.
11  *
12  * Permission is hereby granted, free of charge, to any person obtaining a
13  * copy of this software and associated documentation files (the "Software"),
14  * to deal in the Software without restriction, including without limitation
15  * the rights to use, copy, modify, merge, publish, distribute, sublicense,
16  * and/or sell copies of the Software, and to permit persons to whom the
17  * Software is furnished to do so, subject to the following conditions:
18  *
19  * The above copyright notice and this permission notice shall be included
20  * in all copies or substantial portions of the Software.
21  *
22  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
23  * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
24  * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
25  * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
26  * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
27  * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
28  */
29
30
31 #ifndef DD_INCLUDED
32 #define DD_INCLUDED
33
34 /* THIS FILE ONLY INCLUDED BY mtypes.h !!!!! */
35
36 struct gl_pixelstore_attrib;
37 struct gl_display_list;
38
39 /* GL_ARB_vertex_buffer_object */
40 /* Modifies GL_MAP_UNSYNCHRONIZED_BIT to allow driver to fail (return
41  * NULL) if buffer is unavailable for immediate mapping.
42  *
43  * Does GL_MAP_INVALIDATE_RANGE_BIT do this?  It seems so, but it
44  * would require more book-keeping in the driver than seems necessary
45  * 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  */
67 struct 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)( struct gl_context *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)( struct gl_context *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)( struct gl_context *ctx, struct gl_framebuffer *fb,
97                           GLuint width, GLuint height);
98
99    /**
100     * Called whenever an error is generated.  
101     * __struct gl_contextRec::ErrorValue contains the error value.
102     */
103    void (*Error)( struct gl_context *ctx );
104
105    /**
106     * This is called whenever glFinish() is called.
107     */
108    void (*Finish)( struct gl_context *ctx );
109
110    /**
111     * This is called whenever glFlush() is called.
112     */
113    void (*Flush)( struct gl_context *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)( struct gl_context *ctx, GLbitfield buffers );
121
122    /**
123     * Execute glAccum command.
124     */
125    void (*Accum)( struct gl_context *ctx, GLenum op, GLfloat value );
126
127
128    /**
129     * Execute glRasterPos, updating the ctx->Current.Raster fields
130     */
131    void (*RasterPos)( struct gl_context *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)( struct gl_context *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)( struct gl_context *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)( struct gl_context *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)( struct gl_context *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)( struct gl_context *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)( struct gl_context *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)( struct gl_context *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)( struct gl_context *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)( struct gl_context *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)( struct gl_context *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)( struct gl_context *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)( struct gl_context *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)( struct gl_context *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)( struct gl_context *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)( struct gl_context *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)( struct gl_context *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)( struct gl_context *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)(struct gl_context *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)(struct gl_context *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)( struct gl_context *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)( struct gl_context *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)( struct gl_context *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)(struct gl_context *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)(struct gl_context *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)(struct gl_context *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)(struct gl_context *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)( struct gl_context *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)( struct gl_context *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)( struct gl_context *ctx, struct gl_texture_object *tObj );
504
505    /**
506     * Called to allocate a new texture image object.
507     */
508    struct gl_texture_image * (*NewTextureImage)( struct gl_context *ctx );
509
510    /** 
511     * Called to free tImage->Data.
512     */
513    void (*FreeTexImageData)( struct gl_context *ctx, struct gl_texture_image *tImage );
514
515    /** Map texture image data into user space */
516    void (*MapTexture)( struct gl_context *ctx, struct gl_texture_object *tObj );
517    /** Unmap texture images from user space */
518    void (*UnmapTexture)( struct gl_context *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)( struct gl_context *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)( struct gl_context *ctx,
546                                  struct gl_texture_object *tObj );
547    /*@}*/
548
549    
550    /**
551     * \name Imaging functionality
552     */
553    /*@{*/
554    void (*CopyColorTable)( struct gl_context *ctx,
555                            GLenum target, GLenum internalformat,
556                            GLint x, GLint y, GLsizei width );
557
558    void (*CopyColorSubTable)( struct gl_context *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)(struct gl_context *ctx, GLenum target, struct gl_program *prog);
570    /** Allocate a new program */
571    struct gl_program * (*NewProgram)(struct gl_context *ctx, GLenum target, GLuint id);
572    /** Delete a program */
573    void (*DeleteProgram)(struct gl_context *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)(struct gl_context *ctx, GLenum target, 
580                                     struct gl_program *prog);
581
582    /** Query if program can be loaded onto hardware */
583    GLboolean (*IsProgramNative)(struct gl_context *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)(struct gl_context *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)(struct gl_context *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)(struct gl_context *ctx, GLenum func, GLfloat ref);
622    /** Set the blend color */
623    void (*BlendColor)(struct gl_context *ctx, const GLfloat color[4]);
624    /** Set the blend equation */
625    void (*BlendEquationSeparate)(struct gl_context *ctx, GLenum modeRGB, GLenum modeA);
626    /** Specify pixel arithmetic */
627    void (*BlendFuncSeparate)(struct gl_context *ctx,
628                              GLenum sfactorRGB, GLenum dfactorRGB,
629                              GLenum sfactorA, GLenum dfactorA);
630    /** Specify clear values for the color buffers */
631    void (*ClearColor)(struct gl_context *ctx, const GLfloat color[4]);
632    /** Specify the clear value for the depth buffer */
633    void (*ClearDepth)(struct gl_context *ctx, GLclampd d);
634    /** Specify the clear value for the stencil buffer */
635    void (*ClearStencil)(struct gl_context *ctx, GLint s);
636    /** Specify a plane against which all geometry is clipped */
637    void (*ClipPlane)(struct gl_context *ctx, GLenum plane, const GLfloat *equation );
638    /** Enable and disable writing of frame buffer color components */
639    void (*ColorMask)(struct gl_context *ctx, GLboolean rmask, GLboolean gmask,
640                      GLboolean bmask, GLboolean amask );
641    void (*ColorMaskIndexed)(struct gl_context *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)(struct gl_context *ctx, GLenum face, GLenum mode);
645    /** Specify whether front- or back-facing facets can be culled */
646    void (*CullFace)(struct gl_context *ctx, GLenum mode);
647    /** Define front- and back-facing polygons */
648    void (*FrontFace)(struct gl_context *ctx, GLenum mode);
649    /** Specify the value used for depth buffer comparisons */
650    void (*DepthFunc)(struct gl_context *ctx, GLenum func);
651    /** Enable or disable writing into the depth buffer */
652    void (*DepthMask)(struct gl_context *ctx, GLboolean flag);
653    /** Specify mapping of depth values from NDC to window coordinates */
654    void (*DepthRange)(struct gl_context *ctx, GLclampd nearval, GLclampd farval);
655    /** Specify the current buffer for writing */
656    void (*DrawBuffer)( struct gl_context *ctx, GLenum buffer );
657    /** Specify the buffers for writing for fragment programs*/
658    void (*DrawBuffers)( struct gl_context *ctx, GLsizei n, const GLenum *buffers );
659    /** Enable or disable server-side gl capabilities */
660    void (*Enable)(struct gl_context *ctx, GLenum cap, GLboolean state);
661    /** Specify fog parameters */
662    void (*Fogfv)(struct gl_context *ctx, GLenum pname, const GLfloat *params);
663    /** Specify implementation-specific hints */
664    void (*Hint)(struct gl_context *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)(struct gl_context *ctx, GLenum light,
670                    GLenum pname, const GLfloat *params );
671    /** Set the lighting model parameters */
672    void (*LightModelfv)(struct gl_context *ctx, GLenum pname, const GLfloat *params);
673    /** Specify the line stipple pattern */
674    void (*LineStipple)(struct gl_context *ctx, GLint factor, GLushort pattern );
675    /** Specify the width of rasterized lines */
676    void (*LineWidth)(struct gl_context *ctx, GLfloat width);
677    /** Specify a logical pixel operation for color index rendering */
678    void (*LogicOpcode)(struct gl_context *ctx, GLenum opcode);
679    void (*PointParameterfv)(struct gl_context *ctx, GLenum pname,
680                             const GLfloat *params);
681    /** Specify the diameter of rasterized points */
682    void (*PointSize)(struct gl_context *ctx, GLfloat size);
683    /** Select a polygon rasterization mode */
684    void (*PolygonMode)(struct gl_context *ctx, GLenum face, GLenum mode);
685    /** Set the scale and units used to calculate depth values */
686    void (*PolygonOffset)(struct gl_context *ctx, GLfloat factor, GLfloat units);
687    /** Set the polygon stippling pattern */
688    void (*PolygonStipple)(struct gl_context *ctx, const GLubyte *mask );
689    /* Specifies the current buffer for reading */
690    void (*ReadBuffer)( struct gl_context *ctx, GLenum buffer );
691    /** Set rasterization mode */
692    void (*RenderMode)(struct gl_context *ctx, GLenum mode );
693    /** Define the scissor box */
694    void (*Scissor)(struct gl_context *ctx, GLint x, GLint y, GLsizei w, GLsizei h);
695    /** Select flat or smooth shading */
696    void (*ShadeModel)(struct gl_context *ctx, GLenum mode);
697    /** OpenGL 2.0 two-sided StencilFunc */
698    void (*StencilFuncSeparate)(struct gl_context *ctx, GLenum face, GLenum func,
699                                GLint ref, GLuint mask);
700    /** OpenGL 2.0 two-sided StencilMask */
701    void (*StencilMaskSeparate)(struct gl_context *ctx, GLenum face, GLuint mask);
702    /** OpenGL 2.0 two-sided StencilOp */
703    void (*StencilOpSeparate)(struct gl_context *ctx, GLenum face, GLenum fail,
704                              GLenum zfail, GLenum zpass);
705    /** Control the generation of texture coordinates */
706    void (*TexGen)(struct gl_context *ctx, GLenum coord, GLenum pname,
707                   const GLfloat *params);
708    /** Set texture environment parameters */
709    void (*TexEnv)(struct gl_context *ctx, GLenum target, GLenum pname,
710                   const GLfloat *param);
711    /** Set texture parameters */
712    void (*TexParameter)(struct gl_context *ctx, GLenum target,
713                         struct gl_texture_object *texObj,
714                         GLenum pname, const GLfloat *params);
715    /** Set the viewport */
716    void (*Viewport)(struct gl_context *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)( struct gl_context *ctx, GLenum target,
725                        struct gl_buffer_object *obj );
726
727    struct gl_buffer_object * (*NewBufferObject)( struct gl_context *ctx, GLuint buffer,
728                                                  GLenum target );
729    
730    void (*DeleteBuffer)( struct gl_context *ctx, struct gl_buffer_object *obj );
731
732    GLboolean (*BufferData)( struct gl_context *ctx, GLenum target, GLsizeiptrARB size,
733                             const GLvoid *data, GLenum usage,
734                             struct gl_buffer_object *obj );
735
736    void (*BufferSubData)( struct gl_context *ctx, GLenum target, GLintptrARB offset,
737                           GLsizeiptrARB size, const GLvoid *data,
738                           struct gl_buffer_object *obj );
739
740    void (*GetBufferSubData)( struct gl_context *ctx, GLenum target,
741                              GLintptrARB offset, GLsizeiptrARB size,
742                              GLvoid *data, struct gl_buffer_object *obj );
743
744    void * (*MapBuffer)( struct gl_context *ctx, GLenum target, GLenum access,
745                         struct gl_buffer_object *obj );
746
747    void (*CopyBufferSubData)( struct gl_context *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)( struct gl_context *ctx, GLenum target, GLintptr offset,
756                              GLsizeiptr length, GLbitfield access,
757                              struct gl_buffer_object *obj);
758
759    void (*FlushMappedBufferRange)(struct gl_context *ctx, GLenum target, 
760                                   GLintptr offset, GLsizeiptr length,
761                                   struct gl_buffer_object *obj);
762
763    GLboolean (*UnmapBuffer)( struct gl_context *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)( struct gl_context *ctx, struct gl_buffer_object *obj, GLenum option );
773    GLenum (*RenderObjectPurgeable)( struct gl_context *ctx, struct gl_renderbuffer *obj, GLenum option );
774    GLenum (*TextureObjectPurgeable)( struct gl_context *ctx, struct gl_texture_object *obj, GLenum option );
775
776    /* variations on ObjectUnpurgeable */
777    GLenum (*BufferObjectUnpurgeable)( struct gl_context *ctx, struct gl_buffer_object *obj, GLenum option );
778    GLenum (*RenderObjectUnpurgeable)( struct gl_context *ctx, struct gl_renderbuffer *obj, GLenum option );
779    GLenum (*TextureObjectUnpurgeable)( struct gl_context *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)(struct gl_context *ctx, GLuint name);
787    struct gl_renderbuffer * (*NewRenderbuffer)(struct gl_context *ctx, GLuint name);
788    void (*BindFramebuffer)(struct gl_context *ctx, GLenum target,
789                            struct gl_framebuffer *drawFb,
790                            struct gl_framebuffer *readFb);
791    void (*FramebufferRenderbuffer)(struct gl_context *ctx, 
792                                    struct gl_framebuffer *fb,
793                                    GLenum attachment,
794                                    struct gl_renderbuffer *rb);
795    void (*RenderTexture)(struct gl_context *ctx,
796                          struct gl_framebuffer *fb,
797                          struct gl_renderbuffer_attachment *att);
798    void (*FinishRenderTexture)(struct gl_context *ctx,
799                                struct gl_renderbuffer_attachment *att);
800    void (*ValidateFramebuffer)(struct gl_context *ctx,
801                                struct gl_framebuffer *fb);
802    /*@}*/
803    void (*BlitFramebuffer)(struct gl_context *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)(struct gl_context *ctx, GLuint id);
813    void (*DeleteQuery)(struct gl_context *ctx, struct gl_query_object *q);
814    void (*BeginQuery)(struct gl_context *ctx, struct gl_query_object *q);
815    void (*EndQuery)(struct gl_context *ctx, struct gl_query_object *q);
816    void (*CheckQuery)(struct gl_context *ctx, struct gl_query_object *q);
817    void (*WaitQuery)(struct gl_context *ctx, struct gl_query_object *q);
818    /*@}*/
819
820
821    /**
822     * \name Vertex Array objects
823     */
824    /*@{*/
825    struct gl_array_object * (*NewArrayObject)(struct gl_context *ctx, GLuint id);
826    void (*DeleteArrayObject)(struct gl_context *ctx, struct gl_array_object *obj);
827    void (*BindArrayObject)(struct gl_context *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)(struct gl_context *ctx, GLuint name, GLenum type);
835    void (*DeleteShader)(struct gl_context *ctx, struct gl_shader *shader);
836    struct gl_shader_program *(*NewShaderProgram)(struct gl_context *ctx, GLuint name);
837    void (*DeleteShaderProgram)(struct gl_context *ctx,
838                                struct gl_shader_program *shProg);
839    void (*UseProgram)(struct gl_context *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)( struct gl_context *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 __struct gl_contextRec::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)( struct gl_context *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     * __struct gl_contextRec::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)( struct gl_context *ctx, GLuint flags );
917    void (*SaveFlushVertices)( struct gl_context *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)( struct gl_context *ctx, GLenum mode );
925
926    /**
927     * Notify driver that the special derived value _NeedEyeCoords has
928     * changed.
929     */
930    void (*LightingSpaceChange)( struct gl_context *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)( struct gl_context *ctx, GLuint list, GLenum mode );
939    /**
940     * Called by glEndList().
941     *
942     * \sa dd_function_table::NewList.
943     */
944    void (*EndList)( struct gl_context *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)( struct gl_context *ctx, 
952                           struct gl_display_list *dlist );
953    /**
954     * Called by glEndCallList().
955     *
956     * \sa dd_function_table::BeginCallList.
957     */
958    void (*EndCallList)( struct gl_context *ctx );
959
960
961    /**
962     * \name GL_ARB_sync interfaces
963     */
964    /*@{*/
965    struct gl_sync_object * (*NewSyncObject)(struct gl_context *, GLenum);
966    void (*FenceSync)(struct gl_context *, struct gl_sync_object *, GLenum, GLbitfield);
967    void (*DeleteSyncObject)(struct gl_context *, struct gl_sync_object *);
968    void (*CheckSync)(struct gl_context *, struct gl_sync_object *);
969    void (*ClientWaitSync)(struct gl_context *, struct gl_sync_object *,
970                           GLbitfield, GLuint64);
971    void (*ServerWaitSync)(struct gl_context *, struct gl_sync_object *,
972                           GLbitfield, GLuint64);
973    /*@}*/
974
975    /** GL_NV_conditional_render */
976    void (*BeginConditionalRender)(struct gl_context *ctx, struct gl_query_object *q,
977                                   GLenum mode);
978    void (*EndConditionalRender)(struct gl_context *ctx, struct gl_query_object *q);
979
980    /**
981     * \name GL_OES_draw_texture interface
982     */
983    /*@{*/
984    void (*DrawTex)(struct gl_context *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)(struct gl_context *ctx, GLenum target,
992                                    struct gl_texture_object *texObj,
993                                    struct gl_texture_image *texImage,
994                                    GLeglImageOES image_handle);
995    void (*EGLImageTargetRenderbufferStorage)(struct gl_context *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)(struct gl_context *ctx, GLuint name);
1004    void (*DeleteTransformFeedback)(struct gl_context *ctx,
1005                                    struct gl_transform_feedback_object *obj);
1006    void (*BeginTransformFeedback)(struct gl_context *ctx, GLenum mode,
1007                                   struct gl_transform_feedback_object *obj);
1008    void (*EndTransformFeedback)(struct gl_context *ctx,
1009                                 struct gl_transform_feedback_object *obj);
1010    void (*PauseTransformFeedback)(struct gl_context *ctx,
1011                                   struct gl_transform_feedback_object *obj);
1012    void (*ResumeTransformFeedback)(struct gl_context *ctx,
1013                                    struct gl_transform_feedback_object *obj);
1014    void (*DrawTransformFeedback)(struct gl_context *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  */
1037 typedef 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    void (GLAPIENTRYP PrimitiveRestartNV)( void );
1090    /* GL_NV_vertex_program */
1091    void (GLAPIENTRYP VertexAttrib1fNV)( GLuint index, GLfloat x );
1092    void (GLAPIENTRYP VertexAttrib1fvNV)( GLuint index, const GLfloat *v );
1093    void (GLAPIENTRYP VertexAttrib2fNV)( GLuint index, GLfloat x, GLfloat y );
1094    void (GLAPIENTRYP VertexAttrib2fvNV)( GLuint index, const GLfloat *v );
1095    void (GLAPIENTRYP VertexAttrib3fNV)( GLuint index, GLfloat x, GLfloat y, GLfloat z );
1096    void (GLAPIENTRYP VertexAttrib3fvNV)( GLuint index, const GLfloat *v );
1097    void (GLAPIENTRYP VertexAttrib4fNV)( GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w );
1098    void (GLAPIENTRYP VertexAttrib4fvNV)( GLuint index, const GLfloat *v );
1099    /* GL_ARB_vertex_program */
1100    void (GLAPIENTRYP VertexAttrib1fARB)( GLuint index, GLfloat x );
1101    void (GLAPIENTRYP VertexAttrib1fvARB)( GLuint index, const GLfloat *v );
1102    void (GLAPIENTRYP VertexAttrib2fARB)( GLuint index, GLfloat x, GLfloat y );
1103    void (GLAPIENTRYP VertexAttrib2fvARB)( GLuint index, const GLfloat *v );
1104    void (GLAPIENTRYP VertexAttrib3fARB)( GLuint index, GLfloat x, GLfloat y, GLfloat z );
1105    void (GLAPIENTRYP VertexAttrib3fvARB)( GLuint index, const GLfloat *v );
1106    void (GLAPIENTRYP VertexAttrib4fARB)( GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w );
1107    void (GLAPIENTRYP VertexAttrib4fvARB)( GLuint index, const GLfloat *v );
1108    /*@}*/
1109
1110    void (GLAPIENTRYP Rectf)( GLfloat, GLfloat, GLfloat, GLfloat );
1111
1112    /**
1113     * \name Array
1114     */
1115    /*@{*/
1116    void (GLAPIENTRYP DrawArrays)( GLenum mode, GLint start, GLsizei count );
1117    void (GLAPIENTRYP DrawElements)( GLenum mode, GLsizei count, GLenum type,
1118                          const GLvoid *indices );
1119    void (GLAPIENTRYP DrawRangeElements)( GLenum mode, GLuint start,
1120                               GLuint end, GLsizei count,
1121                               GLenum type, const GLvoid *indices );
1122    void (GLAPIENTRYP MultiDrawElementsEXT)( GLenum mode, const GLsizei *count,
1123                                             GLenum type,
1124                                             const GLvoid **indices,
1125                                             GLsizei primcount);
1126    void (GLAPIENTRYP DrawElementsBaseVertex)( GLenum mode, GLsizei count,
1127                                               GLenum type,
1128                                               const GLvoid *indices,
1129                                               GLint basevertex );
1130    void (GLAPIENTRYP DrawRangeElementsBaseVertex)( GLenum mode, GLuint start,
1131                                                    GLuint end, GLsizei count,
1132                                                    GLenum type,
1133                                                    const GLvoid *indices,
1134                                                    GLint basevertex);
1135    void (GLAPIENTRYP MultiDrawElementsBaseVertex)( GLenum mode,
1136                                                    const GLsizei *count,
1137                                                    GLenum type,
1138                                                    const GLvoid **indices,
1139                                                    GLsizei primcount,
1140                                                    const GLint *basevertex);
1141    void (GLAPIENTRYP DrawArraysInstanced)(GLenum mode, GLint first,
1142                                           GLsizei count, GLsizei primcount);
1143    void (GLAPIENTRYP DrawElementsInstanced)(GLenum mode, GLsizei count,
1144                                             GLenum type, const GLvoid *indices,
1145                                             GLsizei primcount);
1146    /*@}*/
1147
1148    /**
1149     * \name Eval
1150     *
1151     * If you don't support eval, fallback to the default vertex format
1152     * on receiving an eval call and use the pipeline mechanism to
1153     * provide partial T&L acceleration.
1154     *
1155     * Mesa will provide a set of helper functions to do eval within
1156     * accelerated vertex formats, eventually...
1157     */
1158    /*@{*/
1159    void (GLAPIENTRYP EvalMesh1)( GLenum mode, GLint i1, GLint i2 );
1160    void (GLAPIENTRYP EvalMesh2)( GLenum mode, GLint i1, GLint i2, GLint j1, GLint j2 );
1161    /*@}*/
1162
1163 } GLvertexformat;
1164
1165
1166 #endif /* DD_INCLUDED */