mesa: new BYTE/SHORT_TO_FLOATZ() macros
[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 actual hardware texture format given the user-provided source
193 * image format and type and the desired internal format. In some
194 * cases, srcFormat and srcType can be GL_NONE.
195 * Called by glTexImage(), etc.
196 */
197 gl_format (*ChooseTextureFormat)( struct gl_context *ctx, GLint internalFormat,
198 GLenum srcFormat, GLenum srcType );
199
200 /**
201 * Called by glTexImage1D(). Simply copy the source texture data into the
202 * destination texture memory. The gl_texture_image fields, etc. will be
203 * fully initialized.
204 * The parameters are the same as glTexImage1D(), plus:
205 * \param packing describes how to unpack the source data.
206 * \param texObj is the target texture object.
207 * \param texImage is the target texture image.
208 */
209 void (*TexImage1D)( struct gl_context *ctx, GLenum target, GLint level,
210 GLint internalFormat,
211 GLint width, GLint border,
212 GLenum format, GLenum type, const GLvoid *pixels,
213 const struct gl_pixelstore_attrib *packing,
214 struct gl_texture_object *texObj,
215 struct gl_texture_image *texImage );
216
217 /**
218 * Called by glTexImage2D().
219 *
220 * \sa dd_function_table::TexImage1D.
221 */
222 void (*TexImage2D)( struct gl_context *ctx, GLenum target, GLint level,
223 GLint internalFormat,
224 GLint width, GLint height, GLint border,
225 GLenum format, GLenum type, const GLvoid *pixels,
226 const struct gl_pixelstore_attrib *packing,
227 struct gl_texture_object *texObj,
228 struct gl_texture_image *texImage );
229
230 /**
231 * Called by glTexImage3D().
232 *
233 * \sa dd_function_table::TexImage1D.
234 */
235 void (*TexImage3D)( struct gl_context *ctx, GLenum target, GLint level,
236 GLint internalFormat,
237 GLint width, GLint height, GLint depth, GLint border,
238 GLenum format, GLenum type, const GLvoid *pixels,
239 const struct gl_pixelstore_attrib *packing,
240 struct gl_texture_object *texObj,
241 struct gl_texture_image *texImage );
242
243 /**
244 * Called by glTexSubImage1D(). Replace a subset of the target texture
245 * with new texel data.
246 * \sa dd_function_table::TexImage1D.
247 */
248 void (*TexSubImage1D)( struct gl_context *ctx, GLenum target, GLint level,
249 GLint xoffset, GLsizei width,
250 GLenum format, GLenum type,
251 const GLvoid *pixels,
252 const struct gl_pixelstore_attrib *packing,
253 struct gl_texture_object *texObj,
254 struct gl_texture_image *texImage );
255
256 /**
257 * Called by glTexSubImage2D().
258 *
259 * \sa dd_function_table::TexSubImage1D.
260 */
261 void (*TexSubImage2D)( struct gl_context *ctx, GLenum target, GLint level,
262 GLint xoffset, GLint yoffset,
263 GLsizei width, GLsizei height,
264 GLenum format, GLenum type,
265 const GLvoid *pixels,
266 const struct gl_pixelstore_attrib *packing,
267 struct gl_texture_object *texObj,
268 struct gl_texture_image *texImage );
269
270 /**
271 * Called by glTexSubImage3D().
272 *
273 * \sa dd_function_table::TexSubImage1D.
274 */
275 void (*TexSubImage3D)( struct gl_context *ctx, GLenum target, GLint level,
276 GLint xoffset, GLint yoffset, GLint zoffset,
277 GLsizei width, GLsizei height, GLint depth,
278 GLenum format, GLenum type,
279 const GLvoid *pixels,
280 const struct gl_pixelstore_attrib *packing,
281 struct gl_texture_object *texObj,
282 struct gl_texture_image *texImage );
283
284 /**
285 * Called by glGetTexImage().
286 */
287 void (*GetTexImage)( struct gl_context *ctx,
288 GLenum format, GLenum type, GLvoid *pixels,
289 struct gl_texture_image *texImage );
290
291 /**
292 * Called by glCopyTexSubImage1D().
293 *
294 * Drivers should use a fallback routine from texstore.c if needed.
295 */
296 void (*CopyTexSubImage1D)( struct gl_context *ctx, GLenum target, GLint level,
297 GLint xoffset,
298 GLint x, GLint y, GLsizei width );
299 /**
300 * Called by glCopyTexSubImage2D().
301 *
302 * Drivers should use a fallback routine from texstore.c if needed.
303 */
304 void (*CopyTexSubImage2D)( struct gl_context *ctx, GLenum target, GLint level,
305 GLint xoffset, GLint yoffset,
306 GLint x, GLint y,
307 GLsizei width, GLsizei height );
308 /**
309 * Called by glCopyTexSubImage3D().
310 *
311 * Drivers should use a fallback routine from texstore.c if needed.
312 */
313 void (*CopyTexSubImage3D)( struct gl_context *ctx, GLenum target, GLint level,
314 GLint xoffset, GLint yoffset, GLint zoffset,
315 GLint x, GLint y,
316 GLsizei width, GLsizei height );
317
318 /**
319 * Called by glGenerateMipmap() or when GL_GENERATE_MIPMAP_SGIS is enabled.
320 */
321 void (*GenerateMipmap)(struct gl_context *ctx, GLenum target,
322 struct gl_texture_object *texObj);
323
324 /**
325 * Called by glTexImage[123]D when user specifies a proxy texture
326 * target.
327 *
328 * \return GL_TRUE if the proxy test passes, or GL_FALSE if the test fails.
329 */
330 GLboolean (*TestProxyTexImage)(struct gl_context *ctx, GLenum target,
331 GLint level, GLint internalFormat,
332 GLenum format, GLenum type,
333 GLint width, GLint height,
334 GLint depth, GLint border);
335 /*@}*/
336
337
338 /**
339 * \name Compressed texture functions
340 */
341 /*@{*/
342
343 /**
344 * Called by glCompressedTexImage1D().
345 *
346 * \param target user specified.
347 * \param format user specified.
348 * \param type user specified.
349 * \param pixels user specified.
350 * \param packing indicates the image packing of pixels.
351 * \param texObj is the target texture object.
352 * \param texImage is the target texture image. It will have the texture \p
353 * width, \p height, \p depth, \p border and \p internalFormat information.
354 *
355 * \a retainInternalCopy is returned by this function and indicates whether
356 * core Mesa should keep an internal copy of the texture image.
357 */
358 void (*CompressedTexImage1D)( struct gl_context *ctx, GLenum target,
359 GLint level, GLint internalFormat,
360 GLsizei width, GLint border,
361 GLsizei imageSize, const GLvoid *data,
362 struct gl_texture_object *texObj,
363 struct gl_texture_image *texImage );
364 /**
365 * Called by glCompressedTexImage2D().
366 *
367 * \sa dd_function_table::CompressedTexImage1D.
368 */
369 void (*CompressedTexImage2D)( struct gl_context *ctx, GLenum target,
370 GLint level, GLint internalFormat,
371 GLsizei width, GLsizei height, GLint border,
372 GLsizei imageSize, const GLvoid *data,
373 struct gl_texture_object *texObj,
374 struct gl_texture_image *texImage );
375 /**
376 * Called by glCompressedTexImage3D().
377 *
378 * \sa dd_function_table::CompressedTexImage3D.
379 */
380 void (*CompressedTexImage3D)( struct gl_context *ctx, GLenum target,
381 GLint level, GLint internalFormat,
382 GLsizei width, GLsizei height, GLsizei depth,
383 GLint border,
384 GLsizei imageSize, const GLvoid *data,
385 struct gl_texture_object *texObj,
386 struct gl_texture_image *texImage );
387
388 /**
389 * Called by glCompressedTexSubImage1D().
390 *
391 * \param target user specified.
392 * \param level user specified.
393 * \param xoffset user specified.
394 * \param yoffset user specified.
395 * \param zoffset user specified.
396 * \param width user specified.
397 * \param height user specified.
398 * \param depth user specified.
399 * \param imageSize user specified.
400 * \param data user specified.
401 * \param texObj is the target texture object.
402 * \param texImage is the target texture image. It will have the texture \p
403 * width, \p height, \p depth, \p border and \p internalFormat information.
404 */
405 void (*CompressedTexSubImage1D)(struct gl_context *ctx, GLenum target, GLint level,
406 GLint xoffset, GLsizei width,
407 GLenum format,
408 GLsizei imageSize, const GLvoid *data,
409 struct gl_texture_object *texObj,
410 struct gl_texture_image *texImage);
411 /**
412 * Called by glCompressedTexSubImage2D().
413 *
414 * \sa dd_function_table::CompressedTexImage3D.
415 */
416 void (*CompressedTexSubImage2D)(struct gl_context *ctx, GLenum target, GLint level,
417 GLint xoffset, GLint yoffset,
418 GLsizei width, GLint height,
419 GLenum format,
420 GLsizei imageSize, const GLvoid *data,
421 struct gl_texture_object *texObj,
422 struct gl_texture_image *texImage);
423 /**
424 * Called by glCompressedTexSubImage3D().
425 *
426 * \sa dd_function_table::CompressedTexImage3D.
427 */
428 void (*CompressedTexSubImage3D)(struct gl_context *ctx, GLenum target, GLint level,
429 GLint xoffset, GLint yoffset, GLint zoffset,
430 GLsizei width, GLint height, GLint depth,
431 GLenum format,
432 GLsizei imageSize, const GLvoid *data,
433 struct gl_texture_object *texObj,
434 struct gl_texture_image *texImage);
435
436
437 /**
438 * Called by glGetCompressedTexImage.
439 */
440 void (*GetCompressedTexImage)(struct gl_context *ctx, GLenum target, GLint level,
441 GLvoid *img,
442 struct gl_texture_object *texObj,
443 struct gl_texture_image *texImage);
444
445 /*@}*/
446
447 /**
448 * \name Texture object functions
449 */
450 /*@{*/
451
452 /**
453 * Called by glBindTexture().
454 */
455 void (*BindTexture)( struct gl_context *ctx, GLenum target,
456 struct gl_texture_object *tObj );
457
458 /**
459 * Called to allocate a new texture object.
460 * A new gl_texture_object should be returned. The driver should
461 * attach to it any device-specific info it needs.
462 */
463 struct gl_texture_object * (*NewTextureObject)( struct gl_context *ctx, GLuint name,
464 GLenum target );
465 /**
466 * Called when a texture object is about to be deallocated.
467 *
468 * Driver should delete the gl_texture_object object and anything
469 * hanging off of it.
470 */
471 void (*DeleteTexture)( struct gl_context *ctx, struct gl_texture_object *tObj );
472
473 /**
474 * Called to allocate a new texture image object.
475 */
476 struct gl_texture_image * (*NewTextureImage)( struct gl_context *ctx );
477
478 /** Called to free a texture image object returned by NewTextureImage() */
479 void (*DeleteTextureImage)(struct gl_context *ctx,
480 struct gl_texture_image *);
481
482 /** Called to allocate memory for a single texture image */
483 GLboolean (*AllocTextureImageBuffer)(struct gl_context *ctx,
484 struct gl_texture_image *texImage,
485 gl_format format, GLsizei width,
486 GLsizei height, GLsizei depth);
487
488 /**
489 * Called to free tImage->Data.
490 */
491 void (*FreeTextureImageBuffer)( struct gl_context *ctx, struct gl_texture_image *tImage );
492
493 /** Map a slice of a texture image into user space.
494 * \param texImage the texture image
495 * \param slice the 3D image slice or array texture slice
496 * \param x, y, w, h region of interest
497 * \param mode bitmask of GL_MAP_READ_BIT, GL_MAP_WRITE_BIT
498 * \param mapOut returns start of mapping of region of interest
499 * \param rowStrideOut returns row stride (in bytes)
500 */
501 void (*MapTextureImage)(struct gl_context *ctx,
502 struct gl_texture_image *texImage,
503 GLuint slice,
504 GLuint x, GLuint y, GLuint w, GLuint h,
505 GLbitfield mode,
506 GLubyte **mapOut, GLint *rowStrideOut);
507
508 void (*UnmapTextureImage)(struct gl_context *ctx,
509 struct gl_texture_image *texImage,
510 GLuint slice);
511
512 /** Map texture image data into user space */
513 void (*MapTexture)( struct gl_context *ctx, struct gl_texture_object *tObj );
514 /** Unmap texture images from user space */
515 void (*UnmapTexture)( struct gl_context *ctx, struct gl_texture_object *tObj );
516
517 /** For GL_ARB_texture_storage. Allocate memory for whole mipmap stack.
518 * All the gl_texture_images in the texture object will have their
519 * dimensions, format, etc. initialized already.
520 */
521 GLboolean (*AllocTextureStorage)(struct gl_context *ctx,
522 struct gl_texture_object *texObj,
523 GLsizei levels, GLsizei width,
524 GLsizei height, GLsizei depth);
525
526 void (*MapRenderbuffer)(struct gl_context *ctx,
527 struct gl_renderbuffer *rb,
528 GLuint x, GLuint y, GLuint w, GLuint h,
529 GLbitfield mode,
530 GLubyte **mapOut, GLint *rowStrideOut);
531
532 void (*UnmapRenderbuffer)(struct gl_context *ctx,
533 struct gl_renderbuffer *rb);
534
535 /**
536 * Note: no context argument. This function doesn't initially look
537 * like it belongs here, except that the driver is the only entity
538 * that knows for sure how the texture memory is allocated - via
539 * the above callbacks. There is then an argument that the driver
540 * knows what memcpy paths might be fast. Typically this is invoked with
541 *
542 * to -- a pointer into texture memory allocated by NewTextureImage() above.
543 * from -- a pointer into client memory or a mesa temporary.
544 * sz -- nr bytes to copy.
545 */
546 void* (*TextureMemCpy)( void *to, const void *from, size_t sz );
547
548 /**
549 * Called by glAreTextureResident().
550 */
551 GLboolean (*IsTextureResident)( struct gl_context *ctx,
552 struct gl_texture_object *t );
553 /*@}*/
554
555
556 /**
557 * \name Vertex/fragment program functions
558 */
559 /*@{*/
560 /** Bind a vertex/fragment program */
561 void (*BindProgram)(struct gl_context *ctx, GLenum target, struct gl_program *prog);
562 /** Allocate a new program */
563 struct gl_program * (*NewProgram)(struct gl_context *ctx, GLenum target, GLuint id);
564 /** Delete a program */
565 void (*DeleteProgram)(struct gl_context *ctx, struct gl_program *prog);
566 /**
567 * Notify driver that a program string (and GPU code) has been specified
568 * or modified. Return GL_TRUE or GL_FALSE to indicate if the program is
569 * supported by the driver.
570 */
571 GLboolean (*ProgramStringNotify)(struct gl_context *ctx, GLenum target,
572 struct gl_program *prog);
573
574 /** Query if program can be loaded onto hardware */
575 GLboolean (*IsProgramNative)(struct gl_context *ctx, GLenum target,
576 struct gl_program *prog);
577
578 /*@}*/
579
580 /**
581 * \name GLSL shader/program functions.
582 */
583 /*@{*/
584 /**
585 * Called when a shader program is linked.
586 *
587 * This gives drivers an opportunity to clone the IR and make their
588 * own transformations on it for the purposes of code generation.
589 */
590 GLboolean (*LinkShader)(struct gl_context *ctx, struct gl_shader_program *shader);
591 /*@}*/
592
593 /**
594 * \name State-changing functions.
595 *
596 * \note drawing functions are above.
597 *
598 * These functions are called by their corresponding OpenGL API functions.
599 * They are \e also called by the gl_PopAttrib() function!!!
600 * May add more functions like these to the device driver in the future.
601 */
602 /*@{*/
603 /** Specify the alpha test function */
604 void (*AlphaFunc)(struct gl_context *ctx, GLenum func, GLfloat ref);
605 /** Set the blend color */
606 void (*BlendColor)(struct gl_context *ctx, const GLfloat color[4]);
607 /** Set the blend equation */
608 void (*BlendEquationSeparate)(struct gl_context *ctx, GLenum modeRGB, GLenum modeA);
609 void (*BlendEquationSeparatei)(struct gl_context *ctx, GLuint buffer,
610 GLenum modeRGB, GLenum modeA);
611 /** Specify pixel arithmetic */
612 void (*BlendFuncSeparate)(struct gl_context *ctx,
613 GLenum sfactorRGB, GLenum dfactorRGB,
614 GLenum sfactorA, GLenum dfactorA);
615 void (*BlendFuncSeparatei)(struct gl_context *ctx, GLuint buffer,
616 GLenum sfactorRGB, GLenum dfactorRGB,
617 GLenum sfactorA, GLenum dfactorA);
618 /** Specify clear values for the color buffers */
619 void (*ClearColor)(struct gl_context *ctx,
620 const union gl_color_union color);
621 /** Specify the clear value for the depth buffer */
622 void (*ClearDepth)(struct gl_context *ctx, GLclampd d);
623 /** Specify the clear value for the stencil buffer */
624 void (*ClearStencil)(struct gl_context *ctx, GLint s);
625 /** Specify a plane against which all geometry is clipped */
626 void (*ClipPlane)(struct gl_context *ctx, GLenum plane, const GLfloat *equation );
627 /** Enable and disable writing of frame buffer color components */
628 void (*ColorMask)(struct gl_context *ctx, GLboolean rmask, GLboolean gmask,
629 GLboolean bmask, GLboolean amask );
630 void (*ColorMaskIndexed)(struct gl_context *ctx, GLuint buf, GLboolean rmask,
631 GLboolean gmask, GLboolean bmask, GLboolean amask);
632 /** Cause a material color to track the current color */
633 void (*ColorMaterial)(struct gl_context *ctx, GLenum face, GLenum mode);
634 /** Specify whether front- or back-facing facets can be culled */
635 void (*CullFace)(struct gl_context *ctx, GLenum mode);
636 /** Define front- and back-facing polygons */
637 void (*FrontFace)(struct gl_context *ctx, GLenum mode);
638 /** Specify the value used for depth buffer comparisons */
639 void (*DepthFunc)(struct gl_context *ctx, GLenum func);
640 /** Enable or disable writing into the depth buffer */
641 void (*DepthMask)(struct gl_context *ctx, GLboolean flag);
642 /** Specify mapping of depth values from NDC to window coordinates */
643 void (*DepthRange)(struct gl_context *ctx, GLclampd nearval, GLclampd farval);
644 /** Specify the current buffer for writing */
645 void (*DrawBuffer)( struct gl_context *ctx, GLenum buffer );
646 /** Specify the buffers for writing for fragment programs*/
647 void (*DrawBuffers)( struct gl_context *ctx, GLsizei n, const GLenum *buffers );
648 /** Enable or disable server-side gl capabilities */
649 void (*Enable)(struct gl_context *ctx, GLenum cap, GLboolean state);
650 /** Specify fog parameters */
651 void (*Fogfv)(struct gl_context *ctx, GLenum pname, const GLfloat *params);
652 /** Specify implementation-specific hints */
653 void (*Hint)(struct gl_context *ctx, GLenum target, GLenum mode);
654 /** Set light source parameters.
655 * Note: for GL_POSITION and GL_SPOT_DIRECTION, params will have already
656 * been transformed to eye-space.
657 */
658 void (*Lightfv)(struct gl_context *ctx, GLenum light,
659 GLenum pname, const GLfloat *params );
660 /** Set the lighting model parameters */
661 void (*LightModelfv)(struct gl_context *ctx, GLenum pname, const GLfloat *params);
662 /** Specify the line stipple pattern */
663 void (*LineStipple)(struct gl_context *ctx, GLint factor, GLushort pattern );
664 /** Specify the width of rasterized lines */
665 void (*LineWidth)(struct gl_context *ctx, GLfloat width);
666 /** Specify a logical pixel operation for color index rendering */
667 void (*LogicOpcode)(struct gl_context *ctx, GLenum opcode);
668 void (*PointParameterfv)(struct gl_context *ctx, GLenum pname,
669 const GLfloat *params);
670 /** Specify the diameter of rasterized points */
671 void (*PointSize)(struct gl_context *ctx, GLfloat size);
672 /** Select a polygon rasterization mode */
673 void (*PolygonMode)(struct gl_context *ctx, GLenum face, GLenum mode);
674 /** Set the scale and units used to calculate depth values */
675 void (*PolygonOffset)(struct gl_context *ctx, GLfloat factor, GLfloat units);
676 /** Set the polygon stippling pattern */
677 void (*PolygonStipple)(struct gl_context *ctx, const GLubyte *mask );
678 /* Specifies the current buffer for reading */
679 void (*ReadBuffer)( struct gl_context *ctx, GLenum buffer );
680 /** Set rasterization mode */
681 void (*RenderMode)(struct gl_context *ctx, GLenum mode );
682 /** Define the scissor box */
683 void (*Scissor)(struct gl_context *ctx, GLint x, GLint y, GLsizei w, GLsizei h);
684 /** Select flat or smooth shading */
685 void (*ShadeModel)(struct gl_context *ctx, GLenum mode);
686 /** OpenGL 2.0 two-sided StencilFunc */
687 void (*StencilFuncSeparate)(struct gl_context *ctx, GLenum face, GLenum func,
688 GLint ref, GLuint mask);
689 /** OpenGL 2.0 two-sided StencilMask */
690 void (*StencilMaskSeparate)(struct gl_context *ctx, GLenum face, GLuint mask);
691 /** OpenGL 2.0 two-sided StencilOp */
692 void (*StencilOpSeparate)(struct gl_context *ctx, GLenum face, GLenum fail,
693 GLenum zfail, GLenum zpass);
694 /** Control the generation of texture coordinates */
695 void (*TexGen)(struct gl_context *ctx, GLenum coord, GLenum pname,
696 const GLfloat *params);
697 /** Set texture environment parameters */
698 void (*TexEnv)(struct gl_context *ctx, GLenum target, GLenum pname,
699 const GLfloat *param);
700 /** Set texture parameters */
701 void (*TexParameter)(struct gl_context *ctx, GLenum target,
702 struct gl_texture_object *texObj,
703 GLenum pname, const GLfloat *params);
704 /** Set the viewport */
705 void (*Viewport)(struct gl_context *ctx, GLint x, GLint y, GLsizei w, GLsizei h);
706 /*@}*/
707
708
709 /**
710 * \name Vertex/pixel buffer object functions
711 */
712 /*@{*/
713 void (*BindBuffer)( struct gl_context *ctx, GLenum target,
714 struct gl_buffer_object *obj );
715
716 struct gl_buffer_object * (*NewBufferObject)( struct gl_context *ctx, GLuint buffer,
717 GLenum target );
718
719 void (*DeleteBuffer)( struct gl_context *ctx, struct gl_buffer_object *obj );
720
721 GLboolean (*BufferData)( struct gl_context *ctx, GLenum target, GLsizeiptrARB size,
722 const GLvoid *data, GLenum usage,
723 struct gl_buffer_object *obj );
724
725 void (*BufferSubData)( struct gl_context *ctx, GLintptrARB offset,
726 GLsizeiptrARB size, const GLvoid *data,
727 struct gl_buffer_object *obj );
728
729 void (*GetBufferSubData)( struct gl_context *ctx,
730 GLintptrARB offset, GLsizeiptrARB size,
731 GLvoid *data, struct gl_buffer_object *obj );
732
733 void (*CopyBufferSubData)( struct gl_context *ctx,
734 struct gl_buffer_object *src,
735 struct gl_buffer_object *dst,
736 GLintptr readOffset, GLintptr writeOffset,
737 GLsizeiptr size );
738
739 /* May return NULL if MESA_MAP_NOWAIT_BIT is set in access:
740 */
741 void * (*MapBufferRange)( struct gl_context *ctx, GLintptr offset,
742 GLsizeiptr length, GLbitfield access,
743 struct gl_buffer_object *obj);
744
745 void (*FlushMappedBufferRange)(struct gl_context *ctx,
746 GLintptr offset, GLsizeiptr length,
747 struct gl_buffer_object *obj);
748
749 GLboolean (*UnmapBuffer)( struct gl_context *ctx,
750 struct gl_buffer_object *obj );
751 /*@}*/
752
753 /**
754 * \name Functions for GL_APPLE_object_purgeable
755 */
756 /*@{*/
757 /* variations on ObjectPurgeable */
758 GLenum (*BufferObjectPurgeable)( struct gl_context *ctx, struct gl_buffer_object *obj, GLenum option );
759 GLenum (*RenderObjectPurgeable)( struct gl_context *ctx, struct gl_renderbuffer *obj, GLenum option );
760 GLenum (*TextureObjectPurgeable)( struct gl_context *ctx, struct gl_texture_object *obj, GLenum option );
761
762 /* variations on ObjectUnpurgeable */
763 GLenum (*BufferObjectUnpurgeable)( struct gl_context *ctx, struct gl_buffer_object *obj, GLenum option );
764 GLenum (*RenderObjectUnpurgeable)( struct gl_context *ctx, struct gl_renderbuffer *obj, GLenum option );
765 GLenum (*TextureObjectUnpurgeable)( struct gl_context *ctx, struct gl_texture_object *obj, GLenum option );
766 /*@}*/
767
768 /**
769 * \name Functions for GL_EXT_framebuffer_{object,blit}.
770 */
771 /*@{*/
772 struct gl_framebuffer * (*NewFramebuffer)(struct gl_context *ctx, GLuint name);
773 struct gl_renderbuffer * (*NewRenderbuffer)(struct gl_context *ctx, GLuint name);
774 void (*BindFramebuffer)(struct gl_context *ctx, GLenum target,
775 struct gl_framebuffer *drawFb,
776 struct gl_framebuffer *readFb);
777 void (*FramebufferRenderbuffer)(struct gl_context *ctx,
778 struct gl_framebuffer *fb,
779 GLenum attachment,
780 struct gl_renderbuffer *rb);
781 void (*RenderTexture)(struct gl_context *ctx,
782 struct gl_framebuffer *fb,
783 struct gl_renderbuffer_attachment *att);
784 void (*FinishRenderTexture)(struct gl_context *ctx,
785 struct gl_renderbuffer_attachment *att);
786 void (*ValidateFramebuffer)(struct gl_context *ctx,
787 struct gl_framebuffer *fb);
788 /*@}*/
789 void (*BlitFramebuffer)(struct gl_context *ctx,
790 GLint srcX0, GLint srcY0, GLint srcX1, GLint srcY1,
791 GLint dstX0, GLint dstY0, GLint dstX1, GLint dstY1,
792 GLbitfield mask, GLenum filter);
793
794 /**
795 * \name Query objects
796 */
797 /*@{*/
798 struct gl_query_object * (*NewQueryObject)(struct gl_context *ctx, GLuint id);
799 void (*DeleteQuery)(struct gl_context *ctx, struct gl_query_object *q);
800 void (*BeginQuery)(struct gl_context *ctx, struct gl_query_object *q);
801 void (*EndQuery)(struct gl_context *ctx, struct gl_query_object *q);
802 void (*CheckQuery)(struct gl_context *ctx, struct gl_query_object *q);
803 void (*WaitQuery)(struct gl_context *ctx, struct gl_query_object *q);
804 /*@}*/
805
806
807 /**
808 * \name Vertex Array objects
809 */
810 /*@{*/
811 struct gl_array_object * (*NewArrayObject)(struct gl_context *ctx, GLuint id);
812 void (*DeleteArrayObject)(struct gl_context *ctx, struct gl_array_object *obj);
813 void (*BindArrayObject)(struct gl_context *ctx, struct gl_array_object *obj);
814 /*@}*/
815
816 /**
817 * \name GLSL-related functions (ARB extensions and OpenGL 2.x)
818 */
819 /*@{*/
820 struct gl_shader *(*NewShader)(struct gl_context *ctx, GLuint name, GLenum type);
821 void (*DeleteShader)(struct gl_context *ctx, struct gl_shader *shader);
822 struct gl_shader_program *(*NewShaderProgram)(struct gl_context *ctx, GLuint name);
823 void (*DeleteShaderProgram)(struct gl_context *ctx,
824 struct gl_shader_program *shProg);
825 void (*UseProgram)(struct gl_context *ctx, struct gl_shader_program *shProg);
826 /*@}*/
827
828
829 /**
830 * \name Support for multiple T&L engines
831 */
832 /*@{*/
833
834 /**
835 * Set by the driver-supplied T&L engine.
836 *
837 * Set to PRIM_OUTSIDE_BEGIN_END when outside glBegin()/glEnd().
838 */
839 GLuint CurrentExecPrimitive;
840
841 /**
842 * Current state of an in-progress compilation.
843 *
844 * May take on any of the additional values PRIM_OUTSIDE_BEGIN_END,
845 * PRIM_INSIDE_UNKNOWN_PRIM or PRIM_UNKNOWN defined above.
846 */
847 GLuint CurrentSavePrimitive;
848
849
850 #define FLUSH_STORED_VERTICES 0x1
851 #define FLUSH_UPDATE_CURRENT 0x2
852 /**
853 * Set by the driver-supplied T&L engine whenever vertices are buffered
854 * between glBegin()/glEnd() objects or __struct gl_contextRec::Current is not
855 * updated.
856 *
857 * The dd_function_table::FlushVertices call below may be used to resolve
858 * these conditions.
859 */
860 GLuint NeedFlush;
861 GLuint SaveNeedFlush;
862
863
864 /* Called prior to any of the GLvertexformat functions being
865 * called. Paired with Driver.FlushVertices().
866 */
867 void (*BeginVertices)( struct gl_context *ctx );
868
869 /**
870 * If inside glBegin()/glEnd(), it should ASSERT(0). Otherwise, if
871 * FLUSH_STORED_VERTICES bit in \p flags is set flushes any buffered
872 * vertices, if FLUSH_UPDATE_CURRENT bit is set updates
873 * __struct gl_contextRec::Current and gl_light_attrib::Material
874 *
875 * Note that the default T&L engine never clears the
876 * FLUSH_UPDATE_CURRENT bit, even after performing the update.
877 */
878 void (*FlushVertices)( struct gl_context *ctx, GLuint flags );
879 void (*SaveFlushVertices)( struct gl_context *ctx );
880
881 /**
882 * \brief Hook for drivers to prepare for a glBegin/glEnd block
883 *
884 * This hook is called in vbo_exec_Begin() before any action, including
885 * state updates, occurs.
886 */
887 void (*PrepareExecBegin)( struct gl_context *ctx );
888
889 /**
890 * Give the driver the opportunity to hook in its own vtxfmt for
891 * compiling optimized display lists. This is called on each valid
892 * glBegin() during list compilation.
893 */
894 GLboolean (*NotifySaveBegin)( struct gl_context *ctx, GLenum mode );
895
896 /**
897 * Notify driver that the special derived value _NeedEyeCoords has
898 * changed.
899 */
900 void (*LightingSpaceChange)( struct gl_context *ctx );
901
902 /**
903 * Called by glNewList().
904 *
905 * Let the T&L component know what is going on with display lists
906 * in time to make changes to dispatch tables, etc.
907 */
908 void (*NewList)( struct gl_context *ctx, GLuint list, GLenum mode );
909 /**
910 * Called by glEndList().
911 *
912 * \sa dd_function_table::NewList.
913 */
914 void (*EndList)( struct gl_context *ctx );
915
916 /**
917 * Called by glCallList(s).
918 *
919 * Notify the T&L component before and after calling a display list.
920 */
921 void (*BeginCallList)( struct gl_context *ctx,
922 struct gl_display_list *dlist );
923 /**
924 * Called by glEndCallList().
925 *
926 * \sa dd_function_table::BeginCallList.
927 */
928 void (*EndCallList)( struct gl_context *ctx );
929
930 /**@}*/
931
932 /**
933 * \name GL_ARB_sync interfaces
934 */
935 /*@{*/
936 struct gl_sync_object * (*NewSyncObject)(struct gl_context *, GLenum);
937 void (*FenceSync)(struct gl_context *, struct gl_sync_object *, GLenum, GLbitfield);
938 void (*DeleteSyncObject)(struct gl_context *, struct gl_sync_object *);
939 void (*CheckSync)(struct gl_context *, struct gl_sync_object *);
940 void (*ClientWaitSync)(struct gl_context *, struct gl_sync_object *,
941 GLbitfield, GLuint64);
942 void (*ServerWaitSync)(struct gl_context *, struct gl_sync_object *,
943 GLbitfield, GLuint64);
944 /*@}*/
945
946 /** GL_NV_conditional_render */
947 void (*BeginConditionalRender)(struct gl_context *ctx, struct gl_query_object *q,
948 GLenum mode);
949 void (*EndConditionalRender)(struct gl_context *ctx, struct gl_query_object *q);
950
951 /**
952 * \name GL_OES_draw_texture interface
953 */
954 /*@{*/
955 void (*DrawTex)(struct gl_context *ctx, GLfloat x, GLfloat y, GLfloat z,
956 GLfloat width, GLfloat height);
957 /*@}*/
958
959 /**
960 * \name GL_OES_EGL_image interface
961 */
962 void (*EGLImageTargetTexture2D)(struct gl_context *ctx, GLenum target,
963 struct gl_texture_object *texObj,
964 struct gl_texture_image *texImage,
965 GLeglImageOES image_handle);
966 void (*EGLImageTargetRenderbufferStorage)(struct gl_context *ctx,
967 struct gl_renderbuffer *rb,
968 void *image_handle);
969
970 /**
971 * \name GL_EXT_transform_feedback interface
972 */
973 struct gl_transform_feedback_object *
974 (*NewTransformFeedback)(struct gl_context *ctx, GLuint name);
975 void (*DeleteTransformFeedback)(struct gl_context *ctx,
976 struct gl_transform_feedback_object *obj);
977 void (*BeginTransformFeedback)(struct gl_context *ctx, GLenum mode,
978 struct gl_transform_feedback_object *obj);
979 void (*EndTransformFeedback)(struct gl_context *ctx,
980 struct gl_transform_feedback_object *obj);
981 void (*PauseTransformFeedback)(struct gl_context *ctx,
982 struct gl_transform_feedback_object *obj);
983 void (*ResumeTransformFeedback)(struct gl_context *ctx,
984 struct gl_transform_feedback_object *obj);
985 void (*DrawTransformFeedback)(struct gl_context *ctx, GLenum mode,
986 struct gl_transform_feedback_object *obj);
987
988 /**
989 * \name GL_NV_texture_barrier interface
990 */
991 void (*TextureBarrier)(struct gl_context *ctx);
992
993 /**
994 * \name GL_ARB_sampler_objects
995 */
996 struct gl_sampler_object * (*NewSamplerObject)(struct gl_context *ctx,
997 GLuint name);
998 void (*DeleteSamplerObject)(struct gl_context *ctx,
999 struct gl_sampler_object *samp);
1000 };
1001
1002
1003 /**
1004 * Transform/Clip/Lighting interface
1005 *
1006 * Drivers present a reduced set of the functions possible in
1007 * glBegin()/glEnd() objects. Core mesa provides translation stubs for the
1008 * remaining functions to map down to these entry points.
1009 *
1010 * These are the initial values to be installed into dispatch by
1011 * mesa. If the T&L driver wants to modify the dispatch table
1012 * while installed, it must do so itself. It would be possible for
1013 * the vertexformat to install its own initial values for these
1014 * functions, but this way there is an obvious list of what is
1015 * expected of the driver.
1016 *
1017 * If the driver wants to hook in entry points other than those
1018 * listed, it must restore them to their original values in
1019 * the disable() callback, below.
1020 */
1021 typedef struct {
1022 /**
1023 * \name Vertex
1024 */
1025 /*@{*/
1026 void (GLAPIENTRYP ArrayElement)( GLint );
1027 void (GLAPIENTRYP Color3f)( GLfloat, GLfloat, GLfloat );
1028 void (GLAPIENTRYP Color3fv)( const GLfloat * );
1029 void (GLAPIENTRYP Color4f)( GLfloat, GLfloat, GLfloat, GLfloat );
1030 void (GLAPIENTRYP Color4fv)( const GLfloat * );
1031 void (GLAPIENTRYP EdgeFlag)( GLboolean );
1032 void (GLAPIENTRYP EvalCoord1f)( GLfloat );
1033 void (GLAPIENTRYP EvalCoord1fv)( const GLfloat * );
1034 void (GLAPIENTRYP EvalCoord2f)( GLfloat, GLfloat );
1035 void (GLAPIENTRYP EvalCoord2fv)( const GLfloat * );
1036 void (GLAPIENTRYP EvalPoint1)( GLint );
1037 void (GLAPIENTRYP EvalPoint2)( GLint, GLint );
1038 void (GLAPIENTRYP FogCoordfEXT)( GLfloat );
1039 void (GLAPIENTRYP FogCoordfvEXT)( const GLfloat * );
1040 void (GLAPIENTRYP Indexf)( GLfloat );
1041 void (GLAPIENTRYP Indexfv)( const GLfloat * );
1042 void (GLAPIENTRYP Materialfv)( GLenum face, GLenum pname, const GLfloat * );
1043 void (GLAPIENTRYP MultiTexCoord1fARB)( GLenum, GLfloat );
1044 void (GLAPIENTRYP MultiTexCoord1fvARB)( GLenum, const GLfloat * );
1045 void (GLAPIENTRYP MultiTexCoord2fARB)( GLenum, GLfloat, GLfloat );
1046 void (GLAPIENTRYP MultiTexCoord2fvARB)( GLenum, const GLfloat * );
1047 void (GLAPIENTRYP MultiTexCoord3fARB)( GLenum, GLfloat, GLfloat, GLfloat );
1048 void (GLAPIENTRYP MultiTexCoord3fvARB)( GLenum, const GLfloat * );
1049 void (GLAPIENTRYP MultiTexCoord4fARB)( GLenum, GLfloat, GLfloat, GLfloat, GLfloat );
1050 void (GLAPIENTRYP MultiTexCoord4fvARB)( GLenum, const GLfloat * );
1051 void (GLAPIENTRYP Normal3f)( GLfloat, GLfloat, GLfloat );
1052 void (GLAPIENTRYP Normal3fv)( const GLfloat * );
1053 void (GLAPIENTRYP SecondaryColor3fEXT)( GLfloat, GLfloat, GLfloat );
1054 void (GLAPIENTRYP SecondaryColor3fvEXT)( const GLfloat * );
1055 void (GLAPIENTRYP TexCoord1f)( GLfloat );
1056 void (GLAPIENTRYP TexCoord1fv)( const GLfloat * );
1057 void (GLAPIENTRYP TexCoord2f)( GLfloat, GLfloat );
1058 void (GLAPIENTRYP TexCoord2fv)( const GLfloat * );
1059 void (GLAPIENTRYP TexCoord3f)( GLfloat, GLfloat, GLfloat );
1060 void (GLAPIENTRYP TexCoord3fv)( const GLfloat * );
1061 void (GLAPIENTRYP TexCoord4f)( GLfloat, GLfloat, GLfloat, GLfloat );
1062 void (GLAPIENTRYP TexCoord4fv)( const GLfloat * );
1063 void (GLAPIENTRYP Vertex2f)( GLfloat, GLfloat );
1064 void (GLAPIENTRYP Vertex2fv)( const GLfloat * );
1065 void (GLAPIENTRYP Vertex3f)( GLfloat, GLfloat, GLfloat );
1066 void (GLAPIENTRYP Vertex3fv)( const GLfloat * );
1067 void (GLAPIENTRYP Vertex4f)( GLfloat, GLfloat, GLfloat, GLfloat );
1068 void (GLAPIENTRYP Vertex4fv)( const GLfloat * );
1069 void (GLAPIENTRYP CallList)( GLuint );
1070 void (GLAPIENTRYP CallLists)( GLsizei, GLenum, const GLvoid * );
1071 void (GLAPIENTRYP Begin)( GLenum );
1072 void (GLAPIENTRYP End)( void );
1073 void (GLAPIENTRYP PrimitiveRestartNV)( void );
1074 /* GL_NV_vertex_program */
1075 void (GLAPIENTRYP VertexAttrib1fNV)( GLuint index, GLfloat x );
1076 void (GLAPIENTRYP VertexAttrib1fvNV)( GLuint index, const GLfloat *v );
1077 void (GLAPIENTRYP VertexAttrib2fNV)( GLuint index, GLfloat x, GLfloat y );
1078 void (GLAPIENTRYP VertexAttrib2fvNV)( GLuint index, const GLfloat *v );
1079 void (GLAPIENTRYP VertexAttrib3fNV)( GLuint index, GLfloat x, GLfloat y, GLfloat z );
1080 void (GLAPIENTRYP VertexAttrib3fvNV)( GLuint index, const GLfloat *v );
1081 void (GLAPIENTRYP VertexAttrib4fNV)( GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w );
1082 void (GLAPIENTRYP VertexAttrib4fvNV)( GLuint index, const GLfloat *v );
1083 /* GL_ARB_vertex_program */
1084 void (GLAPIENTRYP VertexAttrib1fARB)( GLuint index, GLfloat x );
1085 void (GLAPIENTRYP VertexAttrib1fvARB)( GLuint index, const GLfloat *v );
1086 void (GLAPIENTRYP VertexAttrib2fARB)( GLuint index, GLfloat x, GLfloat y );
1087 void (GLAPIENTRYP VertexAttrib2fvARB)( GLuint index, const GLfloat *v );
1088 void (GLAPIENTRYP VertexAttrib3fARB)( GLuint index, GLfloat x, GLfloat y, GLfloat z );
1089 void (GLAPIENTRYP VertexAttrib3fvARB)( GLuint index, const GLfloat *v );
1090 void (GLAPIENTRYP VertexAttrib4fARB)( GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w );
1091 void (GLAPIENTRYP VertexAttrib4fvARB)( GLuint index, const GLfloat *v );
1092
1093 /* GL_EXT_gpu_shader4 / GL 3.0 */
1094 void (GLAPIENTRYP VertexAttribI1i)( GLuint index, GLint x);
1095 void (GLAPIENTRYP VertexAttribI2i)( GLuint index, GLint x, GLint y);
1096 void (GLAPIENTRYP VertexAttribI3i)( GLuint index, GLint x, GLint y, GLint z);
1097 void (GLAPIENTRYP VertexAttribI4i)( GLuint index, GLint x, GLint y, GLint z, GLint w);
1098 void (GLAPIENTRYP VertexAttribI2iv)( GLuint index, const GLint *v);
1099 void (GLAPIENTRYP VertexAttribI3iv)( GLuint index, const GLint *v);
1100 void (GLAPIENTRYP VertexAttribI4iv)( GLuint index, const GLint *v);
1101
1102 void (GLAPIENTRYP VertexAttribI1ui)( GLuint index, GLuint x);
1103 void (GLAPIENTRYP VertexAttribI2ui)( GLuint index, GLuint x, GLuint y);
1104 void (GLAPIENTRYP VertexAttribI3ui)( GLuint index, GLuint x, GLuint y, GLuint z);
1105 void (GLAPIENTRYP VertexAttribI4ui)( GLuint index, GLuint x, GLuint y, GLuint z, GLuint w);
1106 void (GLAPIENTRYP VertexAttribI2uiv)( GLuint index, const GLuint *v);
1107 void (GLAPIENTRYP VertexAttribI3uiv)( GLuint index, const GLuint *v);
1108 void (GLAPIENTRYP VertexAttribI4uiv)( GLuint index, const GLuint *v);
1109
1110 /* GL_ARB_vertex_type_10_10_10_2_rev / GL3.3 */
1111 void (GLAPIENTRYP VertexP2ui)( GLenum type, GLuint value );
1112 void (GLAPIENTRYP VertexP2uiv)( GLenum type, const GLuint *value);
1113
1114 void (GLAPIENTRYP VertexP3ui)( GLenum type, GLuint value );
1115 void (GLAPIENTRYP VertexP3uiv)( GLenum type, const GLuint *value);
1116
1117 void (GLAPIENTRYP VertexP4ui)( GLenum type, GLuint value );
1118 void (GLAPIENTRYP VertexP4uiv)( GLenum type, const GLuint *value);
1119
1120 void (GLAPIENTRYP TexCoordP1ui)( GLenum type, GLuint coords );
1121 void (GLAPIENTRYP TexCoordP1uiv)( GLenum type, const GLuint *coords );
1122
1123 void (GLAPIENTRYP TexCoordP2ui)( GLenum type, GLuint coords );
1124 void (GLAPIENTRYP TexCoordP2uiv)( GLenum type, const GLuint *coords );
1125
1126 void (GLAPIENTRYP TexCoordP3ui)( GLenum type, GLuint coords );
1127 void (GLAPIENTRYP TexCoordP3uiv)( GLenum type, const GLuint *coords );
1128
1129 void (GLAPIENTRYP TexCoordP4ui)( GLenum type, GLuint coords );
1130 void (GLAPIENTRYP TexCoordP4uiv)( GLenum type, const GLuint *coords );
1131
1132 void (GLAPIENTRYP MultiTexCoordP1ui)( GLenum texture, GLenum type, GLuint coords );
1133 void (GLAPIENTRYP MultiTexCoordP1uiv)( GLenum texture, GLenum type, const GLuint *coords );
1134 void (GLAPIENTRYP MultiTexCoordP2ui)( GLenum texture, GLenum type, GLuint coords );
1135 void (GLAPIENTRYP MultiTexCoordP2uiv)( GLenum texture, GLenum type, const GLuint *coords );
1136 void (GLAPIENTRYP MultiTexCoordP3ui)( GLenum texture, GLenum type, GLuint coords );
1137 void (GLAPIENTRYP MultiTexCoordP3uiv)( GLenum texture, GLenum type, const GLuint *coords );
1138 void (GLAPIENTRYP MultiTexCoordP4ui)( GLenum texture, GLenum type, GLuint coords );
1139 void (GLAPIENTRYP MultiTexCoordP4uiv)( GLenum texture, GLenum type, const GLuint *coords );
1140
1141 void (GLAPIENTRYP NormalP3ui)( GLenum type, GLuint coords );
1142 void (GLAPIENTRYP NormalP3uiv)( GLenum type, const GLuint *coords );
1143
1144 void (GLAPIENTRYP ColorP3ui)( GLenum type, GLuint color );
1145 void (GLAPIENTRYP ColorP3uiv)( GLenum type, const GLuint *color );
1146
1147 void (GLAPIENTRYP ColorP4ui)( GLenum type, GLuint color );
1148 void (GLAPIENTRYP ColorP4uiv)( GLenum type, const GLuint *color );
1149
1150 void (GLAPIENTRYP SecondaryColorP3ui)( GLenum type, GLuint color );
1151 void (GLAPIENTRYP SecondaryColorP3uiv)( GLenum type, const GLuint *color );
1152
1153 void (GLAPIENTRYP VertexAttribP1ui)( GLuint index, GLenum type,
1154 GLboolean normalized, GLuint value);
1155 void (GLAPIENTRYP VertexAttribP2ui)( GLuint index, GLenum type,
1156 GLboolean normalized, GLuint value);
1157 void (GLAPIENTRYP VertexAttribP3ui)( GLuint index, GLenum type,
1158 GLboolean normalized, GLuint value);
1159 void (GLAPIENTRYP VertexAttribP4ui)( GLuint index, GLenum type,
1160 GLboolean normalized, GLuint value);
1161 void (GLAPIENTRYP VertexAttribP1uiv)( GLuint index, GLenum type,
1162 GLboolean normalized,
1163 const GLuint *value);
1164 void (GLAPIENTRYP VertexAttribP2uiv)( GLuint index, GLenum type,
1165 GLboolean normalized,
1166 const GLuint *value);
1167 void (GLAPIENTRYP VertexAttribP3uiv)( GLuint index, GLenum type,
1168 GLboolean normalized,
1169 const GLuint *value);
1170 void (GLAPIENTRYP VertexAttribP4uiv)( GLuint index, GLenum type,
1171 GLboolean normalized,
1172 const GLuint *value);
1173
1174 /*@}*/
1175
1176 void (GLAPIENTRYP Rectf)( GLfloat, GLfloat, GLfloat, GLfloat );
1177
1178 /**
1179 * \name Array
1180 */
1181 /*@{*/
1182 void (GLAPIENTRYP DrawArrays)( GLenum mode, GLint start, GLsizei count );
1183 void (GLAPIENTRYP DrawElements)( GLenum mode, GLsizei count, GLenum type,
1184 const GLvoid *indices );
1185 void (GLAPIENTRYP DrawRangeElements)( GLenum mode, GLuint start,
1186 GLuint end, GLsizei count,
1187 GLenum type, const GLvoid *indices );
1188 void (GLAPIENTRYP MultiDrawElementsEXT)( GLenum mode, const GLsizei *count,
1189 GLenum type,
1190 const GLvoid **indices,
1191 GLsizei primcount);
1192 void (GLAPIENTRYP DrawElementsBaseVertex)( GLenum mode, GLsizei count,
1193 GLenum type,
1194 const GLvoid *indices,
1195 GLint basevertex );
1196 void (GLAPIENTRYP DrawRangeElementsBaseVertex)( GLenum mode, GLuint start,
1197 GLuint end, GLsizei count,
1198 GLenum type,
1199 const GLvoid *indices,
1200 GLint basevertex);
1201 void (GLAPIENTRYP MultiDrawElementsBaseVertex)( GLenum mode,
1202 const GLsizei *count,
1203 GLenum type,
1204 const GLvoid **indices,
1205 GLsizei primcount,
1206 const GLint *basevertex);
1207 void (GLAPIENTRYP DrawArraysInstanced)(GLenum mode, GLint first,
1208 GLsizei count, GLsizei primcount);
1209 void (GLAPIENTRYP DrawElementsInstanced)(GLenum mode, GLsizei count,
1210 GLenum type, const GLvoid *indices,
1211 GLsizei primcount);
1212 void (GLAPIENTRYP DrawElementsInstancedBaseVertex)(GLenum mode, GLsizei count,
1213 GLenum type, const GLvoid *indices,
1214 GLsizei primcount, GLint basevertex);
1215 /*@}*/
1216
1217 /**
1218 * \name Eval
1219 *
1220 * If you don't support eval, fallback to the default vertex format
1221 * on receiving an eval call and use the pipeline mechanism to
1222 * provide partial T&L acceleration.
1223 *
1224 * Mesa will provide a set of helper functions to do eval within
1225 * accelerated vertex formats, eventually...
1226 */
1227 /*@{*/
1228 void (GLAPIENTRYP EvalMesh1)( GLenum mode, GLint i1, GLint i2 );
1229 void (GLAPIENTRYP EvalMesh2)( GLenum mode, GLint i1, GLint i2, GLint j1, GLint j2 );
1230 /*@}*/
1231
1232 } GLvertexformat;
1233
1234
1235 #endif /* DD_INCLUDED */