1 /** 2 * \file dd.h 3 * Device driver interfaces. 4 */ 5 6 /* 7 * Mesa 3-D graphics library 8 * 9 * Copyright (C) 1999-2006 Brian Paul All Rights Reserved. 10 * 11 * Permission is hereby granted, free of charge, to any person obtaining a 12 * copy of this software and associated documentation files (the "Software"), 13 * to deal in the Software without restriction, including without limitation 14 * the rights to use, copy, modify, merge, publish, distribute, sublicense, 15 * and/or sell copies of the Software, and to permit persons to whom the 16 * Software is furnished to do so, subject to the following conditions: 17 * 18 * The above copyright notice and this permission notice shall be included 19 * in all copies or substantial portions of the Software. 20 * 21 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS 22 * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 23 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL 24 * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR 25 * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, 26 * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR 27 * OTHER DEALINGS IN THE SOFTWARE. 28 */ 29 30 31 #ifndef DD_INCLUDED 32 #define DD_INCLUDED 33 34 #include "glheader.h" 35 #include "formats.h" 36 #include "menums.h" 37 #include "compiler/shader_enums.h" 38 39 /* Windows winnt.h defines MemoryBarrier as a macro on some platforms, 40 * including as a function-like macro in some cases. That either causes 41 * the table entry below to have a weird name, or fail to compile. 42 */ 43 #ifdef MemoryBarrier 44 #undef MemoryBarrier 45 #endif 46 47 struct gl_bitmap_atlas; 48 struct gl_buffer_object; 49 struct gl_context; 50 struct gl_display_list; 51 struct gl_framebuffer; 52 struct gl_image_unit; 53 struct gl_pixelstore_attrib; 54 struct gl_program; 55 struct gl_renderbuffer; 56 struct gl_renderbuffer_attachment; 57 struct gl_shader; 58 struct gl_shader_program; 59 struct gl_texture_image; 60 struct gl_texture_object; 61 struct gl_memory_info; 62 struct gl_transform_feedback_object; 63 struct gl_vertex_array_object; 64 struct ati_fragment_shader; 65 struct util_queue_monitoring; 66 struct _mesa_prim; 67 struct _mesa_index_buffer; 68 struct pipe_draw_info; 69 struct pipe_draw_start_count_bias; 70 struct pipe_vertex_state; 71 struct pipe_draw_vertex_state_info; 72 struct pipe_vertex_buffer; 73 struct pipe_vertex_element; 74 75 /* GL_ARB_vertex_buffer_object */ 76 /* Modifies GL_MAP_UNSYNCHRONIZED_BIT to allow driver to fail (return 77 * NULL) if buffer is unavailable for immediate mapping. 78 * 79 * Does GL_MAP_INVALIDATE_RANGE_BIT do this? It seems so, but it 80 * would require more book-keeping in the driver than seems necessary 81 * at this point. 82 * 83 * Does GL_MAP_INVALDIATE_BUFFER_BIT do this? Not really -- we don't 84 * want to provoke the driver to throw away the old storage, we will 85 * respect the contents of already referenced data. 86 */ 87 #define MESA_MAP_NOWAIT_BIT 0x4000 88 89 /* Mapping a buffer is allowed from any thread. */ 90 #define MESA_MAP_THREAD_SAFE_BIT 0x8000 91 92 /* This buffer will only be mapped/unmapped once */ 93 #define MESA_MAP_ONCE 0x10000 94 95 96 /** 97 * Device driver function table. 98 * Core Mesa uses these function pointers to call into device drivers. 99 * Most of these functions directly correspond to OpenGL state commands. 100 * Core Mesa will call these functions after error checking has been done 101 * so that the drivers don't have to worry about error testing. 102 * 103 * Vertex transformation/clipping/lighting is patched into the T&L module. 104 * Rasterization functions are patched into the swrast module. 105 * 106 * Note: when new functions are added here, the drivers/common/driverfuncs.c 107 * file should be updated too!!! 108 */ 109 struct dd_function_table { 110 /** 111 * Return a string as needed by glGetString(). 112 * Only the GL_RENDERER query must be implemented. Otherwise, NULL can be 113 * returned. 114 */ 115 const GLubyte * (*GetString)( struct gl_context *ctx, GLenum name ); 116 117 /** 118 * Notify the driver after Mesa has made some internal state changes. 119 * 120 * This is in addition to any state change callbacks Mesa may already have 121 * made. 122 */ 123 void (*UpdateState)(struct gl_context *ctx); 124 125 /** 126 * This is called whenever glFinish() is called. 127 */ 128 void (*Finish)( struct gl_context *ctx ); 129 130 /** 131 * This is called whenever glFlush() is called. 132 */ 133 void (*Flush)(struct gl_context *ctx, unsigned gallium_flush_flags); 134 135 /** 136 * Clear the color/depth/stencil/accum buffer(s). 137 * \param buffers a bitmask of BUFFER_BIT_* flags indicating which 138 * renderbuffers need to be cleared. 139 */ 140 void (*Clear)( struct gl_context *ctx, GLbitfield buffers ); 141 142 /** 143 * Execute glRasterPos, updating the ctx->Current.Raster fields 144 */ 145 void (*RasterPos)( struct gl_context *ctx, const GLfloat v[4] ); 146 147 /** 148 * \name Image-related functions 149 */ 150 /*@{*/ 151 152 /** 153 * Called by glDrawPixels(). 154 * \p unpack describes how to unpack the source image data. 155 */ 156 void (*DrawPixels)( struct gl_context *ctx, 157 GLint x, GLint y, GLsizei width, GLsizei height, 158 GLenum format, GLenum type, 159 const struct gl_pixelstore_attrib *unpack, 160 const GLvoid *pixels ); 161 162 /** 163 * Called by glReadPixels(). 164 */ 165 void (*ReadPixels)( struct gl_context *ctx, 166 GLint x, GLint y, GLsizei width, GLsizei height, 167 GLenum format, GLenum type, 168 const struct gl_pixelstore_attrib *unpack, 169 GLvoid *dest ); 170 171 /** 172 * Called by glCopyPixels(). 173 */ 174 void (*CopyPixels)( struct gl_context *ctx, GLint srcx, GLint srcy, 175 GLsizei width, GLsizei height, 176 GLint dstx, GLint dsty, GLenum type ); 177 178 /** 179 * Called by glBitmap(). 180 */ 181 void (*Bitmap)( struct gl_context *ctx, 182 GLint x, GLint y, GLsizei width, GLsizei height, 183 const struct gl_pixelstore_attrib *unpack, 184 const GLubyte *bitmap ); 185 186 /** 187 * Called by display list code for optimized glCallLists/glBitmap rendering 188 * The driver must support texture rectangles of width 1024 or more. 189 */ 190 void (*DrawAtlasBitmaps)(struct gl_context *ctx, 191 const struct gl_bitmap_atlas *atlas, 192 GLuint count, const GLubyte *ids); 193 /*@}*/ 194 195 196 /** 197 * \name Texture image functions 198 */ 199 /*@{*/ 200 201 /** 202 * Choose actual hardware texture format given the texture target, the 203 * user-provided source image format and type and the desired internal 204 * format. In some cases, srcFormat and srcType can be GL_NONE. 205 * Note: target may be GL_TEXTURE_CUBE_MAP, but never 206 * GL_TEXTURE_CUBE_MAP_[POSITIVE/NEGATIVE]_[XYZ]. 207 * Called by glTexImage(), etc. 208 */ 209 mesa_format (*ChooseTextureFormat)(struct gl_context *ctx, 210 GLenum target, GLint internalFormat, 211 GLenum srcFormat, GLenum srcType ); 212 213 /** 214 * Queries different driver parameters for a particular target and format. 215 * Since ARB_internalformat_query2 introduced several new query parameters 216 * over ARB_internalformat_query, having one driver hook for each parameter 217 * is no longer feasible. So this is the generic entry-point for calls 218 * to glGetInternalFormativ and glGetInternalFormati64v, after Mesa has 219 * checked errors and default values. 220 * 221 * \param ctx GL context 222 * \param target GL target enum 223 * \param internalFormat GL format enum 224 * \param pname GL enum that specifies the info to query. 225 * \param params Buffer to hold the result of the query. 226 */ 227 void (*QueryInternalFormat)(struct gl_context *ctx, 228 GLenum target, 229 GLenum internalFormat, 230 GLenum pname, 231 GLint *params); 232 233 /** 234 * Called by glTexImage[123]D() and glCopyTexImage[12]D() 235 * Allocate texture memory and copy the user's image to the buffer. 236 * The gl_texture_image fields, etc. will be fully initialized. 237 * The parameters are the same as glTexImage3D(), plus: 238 * \param dims 1, 2, or 3 indicating glTexImage1/2/3D() 239 * \param packing describes how to unpack the source data. 240 * \param texImage is the destination texture image. 241 */ 242 void (*TexImage)(struct gl_context *ctx, GLuint dims, 243 struct gl_texture_image *texImage, 244 GLenum format, GLenum type, const GLvoid *pixels, 245 const struct gl_pixelstore_attrib *packing); 246 247 /** 248 * Called by glTexSubImage[123]D(). 249 * Replace a subset of the target texture with new texel data. 250 */ 251 void (*TexSubImage)(struct gl_context *ctx, GLuint dims, 252 struct gl_texture_image *texImage, 253 GLint xoffset, GLint yoffset, GLint zoffset, 254 GLsizei width, GLsizei height, GLint depth, 255 GLenum format, GLenum type, 256 const GLvoid *pixels, 257 const struct gl_pixelstore_attrib *packing); 258 259 260 /** 261 * Called by glGetTexImage(), glGetTextureSubImage(). 262 */ 263 void (*GetTexSubImage)(struct gl_context *ctx, 264 GLint xoffset, GLint yoffset, GLint zoffset, 265 GLsizei width, GLsizei height, GLsizei depth, 266 GLenum format, GLenum type, GLvoid *pixels, 267 struct gl_texture_image *texImage); 268 269 /** 270 * Called by glClearTex[Sub]Image 271 * 272 * Clears a rectangular region of the image to a given value. The 273 * clearValue argument is either NULL or points to a single texel to use as 274 * the clear value in the same internal format as the texture image. If it 275 * is NULL then the texture should be cleared to zeroes. 276 */ 277 void (*ClearTexSubImage)(struct gl_context *ctx, 278 struct gl_texture_image *texImage, 279 GLint xoffset, GLint yoffset, GLint zoffset, 280 GLsizei width, GLsizei height, GLsizei depth, 281 const GLvoid *clearValue); 282 283 /** 284 * Called by glCopyTex[Sub]Image[123]D(). 285 * 286 * This function should copy a rectangular region in the rb to a single 287 * destination slice, specified by @slice. In the case of 1D array 288 * textures (where one GL call can potentially affect multiple destination 289 * slices), core mesa takes care of calling this function multiple times, 290 * once for each scanline to be copied. 291 */ 292 void (*CopyTexSubImage)(struct gl_context *ctx, GLuint dims, 293 struct gl_texture_image *texImage, 294 GLint xoffset, GLint yoffset, GLint slice, 295 struct gl_renderbuffer *rb, 296 GLint x, GLint y, 297 GLsizei width, GLsizei height); 298 /** 299 * Called by glCopyImageSubData(). 300 * 301 * This function should copy one 2-D slice from src_teximage or 302 * src_renderbuffer to dst_teximage or dst_renderbuffer. Either the 303 * teximage or renderbuffer pointer will be non-null to indicate which 304 * is the real src/dst. 305 * 306 * If one of the textures is 3-D or is a 1-D or 2-D array 307 * texture, this function will be called multiple times: once for each 308 * slice. If one of the textures is a cube map, this function will be 309 * called once for each face to be copied. 310 */ 311 void (*CopyImageSubData)(struct gl_context *ctx, 312 struct gl_texture_image *src_teximage, 313 struct gl_renderbuffer *src_renderbuffer, 314 int src_x, int src_y, int src_z, 315 struct gl_texture_image *dst_teximage, 316 struct gl_renderbuffer *dst_renderbuffer, 317 int dst_x, int dst_y, int dst_z, 318 int src_width, int src_height); 319 320 /** 321 * Called by glGenerateMipmap() or when GL_GENERATE_MIPMAP_SGIS is enabled. 322 * Note that if the texture is a cube map, the <target> parameter will 323 * indicate which cube face to generate (GL_POSITIVE/NEGATIVE_X/Y/Z). 324 * texObj->BaseLevel is the level from which to generate the remaining 325 * mipmap levels. 326 */ 327 void (*GenerateMipmap)(struct gl_context *ctx, GLenum target, 328 struct gl_texture_object *texObj); 329 330 /** 331 * Called by glTexImage, glCompressedTexImage, glCopyTexImage 332 * and glTexStorage to check if the dimensions of the texture image 333 * are too large. 334 * \param target any GL_PROXY_TEXTURE_x target 335 * \return GL_TRUE if the image is OK, GL_FALSE if too large 336 */ 337 GLboolean (*TestProxyTexImage)(struct gl_context *ctx, GLenum target, 338 GLuint numLevels, GLint level, 339 mesa_format format, GLuint numSamples, 340 GLint width, GLint height, 341 GLint depth); 342 /*@}*/ 343 344 345 /** 346 * \name Compressed texture functions 347 */ 348 /*@{*/ 349 350 /** 351 * Called by glCompressedTexImage[123]D(). 352 */ 353 void (*CompressedTexImage)(struct gl_context *ctx, GLuint dims, 354 struct gl_texture_image *texImage, 355 GLsizei imageSize, const GLvoid *data); 356 357 /** 358 * Called by glCompressedTexSubImage[123]D(). 359 */ 360 void (*CompressedTexSubImage)(struct gl_context *ctx, GLuint dims, 361 struct gl_texture_image *texImage, 362 GLint xoffset, GLint yoffset, GLint zoffset, 363 GLsizei width, GLsizei height, GLsizei depth, 364 GLenum format, 365 GLsizei imageSize, const GLvoid *data); 366 /*@}*/ 367 368 /** 369 * \name Texture object / image functions 370 */ 371 /*@{*/ 372 373 /** 374 * Called by glBindTexture() and glBindTextures(). 375 */ 376 void (*BindTexture)( struct gl_context *ctx, GLuint texUnit, 377 GLenum target, struct gl_texture_object *tObj ); 378 379 /** 380 * Called to allocate a new texture object. Drivers will usually 381 * allocate/return a subclass of gl_texture_object. 382 */ 383 struct gl_texture_object * (*NewTextureObject)(struct gl_context *ctx, 384 GLuint name, GLenum target); 385 /** 386 * Called to delete/free a texture object. Drivers should free the 387 * object and any image data it contains. 388 */ 389 void (*DeleteTexture)(struct gl_context *ctx, 390 struct gl_texture_object *texObj); 391 392 /** 393 * Called to notify that texture is removed from ctx->Shared->TexObjects 394 */ 395 void (*TextureRemovedFromShared)(struct gl_context *ctx, 396 struct gl_texture_object *texObj); 397 398 /** Called to allocate a new texture image object. */ 399 struct gl_texture_image * (*NewTextureImage)(struct gl_context *ctx); 400 401 /** Called to free a texture image object returned by NewTextureImage() */ 402 void (*DeleteTextureImage)(struct gl_context *ctx, 403 struct gl_texture_image *); 404 405 /** Called to allocate memory for a single texture image */ 406 GLboolean (*AllocTextureImageBuffer)(struct gl_context *ctx, 407 struct gl_texture_image *texImage); 408 409 /** Free the memory for a single texture image */ 410 void (*FreeTextureImageBuffer)(struct gl_context *ctx, 411 struct gl_texture_image *texImage); 412 413 /** Map a slice of a texture image into user space. 414 * Note: for GL_TEXTURE_1D_ARRAY, height must be 1, y must be 0 and slice 415 * indicates the 1D array index. 416 * \param texImage the texture image 417 * \param slice the 3D image slice or array texture slice 418 * \param x, y, w, h region of interest 419 * \param mode bitmask of GL_MAP_READ_BIT, GL_MAP_WRITE_BIT and 420 * GL_MAP_INVALIDATE_RANGE_BIT (if writing) 421 * \param mapOut returns start of mapping of region of interest 422 * \param rowStrideOut returns row stride (in bytes). In the case of a 423 * compressed texture, this is the byte stride between one row of blocks 424 * and another. 425 */ 426 void (*MapTextureImage)(struct gl_context *ctx, 427 struct gl_texture_image *texImage, 428 GLuint slice, 429 GLuint x, GLuint y, GLuint w, GLuint h, 430 GLbitfield mode, 431 GLubyte **mapOut, GLint *rowStrideOut); 432 433 void (*UnmapTextureImage)(struct gl_context *ctx, 434 struct gl_texture_image *texImage, 435 GLuint slice); 436 437 /** For GL_ARB_texture_storage. Allocate memory for whole mipmap stack. 438 * All the gl_texture_images in the texture object will have their 439 * dimensions, format, etc. initialized already. 440 */ 441 GLboolean (*AllocTextureStorage)(struct gl_context *ctx, 442 struct gl_texture_object *texObj, 443 GLsizei levels, GLsizei width, 444 GLsizei height, GLsizei depth); 445 446 /** Called as part of glTextureView to add views to origTexObj */ 447 GLboolean (*TextureView)(struct gl_context *ctx, 448 struct gl_texture_object *texObj, 449 struct gl_texture_object *origTexObj); 450 451 /** 452 * Map a renderbuffer into user space. 453 * \param mode bitmask of GL_MAP_READ_BIT, GL_MAP_WRITE_BIT and 454 * GL_MAP_INVALIDATE_RANGE_BIT (if writing) 455 */ 456 void (*MapRenderbuffer)(struct gl_context *ctx, 457 struct gl_renderbuffer *rb, 458 GLuint x, GLuint y, GLuint w, GLuint h, 459 GLbitfield mode, 460 GLubyte **mapOut, GLint *rowStrideOut, 461 bool flip_y); 462 463 void (*UnmapRenderbuffer)(struct gl_context *ctx, 464 struct gl_renderbuffer *rb); 465 466 /** 467 * Optional driver entrypoint that binds a non-texture renderbuffer's 468 * contents to a texture image. 469 */ 470 GLboolean (*BindRenderbufferTexImage)(struct gl_context *ctx, 471 struct gl_renderbuffer *rb, 472 struct gl_texture_image *texImage); 473 /*@}*/ 474 475 476 /** 477 * \name Vertex/fragment program functions 478 */ 479 /*@{*/ 480 /** Allocate a new program */ 481 struct gl_program * (*NewProgram)(struct gl_context *ctx, 482 gl_shader_stage stage, 483 GLuint id, bool is_arb_asm); 484 /** Delete a program */ 485 void (*DeleteProgram)(struct gl_context *ctx, struct gl_program *prog); 486 /** 487 * Allocate a program to associate with the new ATI fragment shader (optional) 488 */ 489 struct gl_program * (*NewATIfs)(struct gl_context *ctx, 490 struct ati_fragment_shader *curProg); 491 /** 492 * Notify driver that a program string (and GPU code) has been specified 493 * or modified. Return GL_TRUE or GL_FALSE to indicate if the program is 494 * supported by the driver. 495 */ 496 GLboolean (*ProgramStringNotify)(struct gl_context *ctx, GLenum target, 497 struct gl_program *prog); 498 499 /** 500 * Notify driver that the sampler uniforms for the current program have 501 * changed. On some drivers, this may require shader recompiles. 502 */ 503 void (*SamplerUniformChange)(struct gl_context *ctx, GLenum target, 504 struct gl_program *prog); 505 506 /** Query if program can be loaded onto hardware */ 507 GLboolean (*IsProgramNative)(struct gl_context *ctx, GLenum target, 508 struct gl_program *prog); 509 510 /*@}*/ 511 512 /** 513 * \name GLSL shader/program functions. 514 */ 515 /*@{*/ 516 /** 517 * Called when a shader program is linked. 518 * 519 * This gives drivers an opportunity to clone the IR and make their 520 * own transformations on it for the purposes of code generation. 521 */ 522 GLboolean (*LinkShader)(struct gl_context *ctx, 523 struct gl_shader_program *shader); 524 /*@}*/ 525 526 527 /** 528 * \name Draw functions. 529 */ 530 /*@{*/ 531 /** 532 * For indirect array drawing: 533 * 534 * typedef struct { 535 * GLuint count; 536 * GLuint primCount; 537 * GLuint first; 538 * GLuint baseInstance; // in GL 4.2 and later, must be zero otherwise 539 * } DrawArraysIndirectCommand; 540 * 541 * For indirect indexed drawing: 542 * 543 * typedef struct { 544 * GLuint count; 545 * GLuint primCount; 546 * GLuint firstIndex; 547 * GLint baseVertex; 548 * GLuint baseInstance; // in GL 4.2 and later, must be zero otherwise 549 * } DrawElementsIndirectCommand; 550 */ 551 552 /** 553 * Draw a number of primitives. 554 * \param prims array [nr_prims] describing what to draw (prim type, 555 * vertex count, first index, instance count, etc). 556 * \param ib index buffer for indexed drawing, NULL for array drawing 557 * \param index_bounds_valid are min_index and max_index valid? 558 * \param min_index lowest vertex index used 559 * \param max_index highest vertex index used 560 * \param num_instances instance count from ARB_draw_instanced 561 * \param base_instance base instance from ARB_base_instance 562 */ 563 void (*Draw)(struct gl_context *ctx, 564 const struct _mesa_prim *prims, unsigned nr_prims, 565 const struct _mesa_index_buffer *ib, 566 bool index_bounds_valid, 567 bool primitive_restart, 568 unsigned restart_index, 569 unsigned min_index, unsigned max_index, 570 unsigned num_instances, unsigned base_instance); 571 572 /** 573 * Optimal Gallium version of Draw() that doesn't require translation 574 * of draw info in the state tracker. 575 * 576 * The interface is identical to pipe_context::draw_vbo 577 * with indirect == NULL. 578 * 579 * "info" is not const and the following fields can be changed by 580 * the callee, so callers should be aware: 581 * - info->index_bounds_valid (if false) 582 * - info->min_index (if index_bounds_valid is false) 583 * - info->max_index (if index_bounds_valid is false) 584 * - info->drawid (if increment_draw_id is true) 585 * - info->index.gl_bo (if index_size && !has_user_indices) 586 */ 587 void (*DrawGallium)(struct gl_context *ctx, 588 struct pipe_draw_info *info, 589 unsigned drawid_offset, 590 const struct pipe_draw_start_count_bias *draws, 591 unsigned num_draws); 592 593 /** 594 * Same as DrawGallium, but mode can also change between draws. 595 * 596 * "info" is not const and the following fields can be changed by 597 * the callee in addition to the fields listed by DrawGallium: 598 * - info->mode 599 * 600 * This function exists to decrease complexity of DrawGallium. 601 */ 602 void (*DrawGalliumMultiMode)(struct gl_context *ctx, 603 struct pipe_draw_info *info, 604 const struct pipe_draw_start_count_bias *draws, 605 const unsigned char *mode, 606 unsigned num_draws); 607 608 /** 609 * Draw a primitive, getting the vertex count, instance count, start 610 * vertex, etc. from a buffer object. 611 * \param mode GL_POINTS, GL_LINES, GL_TRIANGLE_STRIP, etc. 612 * \param indirect_data buffer to get "DrawArrays/ElementsIndirectCommand" 613 * data 614 * \param indirect_offset offset of first primitive in indrect_data buffer 615 * \param draw_count number of primitives to draw 616 * \param stride stride, in bytes, between 617 * "DrawArrays/ElementsIndirectCommand" objects 618 * \param indirect_draw_count_buffer if non-NULL specifies a buffer to get 619 * the real draw_count value. Used for 620 * GL_ARB_indirect_parameters. 621 * \param indirect_draw_count_offset offset to the draw_count value in 622 * indirect_draw_count_buffer 623 * \param ib index buffer for indexed drawing, NULL otherwise. 624 */ 625 void (*DrawIndirect)(struct gl_context *ctx, GLuint mode, 626 struct gl_buffer_object *indirect_data, 627 GLsizeiptr indirect_offset, unsigned draw_count, 628 unsigned stride, 629 struct gl_buffer_object *indirect_draw_count_buffer, 630 GLsizeiptr indirect_draw_count_offset, 631 const struct _mesa_index_buffer *ib, 632 bool primitive_restart, 633 unsigned restart_index); 634 635 /** 636 * Driver implementation of glDrawTransformFeedback. 637 * 638 * \param mode Primitive type 639 * \param num_instances instance count from ARB_draw_instanced 640 * \param stream If called via DrawTransformFeedbackStream, specifies 641 * the vertex stream buffer from which to get the vertex 642 * count. 643 * \param tfb_vertcount if non-null, indicates which transform feedback 644 * object has the vertex count. 645 */ 646 void (*DrawTransformFeedback)(struct gl_context *ctx, GLenum mode, 647 unsigned num_instances, unsigned stream, 648 struct gl_transform_feedback_object *tfb_vertcount); 649 650 void (*DrawGalliumVertexState)(struct gl_context *ctx, 651 struct pipe_vertex_state *state, 652 struct pipe_draw_vertex_state_info info, 653 const struct pipe_draw_start_count_bias *draws, 654 const uint8_t *mode, 655 unsigned num_draws, 656 bool per_vertex_edgeflags); 657 /*@}*/ 658 659 struct pipe_vertex_state * 660 (*CreateGalliumVertexState)(struct gl_context *ctx, 661 const struct gl_vertex_array_object *vao, 662 struct gl_buffer_object *indexbuf, 663 uint32_t enabled_attribs); 664 665 /** 666 * \name State-changing functions. 667 * 668 * \note drawing functions are above. 669 * 670 * These functions are called by their corresponding OpenGL API functions. 671 * They are \e also called by the gl_PopAttrib() function!!! 672 * May add more functions like these to the device driver in the future. 673 */ 674 /*@{*/ 675 /** Specify the alpha test function */ 676 void (*AlphaFunc)(struct gl_context *ctx, GLenum func, GLfloat ref); 677 /** Set the blend color */ 678 void (*BlendColor)(struct gl_context *ctx, const GLfloat color[4]); 679 /** Set the blend equation */ 680 void (*BlendEquationSeparate)(struct gl_context *ctx, 681 GLenum modeRGB, GLenum modeA); 682 /** Specify pixel arithmetic */ 683 void (*BlendFuncSeparate)(struct gl_context *ctx, 684 GLenum sfactorRGB, GLenum dfactorRGB, 685 GLenum sfactorA, GLenum dfactorA); 686 /** Specify a plane against which all geometry is clipped */ 687 void (*ClipPlane)(struct gl_context *ctx, GLenum plane, const GLfloat *eq); 688 /** Enable and disable writing of frame buffer color components */ 689 void (*ColorMask)(struct gl_context *ctx, GLboolean rmask, GLboolean gmask, 690 GLboolean bmask, GLboolean amask ); 691 /** Cause a material color to track the current color */ 692 void (*ColorMaterial)(struct gl_context *ctx, GLenum face, GLenum mode); 693 /** Specify whether front- or back-facing facets can be culled */ 694 void (*CullFace)(struct gl_context *ctx, GLenum mode); 695 /** Define front- and back-facing polygons */ 696 void (*FrontFace)(struct gl_context *ctx, GLenum mode); 697 /** Specify the value used for depth buffer comparisons */ 698 void (*DepthFunc)(struct gl_context *ctx, GLenum func); 699 /** Enable or disable writing into the depth buffer */ 700 void (*DepthMask)(struct gl_context *ctx, GLboolean flag); 701 /** Specify mapping of depth values from NDC to window coordinates */ 702 void (*DepthRange)(struct gl_context *ctx); 703 /** Specify the current buffer for writing */ 704 void (*DrawBuffer)(struct gl_context *ctx); 705 /** Used to allocated any buffers with on-demand creation */ 706 void (*DrawBufferAllocate)(struct gl_context *ctx); 707 /** Enable or disable server-side gl capabilities */ 708 void (*Enable)(struct gl_context *ctx, GLenum cap, GLboolean state); 709 /** Specify fog parameters */ 710 void (*Fogfv)(struct gl_context *ctx, GLenum pname, const GLfloat *params); 711 /** Set light source parameters. 712 * Note: for GL_POSITION and GL_SPOT_DIRECTION, params will have already 713 * been transformed to eye-space. 714 */ 715 void (*Lightfv)(struct gl_context *ctx, GLenum light, 716 GLenum pname, const GLfloat *params ); 717 /** Set the lighting model parameters */ 718 void (*LightModelfv)(struct gl_context *ctx, GLenum pname, 719 const GLfloat *params); 720 /** Specify the line stipple pattern */ 721 void (*LineStipple)(struct gl_context *ctx, GLint factor, GLushort pattern ); 722 /** Specify the width of rasterized lines */ 723 void (*LineWidth)(struct gl_context *ctx, GLfloat width); 724 /** Specify a logical pixel operation for color index rendering */ 725 void (*LogicOpcode)(struct gl_context *ctx, enum gl_logicop_mode opcode); 726 void (*PointParameterfv)(struct gl_context *ctx, GLenum pname, 727 const GLfloat *params); 728 /** Specify the diameter of rasterized points */ 729 void (*PointSize)(struct gl_context *ctx, GLfloat size); 730 /** Select a polygon rasterization mode */ 731 void (*PolygonMode)(struct gl_context *ctx, GLenum face, GLenum mode); 732 /** Set the scale and units used to calculate depth values */ 733 void (*PolygonOffset)(struct gl_context *ctx, GLfloat factor, GLfloat units, GLfloat clamp); 734 /** Set the polygon stippling pattern */ 735 void (*PolygonStipple)(struct gl_context *ctx, const GLubyte *mask ); 736 /* Specifies the current buffer for reading */ 737 void (*ReadBuffer)( struct gl_context *ctx, GLenum buffer ); 738 /** Set rasterization mode */ 739 void (*RenderMode)(struct gl_context *ctx, GLenum mode ); 740 /** Define the scissor box */ 741 void (*Scissor)(struct gl_context *ctx); 742 /** Select flat or smooth shading */ 743 void (*ShadeModel)(struct gl_context *ctx, GLenum mode); 744 /** OpenGL 2.0 two-sided StencilFunc */ 745 void (*StencilFuncSeparate)(struct gl_context *ctx, GLenum face, GLenum func, 746 GLint ref, GLuint mask); 747 /** OpenGL 2.0 two-sided StencilMask */ 748 void (*StencilMaskSeparate)(struct gl_context *ctx, GLenum face, GLuint mask); 749 /** OpenGL 2.0 two-sided StencilOp */ 750 void (*StencilOpSeparate)(struct gl_context *ctx, GLenum face, GLenum fail, 751 GLenum zfail, GLenum zpass); 752 /** Control the generation of texture coordinates */ 753 void (*TexGen)(struct gl_context *ctx, GLenum coord, GLenum pname, 754 const GLfloat *params); 755 /** Set texture environment parameters */ 756 void (*TexEnv)(struct gl_context *ctx, GLenum target, GLenum pname, 757 const GLfloat *param); 758 /** Set texture parameter (callee gets param value from the texObj) */ 759 void (*TexParameter)(struct gl_context *ctx, 760 struct gl_texture_object *texObj, GLenum pname); 761 /** Set the viewport */ 762 void (*Viewport)(struct gl_context *ctx); 763 /*@}*/ 764 765 766 /** 767 * \name Vertex/pixel buffer object functions 768 */ 769 /*@{*/ 770 struct gl_buffer_object * (*NewBufferObject)(struct gl_context *ctx, 771 GLuint buffer); 772 773 void (*DeleteBuffer)( struct gl_context *ctx, struct gl_buffer_object *obj ); 774 775 GLboolean (*BufferData)(struct gl_context *ctx, GLenum target, 776 GLsizeiptrARB size, const GLvoid *data, GLenum usage, 777 GLenum storageFlags, struct gl_buffer_object *obj); 778 779 void (*BufferSubData)( struct gl_context *ctx, GLintptrARB offset, 780 GLsizeiptrARB size, const GLvoid *data, 781 struct gl_buffer_object *obj ); 782 783 void (*GetBufferSubData)( struct gl_context *ctx, 784 GLintptrARB offset, GLsizeiptrARB size, 785 GLvoid *data, struct gl_buffer_object *obj ); 786 787 void (*ClearBufferSubData)( struct gl_context *ctx, 788 GLintptr offset, GLsizeiptr size, 789 const GLvoid *clearValue, 790 GLsizeiptr clearValueSize, 791 struct gl_buffer_object *obj ); 792 793 void (*CopyBufferSubData)( struct gl_context *ctx, 794 struct gl_buffer_object *src, 795 struct gl_buffer_object *dst, 796 GLintptr readOffset, GLintptr writeOffset, 797 GLsizeiptr size ); 798 799 void (*InvalidateBufferSubData)( struct gl_context *ctx, 800 struct gl_buffer_object *obj, 801 GLintptr offset, 802 GLsizeiptr length ); 803 804 /* Returns pointer to the start of the mapped range. 805 * May return NULL if MESA_MAP_NOWAIT_BIT is set in access: 806 */ 807 void * (*MapBufferRange)( struct gl_context *ctx, GLintptr offset, 808 GLsizeiptr length, GLbitfield access, 809 struct gl_buffer_object *obj, 810 gl_map_buffer_index index); 811 812 void (*FlushMappedBufferRange)(struct gl_context *ctx, 813 GLintptr offset, GLsizeiptr length, 814 struct gl_buffer_object *obj, 815 gl_map_buffer_index index); 816 817 GLboolean (*UnmapBuffer)( struct gl_context *ctx, 818 struct gl_buffer_object *obj, 819 gl_map_buffer_index index); 820 /*@}*/ 821 822 /** 823 * \name Functions for GL_APPLE_object_purgeable 824 */ 825 /*@{*/ 826 /* variations on ObjectPurgeable */ 827 GLenum (*BufferObjectPurgeable)(struct gl_context *ctx, 828 struct gl_buffer_object *obj, GLenum option); 829 GLenum (*RenderObjectPurgeable)(struct gl_context *ctx, 830 struct gl_renderbuffer *obj, GLenum option); 831 GLenum (*TextureObjectPurgeable)(struct gl_context *ctx, 832 struct gl_texture_object *obj, 833 GLenum option); 834 835 /* variations on ObjectUnpurgeable */ 836 GLenum (*BufferObjectUnpurgeable)(struct gl_context *ctx, 837 struct gl_buffer_object *obj, 838 GLenum option); 839 GLenum (*RenderObjectUnpurgeable)(struct gl_context *ctx, 840 struct gl_renderbuffer *obj, 841 GLenum option); 842 GLenum (*TextureObjectUnpurgeable)(struct gl_context *ctx, 843 struct gl_texture_object *obj, 844 GLenum option); 845 /*@}*/ 846 847 /** 848 * \name Functions for GL_EXT_framebuffer_{object,blit,discard}. 849 */ 850 /*@{*/ 851 struct gl_framebuffer * (*NewFramebuffer)(struct gl_context *ctx, 852 GLuint name); 853 struct gl_renderbuffer * (*NewRenderbuffer)(struct gl_context *ctx, 854 GLuint name); 855 void (*BindFramebuffer)(struct gl_context *ctx, GLenum target, 856 struct gl_framebuffer *drawFb, 857 struct gl_framebuffer *readFb); 858 void (*FramebufferRenderbuffer)(struct gl_context *ctx, 859 struct gl_framebuffer *fb, 860 GLenum attachment, 861 struct gl_renderbuffer *rb); 862 void (*RenderTexture)(struct gl_context *ctx, 863 struct gl_framebuffer *fb, 864 struct gl_renderbuffer_attachment *att); 865 void (*FinishRenderTexture)(struct gl_context *ctx, 866 struct gl_renderbuffer *rb); 867 void (*ValidateFramebuffer)(struct gl_context *ctx, 868 struct gl_framebuffer *fb); 869 /*@}*/ 870 void (*BlitFramebuffer)(struct gl_context *ctx, 871 struct gl_framebuffer *readFb, 872 struct gl_framebuffer *drawFb, 873 GLint srcX0, GLint srcY0, GLint srcX1, GLint srcY1, 874 GLint dstX0, GLint dstY0, GLint dstX1, GLint dstY1, 875 GLbitfield mask, GLenum filter); 876 void (*DiscardFramebuffer)(struct gl_context *ctx, struct gl_framebuffer *fb, 877 struct gl_renderbuffer_attachment *att); 878 879 /** 880 * \name Functions for GL_ARB_sample_locations 881 */ 882 void (*GetProgrammableSampleCaps)(struct gl_context *ctx, 883 const struct gl_framebuffer *fb, 884 GLuint *bits, GLuint *width, GLuint *height); 885 void (*EvaluateDepthValues)(struct gl_context *ctx); 886 887 /** 888 * \name Query objects 889 */ 890 /*@{*/ 891 struct gl_query_object * (*NewQueryObject)(struct gl_context *ctx, GLuint id); 892 void (*DeleteQuery)(struct gl_context *ctx, struct gl_query_object *q); 893 void (*BeginQuery)(struct gl_context *ctx, struct gl_query_object *q); 894 void (*QueryCounter)(struct gl_context *ctx, struct gl_query_object *q); 895 void (*EndQuery)(struct gl_context *ctx, struct gl_query_object *q); 896 void (*CheckQuery)(struct gl_context *ctx, struct gl_query_object *q); 897 void (*WaitQuery)(struct gl_context *ctx, struct gl_query_object *q); 898 /* 899 * \pname the value requested to be written (GL_QUERY_RESULT, etc) 900 * \ptype the type of the value requested to be written: 901 * GL_UNSIGNED_INT, GL_UNSIGNED_INT64_ARB, 902 * GL_INT, GL_INT64_ARB 903 */ 904 void (*StoreQueryResult)(struct gl_context *ctx, struct gl_query_object *q, 905 struct gl_buffer_object *buf, intptr_t offset, 906 GLenum pname, GLenum ptype); 907 /*@}*/ 908 909 /** 910 * \name Performance monitors 911 */ 912 /*@{*/ 913 void (*InitPerfMonitorGroups)(struct gl_context *ctx); 914 struct gl_perf_monitor_object * (*NewPerfMonitor)(struct gl_context *ctx); 915 void (*DeletePerfMonitor)(struct gl_context *ctx, 916 struct gl_perf_monitor_object *m); 917 GLboolean (*BeginPerfMonitor)(struct gl_context *ctx, 918 struct gl_perf_monitor_object *m); 919 920 /** Stop an active performance monitor, discarding results. */ 921 void (*ResetPerfMonitor)(struct gl_context *ctx, 922 struct gl_perf_monitor_object *m); 923 void (*EndPerfMonitor)(struct gl_context *ctx, 924 struct gl_perf_monitor_object *m); 925 GLboolean (*IsPerfMonitorResultAvailable)(struct gl_context *ctx, 926 struct gl_perf_monitor_object *m); 927 void (*GetPerfMonitorResult)(struct gl_context *ctx, 928 struct gl_perf_monitor_object *m, 929 GLsizei dataSize, 930 GLuint *data, 931 GLint *bytesWritten); 932 /*@}*/ 933 934 /** 935 * \name Performance Query objects 936 */ 937 /*@{*/ 938 unsigned (*InitPerfQueryInfo)(struct gl_context *ctx); 939 void (*GetPerfQueryInfo)(struct gl_context *ctx, 940 unsigned queryIndex, 941 const char **name, 942 GLuint *dataSize, 943 GLuint *numCounters, 944 GLuint *numActive); 945 void (*GetPerfCounterInfo)(struct gl_context *ctx, 946 unsigned queryIndex, 947 unsigned counterIndex, 948 const char **name, 949 const char **desc, 950 GLuint *offset, 951 GLuint *data_size, 952 GLuint *type_enum, 953 GLuint *data_type_enum, 954 GLuint64 *raw_max); 955 struct gl_perf_query_object * (*NewPerfQueryObject)(struct gl_context *ctx, 956 unsigned queryIndex); 957 void (*DeletePerfQuery)(struct gl_context *ctx, 958 struct gl_perf_query_object *obj); 959 bool (*BeginPerfQuery)(struct gl_context *ctx, 960 struct gl_perf_query_object *obj); 961 void (*EndPerfQuery)(struct gl_context *ctx, 962 struct gl_perf_query_object *obj); 963 void (*WaitPerfQuery)(struct gl_context *ctx, 964 struct gl_perf_query_object *obj); 965 bool (*IsPerfQueryReady)(struct gl_context *ctx, 966 struct gl_perf_query_object *obj); 967 bool (*GetPerfQueryData)(struct gl_context *ctx, 968 struct gl_perf_query_object *obj, 969 GLsizei dataSize, 970 GLuint *data, 971 GLuint *bytesWritten); 972 /*@}*/ 973 974 975 /** 976 * \name GREMEDY debug/marker functions 977 */ 978 /*@{*/ 979 void (*EmitStringMarker)(struct gl_context *ctx, const GLchar *string, GLsizei len); 980 /*@}*/ 981 982 /** 983 * \name Support for multiple T&L engines 984 */ 985 /*@{*/ 986 987 /** 988 * Set by the driver-supplied T&L engine. 989 * 990 * Set to PRIM_OUTSIDE_BEGIN_END when outside glBegin()/glEnd(). 991 */ 992 GLuint CurrentExecPrimitive; 993 994 /** 995 * Current glBegin state of an in-progress compilation. May be 996 * GL_POINTS, GL_TRIANGLE_STRIP, etc. or PRIM_OUTSIDE_BEGIN_END 997 * or PRIM_UNKNOWN. 998 */ 999 GLuint CurrentSavePrimitive; 1000 1001 1002 #define FLUSH_STORED_VERTICES 0x1 1003 #define FLUSH_UPDATE_CURRENT 0x2 1004 /** 1005 * Set by the driver-supplied T&L engine whenever vertices are buffered 1006 * between glBegin()/glEnd() objects or __struct gl_contextRec::Current 1007 * is not updated. A bitmask of the FLUSH_x values above. 1008 * 1009 * The dd_function_table::FlushVertices call below may be used to resolve 1010 * these conditions. 1011 */ 1012 GLbitfield NeedFlush; 1013 1014 /** Need to call vbo_save_SaveFlushVertices() upon state change? */ 1015 GLboolean SaveNeedFlush; 1016 1017 /** 1018 * Notify driver that the special derived value _NeedEyeCoords has 1019 * changed. 1020 */ 1021 void (*LightingSpaceChange)( struct gl_context *ctx ); 1022 1023 /**@}*/ 1024 1025 /** 1026 * \name GL_ARB_sync interfaces 1027 */ 1028 /*@{*/ 1029 struct gl_sync_object * (*NewSyncObject)(struct gl_context *); 1030 void (*FenceSync)(struct gl_context *, struct gl_sync_object *, 1031 GLenum, GLbitfield); 1032 void (*DeleteSyncObject)(struct gl_context *, struct gl_sync_object *); 1033 void (*CheckSync)(struct gl_context *, struct gl_sync_object *); 1034 void (*ClientWaitSync)(struct gl_context *, struct gl_sync_object *, 1035 GLbitfield, GLuint64); 1036 void (*ServerWaitSync)(struct gl_context *, struct gl_sync_object *, 1037 GLbitfield, GLuint64); 1038 /*@}*/ 1039 1040 /** GL_NV_conditional_render */ 1041 void (*BeginConditionalRender)(struct gl_context *ctx, 1042 struct gl_query_object *q, 1043 GLenum mode); 1044 void (*EndConditionalRender)(struct gl_context *ctx, 1045 struct gl_query_object *q); 1046 1047 /** 1048 * \name GL_OES_draw_texture interface 1049 */ 1050 /*@{*/ 1051 void (*DrawTex)(struct gl_context *ctx, GLfloat x, GLfloat y, GLfloat z, 1052 GLfloat width, GLfloat height); 1053 /*@}*/ 1054 1055 /** 1056 * \name GL_OES_EGL_image interface 1057 */ 1058 void (*EGLImageTargetTexture2D)(struct gl_context *ctx, GLenum target, 1059 struct gl_texture_object *texObj, 1060 struct gl_texture_image *texImage, 1061 GLeglImageOES image_handle); 1062 void (*EGLImageTargetRenderbufferStorage)(struct gl_context *ctx, 1063 struct gl_renderbuffer *rb, 1064 void *image_handle); 1065 1066 /** 1067 * \name GL_EXT_EGL_image_storage interface 1068 */ 1069 void (*EGLImageTargetTexStorage)(struct gl_context *ctx, GLenum target, 1070 struct gl_texture_object *texObj, 1071 struct gl_texture_image *texImage, 1072 GLeglImageOES image_handle); 1073 /** 1074 * \name GL_EXT_transform_feedback interface 1075 */ 1076 struct gl_transform_feedback_object * 1077 (*NewTransformFeedback)(struct gl_context *ctx, GLuint name); 1078 void (*DeleteTransformFeedback)(struct gl_context *ctx, 1079 struct gl_transform_feedback_object *obj); 1080 void (*BeginTransformFeedback)(struct gl_context *ctx, GLenum mode, 1081 struct gl_transform_feedback_object *obj); 1082 void (*EndTransformFeedback)(struct gl_context *ctx, 1083 struct gl_transform_feedback_object *obj); 1084 void (*PauseTransformFeedback)(struct gl_context *ctx, 1085 struct gl_transform_feedback_object *obj); 1086 void (*ResumeTransformFeedback)(struct gl_context *ctx, 1087 struct gl_transform_feedback_object *obj); 1088 1089 /** 1090 * Return the number of vertices written to a stream during the last 1091 * Begin/EndTransformFeedback block. 1092 */ 1093 GLsizei (*GetTransformFeedbackVertexCount)(struct gl_context *ctx, 1094 struct gl_transform_feedback_object *obj, 1095 GLuint stream); 1096 1097 /** 1098 * \name GL_NV_texture_barrier interface 1099 */ 1100 void (*TextureBarrier)(struct gl_context *ctx); 1101 1102 /** 1103 * \name GL_ARB_sampler_objects 1104 */ 1105 struct gl_sampler_object * (*NewSamplerObject)(struct gl_context *ctx, 1106 GLuint name); 1107 1108 /** 1109 * \name Return a timestamp in nanoseconds as defined by GL_ARB_timer_query. 1110 * This should be equivalent to glGetInteger64v(GL_TIMESTAMP); 1111 */ 1112 uint64_t (*GetTimestamp)(struct gl_context *ctx); 1113 1114 /** 1115 * \name GL_ARB_texture_multisample 1116 */ 1117 void (*GetSamplePosition)(struct gl_context *ctx, 1118 struct gl_framebuffer *fb, 1119 GLuint index, 1120 GLfloat *outValue); 1121 1122 /** 1123 * \name NV_vdpau_interop interface 1124 */ 1125 void (*VDPAUMapSurface)(struct gl_context *ctx, GLenum target, 1126 GLenum access, GLboolean output, 1127 struct gl_texture_object *texObj, 1128 struct gl_texture_image *texImage, 1129 const GLvoid *vdpSurface, GLuint index); 1130 void (*VDPAUUnmapSurface)(struct gl_context *ctx, GLenum target, 1131 GLenum access, GLboolean output, 1132 struct gl_texture_object *texObj, 1133 struct gl_texture_image *texImage, 1134 const GLvoid *vdpSurface, GLuint index); 1135 1136 /** 1137 * Query reset status for GL_ARB_robustness 1138 * 1139 * Per \c glGetGraphicsResetStatusARB, this function should return a 1140 * non-zero value once after a reset. If a reset is non-atomic, the 1141 * non-zero status should be returned for the duration of the reset. 1142 */ 1143 GLenum (*GetGraphicsResetStatus)(struct gl_context *ctx); 1144 1145 /** 1146 * \name GL_ARB_shader_image_load_store interface. 1147 */ 1148 /** @{ */ 1149 void (*MemoryBarrier)(struct gl_context *ctx, GLbitfield barriers); 1150 /** @} */ 1151 1152 /** 1153 * GL_EXT_shader_framebuffer_fetch_non_coherent rendering barrier. 1154 * 1155 * On return from this function any framebuffer contents written by 1156 * previous draw commands are guaranteed to be visible from subsequent 1157 * fragment shader invocations using the 1158 * EXT_shader_framebuffer_fetch_non_coherent interface. 1159 */ 1160 /** @{ */ 1161 void (*FramebufferFetchBarrier)(struct gl_context *ctx); 1162 /** @} */ 1163 1164 /** 1165 * \name GL_ARB_compute_shader interface 1166 */ 1167 /*@{*/ 1168 void (*DispatchCompute)(struct gl_context *ctx, const GLuint *num_groups); 1169 void (*DispatchComputeIndirect)(struct gl_context *ctx, GLintptr indirect); 1170 /*@}*/ 1171 1172 /** 1173 * \name GL_ARB_compute_variable_group_size interface 1174 */ 1175 /*@{*/ 1176 void (*DispatchComputeGroupSize)(struct gl_context *ctx, 1177 const GLuint *num_groups, 1178 const GLuint *group_size); 1179 /*@}*/ 1180 1181 /** 1182 * Query information about memory. Device memory is e.g. VRAM. Staging 1183 * memory is e.g. GART. All sizes are in kilobytes. 1184 */ 1185 void (*QueryMemoryInfo)(struct gl_context *ctx, 1186 struct gl_memory_info *info); 1187 1188 /** 1189 * Indicate that this thread is being used by Mesa as a background drawing 1190 * thread for the given GL context. 1191 * 1192 * If this function is called more than once from any given thread, each 1193 * subsequent call overrides the context that was passed in the previous 1194 * call. Mesa takes advantage of this to re-use a background thread to 1195 * perform drawing on behalf of multiple contexts. 1196 * 1197 * Mesa may sometimes call this function from a non-background thread 1198 * (i.e. a thread that has already been bound to a context using 1199 * __DriverAPIRec::MakeCurrent()); when this happens, ctx will be equal to 1200 * the context that is bound to this thread. 1201 * 1202 * Mesa will only call this function if GL multithreading is enabled. 1203 */ 1204 void (*SetBackgroundContext)(struct gl_context *ctx, 1205 struct util_queue_monitoring *queue_info); 1206 1207 /** 1208 * \name GL_ARB_sparse_buffer interface 1209 */ 1210 /*@{*/ 1211 void (*BufferPageCommitment)(struct gl_context *ctx, 1212 struct gl_buffer_object *bufferObj, 1213 GLintptr offset, GLsizeiptr size, 1214 GLboolean commit); 1215 /*@}*/ 1216 1217 /** 1218 * \name GL_ARB_bindless_texture interface 1219 */ 1220 /*@{*/ 1221 GLuint64 (*NewTextureHandle)(struct gl_context *ctx, 1222 struct gl_texture_object *texObj, 1223 struct gl_sampler_object *sampObj); 1224 void (*DeleteTextureHandle)(struct gl_context *ctx, GLuint64 handle); 1225 void (*MakeTextureHandleResident)(struct gl_context *ctx, GLuint64 handle, 1226 bool resident); 1227 GLuint64 (*NewImageHandle)(struct gl_context *ctx, 1228 struct gl_image_unit *imgObj); 1229 void (*DeleteImageHandle)(struct gl_context *ctx, GLuint64 handle); 1230 void (*MakeImageHandleResident)(struct gl_context *ctx, GLuint64 handle, 1231 GLenum access, bool resident); 1232 /*@}*/ 1233 1234 1235 /** 1236 * \name GL_EXT_external_objects interface 1237 */ 1238 /*@{*/ 1239 /** 1240 * Called to allocate a new memory object. Drivers will usually 1241 * allocate/return a subclass of gl_memory_object. 1242 */ 1243 struct gl_memory_object * (*NewMemoryObject)(struct gl_context *ctx, 1244 GLuint name); 1245 /** 1246 * Called to delete/free a memory object. Drivers should free the 1247 * object and any image data it contains. 1248 */ 1249 void (*DeleteMemoryObject)(struct gl_context *ctx, 1250 struct gl_memory_object *memObj); 1251 1252 /** 1253 * Set the given memory object as the texture's storage. 1254 */ 1255 GLboolean (*SetTextureStorageForMemoryObject)(struct gl_context *ctx, 1256 struct gl_texture_object *tex_obj, 1257 struct gl_memory_object *mem_obj, 1258 GLsizei levels, GLsizei width, 1259 GLsizei height, GLsizei depth, 1260 GLuint64 offset); 1261 1262 /** 1263 * Use a memory object as the backing data for a buffer object 1264 */ 1265 GLboolean (*BufferDataMem)(struct gl_context *ctx, 1266 GLenum target, 1267 GLsizeiptrARB size, 1268 struct gl_memory_object *memObj, 1269 GLuint64 offset, 1270 GLenum usage, 1271 struct gl_buffer_object *bufObj); 1272 1273 /** 1274 * Fill uuid with an unique identifier for this driver 1275 * 1276 * uuid must point to GL_UUID_SIZE_EXT bytes of available memory 1277 */ 1278 void (*GetDriverUuid)(struct gl_context *ctx, char *uuid); 1279 1280 /** 1281 * Fill uuid with an unique identifier for the device associated 1282 * to this driver 1283 * 1284 * uuid must point to GL_UUID_SIZE_EXT bytes of available memory 1285 */ 1286 void (*GetDeviceUuid)(struct gl_context *ctx, char *uuid); 1287 1288 /*@}*/ 1289 1290 /** 1291 * \name GL_EXT_external_objects_fd interface 1292 */ 1293 /*@{*/ 1294 /** 1295 * Called to import a memory object. The caller relinquishes ownership 1296 * of fd after the call returns. 1297 * 1298 * Accessing fd after ImportMemoryObjectFd returns results in undefined 1299 * behaviour. This is consistent with EXT_external_object_fd. 1300 */ 1301 void (*ImportMemoryObjectFd)(struct gl_context *ctx, 1302 struct gl_memory_object *memObj, 1303 GLuint64 size, 1304 int fd); 1305 /*@}*/ 1306 1307 /** 1308 * \name GL_ARB_get_program_binary 1309 */ 1310 /*@{*/ 1311 /** 1312 * Calls to retrieve/store a binary serialized copy of the current program. 1313 */ 1314 void (*GetProgramBinaryDriverSHA1)(struct gl_context *ctx, uint8_t *sha1); 1315 1316 void (*ProgramBinarySerializeDriverBlob)(struct gl_context *ctx, 1317 struct gl_shader_program *shProg, 1318 struct gl_program *prog); 1319 1320 void (*ProgramBinaryDeserializeDriverBlob)(struct gl_context *ctx, 1321 struct gl_shader_program *shProg, 1322 struct gl_program *prog); 1323 /*@}*/ 1324 1325 /** 1326 * \name GL_EXT_semaphore interface 1327 */ 1328 /*@{*/ 1329 /** 1330 * Called to allocate a new semaphore object. Drivers will usually 1331 * allocate/return a subclass of gl_semaphore_object. 1332 */ 1333 struct gl_semaphore_object * (*NewSemaphoreObject)(struct gl_context *ctx, 1334 GLuint name); 1335 /** 1336 * Called to delete/free a semaphore object. Drivers should free the 1337 * object and any associated resources. 1338 */ 1339 void (*DeleteSemaphoreObject)(struct gl_context *ctx, 1340 struct gl_semaphore_object *semObj); 1341 1342 /** 1343 * Introduce an operation to wait for the semaphore object in the GL 1344 * server's command stream 1345 */ 1346 void (*ServerWaitSemaphoreObject)(struct gl_context *ctx, 1347 struct gl_semaphore_object *semObj, 1348 GLuint numBufferBarriers, 1349 struct gl_buffer_object **bufObjs, 1350 GLuint numTextureBarriers, 1351 struct gl_texture_object **texObjs, 1352 const GLenum *srcLayouts); 1353 1354 /** 1355 * Introduce an operation to signal the semaphore object in the GL 1356 * server's command stream 1357 */ 1358 void (*ServerSignalSemaphoreObject)(struct gl_context *ctx, 1359 struct gl_semaphore_object *semObj, 1360 GLuint numBufferBarriers, 1361 struct gl_buffer_object **bufObjs, 1362 GLuint numTextureBarriers, 1363 struct gl_texture_object **texObjs, 1364 const GLenum *dstLayouts); 1365 /*@}*/ 1366 1367 /** 1368 * \name GL_EXT_semaphore_fd interface 1369 */ 1370 /*@{*/ 1371 /** 1372 * Called to import a semaphore object. The caller relinquishes ownership 1373 * of fd after the call returns. 1374 * 1375 * Accessing fd after ImportSemaphoreFd returns results in undefined 1376 * behaviour. This is consistent with EXT_semaphore_fd. 1377 */ 1378 void (*ImportSemaphoreFd)(struct gl_context *ctx, 1379 struct gl_semaphore_object *semObj, 1380 int fd); 1381 /*@}*/ 1382 1383 /** 1384 * \name Disk shader cache functions 1385 */ 1386 /*@{*/ 1387 /** 1388 * Called to initialize gl_program::driver_cache_blob (and size) with a 1389 * ralloc allocated buffer. 1390 * 1391 * This buffer will be saved and restored as part of the gl_program 1392 * serialization and deserialization. 1393 */ 1394 void (*ShaderCacheSerializeDriverBlob)(struct gl_context *ctx, 1395 struct gl_program *prog); 1396 /*@}*/ 1397 1398 /** 1399 * \name Set the number of compiler threads for ARB_parallel_shader_compile 1400 */ 1401 void (*SetMaxShaderCompilerThreads)(struct gl_context *ctx, unsigned count); 1402 bool (*GetShaderProgramCompletionStatus)(struct gl_context *ctx, 1403 struct gl_shader_program *shprog); 1404 1405 void (*PinDriverToL3Cache)(struct gl_context *ctx, unsigned L3_cache); 1406 1407 GLboolean (*ValidateEGLImage)(struct gl_context *ctx, GLeglImageOES image_handle); 1408 }; 1409 1410 1411 /** 1412 * Per-vertex functions. 1413 * 1414 * These are the functions which can appear between glBegin and glEnd. 1415 * Depending on whether we're inside or outside a glBegin/End pair 1416 * and whether we're in immediate mode or building a display list, these 1417 * functions behave differently. This structure allows us to switch 1418 * between those modes more easily. 1419 * 1420 * Generally, these pointers point to functions in the VBO module. 1421 */ 1422 typedef struct { 1423 void (GLAPIENTRYP ArrayElement)( GLint ); 1424 void (GLAPIENTRYP Color3f)( GLfloat, GLfloat, GLfloat ); 1425 void (GLAPIENTRYP Color3fv)( const GLfloat * ); 1426 void (GLAPIENTRYP Color4f)( GLfloat, GLfloat, GLfloat, GLfloat ); 1427 void (GLAPIENTRYP Color4fv)( const GLfloat * ); 1428 void (GLAPIENTRYP EdgeFlag)( GLboolean ); 1429 void (GLAPIENTRYP EvalCoord1f)( GLfloat ); 1430 void (GLAPIENTRYP EvalCoord1fv)( const GLfloat * ); 1431 void (GLAPIENTRYP EvalCoord2f)( GLfloat, GLfloat ); 1432 void (GLAPIENTRYP EvalCoord2fv)( const GLfloat * ); 1433 void (GLAPIENTRYP EvalPoint1)( GLint ); 1434 void (GLAPIENTRYP EvalPoint2)( GLint, GLint ); 1435 void (GLAPIENTRYP FogCoordfEXT)( GLfloat ); 1436 void (GLAPIENTRYP FogCoordfvEXT)( const GLfloat * ); 1437 void (GLAPIENTRYP Indexf)( GLfloat ); 1438 void (GLAPIENTRYP Indexfv)( const GLfloat * ); 1439 void (GLAPIENTRYP Materialfv)( GLenum face, GLenum pname, const GLfloat * ); 1440 void (GLAPIENTRYP MultiTexCoord1fARB)( GLenum, GLfloat ); 1441 void (GLAPIENTRYP MultiTexCoord1fvARB)( GLenum, const GLfloat * ); 1442 void (GLAPIENTRYP MultiTexCoord2fARB)( GLenum, GLfloat, GLfloat ); 1443 void (GLAPIENTRYP MultiTexCoord2fvARB)( GLenum, const GLfloat * ); 1444 void (GLAPIENTRYP MultiTexCoord3fARB)( GLenum, GLfloat, GLfloat, GLfloat ); 1445 void (GLAPIENTRYP MultiTexCoord3fvARB)( GLenum, const GLfloat * ); 1446 void (GLAPIENTRYP MultiTexCoord4fARB)( GLenum, GLfloat, GLfloat, GLfloat, GLfloat ); 1447 void (GLAPIENTRYP MultiTexCoord4fvARB)( GLenum, const GLfloat * ); 1448 void (GLAPIENTRYP Normal3f)( GLfloat, GLfloat, GLfloat ); 1449 void (GLAPIENTRYP Normal3fv)( const GLfloat * ); 1450 void (GLAPIENTRYP SecondaryColor3fEXT)( GLfloat, GLfloat, GLfloat ); 1451 void (GLAPIENTRYP SecondaryColor3fvEXT)( const GLfloat * ); 1452 void (GLAPIENTRYP TexCoord1f)( GLfloat ); 1453 void (GLAPIENTRYP TexCoord1fv)( const GLfloat * ); 1454 void (GLAPIENTRYP TexCoord2f)( GLfloat, GLfloat ); 1455 void (GLAPIENTRYP TexCoord2fv)( const GLfloat * ); 1456 void (GLAPIENTRYP TexCoord3f)( GLfloat, GLfloat, GLfloat ); 1457 void (GLAPIENTRYP TexCoord3fv)( const GLfloat * ); 1458 void (GLAPIENTRYP TexCoord4f)( GLfloat, GLfloat, GLfloat, GLfloat ); 1459 void (GLAPIENTRYP TexCoord4fv)( const GLfloat * ); 1460 void (GLAPIENTRYP Vertex2f)( GLfloat, GLfloat ); 1461 void (GLAPIENTRYP Vertex2fv)( const GLfloat * ); 1462 void (GLAPIENTRYP Vertex3f)( GLfloat, GLfloat, GLfloat ); 1463 void (GLAPIENTRYP Vertex3fv)( const GLfloat * ); 1464 void (GLAPIENTRYP Vertex4f)( GLfloat, GLfloat, GLfloat, GLfloat ); 1465 void (GLAPIENTRYP Vertex4fv)( const GLfloat * ); 1466 void (GLAPIENTRYP CallList)( GLuint ); 1467 void (GLAPIENTRYP CallLists)( GLsizei, GLenum, const GLvoid * ); 1468 void (GLAPIENTRYP Begin)( GLenum ); 1469 void (GLAPIENTRYP End)( void ); 1470 void (GLAPIENTRYP PrimitiveRestartNV)( void ); 1471 /* Originally for GL_NV_vertex_program, now used only dlist.c and friends */ 1472 void (GLAPIENTRYP VertexAttrib1fNV)( GLuint index, GLfloat x ); 1473 void (GLAPIENTRYP VertexAttrib1fvNV)( GLuint index, const GLfloat *v ); 1474 void (GLAPIENTRYP VertexAttrib2fNV)( GLuint index, GLfloat x, GLfloat y ); 1475 void (GLAPIENTRYP VertexAttrib2fvNV)( GLuint index, const GLfloat *v ); 1476 void (GLAPIENTRYP VertexAttrib3fNV)( GLuint index, GLfloat x, GLfloat y, GLfloat z ); 1477 void (GLAPIENTRYP VertexAttrib3fvNV)( GLuint index, const GLfloat *v ); 1478 void (GLAPIENTRYP VertexAttrib4fNV)( GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w ); 1479 void (GLAPIENTRYP VertexAttrib4fvNV)( GLuint index, const GLfloat *v ); 1480 /* GL_ARB_vertex_program */ 1481 void (GLAPIENTRYP VertexAttrib1fARB)( GLuint index, GLfloat x ); 1482 void (GLAPIENTRYP VertexAttrib1fvARB)( GLuint index, const GLfloat *v ); 1483 void (GLAPIENTRYP VertexAttrib2fARB)( GLuint index, GLfloat x, GLfloat y ); 1484 void (GLAPIENTRYP VertexAttrib2fvARB)( GLuint index, const GLfloat *v ); 1485 void (GLAPIENTRYP VertexAttrib3fARB)( GLuint index, GLfloat x, GLfloat y, GLfloat z ); 1486 void (GLAPIENTRYP VertexAttrib3fvARB)( GLuint index, const GLfloat *v ); 1487 void (GLAPIENTRYP VertexAttrib4fARB)( GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w ); 1488 void (GLAPIENTRYP VertexAttrib4fvARB)( GLuint index, const GLfloat *v ); 1489 1490 /* GL_EXT_gpu_shader4 / GL 3.0 */ 1491 void (GLAPIENTRYP VertexAttribI1i)( GLuint index, GLint x); 1492 void (GLAPIENTRYP VertexAttribI2i)( GLuint index, GLint x, GLint y); 1493 void (GLAPIENTRYP VertexAttribI3i)( GLuint index, GLint x, GLint y, GLint z); 1494 void (GLAPIENTRYP VertexAttribI4i)( GLuint index, GLint x, GLint y, GLint z, GLint w); 1495 void (GLAPIENTRYP VertexAttribI2iv)( GLuint index, const GLint *v); 1496 void (GLAPIENTRYP VertexAttribI3iv)( GLuint index, const GLint *v); 1497 void (GLAPIENTRYP VertexAttribI4iv)( GLuint index, const GLint *v); 1498 1499 void (GLAPIENTRYP VertexAttribI1ui)( GLuint index, GLuint x); 1500 void (GLAPIENTRYP VertexAttribI2ui)( GLuint index, GLuint x, GLuint y); 1501 void (GLAPIENTRYP VertexAttribI3ui)( GLuint index, GLuint x, GLuint y, GLuint z); 1502 void (GLAPIENTRYP VertexAttribI4ui)( GLuint index, GLuint x, GLuint y, GLuint z, GLuint w); 1503 void (GLAPIENTRYP VertexAttribI2uiv)( GLuint index, const GLuint *v); 1504 void (GLAPIENTRYP VertexAttribI3uiv)( GLuint index, const GLuint *v); 1505 void (GLAPIENTRYP VertexAttribI4uiv)( GLuint index, const GLuint *v); 1506 1507 /* GL_ARB_vertex_type_10_10_10_2_rev / GL3.3 */ 1508 void (GLAPIENTRYP VertexP2ui)( GLenum type, GLuint value ); 1509 void (GLAPIENTRYP VertexP2uiv)( GLenum type, const GLuint *value); 1510 1511 void (GLAPIENTRYP VertexP3ui)( GLenum type, GLuint value ); 1512 void (GLAPIENTRYP VertexP3uiv)( GLenum type, const GLuint *value); 1513 1514 void (GLAPIENTRYP VertexP4ui)( GLenum type, GLuint value ); 1515 void (GLAPIENTRYP VertexP4uiv)( GLenum type, const GLuint *value); 1516 1517 void (GLAPIENTRYP TexCoordP1ui)( GLenum type, GLuint coords ); 1518 void (GLAPIENTRYP TexCoordP1uiv)( GLenum type, const GLuint *coords ); 1519 1520 void (GLAPIENTRYP TexCoordP2ui)( GLenum type, GLuint coords ); 1521 void (GLAPIENTRYP TexCoordP2uiv)( GLenum type, const GLuint *coords ); 1522 1523 void (GLAPIENTRYP TexCoordP3ui)( GLenum type, GLuint coords ); 1524 void (GLAPIENTRYP TexCoordP3uiv)( GLenum type, const GLuint *coords ); 1525 1526 void (GLAPIENTRYP TexCoordP4ui)( GLenum type, GLuint coords ); 1527 void (GLAPIENTRYP TexCoordP4uiv)( GLenum type, const GLuint *coords ); 1528 1529 void (GLAPIENTRYP MultiTexCoordP1ui)( GLenum texture, GLenum type, GLuint coords ); 1530 void (GLAPIENTRYP MultiTexCoordP1uiv)( GLenum texture, GLenum type, const GLuint *coords ); 1531 void (GLAPIENTRYP MultiTexCoordP2ui)( GLenum texture, GLenum type, GLuint coords ); 1532 void (GLAPIENTRYP MultiTexCoordP2uiv)( GLenum texture, GLenum type, const GLuint *coords ); 1533 void (GLAPIENTRYP MultiTexCoordP3ui)( GLenum texture, GLenum type, GLuint coords ); 1534 void (GLAPIENTRYP MultiTexCoordP3uiv)( GLenum texture, GLenum type, const GLuint *coords ); 1535 void (GLAPIENTRYP MultiTexCoordP4ui)( GLenum texture, GLenum type, GLuint coords ); 1536 void (GLAPIENTRYP MultiTexCoordP4uiv)( GLenum texture, GLenum type, const GLuint *coords ); 1537 1538 void (GLAPIENTRYP NormalP3ui)( GLenum type, GLuint coords ); 1539 void (GLAPIENTRYP NormalP3uiv)( GLenum type, const GLuint *coords ); 1540 1541 void (GLAPIENTRYP ColorP3ui)( GLenum type, GLuint color ); 1542 void (GLAPIENTRYP ColorP3uiv)( GLenum type, const GLuint *color ); 1543 1544 void (GLAPIENTRYP ColorP4ui)( GLenum type, GLuint color ); 1545 void (GLAPIENTRYP ColorP4uiv)( GLenum type, const GLuint *color ); 1546 1547 void (GLAPIENTRYP SecondaryColorP3ui)( GLenum type, GLuint color ); 1548 void (GLAPIENTRYP SecondaryColorP3uiv)( GLenum type, const GLuint *color ); 1549 1550 void (GLAPIENTRYP VertexAttribP1ui)( GLuint index, GLenum type, 1551 GLboolean normalized, GLuint value); 1552 void (GLAPIENTRYP VertexAttribP2ui)( GLuint index, GLenum type, 1553 GLboolean normalized, GLuint value); 1554 void (GLAPIENTRYP VertexAttribP3ui)( GLuint index, GLenum type, 1555 GLboolean normalized, GLuint value); 1556 void (GLAPIENTRYP VertexAttribP4ui)( GLuint index, GLenum type, 1557 GLboolean normalized, GLuint value); 1558 void (GLAPIENTRYP VertexAttribP1uiv)( GLuint index, GLenum type, 1559 GLboolean normalized, 1560 const GLuint *value); 1561 void (GLAPIENTRYP VertexAttribP2uiv)( GLuint index, GLenum type, 1562 GLboolean normalized, 1563 const GLuint *value); 1564 void (GLAPIENTRYP VertexAttribP3uiv)( GLuint index, GLenum type, 1565 GLboolean normalized, 1566 const GLuint *value); 1567 void (GLAPIENTRYP VertexAttribP4uiv)( GLuint index, GLenum type, 1568 GLboolean normalized, 1569 const GLuint *value); 1570 1571 /* GL_ARB_vertex_attrib_64bit / GL 4.1 */ 1572 void (GLAPIENTRYP VertexAttribL1d)( GLuint index, GLdouble x); 1573 void (GLAPIENTRYP VertexAttribL2d)( GLuint index, GLdouble x, GLdouble y); 1574 void (GLAPIENTRYP VertexAttribL3d)( GLuint index, GLdouble x, GLdouble y, GLdouble z); 1575 void (GLAPIENTRYP VertexAttribL4d)( GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w); 1576 1577 1578 void (GLAPIENTRYP VertexAttribL1dv)( GLuint index, const GLdouble *v); 1579 void (GLAPIENTRYP VertexAttribL2dv)( GLuint index, const GLdouble *v); 1580 void (GLAPIENTRYP VertexAttribL3dv)( GLuint index, const GLdouble *v); 1581 void (GLAPIENTRYP VertexAttribL4dv)( GLuint index, const GLdouble *v); 1582 1583 void (GLAPIENTRYP VertexAttribL1ui64ARB)( GLuint index, GLuint64EXT x); 1584 void (GLAPIENTRYP VertexAttribL1ui64vARB)( GLuint index, const GLuint64EXT *v); 1585 1586 /* GL_NV_half_float */ 1587 void (GLAPIENTRYP Vertex2hNV)( GLhalfNV, GLhalfNV ); 1588 void (GLAPIENTRYP Vertex2hvNV)( const GLhalfNV * ); 1589 void (GLAPIENTRYP Vertex3hNV)( GLhalfNV, GLhalfNV, GLhalfNV ); 1590 void (GLAPIENTRYP Vertex3hvNV)( const GLhalfNV * ); 1591 void (GLAPIENTRYP Vertex4hNV)( GLhalfNV, GLhalfNV, GLhalfNV, GLhalfNV ); 1592 void (GLAPIENTRYP Vertex4hvNV)( const GLhalfNV * ); 1593 void (GLAPIENTRYP Normal3hNV)( GLhalfNV, GLhalfNV, GLhalfNV ); 1594 void (GLAPIENTRYP Normal3hvNV)( const GLhalfNV * ); 1595 void (GLAPIENTRYP Color3hNV)( GLhalfNV, GLhalfNV, GLhalfNV ); 1596 void (GLAPIENTRYP Color3hvNV)( const GLhalfNV * ); 1597 void (GLAPIENTRYP Color4hNV)( GLhalfNV, GLhalfNV, GLhalfNV, GLhalfNV ); 1598 void (GLAPIENTRYP Color4hvNV)( const GLhalfNV * ); 1599 void (GLAPIENTRYP TexCoord1hNV)( GLhalfNV ); 1600 void (GLAPIENTRYP TexCoord1hvNV)( const GLhalfNV * ); 1601 void (GLAPIENTRYP TexCoord2hNV)( GLhalfNV, GLhalfNV ); 1602 void (GLAPIENTRYP TexCoord2hvNV)( const GLhalfNV * ); 1603 void (GLAPIENTRYP TexCoord3hNV)( GLhalfNV, GLhalfNV, GLhalfNV ); 1604 void (GLAPIENTRYP TexCoord3hvNV)( const GLhalfNV * ); 1605 void (GLAPIENTRYP TexCoord4hNV)( GLhalfNV, GLhalfNV, GLhalfNV, GLhalfNV ); 1606 void (GLAPIENTRYP TexCoord4hvNV)( const GLhalfNV * ); 1607 void (GLAPIENTRYP MultiTexCoord1hNV)( GLenum, GLhalfNV ); 1608 void (GLAPIENTRYP MultiTexCoord1hvNV)( GLenum, const GLhalfNV * ); 1609 void (GLAPIENTRYP MultiTexCoord2hNV)( GLenum, GLhalfNV, GLhalfNV ); 1610 void (GLAPIENTRYP MultiTexCoord2hvNV)( GLenum, const GLhalfNV * ); 1611 void (GLAPIENTRYP MultiTexCoord3hNV)( GLenum, GLhalfNV, GLhalfNV, GLhalfNV ); 1612 void (GLAPIENTRYP MultiTexCoord3hvNV)( GLenum, const GLhalfNV * ); 1613 void (GLAPIENTRYP MultiTexCoord4hNV)( GLenum, GLhalfNV, GLhalfNV, GLhalfNV, GLhalfNV ); 1614 void (GLAPIENTRYP MultiTexCoord4hvNV)( GLenum, const GLhalfNV * ); 1615 void (GLAPIENTRYP VertexAttrib1hNV)( GLuint index, GLhalfNV x ); 1616 void (GLAPIENTRYP VertexAttrib1hvNV)( GLuint index, const GLhalfNV *v ); 1617 void (GLAPIENTRYP VertexAttrib2hNV)( GLuint index, GLhalfNV x, GLhalfNV y ); 1618 void (GLAPIENTRYP VertexAttrib2hvNV)( GLuint index, const GLhalfNV *v ); 1619 void (GLAPIENTRYP VertexAttrib3hNV)( GLuint index, GLhalfNV x, GLhalfNV y, GLhalfNV z ); 1620 void (GLAPIENTRYP VertexAttrib3hvNV)( GLuint index, const GLhalfNV *v ); 1621 void (GLAPIENTRYP VertexAttrib4hNV)( GLuint index, GLhalfNV x, GLhalfNV y, GLhalfNV z, GLhalfNV w ); 1622 void (GLAPIENTRYP VertexAttrib4hvNV)( GLuint index, const GLhalfNV *v ); 1623 void (GLAPIENTRYP VertexAttribs1hvNV)(GLuint index, GLsizei n, const GLhalfNV *v); 1624 void (GLAPIENTRYP VertexAttribs2hvNV)(GLuint index, GLsizei n, const GLhalfNV *v); 1625 void (GLAPIENTRYP VertexAttribs3hvNV)(GLuint index, GLsizei n, const GLhalfNV *v); 1626 void (GLAPIENTRYP VertexAttribs4hvNV)(GLuint index, GLsizei n, const GLhalfNV *v); 1627 void (GLAPIENTRYP FogCoordhNV)( GLhalfNV ); 1628 void (GLAPIENTRYP FogCoordhvNV)( const GLhalfNV * ); 1629 void (GLAPIENTRYP SecondaryColor3hNV)( GLhalfNV, GLhalfNV, GLhalfNV ); 1630 void (GLAPIENTRYP SecondaryColor3hvNV)( const GLhalfNV * ); 1631 1632 void (GLAPIENTRYP Color3b)( GLbyte red, GLbyte green, GLbyte blue ); 1633 void (GLAPIENTRYP Color3d)( GLdouble red, GLdouble green, GLdouble blue ); 1634 void (GLAPIENTRYP Color3i)( GLint red, GLint green, GLint blue ); 1635 void (GLAPIENTRYP Color3s)( GLshort red, GLshort green, GLshort blue ); 1636 void (GLAPIENTRYP Color3ui)( GLuint red, GLuint green, GLuint blue ); 1637 void (GLAPIENTRYP Color3us)( GLushort red, GLushort green, GLushort blue ); 1638 void (GLAPIENTRYP Color3ub)( GLubyte red, GLubyte green, GLubyte blue ); 1639 void (GLAPIENTRYP Color3bv)( const GLbyte *v ); 1640 void (GLAPIENTRYP Color3dv)( const GLdouble *v ); 1641 void (GLAPIENTRYP Color3iv)( const GLint *v ); 1642 void (GLAPIENTRYP Color3sv)( const GLshort *v ); 1643 void (GLAPIENTRYP Color3uiv)( const GLuint *v ); 1644 void (GLAPIENTRYP Color3usv)( const GLushort *v ); 1645 void (GLAPIENTRYP Color3ubv)( const GLubyte *v ); 1646 void (GLAPIENTRYP Color4b)( GLbyte red, GLbyte green, GLbyte blue, GLbyte alpha ); 1647 void (GLAPIENTRYP Color4d)( GLdouble red, GLdouble green, GLdouble blue, 1648 GLdouble alpha ); 1649 void (GLAPIENTRYP Color4i)( GLint red, GLint green, GLint blue, GLint alpha ); 1650 void (GLAPIENTRYP Color4s)( GLshort red, GLshort green, GLshort blue, 1651 GLshort alpha ); 1652 void (GLAPIENTRYP Color4ui)( GLuint red, GLuint green, GLuint blue, GLuint alpha ); 1653 void (GLAPIENTRYP Color4us)( GLushort red, GLushort green, GLushort blue, 1654 GLushort alpha ); 1655 void (GLAPIENTRYP Color4ub)( GLubyte red, GLubyte green, GLubyte blue, GLubyte alpha ); 1656 void (GLAPIENTRYP Color4iv)( const GLint *v ); 1657 void (GLAPIENTRYP Color4bv)( const GLbyte *v ); 1658 void (GLAPIENTRYP Color4dv)( const GLdouble *v ); 1659 void (GLAPIENTRYP Color4sv)( const GLshort *v); 1660 void (GLAPIENTRYP Color4uiv)( const GLuint *v); 1661 void (GLAPIENTRYP Color4usv)( const GLushort *v); 1662 void (GLAPIENTRYP Color4ubv)( const GLubyte *v); 1663 void (GLAPIENTRYP FogCoordd)( GLdouble d ); 1664 void (GLAPIENTRYP FogCoorddv)( const GLdouble *v ); 1665 void (GLAPIENTRYP Indexd)( GLdouble c ); 1666 void (GLAPIENTRYP Indexi)( GLint c ); 1667 void (GLAPIENTRYP Indexs)( GLshort c ); 1668 void (GLAPIENTRYP Indexub)( GLubyte c ); 1669 void (GLAPIENTRYP Indexdv)( const GLdouble *c ); 1670 void (GLAPIENTRYP Indexiv)( const GLint *c ); 1671 void (GLAPIENTRYP Indexsv)( const GLshort *c ); 1672 void (GLAPIENTRYP Indexubv)( const GLubyte *c ); 1673 void (GLAPIENTRYP EdgeFlagv)(const GLboolean *flag); 1674 void (GLAPIENTRYP Normal3b)( GLbyte nx, GLbyte ny, GLbyte nz ); 1675 void (GLAPIENTRYP Normal3d)( GLdouble nx, GLdouble ny, GLdouble nz ); 1676 void (GLAPIENTRYP Normal3i)( GLint nx, GLint ny, GLint nz ); 1677 void (GLAPIENTRYP Normal3s)( GLshort nx, GLshort ny, GLshort nz ); 1678 void (GLAPIENTRYP Normal3bv)( const GLbyte *v ); 1679 void (GLAPIENTRYP Normal3dv)( const GLdouble *v ); 1680 void (GLAPIENTRYP Normal3iv)( const GLint *v ); 1681 void (GLAPIENTRYP Normal3sv)( const GLshort *v ); 1682 void (GLAPIENTRYP TexCoord1d)( GLdouble s ); 1683 void (GLAPIENTRYP TexCoord1i)( GLint s ); 1684 void (GLAPIENTRYP TexCoord1s)( GLshort s ); 1685 void (GLAPIENTRYP TexCoord2d)( GLdouble s, GLdouble t ); 1686 void (GLAPIENTRYP TexCoord2s)( GLshort s, GLshort t ); 1687 void (GLAPIENTRYP TexCoord2i)( GLint s, GLint t ); 1688 void (GLAPIENTRYP TexCoord3d)( GLdouble s, GLdouble t, GLdouble r ); 1689 void (GLAPIENTRYP TexCoord3i)( GLint s, GLint t, GLint r ); 1690 void (GLAPIENTRYP TexCoord3s)( GLshort s, GLshort t, GLshort r ); 1691 void (GLAPIENTRYP TexCoord4d)( GLdouble s, GLdouble t, GLdouble r, GLdouble q ); 1692 void (GLAPIENTRYP TexCoord4i)( GLint s, GLint t, GLint r, GLint q ); 1693 void (GLAPIENTRYP TexCoord4s)( GLshort s, GLshort t, GLshort r, GLshort q ); 1694 void (GLAPIENTRYP TexCoord1dv)( const GLdouble *v ); 1695 void (GLAPIENTRYP TexCoord1iv)( const GLint *v ); 1696 void (GLAPIENTRYP TexCoord1sv)( const GLshort *v ); 1697 void (GLAPIENTRYP TexCoord2dv)( const GLdouble *v ); 1698 void (GLAPIENTRYP TexCoord2iv)( const GLint *v ); 1699 void (GLAPIENTRYP TexCoord2sv)( const GLshort *v ); 1700 void (GLAPIENTRYP TexCoord3dv)( const GLdouble *v ); 1701 void (GLAPIENTRYP TexCoord3iv)( const GLint *v ); 1702 void (GLAPIENTRYP TexCoord3sv)( const GLshort *v ); 1703 void (GLAPIENTRYP TexCoord4dv)( const GLdouble *v ); 1704 void (GLAPIENTRYP TexCoord4iv)( const GLint *v ); 1705 void (GLAPIENTRYP TexCoord4sv)( const GLshort *v ); 1706 void (GLAPIENTRYP Vertex2d)( GLdouble x, GLdouble y ); 1707 void (GLAPIENTRYP Vertex2i)( GLint x, GLint y ); 1708 void (GLAPIENTRYP Vertex2s)( GLshort x, GLshort y ); 1709 void (GLAPIENTRYP Vertex3d)( GLdouble x, GLdouble y, GLdouble z ); 1710 void (GLAPIENTRYP Vertex3i)( GLint x, GLint y, GLint z ); 1711 void (GLAPIENTRYP Vertex3s)( GLshort x, GLshort y, GLshort z ); 1712 void (GLAPIENTRYP Vertex4d)( GLdouble x, GLdouble y, GLdouble z, GLdouble w ); 1713 void (GLAPIENTRYP Vertex4i)( GLint x, GLint y, GLint z, GLint w ); 1714 void (GLAPIENTRYP Vertex4s)( GLshort x, GLshort y, GLshort z, GLshort w ); 1715 void (GLAPIENTRYP Vertex2dv)( const GLdouble *v ); 1716 void (GLAPIENTRYP Vertex2iv)( const GLint *v ); 1717 void (GLAPIENTRYP Vertex2sv)( const GLshort *v ); 1718 void (GLAPIENTRYP Vertex3dv)( const GLdouble *v ); 1719 void (GLAPIENTRYP Vertex3iv)( const GLint *v ); 1720 void (GLAPIENTRYP Vertex3sv)( const GLshort *v ); 1721 void (GLAPIENTRYP Vertex4dv)( const GLdouble *v ); 1722 void (GLAPIENTRYP Vertex4iv)( const GLint *v ); 1723 void (GLAPIENTRYP Vertex4sv)( const GLshort *v ); 1724 void (GLAPIENTRYP MultiTexCoord1d)(GLenum target, GLdouble s); 1725 void (GLAPIENTRYP MultiTexCoord1dv)(GLenum target, const GLdouble *v); 1726 void (GLAPIENTRYP MultiTexCoord1i)(GLenum target, GLint s); 1727 void (GLAPIENTRYP MultiTexCoord1iv)(GLenum target, const GLint *v); 1728 void (GLAPIENTRYP MultiTexCoord1s)(GLenum target, GLshort s); 1729 void (GLAPIENTRYP MultiTexCoord1sv)(GLenum target, const GLshort *v); 1730 void (GLAPIENTRYP MultiTexCoord2d)(GLenum target, GLdouble s, GLdouble t); 1731 void (GLAPIENTRYP MultiTexCoord2dv)(GLenum target, const GLdouble *v); 1732 void (GLAPIENTRYP MultiTexCoord2i)(GLenum target, GLint s, GLint t); 1733 void (GLAPIENTRYP MultiTexCoord2iv)(GLenum target, const GLint *v); 1734 void (GLAPIENTRYP MultiTexCoord2s)(GLenum target, GLshort s, GLshort t); 1735 void (GLAPIENTRYP MultiTexCoord2sv)(GLenum target, const GLshort *v); 1736 void (GLAPIENTRYP MultiTexCoord3d)(GLenum target, GLdouble s, GLdouble t, GLdouble r); 1737 void (GLAPIENTRYP MultiTexCoord3dv)(GLenum target, const GLdouble *v); 1738 void (GLAPIENTRYP MultiTexCoord3i)(GLenum target, GLint s, GLint t, GLint r); 1739 void (GLAPIENTRYP MultiTexCoord3iv)(GLenum target, const GLint *v); 1740 void (GLAPIENTRYP MultiTexCoord3s)(GLenum target, GLshort s, GLshort t, GLshort r); 1741 void (GLAPIENTRYP MultiTexCoord3sv)(GLenum target, const GLshort *v); 1742 void (GLAPIENTRYP MultiTexCoord4d)(GLenum target, GLdouble s, GLdouble t, GLdouble r, 1743 GLdouble q); 1744 void (GLAPIENTRYP MultiTexCoord4dv)(GLenum target, const GLdouble *v); 1745 void (GLAPIENTRYP MultiTexCoord4i)(GLenum target, GLint s, GLint t, GLint r, GLint q); 1746 void (GLAPIENTRYP MultiTexCoord4iv)(GLenum target, const GLint *v); 1747 void (GLAPIENTRYP MultiTexCoord4s)(GLenum target, GLshort s, GLshort t, GLshort r, 1748 GLshort q); 1749 void (GLAPIENTRYP MultiTexCoord4sv)(GLenum target, const GLshort *v); 1750 void (GLAPIENTRYP EvalCoord2dv)( const GLdouble *u ); 1751 void (GLAPIENTRYP EvalCoord2d)( GLdouble u, GLdouble v ); 1752 void (GLAPIENTRYP EvalCoord1dv)( const GLdouble *u ); 1753 void (GLAPIENTRYP EvalCoord1d)( GLdouble u ); 1754 void (GLAPIENTRYP Materialf)( GLenum face, GLenum pname, GLfloat param ); 1755 void (GLAPIENTRYP Materiali)(GLenum face, GLenum pname, GLint param ); 1756 void (GLAPIENTRYP Materialiv)(GLenum face, GLenum pname, const GLint *params ); 1757 void (GLAPIENTRYP SecondaryColor3b)( GLbyte red, GLbyte green, GLbyte blue ); 1758 void (GLAPIENTRYP SecondaryColor3d)( GLdouble red, GLdouble green, GLdouble blue ); 1759 void (GLAPIENTRYP SecondaryColor3i)( GLint red, GLint green, GLint blue ); 1760 void (GLAPIENTRYP SecondaryColor3s)( GLshort red, GLshort green, GLshort blue ); 1761 void (GLAPIENTRYP SecondaryColor3ui)( GLuint red, GLuint green, GLuint blue ); 1762 void (GLAPIENTRYP SecondaryColor3us)( GLushort red, GLushort green, GLushort blue ); 1763 void (GLAPIENTRYP SecondaryColor3ub)( GLubyte red, GLubyte green, GLubyte blue ); 1764 void (GLAPIENTRYP SecondaryColor3bv)( const GLbyte *v ); 1765 void (GLAPIENTRYP SecondaryColor3dv)( const GLdouble *v ); 1766 void (GLAPIENTRYP SecondaryColor3iv)( const GLint *v ); 1767 void (GLAPIENTRYP SecondaryColor3sv)( const GLshort *v ); 1768 void (GLAPIENTRYP SecondaryColor3uiv)( const GLuint *v ); 1769 void (GLAPIENTRYP SecondaryColor3usv)( const GLushort *v ); 1770 void (GLAPIENTRYP SecondaryColor3ubv)( const GLubyte *v ); 1771 void (GLAPIENTRYP VertexAttrib1sNV)(GLuint index, GLshort x); 1772 void (GLAPIENTRYP VertexAttrib1dNV)(GLuint index, GLdouble x); 1773 void (GLAPIENTRYP VertexAttrib2sNV)(GLuint index, GLshort x, GLshort y); 1774 void (GLAPIENTRYP VertexAttrib2dNV)(GLuint index, GLdouble x, GLdouble y); 1775 void (GLAPIENTRYP VertexAttrib3sNV)(GLuint index, GLshort x, GLshort y, GLshort z); 1776 void (GLAPIENTRYP VertexAttrib3dNV)(GLuint index, GLdouble x, GLdouble y, GLdouble z); 1777 void (GLAPIENTRYP VertexAttrib4sNV)(GLuint index, GLshort x, GLshort y, GLshort z, 1778 GLshort w); 1779 void (GLAPIENTRYP VertexAttrib4dNV)(GLuint index, GLdouble x, GLdouble y, GLdouble z, 1780 GLdouble w); 1781 void (GLAPIENTRYP VertexAttrib4ubNV)(GLuint index, GLubyte x, GLubyte y, GLubyte z, 1782 GLubyte w); 1783 void (GLAPIENTRYP VertexAttrib1svNV)(GLuint index, const GLshort *v); 1784 void (GLAPIENTRYP VertexAttrib1dvNV)(GLuint index, const GLdouble *v); 1785 void (GLAPIENTRYP VertexAttrib2svNV)(GLuint index, const GLshort *v); 1786 void (GLAPIENTRYP VertexAttrib2dvNV)(GLuint index, const GLdouble *v); 1787 void (GLAPIENTRYP VertexAttrib3svNV)(GLuint index, const GLshort *v); 1788 void (GLAPIENTRYP VertexAttrib3dvNV)(GLuint index, const GLdouble *v); 1789 void (GLAPIENTRYP VertexAttrib4svNV)(GLuint index, const GLshort *v); 1790 void (GLAPIENTRYP VertexAttrib4dvNV)(GLuint index, const GLdouble *v); 1791 void (GLAPIENTRYP VertexAttrib4ubvNV)(GLuint index, const GLubyte *v); 1792 void (GLAPIENTRYP VertexAttribs1svNV)(GLuint index, GLsizei n, const GLshort *v); 1793 void (GLAPIENTRYP VertexAttribs1fvNV)(GLuint index, GLsizei n, const GLfloat *v); 1794 void (GLAPIENTRYP VertexAttribs1dvNV)(GLuint index, GLsizei n, const GLdouble *v); 1795 void (GLAPIENTRYP VertexAttribs2svNV)(GLuint index, GLsizei n, const GLshort *v); 1796 void (GLAPIENTRYP VertexAttribs2fvNV)(GLuint index, GLsizei n, const GLfloat *v); 1797 void (GLAPIENTRYP VertexAttribs2dvNV)(GLuint index, GLsizei n, const GLdouble *v); 1798 void (GLAPIENTRYP VertexAttribs3svNV)(GLuint index, GLsizei n, const GLshort *v); 1799 void (GLAPIENTRYP VertexAttribs3fvNV)(GLuint index, GLsizei n, const GLfloat *v); 1800 void (GLAPIENTRYP VertexAttribs3dvNV)(GLuint index, GLsizei n, const GLdouble *v); 1801 void (GLAPIENTRYP VertexAttribs4svNV)(GLuint index, GLsizei n, const GLshort *v); 1802 void (GLAPIENTRYP VertexAttribs4fvNV)(GLuint index, GLsizei n, const GLfloat *v); 1803 void (GLAPIENTRYP VertexAttribs4dvNV)(GLuint index, GLsizei n, const GLdouble *v); 1804 void (GLAPIENTRYP VertexAttribs4ubvNV)(GLuint index, GLsizei n, const GLubyte *v); 1805 void (GLAPIENTRYP VertexAttrib1s)(GLuint index, GLshort x); 1806 void (GLAPIENTRYP VertexAttrib1d)(GLuint index, GLdouble x); 1807 void (GLAPIENTRYP VertexAttrib2s)(GLuint index, GLshort x, GLshort y); 1808 void (GLAPIENTRYP VertexAttrib2d)(GLuint index, GLdouble x, GLdouble y); 1809 void (GLAPIENTRYP VertexAttrib3s)(GLuint index, GLshort x, GLshort y, GLshort z); 1810 void (GLAPIENTRYP VertexAttrib3d)(GLuint index, GLdouble x, GLdouble y, GLdouble z); 1811 void (GLAPIENTRYP VertexAttrib4s)(GLuint index, GLshort x, GLshort y, GLshort z, 1812 GLshort w); 1813 void (GLAPIENTRYP VertexAttrib4d)(GLuint index, GLdouble x, GLdouble y, GLdouble z, 1814 GLdouble w); 1815 void (GLAPIENTRYP VertexAttrib1sv)(GLuint index, const GLshort *v); 1816 void (GLAPIENTRYP VertexAttrib1dv)(GLuint index, const GLdouble *v); 1817 void (GLAPIENTRYP VertexAttrib2sv)(GLuint index, const GLshort *v); 1818 void (GLAPIENTRYP VertexAttrib2dv)(GLuint index, const GLdouble *v); 1819 void (GLAPIENTRYP VertexAttrib3sv)(GLuint index, const GLshort *v); 1820 void (GLAPIENTRYP VertexAttrib3dv)(GLuint index, const GLdouble *v); 1821 void (GLAPIENTRYP VertexAttrib4sv)(GLuint index, const GLshort *v); 1822 void (GLAPIENTRYP VertexAttrib4dv)(GLuint index, const GLdouble *v); 1823 void (GLAPIENTRYP VertexAttrib4bv)(GLuint index, const GLbyte * v); 1824 void (GLAPIENTRYP VertexAttrib4iv)(GLuint index, const GLint * v); 1825 void (GLAPIENTRYP VertexAttrib4ubv)(GLuint index, const GLubyte * v); 1826 void (GLAPIENTRYP VertexAttrib4usv)(GLuint index, const GLushort * v); 1827 void (GLAPIENTRYP VertexAttrib4uiv)(GLuint index, const GLuint * v); 1828 void (GLAPIENTRYP VertexAttrib4Nbv)(GLuint index, const GLbyte * v); 1829 void (GLAPIENTRYP VertexAttrib4Nsv)(GLuint index, const GLshort * v); 1830 void (GLAPIENTRYP VertexAttrib4Niv)(GLuint index, const GLint * v); 1831 void (GLAPIENTRYP VertexAttrib4Nub)(GLuint index, GLubyte x, GLubyte y, GLubyte z, 1832 GLubyte w); 1833 void (GLAPIENTRYP VertexAttrib4Nubv)(GLuint index, const GLubyte * v); 1834 void (GLAPIENTRYP VertexAttrib4Nusv)(GLuint index, const GLushort * v); 1835 void (GLAPIENTRYP VertexAttrib4Nuiv)(GLuint index, const GLuint * v); 1836 void (GLAPIENTRYP VertexAttribI1iv)(GLuint index, const GLint *v); 1837 void (GLAPIENTRYP VertexAttribI1uiv)(GLuint index, const GLuint *v); 1838 void (GLAPIENTRYP VertexAttribI4bv)(GLuint index, const GLbyte *v); 1839 void (GLAPIENTRYP VertexAttribI4sv)(GLuint index, const GLshort *v); 1840 void (GLAPIENTRYP VertexAttribI4ubv)(GLuint index, const GLubyte *v); 1841 void (GLAPIENTRYP VertexAttribI4usv)(GLuint index, const GLushort *v); 1842 } GLvertexformat; 1843 1844 1845 #endif /* DD_INCLUDED */ 1846