Merge branch 'lp-offset-twoside'
[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 /** Specify pixel arithmetic */
639 void (*BlendFuncSeparate)(struct gl_context *ctx,
640 GLenum sfactorRGB, GLenum dfactorRGB,
641 GLenum sfactorA, GLenum dfactorA);
642 /** Specify clear values for the color buffers */
643 void (*ClearColor)(struct gl_context *ctx, const GLfloat color[4]);
644 /** Specify the clear value for the depth buffer */
645 void (*ClearDepth)(struct gl_context *ctx, GLclampd d);
646 /** Specify the clear value for the stencil buffer */
647 void (*ClearStencil)(struct gl_context *ctx, GLint s);
648 /** Specify a plane against which all geometry is clipped */
649 void (*ClipPlane)(struct gl_context *ctx, GLenum plane, const GLfloat *equation );
650 /** Enable and disable writing of frame buffer color components */
651 void (*ColorMask)(struct gl_context *ctx, GLboolean rmask, GLboolean gmask,
652 GLboolean bmask, GLboolean amask );
653 void (*ColorMaskIndexed)(struct gl_context *ctx, GLuint buf, GLboolean rmask,
654 GLboolean gmask, GLboolean bmask, GLboolean amask);
655 /** Cause a material color to track the current color */
656 void (*ColorMaterial)(struct gl_context *ctx, GLenum face, GLenum mode);
657 /** Specify whether front- or back-facing facets can be culled */
658 void (*CullFace)(struct gl_context *ctx, GLenum mode);
659 /** Define front- and back-facing polygons */
660 void (*FrontFace)(struct gl_context *ctx, GLenum mode);
661 /** Specify the value used for depth buffer comparisons */
662 void (*DepthFunc)(struct gl_context *ctx, GLenum func);
663 /** Enable or disable writing into the depth buffer */
664 void (*DepthMask)(struct gl_context *ctx, GLboolean flag);
665 /** Specify mapping of depth values from NDC to window coordinates */
666 void (*DepthRange)(struct gl_context *ctx, GLclampd nearval, GLclampd farval);
667 /** Specify the current buffer for writing */
668 void (*DrawBuffer)( struct gl_context *ctx, GLenum buffer );
669 /** Specify the buffers for writing for fragment programs*/
670 void (*DrawBuffers)( struct gl_context *ctx, GLsizei n, const GLenum *buffers );
671 /** Enable or disable server-side gl capabilities */
672 void (*Enable)(struct gl_context *ctx, GLenum cap, GLboolean state);
673 /** Specify fog parameters */
674 void (*Fogfv)(struct gl_context *ctx, GLenum pname, const GLfloat *params);
675 /** Specify implementation-specific hints */
676 void (*Hint)(struct gl_context *ctx, GLenum target, GLenum mode);
677 /** Set light source parameters.
678 * Note: for GL_POSITION and GL_SPOT_DIRECTION, params will have already
679 * been transformed to eye-space.
680 */
681 void (*Lightfv)(struct gl_context *ctx, GLenum light,
682 GLenum pname, const GLfloat *params );
683 /** Set the lighting model parameters */
684 void (*LightModelfv)(struct gl_context *ctx, GLenum pname, const GLfloat *params);
685 /** Specify the line stipple pattern */
686 void (*LineStipple)(struct gl_context *ctx, GLint factor, GLushort pattern );
687 /** Specify the width of rasterized lines */
688 void (*LineWidth)(struct gl_context *ctx, GLfloat width);
689 /** Specify a logical pixel operation for color index rendering */
690 void (*LogicOpcode)(struct gl_context *ctx, GLenum opcode);
691 void (*PointParameterfv)(struct gl_context *ctx, GLenum pname,
692 const GLfloat *params);
693 /** Specify the diameter of rasterized points */
694 void (*PointSize)(struct gl_context *ctx, GLfloat size);
695 /** Select a polygon rasterization mode */
696 void (*PolygonMode)(struct gl_context *ctx, GLenum face, GLenum mode);
697 /** Set the scale and units used to calculate depth values */
698 void (*PolygonOffset)(struct gl_context *ctx, GLfloat factor, GLfloat units);
699 /** Set the polygon stippling pattern */
700 void (*PolygonStipple)(struct gl_context *ctx, const GLubyte *mask );
701 /* Specifies the current buffer for reading */
702 void (*ReadBuffer)( struct gl_context *ctx, GLenum buffer );
703 /** Set rasterization mode */
704 void (*RenderMode)(struct gl_context *ctx, GLenum mode );
705 /** Define the scissor box */
706 void (*Scissor)(struct gl_context *ctx, GLint x, GLint y, GLsizei w, GLsizei h);
707 /** Select flat or smooth shading */
708 void (*ShadeModel)(struct gl_context *ctx, GLenum mode);
709 /** OpenGL 2.0 two-sided StencilFunc */
710 void (*StencilFuncSeparate)(struct gl_context *ctx, GLenum face, GLenum func,
711 GLint ref, GLuint mask);
712 /** OpenGL 2.0 two-sided StencilMask */
713 void (*StencilMaskSeparate)(struct gl_context *ctx, GLenum face, GLuint mask);
714 /** OpenGL 2.0 two-sided StencilOp */
715 void (*StencilOpSeparate)(struct gl_context *ctx, GLenum face, GLenum fail,
716 GLenum zfail, GLenum zpass);
717 /** Control the generation of texture coordinates */
718 void (*TexGen)(struct gl_context *ctx, GLenum coord, GLenum pname,
719 const GLfloat *params);
720 /** Set texture environment parameters */
721 void (*TexEnv)(struct gl_context *ctx, GLenum target, GLenum pname,
722 const GLfloat *param);
723 /** Set texture parameters */
724 void (*TexParameter)(struct gl_context *ctx, GLenum target,
725 struct gl_texture_object *texObj,
726 GLenum pname, const GLfloat *params);
727 /** Set the viewport */
728 void (*Viewport)(struct gl_context *ctx, GLint x, GLint y, GLsizei w, GLsizei h);
729 /*@}*/
730
731
732 /**
733 * \name Vertex/pixel buffer object functions
734 */
735 /*@{*/
736 void (*BindBuffer)( struct gl_context *ctx, GLenum target,
737 struct gl_buffer_object *obj );
738
739 struct gl_buffer_object * (*NewBufferObject)( struct gl_context *ctx, GLuint buffer,
740 GLenum target );
741
742 void (*DeleteBuffer)( struct gl_context *ctx, struct gl_buffer_object *obj );
743
744 GLboolean (*BufferData)( struct gl_context *ctx, GLenum target, GLsizeiptrARB size,
745 const GLvoid *data, GLenum usage,
746 struct gl_buffer_object *obj );
747
748 void (*BufferSubData)( struct gl_context *ctx, GLenum target, GLintptrARB offset,
749 GLsizeiptrARB size, const GLvoid *data,
750 struct gl_buffer_object *obj );
751
752 void (*GetBufferSubData)( struct gl_context *ctx, GLenum target,
753 GLintptrARB offset, GLsizeiptrARB size,
754 GLvoid *data, struct gl_buffer_object *obj );
755
756 void * (*MapBuffer)( struct gl_context *ctx, GLenum target, GLenum access,
757 struct gl_buffer_object *obj );
758
759 void (*CopyBufferSubData)( struct gl_context *ctx,
760 struct gl_buffer_object *src,
761 struct gl_buffer_object *dst,
762 GLintptr readOffset, GLintptr writeOffset,
763 GLsizeiptr size );
764
765 /* May return NULL if MESA_MAP_NOWAIT_BIT is set in access:
766 */
767 void * (*MapBufferRange)( struct gl_context *ctx, GLenum target, GLintptr offset,
768 GLsizeiptr length, GLbitfield access,
769 struct gl_buffer_object *obj);
770
771 void (*FlushMappedBufferRange)(struct gl_context *ctx, GLenum target,
772 GLintptr offset, GLsizeiptr length,
773 struct gl_buffer_object *obj);
774
775 GLboolean (*UnmapBuffer)( struct gl_context *ctx, GLenum target,
776 struct gl_buffer_object *obj );
777 /*@}*/
778
779 /**
780 * \name Functions for GL_APPLE_object_purgeable
781 */
782 /*@{*/
783 /* variations on ObjectPurgeable */
784 GLenum (*BufferObjectPurgeable)( struct gl_context *ctx, struct gl_buffer_object *obj, GLenum option );
785 GLenum (*RenderObjectPurgeable)( struct gl_context *ctx, struct gl_renderbuffer *obj, GLenum option );
786 GLenum (*TextureObjectPurgeable)( struct gl_context *ctx, struct gl_texture_object *obj, GLenum option );
787
788 /* variations on ObjectUnpurgeable */
789 GLenum (*BufferObjectUnpurgeable)( struct gl_context *ctx, struct gl_buffer_object *obj, GLenum option );
790 GLenum (*RenderObjectUnpurgeable)( struct gl_context *ctx, struct gl_renderbuffer *obj, GLenum option );
791 GLenum (*TextureObjectUnpurgeable)( struct gl_context *ctx, struct gl_texture_object *obj, GLenum option );
792 /*@}*/
793
794 /**
795 * \name Functions for GL_EXT_framebuffer_{object,blit}.
796 */
797 /*@{*/
798 struct gl_framebuffer * (*NewFramebuffer)(struct gl_context *ctx, GLuint name);
799 struct gl_renderbuffer * (*NewRenderbuffer)(struct gl_context *ctx, GLuint name);
800 void (*BindFramebuffer)(struct gl_context *ctx, GLenum target,
801 struct gl_framebuffer *drawFb,
802 struct gl_framebuffer *readFb);
803 void (*FramebufferRenderbuffer)(struct gl_context *ctx,
804 struct gl_framebuffer *fb,
805 GLenum attachment,
806 struct gl_renderbuffer *rb);
807 void (*RenderTexture)(struct gl_context *ctx,
808 struct gl_framebuffer *fb,
809 struct gl_renderbuffer_attachment *att);
810 void (*FinishRenderTexture)(struct gl_context *ctx,
811 struct gl_renderbuffer_attachment *att);
812 void (*ValidateFramebuffer)(struct gl_context *ctx,
813 struct gl_framebuffer *fb);
814 /*@}*/
815 void (*BlitFramebuffer)(struct gl_context *ctx,
816 GLint srcX0, GLint srcY0, GLint srcX1, GLint srcY1,
817 GLint dstX0, GLint dstY0, GLint dstX1, GLint dstY1,
818 GLbitfield mask, GLenum filter);
819
820 /**
821 * \name Query objects
822 */
823 /*@{*/
824 struct gl_query_object * (*NewQueryObject)(struct gl_context *ctx, GLuint id);
825 void (*DeleteQuery)(struct gl_context *ctx, struct gl_query_object *q);
826 void (*BeginQuery)(struct gl_context *ctx, struct gl_query_object *q);
827 void (*EndQuery)(struct gl_context *ctx, struct gl_query_object *q);
828 void (*CheckQuery)(struct gl_context *ctx, struct gl_query_object *q);
829 void (*WaitQuery)(struct gl_context *ctx, struct gl_query_object *q);
830 /*@}*/
831
832
833 /**
834 * \name Vertex Array objects
835 */
836 /*@{*/
837 struct gl_array_object * (*NewArrayObject)(struct gl_context *ctx, GLuint id);
838 void (*DeleteArrayObject)(struct gl_context *ctx, struct gl_array_object *obj);
839 void (*BindArrayObject)(struct gl_context *ctx, struct gl_array_object *obj);
840 /*@}*/
841
842 /**
843 * \name GLSL-related functions (ARB extensions and OpenGL 2.x)
844 */
845 /*@{*/
846 struct gl_shader *(*NewShader)(struct gl_context *ctx, GLuint name, GLenum type);
847 void (*DeleteShader)(struct gl_context *ctx, struct gl_shader *shader);
848 struct gl_shader_program *(*NewShaderProgram)(struct gl_context *ctx, GLuint name);
849 void (*DeleteShaderProgram)(struct gl_context *ctx,
850 struct gl_shader_program *shProg);
851 void (*UseProgram)(struct gl_context *ctx, struct gl_shader_program *shProg);
852 /*@}*/
853
854
855 /**
856 * \name Support for multiple T&L engines
857 */
858 /*@{*/
859
860 /**
861 * Bitmask of state changes that require the current T&L module to be
862 * validated, using ValidateTnlModule() below.
863 */
864 GLuint NeedValidate;
865
866 /**
867 * Validate the current T&L module.
868 *
869 * This is called directly after UpdateState() when a state change that has
870 * occurred matches the dd_function_table::NeedValidate bitmask above. This
871 * ensures all computed values are up to date, thus allowing the driver to
872 * decide if the current T&L module needs to be swapped out.
873 *
874 * This must be non-NULL if a driver installs a custom T&L module and sets
875 * the dd_function_table::NeedValidate bitmask, but may be NULL otherwise.
876 */
877 void (*ValidateTnlModule)( struct gl_context *ctx, GLuint new_state );
878
879
880 #define PRIM_OUTSIDE_BEGIN_END (GL_POLYGON+1)
881 #define PRIM_INSIDE_UNKNOWN_PRIM (GL_POLYGON+2)
882 #define PRIM_UNKNOWN (GL_POLYGON+3)
883
884 /**
885 * Set by the driver-supplied T&L engine.
886 *
887 * Set to PRIM_OUTSIDE_BEGIN_END when outside glBegin()/glEnd().
888 */
889 GLuint CurrentExecPrimitive;
890
891 /**
892 * Current state of an in-progress compilation.
893 *
894 * May take on any of the additional values PRIM_OUTSIDE_BEGIN_END,
895 * PRIM_INSIDE_UNKNOWN_PRIM or PRIM_UNKNOWN defined above.
896 */
897 GLuint CurrentSavePrimitive;
898
899
900 #define FLUSH_STORED_VERTICES 0x1
901 #define FLUSH_UPDATE_CURRENT 0x2
902 /**
903 * Set by the driver-supplied T&L engine whenever vertices are buffered
904 * between glBegin()/glEnd() objects or __struct gl_contextRec::Current is not
905 * updated.
906 *
907 * The dd_function_table::FlushVertices call below may be used to resolve
908 * these conditions.
909 */
910 GLuint NeedFlush;
911 GLuint SaveNeedFlush;
912
913
914 /* Called prior to any of the GLvertexformat functions being
915 * called. Paired with Driver.FlushVertices().
916 */
917 void (*BeginVertices)( struct gl_context *ctx );
918
919 /**
920 * If inside glBegin()/glEnd(), it should ASSERT(0). Otherwise, if
921 * FLUSH_STORED_VERTICES bit in \p flags is set flushes any buffered
922 * vertices, if FLUSH_UPDATE_CURRENT bit is set updates
923 * __struct gl_contextRec::Current and gl_light_attrib::Material
924 *
925 * Note that the default T&L engine never clears the
926 * FLUSH_UPDATE_CURRENT bit, even after performing the update.
927 */
928 void (*FlushVertices)( struct gl_context *ctx, GLuint flags );
929 void (*SaveFlushVertices)( struct gl_context *ctx );
930
931 /**
932 * Give the driver the opportunity to hook in its own vtxfmt for
933 * compiling optimized display lists. This is called on each valid
934 * glBegin() during list compilation.
935 */
936 GLboolean (*NotifySaveBegin)( struct gl_context *ctx, GLenum mode );
937
938 /**
939 * Notify driver that the special derived value _NeedEyeCoords has
940 * changed.
941 */
942 void (*LightingSpaceChange)( struct gl_context *ctx );
943
944 /**
945 * Called by glNewList().
946 *
947 * Let the T&L component know what is going on with display lists
948 * in time to make changes to dispatch tables, etc.
949 */
950 void (*NewList)( struct gl_context *ctx, GLuint list, GLenum mode );
951 /**
952 * Called by glEndList().
953 *
954 * \sa dd_function_table::NewList.
955 */
956 void (*EndList)( struct gl_context *ctx );
957
958 /**
959 * Called by glCallList(s).
960 *
961 * Notify the T&L component before and after calling a display list.
962 */
963 void (*BeginCallList)( struct gl_context *ctx,
964 struct gl_display_list *dlist );
965 /**
966 * Called by glEndCallList().
967 *
968 * \sa dd_function_table::BeginCallList.
969 */
970 void (*EndCallList)( struct gl_context *ctx );
971
972
973 /**
974 * \name GL_ARB_sync interfaces
975 */
976 /*@{*/
977 struct gl_sync_object * (*NewSyncObject)(struct gl_context *, GLenum);
978 void (*FenceSync)(struct gl_context *, struct gl_sync_object *, GLenum, GLbitfield);
979 void (*DeleteSyncObject)(struct gl_context *, struct gl_sync_object *);
980 void (*CheckSync)(struct gl_context *, struct gl_sync_object *);
981 void (*ClientWaitSync)(struct gl_context *, struct gl_sync_object *,
982 GLbitfield, GLuint64);
983 void (*ServerWaitSync)(struct gl_context *, struct gl_sync_object *,
984 GLbitfield, GLuint64);
985 /*@}*/
986
987 /** GL_NV_conditional_render */
988 void (*BeginConditionalRender)(struct gl_context *ctx, struct gl_query_object *q,
989 GLenum mode);
990 void (*EndConditionalRender)(struct gl_context *ctx, struct gl_query_object *q);
991
992 /**
993 * \name GL_OES_draw_texture interface
994 */
995 /*@{*/
996 void (*DrawTex)(struct gl_context *ctx, GLfloat x, GLfloat y, GLfloat z,
997 GLfloat width, GLfloat height);
998 /*@}*/
999
1000 /**
1001 * \name GL_OES_EGL_image interface
1002 */
1003 void (*EGLImageTargetTexture2D)(struct gl_context *ctx, GLenum target,
1004 struct gl_texture_object *texObj,
1005 struct gl_texture_image *texImage,
1006 GLeglImageOES image_handle);
1007 void (*EGLImageTargetRenderbufferStorage)(struct gl_context *ctx,
1008 struct gl_renderbuffer *rb,
1009 void *image_handle);
1010
1011 /**
1012 * \name GL_EXT_transform_feedback interface
1013 */
1014 struct gl_transform_feedback_object *
1015 (*NewTransformFeedback)(struct gl_context *ctx, GLuint name);
1016 void (*DeleteTransformFeedback)(struct gl_context *ctx,
1017 struct gl_transform_feedback_object *obj);
1018 void (*BeginTransformFeedback)(struct gl_context *ctx, GLenum mode,
1019 struct gl_transform_feedback_object *obj);
1020 void (*EndTransformFeedback)(struct gl_context *ctx,
1021 struct gl_transform_feedback_object *obj);
1022 void (*PauseTransformFeedback)(struct gl_context *ctx,
1023 struct gl_transform_feedback_object *obj);
1024 void (*ResumeTransformFeedback)(struct gl_context *ctx,
1025 struct gl_transform_feedback_object *obj);
1026 void (*DrawTransformFeedback)(struct gl_context *ctx, GLenum mode,
1027 struct gl_transform_feedback_object *obj);
1028 };
1029
1030
1031 /**
1032 * Transform/Clip/Lighting interface
1033 *
1034 * Drivers present a reduced set of the functions possible in
1035 * glBegin()/glEnd() objects. Core mesa provides translation stubs for the
1036 * remaining functions to map down to these entry points.
1037 *
1038 * These are the initial values to be installed into dispatch by
1039 * mesa. If the T&L driver wants to modify the dispatch table
1040 * while installed, it must do so itself. It would be possible for
1041 * the vertexformat to install its own initial values for these
1042 * functions, but this way there is an obvious list of what is
1043 * expected of the driver.
1044 *
1045 * If the driver wants to hook in entry points other than those
1046 * listed, it must restore them to their original values in
1047 * the disable() callback, below.
1048 */
1049 typedef struct {
1050 /**
1051 * \name Vertex
1052 */
1053 /*@{*/
1054 void (GLAPIENTRYP ArrayElement)( GLint );
1055 void (GLAPIENTRYP Color3f)( GLfloat, GLfloat, GLfloat );
1056 void (GLAPIENTRYP Color3fv)( const GLfloat * );
1057 void (GLAPIENTRYP Color4f)( GLfloat, GLfloat, GLfloat, GLfloat );
1058 void (GLAPIENTRYP Color4fv)( const GLfloat * );
1059 void (GLAPIENTRYP EdgeFlag)( GLboolean );
1060 void (GLAPIENTRYP EvalCoord1f)( GLfloat );
1061 void (GLAPIENTRYP EvalCoord1fv)( const GLfloat * );
1062 void (GLAPIENTRYP EvalCoord2f)( GLfloat, GLfloat );
1063 void (GLAPIENTRYP EvalCoord2fv)( const GLfloat * );
1064 void (GLAPIENTRYP EvalPoint1)( GLint );
1065 void (GLAPIENTRYP EvalPoint2)( GLint, GLint );
1066 void (GLAPIENTRYP FogCoordfEXT)( GLfloat );
1067 void (GLAPIENTRYP FogCoordfvEXT)( const GLfloat * );
1068 void (GLAPIENTRYP Indexf)( GLfloat );
1069 void (GLAPIENTRYP Indexfv)( const GLfloat * );
1070 void (GLAPIENTRYP Materialfv)( GLenum face, GLenum pname, const GLfloat * );
1071 void (GLAPIENTRYP MultiTexCoord1fARB)( GLenum, GLfloat );
1072 void (GLAPIENTRYP MultiTexCoord1fvARB)( GLenum, const GLfloat * );
1073 void (GLAPIENTRYP MultiTexCoord2fARB)( GLenum, GLfloat, GLfloat );
1074 void (GLAPIENTRYP MultiTexCoord2fvARB)( GLenum, const GLfloat * );
1075 void (GLAPIENTRYP MultiTexCoord3fARB)( GLenum, GLfloat, GLfloat, GLfloat );
1076 void (GLAPIENTRYP MultiTexCoord3fvARB)( GLenum, const GLfloat * );
1077 void (GLAPIENTRYP MultiTexCoord4fARB)( GLenum, GLfloat, GLfloat, GLfloat, GLfloat );
1078 void (GLAPIENTRYP MultiTexCoord4fvARB)( GLenum, const GLfloat * );
1079 void (GLAPIENTRYP Normal3f)( GLfloat, GLfloat, GLfloat );
1080 void (GLAPIENTRYP Normal3fv)( const GLfloat * );
1081 void (GLAPIENTRYP SecondaryColor3fEXT)( GLfloat, GLfloat, GLfloat );
1082 void (GLAPIENTRYP SecondaryColor3fvEXT)( const GLfloat * );
1083 void (GLAPIENTRYP TexCoord1f)( GLfloat );
1084 void (GLAPIENTRYP TexCoord1fv)( const GLfloat * );
1085 void (GLAPIENTRYP TexCoord2f)( GLfloat, GLfloat );
1086 void (GLAPIENTRYP TexCoord2fv)( const GLfloat * );
1087 void (GLAPIENTRYP TexCoord3f)( GLfloat, GLfloat, GLfloat );
1088 void (GLAPIENTRYP TexCoord3fv)( const GLfloat * );
1089 void (GLAPIENTRYP TexCoord4f)( GLfloat, GLfloat, GLfloat, GLfloat );
1090 void (GLAPIENTRYP TexCoord4fv)( const GLfloat * );
1091 void (GLAPIENTRYP Vertex2f)( GLfloat, GLfloat );
1092 void (GLAPIENTRYP Vertex2fv)( const GLfloat * );
1093 void (GLAPIENTRYP Vertex3f)( GLfloat, GLfloat, GLfloat );
1094 void (GLAPIENTRYP Vertex3fv)( const GLfloat * );
1095 void (GLAPIENTRYP Vertex4f)( GLfloat, GLfloat, GLfloat, GLfloat );
1096 void (GLAPIENTRYP Vertex4fv)( const GLfloat * );
1097 void (GLAPIENTRYP CallList)( GLuint );
1098 void (GLAPIENTRYP CallLists)( GLsizei, GLenum, const GLvoid * );
1099 void (GLAPIENTRYP Begin)( GLenum );
1100 void (GLAPIENTRYP End)( void );
1101 void (GLAPIENTRYP PrimitiveRestartNV)( void );
1102 /* GL_NV_vertex_program */
1103 void (GLAPIENTRYP VertexAttrib1fNV)( GLuint index, GLfloat x );
1104 void (GLAPIENTRYP VertexAttrib1fvNV)( GLuint index, const GLfloat *v );
1105 void (GLAPIENTRYP VertexAttrib2fNV)( GLuint index, GLfloat x, GLfloat y );
1106 void (GLAPIENTRYP VertexAttrib2fvNV)( GLuint index, const GLfloat *v );
1107 void (GLAPIENTRYP VertexAttrib3fNV)( GLuint index, GLfloat x, GLfloat y, GLfloat z );
1108 void (GLAPIENTRYP VertexAttrib3fvNV)( GLuint index, const GLfloat *v );
1109 void (GLAPIENTRYP VertexAttrib4fNV)( GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w );
1110 void (GLAPIENTRYP VertexAttrib4fvNV)( GLuint index, const GLfloat *v );
1111 /* GL_ARB_vertex_program */
1112 void (GLAPIENTRYP VertexAttrib1fARB)( GLuint index, GLfloat x );
1113 void (GLAPIENTRYP VertexAttrib1fvARB)( GLuint index, const GLfloat *v );
1114 void (GLAPIENTRYP VertexAttrib2fARB)( GLuint index, GLfloat x, GLfloat y );
1115 void (GLAPIENTRYP VertexAttrib2fvARB)( GLuint index, const GLfloat *v );
1116 void (GLAPIENTRYP VertexAttrib3fARB)( GLuint index, GLfloat x, GLfloat y, GLfloat z );
1117 void (GLAPIENTRYP VertexAttrib3fvARB)( GLuint index, const GLfloat *v );
1118 void (GLAPIENTRYP VertexAttrib4fARB)( GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w );
1119 void (GLAPIENTRYP VertexAttrib4fvARB)( GLuint index, const GLfloat *v );
1120
1121 /* GL_EXT_gpu_shader4 / GL 3.0 */
1122 void (GLAPIENTRYP VertexAttribI1i)( GLuint index, GLint x);
1123 void (GLAPIENTRYP VertexAttribI2i)( GLuint index, GLint x, GLint y);
1124 void (GLAPIENTRYP VertexAttribI3i)( GLuint index, GLint x, GLint y, GLint z);
1125 void (GLAPIENTRYP VertexAttribI4i)( GLuint index, GLint x, GLint y, GLint z, GLint w);
1126 void (GLAPIENTRYP VertexAttribI2iv)( GLuint index, const GLint *v);
1127 void (GLAPIENTRYP VertexAttribI3iv)( GLuint index, const GLint *v);
1128 void (GLAPIENTRYP VertexAttribI4iv)( GLuint index, const GLint *v);
1129
1130 void (GLAPIENTRYP VertexAttribI1ui)( GLuint index, GLuint x);
1131 void (GLAPIENTRYP VertexAttribI2ui)( GLuint index, GLuint x, GLuint y);
1132 void (GLAPIENTRYP VertexAttribI3ui)( GLuint index, GLuint x, GLuint y, GLuint z);
1133 void (GLAPIENTRYP VertexAttribI4ui)( GLuint index, GLuint x, GLuint y, GLuint z, GLuint w);
1134 void (GLAPIENTRYP VertexAttribI2uiv)( GLuint index, const GLuint *v);
1135 void (GLAPIENTRYP VertexAttribI3uiv)( GLuint index, const GLuint *v);
1136 void (GLAPIENTRYP VertexAttribI4uiv)( GLuint index, const GLuint *v);
1137
1138 /*@}*/
1139
1140 void (GLAPIENTRYP Rectf)( GLfloat, GLfloat, GLfloat, GLfloat );
1141
1142 /**
1143 * \name Array
1144 */
1145 /*@{*/
1146 void (GLAPIENTRYP DrawArrays)( GLenum mode, GLint start, GLsizei count );
1147 void (GLAPIENTRYP DrawElements)( GLenum mode, GLsizei count, GLenum type,
1148 const GLvoid *indices );
1149 void (GLAPIENTRYP DrawRangeElements)( GLenum mode, GLuint start,
1150 GLuint end, GLsizei count,
1151 GLenum type, const GLvoid *indices );
1152 void (GLAPIENTRYP MultiDrawElementsEXT)( GLenum mode, const GLsizei *count,
1153 GLenum type,
1154 const GLvoid **indices,
1155 GLsizei primcount);
1156 void (GLAPIENTRYP DrawElementsBaseVertex)( GLenum mode, GLsizei count,
1157 GLenum type,
1158 const GLvoid *indices,
1159 GLint basevertex );
1160 void (GLAPIENTRYP DrawRangeElementsBaseVertex)( GLenum mode, GLuint start,
1161 GLuint end, GLsizei count,
1162 GLenum type,
1163 const GLvoid *indices,
1164 GLint basevertex);
1165 void (GLAPIENTRYP MultiDrawElementsBaseVertex)( GLenum mode,
1166 const GLsizei *count,
1167 GLenum type,
1168 const GLvoid **indices,
1169 GLsizei primcount,
1170 const GLint *basevertex);
1171 void (GLAPIENTRYP DrawArraysInstanced)(GLenum mode, GLint first,
1172 GLsizei count, GLsizei primcount);
1173 void (GLAPIENTRYP DrawElementsInstanced)(GLenum mode, GLsizei count,
1174 GLenum type, const GLvoid *indices,
1175 GLsizei primcount);
1176 /*@}*/
1177
1178 /**
1179 * \name Eval
1180 *
1181 * If you don't support eval, fallback to the default vertex format
1182 * on receiving an eval call and use the pipeline mechanism to
1183 * provide partial T&L acceleration.
1184 *
1185 * Mesa will provide a set of helper functions to do eval within
1186 * accelerated vertex formats, eventually...
1187 */
1188 /*@{*/
1189 void (GLAPIENTRYP EvalMesh1)( GLenum mode, GLint i1, GLint i2 );
1190 void (GLAPIENTRYP EvalMesh2)( GLenum mode, GLint i1, GLint i2, GLint j1, GLint j2 );
1191 /*@}*/
1192
1193 } GLvertexformat;
1194
1195
1196 #endif /* DD_INCLUDED */