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