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