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