1Name 2 3 EXT_direct_state_access 4 5Name Strings 6 7 GL_EXT_direct_state_access 8 9Contributors 10 11 Cass Everitt, NVIDIA 12 Daniel Pageau, Blizzard 13 Daniel Koch, TransGaming 14 Ian Romanick, IBM 15 Jason Green, TransGaming 16 Johan Andersson, DICE/Electronic Arts 17 Jon Leech 18 Mark Kilgard, NVIDIA 19 Nicholas Vining, Destineer 20 Pat Brown, NVIDIA 21 Patrick Doane, Blizzard 22 Robert Barris, Blizzard 23 Ryan Gordon, Destineer 24 Scott Nations, NVIDIA 25 Yanjun Zhang, S3 Graphics 26 Jeff Bolz, NVIDIA 27 Jeff Juliano, NVIDIA 28 Jon Burgess, NVIDIA 29 Mike Marcin 30 Nigel Stewart, NVIDIA 31 Jason McKesson 32 Graham Sellers, AMD 33 Vladimir Vukicevic, Mozilla 34 35Contact 36 37 Mark J. Kilgard, NVIDIA Corporation (mjk 'at' nvidia.com) 38 39Status 40 41 Complete, except for GLX protocol 42 43 Version 1.0 implemented by NVIDIA, shipping November 2008 44 Version 1.1 implemented by NVIDIA, shipping January 2009 45 46Version 47 48 Last Modified Date: 02/24/2014 49 Author revision: 39 50 Version 1.2 51 52 (version 1.0 lacked OpenGL 3.0 support) 53 (version 1.1 lacked GL_TEXTUREi support for glVertexArrayTexCoordOffsetEXT) 54 (version 1.1 didn't clearly specify GL_TEXTURE_COORD_ARRAY works with glGetVertexArrayIntegeri_vEXT) 55 56Number 57 58 353 59 60Dependencies 61 62 This extension is written against the OpenGL 2.1 specification. 63 64 This extension interacts with the matrix manipulation commands 65 introduced by OpenGL 1.0. 66 67 This extension interacts with the texture object manipulation commands 68 introduced by EXT_texture_object and standardized by OpenGL 1.1. 69 70 This extension interacts with the 3D texture object manipulation 71 commands introduced by EXT_texture3D and standardized by OpenGL 1.2. 72 73 This extension interacts with the multitexture command introduced 74 by ARB_multitexture and standardized by OpenGL 1.2.1. 75 76 This extension interacts with the matrix transpose manipulation 77 commands introduced by ARB_transpose_matrix and standardized by 78 OpenGL 1.3. 79 80 This extension interacts with the local parameter program object 81 manipulation commands introduced by ARB_vertex_program. 82 83 This extension interacts with the texture rectangle enable and target 84 binding introduced by ARB_texture_rectangle (and NV_texture_rectangle 85 and EXT_texture_rectangle). 86 87 This extension interacts with the buffer manipulation commands 88 standardized by OpenGL 1.5. 89 90 This extension interacts with the GLSL uniform commands standardized 91 by OpenGL 2.0. 92 93 This extension interacts with the GLSL uniform matrix commands 94 standardized by OpenGL 2.1. 95 96 This extension interacts with the framebuffer object commands 97 introduced by EXT_framebuffer_object and standardized by OpenGL 3.0. 98 99 This extension interacts with the framebuffer blit commands introduced 100 by EXT_framebuffer_blit and standardized by OpenGL 3.0. 101 102 This extension interacts with the framebuffer multisample commands 103 introduced by EXT_framebuffer_multisample and standardized by 104 OpenGL 3.0. 105 106 This extension interacts with the vertex array object commands 107 introduced by APPLE_vertex_array_object and standardized by 108 OpenGL 3.0. 109 110 This extension interacts with the integer texture parameter commands 111 introduced by EXT_texture_integer and standardized by OpenGL 3.0. 112 113 This extension interacts with the texture buffer commands introduced 114 by EXT_texture_buffer_object. 115 116 This extension interacts with the GLSL integer uniform commands 117 introduced by EXT_gpu_shader4. 118 119 This extension interacts with the local plural parameter program 120 object manipulation commands introduced by EXT_gpu_program_parameters. 121 122 This extension interacts with the local integer parameter program 123 object manipulation commands introduced by NV_gpu_program4. 124 125 This extension trivially interacts with the EnableIndexedEXT 126 and DisableIndexed commands and the integer and boolean indexed 127 queries introduced by EXT_draw_buffers2, EXT_transform_feedback, 128 and NV_transform_feedback. 129 130 This extension interacts with NV_explicit_multisample. 131 132 This extension trivially interacts with EXT_texture_array. 133 134 This extension trivially interacts with NV_texture_cube_map_array. 135 136 This extension interacts with the buffer data copying command 137 introduced by EXT_copy_buffer and standardized by OpenGL 3.0. 138 139Overview 140 141 This extension introduces a set of new "direct state access" 142 commands (meaning no selector is involved) to access (update and 143 query) OpenGL state that previously depended on the OpenGL state 144 selectors for access. These new commands supplement the existing 145 selector-based OpenGL commands to access the same state. 146 147 The intent of this extension is to make it more efficient for 148 libraries to avoid disturbing selector and latched state. The 149 extension also allows more efficient command usage by eliminating 150 the need for selector update commands. 151 152 Two derivative advantages of this extension are 1) display lists 153 can be executed using these commands that avoid disturbing selectors 154 that subsequent commands may depend on, and 2) drivers implemented 155 with a dual-thread partitioning with OpenGL command buffering from 156 an application thread and then OpenGL command dispatching in a 157 concurrent driver thread can avoid thread synchronization created by 158 selector saving, setting, command execution, and selector restoration. 159 160 This extension does not itself add any new OpenGL state. 161 162 We call a state variable in OpenGL an "OpenGL state selector" or 163 simply a "selector" if OpenGL commands depend on the state variable 164 to determine what state to query or update. The matrix mode and 165 active texture are both selectors. Object bindings for buffers, 166 programs, textures, and framebuffer objects are also selectors. 167 168 We call OpenGL state "latched" if the state is set by one OpenGL 169 command but then that state is saved by a subsequent command or the 170 state determines how client memory or buffer object memory is accessed 171 by a subsequent command. The array and element array buffer bindings 172 are latched by vertex array specification commands to determine 173 which buffer a given vertex array uses. Vertex array state and pixel 174 pack/unpack state decides how client memory or buffer object memory is 175 accessed by subsequent vertex pulling or image specification commands. 176 177 The existence of selectors and latched state in the OpenGL API 178 reduces the number of parameters to various sets of OpenGL commands 179 but complicates the access to state for layered libraries which seek 180 to access state without disturbing other state, namely the state of 181 state selectors and latched state. In many cases, selectors and 182 latched state were introduced by extensions as OpenGL evolved to 183 minimize the disruption to the OpenGL API when new functionality, 184 particularly the pluralization of existing functionality as when 185 texture objects and later multiple texture units, was introduced. 186 187 The OpenGL API involves several selectors (listed in historical 188 order of introduction): 189 190 o The matrix mode. 191 192 o The current bound texture for each supported texture target. 193 194 o The active texture. 195 196 o The active client texture. 197 198 o The current bound program for each supported program target. 199 200 o The current bound buffer for each supported buffer target. 201 202 o The current GLSL program. 203 204 o The current framebuffer object. 205 206 The new selector-free update commands can be compiled into display 207 lists. 208 209 The OpenGL API has latched state for vertex array buffer objects 210 and pixel store state. When an application issues a GL command to 211 unpack or pack pixels (for example, glTexImage2D or glReadPixels 212 respectively), the current unpack and pack pixel store state 213 determines how the pixels are unpacked from/packed to client memory 214 or pixel buffer objects. For example, consider: 215 216 glPixelStorei(GL_UNPACK_SWAP_BYTES, GL_TRUE); 217 glPixelStorei(GL_UNPACK_ROW_LENGTH, 640); 218 glBindBuffer(GL_PIXEL_UNPACK_BUFFER, 47); 219 glDrawPixels(100, 100, GL_RGB, GL_FLOAT, pixels); 220 221 The unpack swap bytes and row length state set by the preceding 222 glPixelStorei commands (as well as the 6 other unpack pixel store 223 state variables) control how data is read (unpacked) from buffer of 224 data pointed to by pixels. The glBindBuffer command also specifies 225 an unpack buffer object (47) so the pixel pointer is actually treated 226 as a byte offset into buffer object 47. 227 228 When an application issues a command to configure a vertex array, 229 the current array buffer state is latched as the binding for the 230 particular vertex array being specified. For example, consider: 231 232 glBindBuffer(GL_ARRAY_BUFFER, 23); 233 glVertexPointer(3, GL_FLOAT, 12, pointer); 234 235 The glBindBuffer command updates the array buffering binding 236 (GL_ARRAY_BUFFER_BINDING) to the buffer object named 23. The 237 subsequent glVertexPointer command specifies explicit parameters 238 for the size, type, stride, and pointer to access the position 239 vertex array BUT ALSO latches the current array buffer binding for 240 the vertex array buffer binding (GL_VERTEX_ARRAY_BUFFER_BINDING). 241 Effectively the current array buffer binding buffer object becomes 242 an implicit fifth parameter to glVertexPointer and this applies to 243 all the gl*Pointer vertex array specification commands. 244 245 Selectors and latched state create problems for layered libraries 246 using OpenGL because selectors require the selector state to be 247 modified to update some other state and latched state means implicit 248 state can affect the operation of commands specifying, packing, or 249 unpacking data through pointers/offsets. For layered libraries, 250 a state update performed by the library may attempt to save the 251 selector state, set the selector, update/query some state the 252 selector controls, and then restore the selector to its saved state. 253 Layered libraries can skip the selector save/restore but this risks 254 introducing uncertainty about the state of a selector after calling 255 layered library routines. Such selector side-effects are difficult 256 to document and lead to compatibility issues as the layered library 257 evolves or its usage varies. For latched state, layered libraries 258 may find commands such as glDrawPixels do not work as expected 259 because latched pixel store state is not what the library expects. 260 Querying or pushing the latched state, setting the latched state 261 explicitly, performing the operation involving latched state, and 262 then restoring or popping the latched state avoids entanglements 263 with latched state but at considerable cost. 264 265 EXAMPLE USAGE OF THIS EXTENSION'S FUNCTIONALITY 266 267 Consider the following routine to set the modelview matrix involving 268 the matrix mode selector: 269 270 void setModelviewMatrix(const GLfloat matrix[16]) 271 { 272 GLenum savedMatrixMode; 273 274 glGetIntegerv(GL_MATRIX_MODE, &savedMatrixMode); 275 glMatrixMode(GL_MODELVIEW); 276 glLoadMatrixf(matrix); 277 glMatrixMode(savedMatrixMode); 278 } 279 280 Notice that four OpenGL commands are required to update the current 281 modelview matrix without disturbing the matrix mode selector. 282 283 OpenGL query commands can also substantially reduce the performance 284 of modern OpenGL implementations which may off-load OpenGL state 285 processing to another CPU core/thread or to the GPU itself. 286 287 An alternative to querying the selector is to use the 288 glPushAttrib/glPopAttrib commands. However this approach typically 289 involves pushing far more state than simply the one or two selectors 290 that need to be saved and restored. Because so much state is 291 associated with a given push/pop attribute bit, the glPushAttrib 292 and glPopAttrib commands are considerably more costly than the 293 save/restore approach. Additionally glPushAttrib risks overflowing 294 the attribute stack. 295 296 The reliability and performance of layered libraries and applications 297 can be improved by adding to the OpenGL API a new set of commands 298 to access directly OpenGL state that otherwise involves selectors 299 to access. 300 301 The above example can be reimplemented more efficiently and without 302 selector side-effects: 303 304 void setModelviewMatrix(const GLfloat matrix[16]) 305 { 306 glMatrixLoadfEXT(GL_MODELVIEW, matrix); 307 } 308 309 Consider a layered library seeking to load a texture: 310 311 void loadTexture(GLint texobj, GLint width, GLint height, 312 void *data) 313 { 314 glBindTexture(GL_TEXTURE_2D, texobj); 315 glTexImage2D(GL_TEXTURE_2D, 0, GL_RGB8, 316 width, height, GL_RGB, GL_FLOAT, data); 317 } 318 319 The library expects the data to be packed into the buffer pointed 320 to by data. But what if the current pixel unpack buffer binding 321 is not zero so the current pixel unpack buffer, rather than client 322 memory, will be read? Or what if the application has modified 323 the GL_UNPACK_ROW_LENGTH pixel store state before loadTexture 324 is called? 325 326 We can fix the routine by calling glBindBuffer(GL_PIXEL_UNPACK_BUFFER, 327 0) and setting all the pixel store unpack state to the initial state 328 the loadTexture routine expects, but this is expensive. It also risks 329 disturbing the state so when loadTexture returns to the application, 330 the application doesn't realize the current texture object (for 331 whatever texture unit the current active texture happens to be) and 332 pixel store state has changed. 333 334 We can more efficiently implement this routine without disturbing 335 selector or latched state as follows: 336 337 void loadTexture(GLint texobj, GLint width, GLint height, 338 void *data) 339 { 340 glPushClientAttribDefaultEXT(GL_CLIENT_PIXEL_STORE_BIT); 341 glTextureImage2D(texobj, GL_TEXTURE_2D, 0, GL_RGB8, 342 width, height, GL_RGB, GL_FLOAT, data); 343 glPopClientAttrib(); 344 } 345 346 Now loadTexture does not have to worry about inappropriately 347 configured pixel store state or a non-zero pixel unpack buffer 348 binding. And loadTexture has no unintended side-effects for 349 selector or latched state (assuming the client attrib state does 350 not overflow). 351 352New Procedures and Functions 353 354 <OpenGL 1.1: New client commands> 355 356 void ClientAttribDefaultEXT(bitfield mask); 357 void PushClientAttribDefaultEXT(bitfield mask); 358 359 <OpenGL 1.0: New matrix commands add "Matrix" prefix to name, 360 drops "Matrix" suffix from name, and add initial "enum matrixMode" 361 parameter> 362 363 void MatrixLoadfEXT(enum matrixMode, const float *m); 364 void MatrixLoaddEXT(enum matrixMode, const double *m); 365 366 void MatrixMultfEXT(enum matrixMode, const float *m); 367 void MatrixMultdEXT(enum matrixMode, const double *m); 368 369 void MatrixLoadIdentityEXT(enum matrixMode); 370 371 void MatrixRotatefEXT(enum matrixMode, float angle, 372 float x, float y, float z); 373 void MatrixRotatedEXT(enum matrixMode, double angle, 374 double x, double y, double z); 375 376 void MatrixScalefEXT(enum matrixMode, 377 float x, float y, float z); 378 void MatrixScaledEXT(enum matrixMode, 379 double x, double y, double z); 380 381 void MatrixTranslatefEXT(enum matrixMode, 382 float x, float y, float z); 383 void MatrixTranslatedEXT(enum matrixMode, 384 double x, double y, double z); 385 386 void MatrixOrthoEXT(enum matrixMode, double l, double r, 387 double b, double t, double n, double f); 388 void MatrixFrustumEXT(enum matrixMode, double l, double r, 389 double b, double t, double n, double f); 390 391 void MatrixPushEXT(enum matrixMode); 392 void MatrixPopEXT(enum matrixMode); 393 394 <OpenGL 1.1: New texture object commands and queries replace "Tex" 395 in name with "Texture" and add initial "uint texture" parameter> 396 397 void TextureParameteriEXT(uint texture, enum target, 398 enum pname, int param); 399 void TextureParameterivEXT(uint texture, enum target, 400 enum pname, const int *param); 401 402 void TextureParameterfEXT(uint texture, enum target, 403 enum pname, float param); 404 void TextureParameterfvEXT(uint texture, enum target, 405 enum pname, const float *param); 406 407 void TextureImage1DEXT(uint texture, enum target, 408 int level, int internalformat, 409 sizei width, int border, 410 enum format, enum type, const void *pixels); 411 void TextureImage2DEXT(uint texture, enum target, 412 int level, int internalformat, 413 sizei width, sizei height, int border, 414 enum format, enum type, const void *pixels); 415 416 void TextureSubImage1DEXT(uint texture, enum target, 417 int level, int xoffset, sizei width, 418 enum format, enum type, 419 const void *pixels); 420 void TextureSubImage2DEXT(uint texture, enum target, 421 int level, int xoffset, int yoffset, 422 sizei width, sizei height, 423 enum format, enum type, 424 const void *pixels); 425 426 void CopyTextureImage1DEXT(uint texture, enum target, 427 int level, enum internalformat, 428 int x, int y, sizei width, int border); 429 void CopyTextureImage2DEXT(uint texture, enum target, 430 int level, enum internalformat, 431 int x, int y, 432 sizei width, sizei height, int border); 433 434 void CopyTextureSubImage1DEXT(uint texture, enum target, 435 int level, int xoffset, 436 int x, int y, sizei width); 437 void CopyTextureSubImage2DEXT(uint texture, enum target, 438 int level, int xoffset, int yoffset, 439 int x, int y, 440 sizei width, sizei height); 441 442 void GetTextureImageEXT(uint texture, enum target, 443 int level, 444 enum format, enum type, void *pixels); 445 446 void GetTextureParameterfvEXT(uint texture, enum target, 447 enum pname, float *params); 448 void GetTextureParameterivEXT(uint texture, enum target, 449 enum pname, int *params); 450 451 void GetTextureLevelParameterfvEXT(uint texture, enum target, 452 int level, 453 enum pname, float *params); 454 void GetTextureLevelParameterivEXT(uint texture, enum target, 455 int level, 456 enum pname, int *params); 457 458 <OpenGL 1.2: New 3D texture object commands replace "Tex" in name with 459 "Texture" and adds initial "uint texture" parameter> 460 461 void TextureImage3DEXT(uint texture, enum target, 462 int level, int internalformat, 463 sizei width, sizei height, sizei depth, 464 int border, 465 enum format, enum type, const void *pixels); 466 467 void TextureSubImage3DEXT(uint texture, enum target, 468 int level, 469 int xoffset, int yoffset, int zoffset, 470 sizei width, sizei height, sizei depth, 471 enum format, enum type, 472 const void *pixels); 473 void CopyTextureSubImage3DEXT(uint texture, enum target, 474 int level, 475 int xoffset, int yoffset, int zoffset, 476 int x, int y, 477 sizei width, sizei height); 478 479 <OpenGL 1.2.1: New multitexture commands and queries prefix "Multi" 480 before "Tex" and add an initial "enum texunit" parameter (to identify 481 the texture unit).> 482 483 void BindMultiTextureEXT(enum texunit, enum target, uint texture); 484 485 void MultiTexCoordPointerEXT(enum texunit, int size, enum type, 486 sizei stride, const void *pointer); 487 488 void MultiTexEnvfEXT(enum texunit, enum target, enum pname, 489 float param); 490 void MultiTexEnvfvEXT(enum texunit, enum target, enum pname, 491 const float *params); 492 void MultiTexEnviEXT(enum texunit, enum target, enum pname, 493 int param); 494 void MultiTexEnvivEXT(enum texunit, enum target, enum pname, 495 const int *params); 496 497 void MultiTexGendEXT(enum texunit, enum coord, enum pname, 498 double param); 499 void MultiTexGendvEXT(enum texunit, enum coord, enum pname, 500 const double *params); 501 void MultiTexGenfEXT(enum texunit, enum coord, enum pname, 502 float param); 503 void MultiTexGenfvEXT(enum texunit, enum coord, enum pname, 504 const float *params); 505 void MultiTexGeniEXT(enum texunit, enum coord, enum pname, 506 int param); 507 void MultiTexGenivEXT(enum texunit, enum coord, enum pname, 508 const int *params); 509 510 void GetMultiTexEnvfvEXT(enum texunit, enum target, enum pname, 511 float *params); 512 void GetMultiTexEnvivEXT(enum texunit, enum target, enum pname, 513 int *params); 514 515 void GetMultiTexGendvEXT(enum texunit, enum coord, enum pname, 516 double *params); 517 void GetMultiTexGenfvEXT(enum texunit, enum coord, enum pname, 518 float *params); 519 void GetMultiTexGenivEXT(enum texunit, enum coord, enum pname, 520 int *params); 521 522 void MultiTexParameteriEXT(enum texunit, enum target, 523 enum pname, int param); 524 void MultiTexParameterivEXT(enum texunit, enum target, 525 enum pname, const int *param); 526 527 void MultiTexParameterfEXT(enum texunit, enum target, 528 enum pname, float param); 529 void MultiTexParameterfvEXT(enum texunit, enum target, 530 enum pname, const float *param); 531 532 void MultiTexImage1DEXT(enum texunit, enum target, 533 int level, int internalformat, 534 sizei width, int border, 535 enum format, enum type, const void *pixels); 536 void MultiTexImage2DEXT(enum texunit, enum target, 537 int level, int internalformat, 538 sizei width, sizei height, int border, 539 enum format, enum type, const void *pixels); 540 541 void MultiTexSubImage1DEXT(enum texunit, enum target, 542 int level, int xoffset, sizei width, 543 enum format, enum type, 544 const void *pixels); 545 void MultiTexSubImage2DEXT(enum texunit, enum target, 546 int level, int xoffset, int yoffset, 547 sizei width, sizei height, 548 enum format, enum type, 549 const void *pixels); 550 551 void CopyMultiTexImage1DEXT(enum texunit, enum target, 552 int level, enum internalformat, 553 int x, int y, sizei width, int border); 554 void CopyMultiTexImage2DEXT(enum texunit, enum target, 555 int level, enum internalformat, 556 int x, int y, 557 sizei width, sizei height, int border); 558 559 void CopyMultiTexSubImage1DEXT(enum texunit, enum target, 560 int level, int xoffset, 561 int x, int y, sizei width); 562 void CopyMultiTexSubImage2DEXT(enum texunit, enum target, 563 int level, int xoffset, int yoffset, 564 int x, int y, 565 sizei width, sizei height); 566 567 void GetMultiTexImageEXT(enum texunit, enum target, 568 int level, 569 enum format, enum type, void *pixels); 570 571 void GetMultiTexParameterfvEXT(enum texunit, enum target, 572 enum pname, float *params); 573 void GetMultiTexParameterivEXT(enum texunit, enum target, 574 enum pname, int *params); 575 576 void GetMultiTexLevelParameterfvEXT(enum texunit, enum target, 577 int level, 578 enum pname, float *params); 579 void GetMultiTexLevelParameterivEXT(enum texunit, enum target, 580 int level, 581 enum pname, int *params); 582 583 void MultiTexImage3DEXT(enum texunit, enum target, 584 int level, int internalformat, 585 sizei width, sizei height, sizei depth, 586 int border, 587 enum format, enum type, const void *pixels); 588 589 void MultiTexSubImage3DEXT(enum texunit, enum target, 590 int level, 591 int xoffset, int yoffset, int zoffset, 592 sizei width, sizei height, sizei depth, 593 enum format, enum type, 594 const void *pixels); 595 void CopyMultiTexSubImage3DEXT(enum texunit, enum target, 596 int level, 597 int xoffset, int yoffset, int zoffset, 598 int x, int y, 599 sizei width, sizei height); 600 601 <OpenGL 1.2.1: New indexed texture commands and queries append 602 "Indexed" to name and add "uint index" parameter (to identify the 603 texture unit index) after state name parameters (if any) and before 604 state value parameters> 605 606 void EnableClientStateIndexedEXT(enum array, uint index); 607 void DisableClientStateIndexedEXT(enum array, uint index); 608 609 <OpenGL 3.0: New indexed texture commands and queries append "i" 610 to name and add "uint index" parameter (to identify the texture 611 unit index) after state name parameters (if any) and before state 612 value parameters> 613 614 void EnableClientStateiEXT(enum array, uint index); 615 void DisableClientStateiEXT(enum array, uint index); 616 617 <OpenGL 1.2.1: New indexed generic queries (added for indexed texture 618 state) append "Indexed" to name and add "uint index" parameter 619 (to identify the texture unit) after state name parameters (if any) and 620 before state value parameters> 621 622 void GetFloatIndexedvEXT(enum target, uint index, float *params); 623 void GetDoubleIndexedvEXT(enum target, uint index, double *params); 624 625 void GetPointerIndexedvEXT(enum target, uint index, void **params); 626 627 <OpenGL 3.0: New indexed generic queries (added for indexed texture 628 state) replace "v" for "i_v" to name and add "uint index" parameter 629 (to identify the texture unit) after state name parameters (if any) 630 and before state value parameters> 631 632 void GetFloati_vEXT(enum pname, uint index, float *params); 633 void GetDoublei_vEXT(enum pname, uint index, double *params); 634 635 void GetPointeri_vEXT(enum pname, uint index, void **params); 636 637 <OpenGL 1.2.1: Extend the functionality of these EXT_draw_buffers2 638 commands and queries for multitexture> 639 640 void EnableIndexedEXT(enum cap, uint index); 641 void DisableIndexedEXT(enum cap, uint index); 642 643 boolean IsEnabledIndexedEXT(enum target, uint index); 644 645 void GetIntegerIndexedvEXT(enum target, uint index, int *params); 646 void GetBooleanIndexedvEXT(enum target, uint index, 647 boolean *params); 648 649 <ARB_vertex_program: New program commands and queries add "Named" 650 prefix to name and adds initial "uint program" parameter> 651 652 void NamedProgramStringEXT(uint program, enum target, enum format, 653 sizei len, const void *string); 654 655 void NamedProgramLocalParameter4dEXT(uint program, enum target, 656 uint index, 657 double x, double y, 658 double z, double w); 659 void NamedProgramLocalParameter4dvEXT(uint program, enum target, 660 uint index, 661 const double *params); 662 void NamedProgramLocalParameter4fEXT(uint program, enum target, 663 uint index, 664 float x, float y, 665 float z, float w); 666 void NamedProgramLocalParameter4fvEXT(uint program, enum target, 667 uint index, 668 const float *params); 669 670 void GetNamedProgramLocalParameterdvEXT(uint program, enum target, 671 uint index, 672 double *params); 673 void GetNamedProgramLocalParameterfvEXT(uint program, enum target, 674 uint index, 675 float *params); 676 void GetNamedProgramivEXT(uint program, enum target, 677 enum pname, int *params); 678 void GetNamedProgramStringEXT(uint program, enum target, 679 enum pname, void *string); 680 681 <OpenGL 1.3: New compressed texture object commands replace "Tex" 682 in name with "Texture" and add initial "uint texture" parameter> 683 684 void CompressedTextureImage3DEXT(uint texture, enum target, int level, 685 enum internalformat, 686 sizei width, sizei height, 687 sizei depth, int border, 688 sizei imageSize, const void *data); 689 void CompressedTextureImage2DEXT(uint texture, enum target, int level, 690 enum internalformat, 691 sizei width, sizei height, 692 int border, sizei imageSize, 693 const void *data); 694 void CompressedTextureImage1DEXT(uint texture, enum target, int level, 695 enum internalformat, 696 sizei width, int border, 697 sizei imageSize, const void *data); 698 void CompressedTextureSubImage3DEXT(uint texture, enum target, int level, 699 int xoffset, int yoffset, 700 int zoffset, 701 sizei width, sizei height, 702 sizei depth, enum format, 703 sizei imageSize, const void *data); 704 void CompressedTextureSubImage2DEXT(uint texture, enum target, int level, 705 int xoffset, int yoffset, 706 sizei width, sizei height, 707 enum format, 708 sizei imageSize, const void *data); 709 void CompressedTextureSubImage1DEXT(uint texture, enum target, int level, 710 int xoffset, sizei width, 711 enum format, 712 sizei imageSize, const void *data); 713 714 void GetCompressedTextureImageEXT(uint texture, enum target, 715 int level, void *img); 716 717 <OpenGL 1.3: New multitexture compressed texture commands and queries 718 prefix "Multi" before "Tex" and add an initial "enum texunit" 719 parameter (to identify the texture unit).> 720 721 void CompressedMultiTexImage3DEXT(enum texunit, enum target, int level, 722 enum internalformat, 723 sizei width, sizei height, 724 sizei depth, int border, 725 sizei imageSize, const void *data); 726 void CompressedMultiTexImage2DEXT(enum texunit, enum target, int level, 727 enum internalformat, 728 sizei width, sizei height, 729 int border, sizei imageSize, 730 const void *data); 731 void CompressedMultiTexImage1DEXT(enum texunit, enum target, int level, 732 enum internalformat, 733 sizei width, int border, 734 sizei imageSize, const void *data); 735 void CompressedMultiTexSubImage3DEXT(enum texunit, enum target, int level, 736 int xoffset, int yoffset, 737 int zoffset, 738 sizei width, sizei height, 739 sizei depth, enum format, 740 sizei imageSize, const void *data); 741 void CompressedMultiTexSubImage2DEXT(enum texunit, enum target, int level, 742 int xoffset, int yoffset, 743 sizei width, sizei height, 744 enum format, 745 sizei imageSize, const void *data); 746 void CompressedMultiTexSubImage1DEXT(enum texunit, enum target, int level, 747 int xoffset, sizei width, 748 enum format, 749 sizei imageSize, const void *data); 750 751 void GetCompressedMultiTexImageEXT(enum texunit, enum target, 752 int level, void *img); 753 754 <OpenGL 1.3: New transpose matrix commands add "Matrix" suffix 755 to name, drops "Matrix" suffix from name, and add initial "enum 756 matrixMode" parameter> 757 758 void MatrixLoadTransposefEXT(enum matrixMode, const float *m); 759 void MatrixLoadTransposedEXT(enum matrixMode, const double *m); 760 761 void MatrixMultTransposefEXT(enum matrixMode, const float *m); 762 void MatrixMultTransposedEXT(enum matrixMode, const double *m); 763 764 <OpenGL 1.5: New buffer commands and queries replace "Buffer" with 765 "NamedBuffer" in name and replace "enum target" parameter with 766 "uint buffer"> 767 768 void NamedBufferDataEXT(uint buffer, sizeiptr size, 769 const void *data, enum usage); 770 void NamedBufferSubDataEXT(uint buffer, intptr offset, 771 sizeiptr size, const void *data); 772 void* MapNamedBufferEXT(uint buffer, enum access); 773 boolean UnmapNamedBufferEXT(uint buffer); 774 void GetNamedBufferParameterivEXT(uint buffer, 775 enum pname, int *params); 776 void GetNamedBufferPointervEXT(uint buffer, 777 enum pname, void* *params); 778 void GetNamedBufferSubDataEXT(uint buffer, 779 intptr offset, sizeiptr size, void *data); 780 781 <OpenGL 2.0: New uniform commands add "Program" prefix to name and 782 add initial "uint program" parameter> 783 784 void ProgramUniform1fEXT(uint program, int location, float v0); 785 void ProgramUniform2fEXT(uint program, int location, 786 float v0, float v1); 787 void ProgramUniform3fEXT(uint program, int location, 788 float v0, float v1, float v2); 789 void ProgramUniform4fEXT(uint program, int location, 790 float v0, float v1, float v2, float v3); 791 792 void ProgramUniform1iEXT(uint program, int location, int v0); 793 void ProgramUniform2iEXT(uint program, int location, 794 int v0, int v1); 795 void ProgramUniform3iEXT(uint program, int location, 796 int v0, int v1, int v2); 797 void ProgramUniform4iEXT(uint program, int location, 798 int v0, int v1, int v2, int v3); 799 800 void ProgramUniform1fvEXT(uint program, int location, 801 sizei count, const float *value); 802 void ProgramUniform2fvEXT(uint program, int location, 803 sizei count, const float *value); 804 void ProgramUniform3fvEXT(uint program, int location, 805 sizei count, const float *value); 806 void ProgramUniform4fvEXT(uint program, int location, 807 sizei count, const float *value); 808 809 void ProgramUniform1ivEXT(uint program, int location, 810 sizei count, const int *value); 811 void ProgramUniform2ivEXT(uint program, int location, 812 sizei count, const int *value); 813 void ProgramUniform3ivEXT(uint program, int location, 814 sizei count, const int *value); 815 void ProgramUniform4ivEXT(uint program, int location, 816 sizei count, const int *value); 817 818 void ProgramUniformMatrix2fvEXT(uint program, int location, 819 sizei count, boolean transpose, 820 const float *value); 821 void ProgramUniformMatrix3fvEXT(uint program, int location, 822 sizei count, boolean transpose, 823 const float *value); 824 void ProgramUniformMatrix4fvEXT(uint program, int location, 825 sizei count, boolean transpose, 826 const float *value); 827 828 <OpenGL 2.1: New uniform matrix commands add "Program" prefix to 829 name and add initial "uint program" parameter> 830 831 void ProgramUniformMatrix2x3fvEXT(uint program, int location, 832 sizei count, boolean transpose, 833 const float *value); 834 void ProgramUniformMatrix3x2fvEXT(uint program, int location, 835 sizei count, boolean transpose, 836 const float *value); 837 void ProgramUniformMatrix2x4fvEXT(uint program, int location, 838 sizei count, boolean transpose, 839 const float *value); 840 void ProgramUniformMatrix4x2fvEXT(uint program, int location, 841 sizei count, boolean transpose, 842 const float *value); 843 void ProgramUniformMatrix3x4fvEXT(uint program, int location, 844 sizei count, boolean transpose, 845 const float *value); 846 void ProgramUniformMatrix4x3fvEXT(uint program, int location, 847 sizei count, boolean transpose, 848 const float *value); 849 850 <EXT_texture_buffer_object: New texture buffer object command 851 replaces "Tex" in name with "Texture" and adds initial "uint texture" 852 parameter> 853 854 void TextureBufferEXT(uint texture, enum target, 855 enum internalformat, uint buffer); 856 857 <EXT_texture_buffer_object: New multitexture texture buffer command 858 prefixes "Multi" before "Tex" and add an initial "enum texunit" 859 parameter (to identify the texture unit).> 860 861 void MultiTexBufferEXT(enum texunit, enum target, 862 enum internalformat, uint buffer); 863 864 <EXT_texture_integer: New integer texture object commands and queries 865 replace "Tex" in name with "Texture" and add initial "uint texture" 866 parameter> 867 868 void TextureParameterIivEXT(uint texture, enum target, 869 enum pname, const int *params); 870 void TextureParameterIuivEXT(uint texture, enum target, 871 enum pname, const uint *params); 872 873 void GetTextureParameterIivEXT(uint texture, enum target, 874 enum pname, int *params); 875 void GetTextureParameterIuivEXT(uint texture, enum target, 876 enum pname, uint *params); 877 878 <EXT_texture_integer: New multitexture integer texture commands and 879 queries prefix "Multi" before "Tex" and add an initial "enum texunit" 880 parameter (to identify the texture unit).> 881 882 void MultiTexParameterIivEXT(enum texunit, enum target, 883 enum pname, const int *params); 884 void MultiTexParameterIuivEXT(enum texunit, enum target, 885 enum pname, const uint *params); 886 887 void GetMultiTexParameterIivEXT(enum texunit, enum target, 888 enum pname, int *params); 889 void GetMultiTexParameterIuivEXT(enum texunit, enum target, 890 enum pname, uint *params); 891 892 <EXT_gpu_shader4: New integer uniform commands add "Program" prefix 893 to name and add initial "uint program" parameter> 894 895 void ProgramUniform1uiEXT(uint program, int location, uint v0); 896 void ProgramUniform2uiEXT(uint program, int location, 897 uint v0, uint v1); 898 void ProgramUniform3uiEXT(uint program, int location, 899 uint v0, uint v1, uint v2); 900 void ProgramUniform4uiEXT(uint program, int location, 901 uint v0, uint v1, uint v2, uint v3); 902 903 void ProgramUniform1uivEXT(uint program, int location, 904 sizei count, const uint *value); 905 void ProgramUniform2uivEXT(uint program, int location, 906 sizei count, const uint *value); 907 void ProgramUniform3uivEXT(uint program, int location, 908 sizei count, const uint *value); 909 void ProgramUniform4uivEXT(uint program, int location, 910 sizei count, const uint *value); 911 912 <EXT_gpu_program_parameters: New program command adds "Named" prefix 913 to name and adds "uint program" parameter> 914 915 void NamedProgramLocalParameters4fvEXT(uint program, enum target, 916 uint index, sizei count, 917 const float *params); 918 919 <NV_gpu_program4: New program commands and queries add "Named" 920 prefix to name and replace "enum target" with "uint program"> 921 922 void NamedProgramLocalParameterI4iEXT(uint program, enum target, 923 uint index, 924 int x, int y, 925 int z, int w); 926 void NamedProgramLocalParameterI4ivEXT(uint program, enum target, 927 uint index, 928 const int *params); 929 void NamedProgramLocalParametersI4ivEXT(uint program, enum target, 930 uint index, sizei count, 931 const int *params); 932 void NamedProgramLocalParameterI4uiEXT(uint program, enum target, 933 uint index, 934 uint x, uint y, 935 uint z, uint w); 936 void NamedProgramLocalParameterI4uivEXT(uint program, enum target, 937 uint index, 938 const uint *params); 939 void NamedProgramLocalParametersI4uivEXT(uint program, enum target, 940 uint index, sizei count, 941 const uint *params); 942 943 void GetNamedProgramLocalParameterIivEXT(uint program, enum target, 944 uint index, 945 int *params); 946 void GetNamedProgramLocalParameterIuivEXT(uint program, enum target, 947 uint index, 948 uint *params); 949 950 <OpenGL 3.0: New renderbuffer commands add "Named" prefix to name 951 and replace "enum target" with "uint renderbuffer"> 952 953 void NamedRenderbufferStorageEXT(uint renderbuffer, 954 enum internalformat, 955 sizei width, sizei height); 956 957 void GetNamedRenderbufferParameterivEXT(uint renderbuffer, 958 enum pname, int *params); 959 960 <OpenGL 3.0: New renderbuffer commands add "Named" 961 prefix to name and replace "enum target" with "uint renderbuffer"> 962 963 void NamedRenderbufferStorageMultisampleEXT(uint renderbuffer, 964 sizei samples, 965 enum internalformat, 966 sizei width, sizei height); 967 968 <NV_framebuffer_multisample_coverage: New renderbuffer commands 969 add "Named" prefix to name and replace "enum target" with "uint 970 renderbuffer"> 971 972 void NamedRenderbufferStorageMultisampleCoverageEXT(uint renderbuffer, 973 sizei coverageSamples, 974 sizei colorSamples, 975 enum internalformat, 976 sizei width, 977 sizei height); 978 979 <OpenGL 3.0: New framebuffer commands add "Named" prefix to name 980 and replace "enum target" with "uint framebuffer"> 981 982 enum CheckNamedFramebufferStatusEXT(uint framebuffer, 983 enum target); 984 985 void NamedFramebufferTexture1DEXT(uint framebuffer, 986 enum attachment, 987 enum textarget, uint texture, 988 int level); 989 void NamedFramebufferTexture2DEXT(uint framebuffer, 990 enum attachment, 991 enum textarget, uint texture, 992 int level); 993 void NamedFramebufferTexture3DEXT(uint framebuffer, 994 enum attachment, 995 enum textarget, uint texture, 996 int level, int zoffset); 997 998 void NamedFramebufferRenderbufferEXT(uint framebuffer, 999 enum attachment, 1000 enum renderbuffertarget, 1001 uint renderbuffer); 1002 1003 void GetNamedFramebufferAttachmentParameterivEXT(uint framebuffer, 1004 enum attachment, 1005 enum pname, 1006 int *params); 1007 1008 <OpenGL 3.0: New texture commands add "Texture" within name and 1009 replace "enum target" with "uint texture"> 1010 1011 void GenerateTextureMipmapEXT(uint texture, enum target); 1012 1013 <OpenGL 3.0: New texture commands add "MultiTex" within name and 1014 replace "enum target" with "enum texunit"> 1015 1016 void GenerateMultiTexMipmapEXT(enum texunit, enum target); 1017 1018 <OpenGL 3.0: New framebuffer commands> 1019 1020 void FramebufferDrawBufferEXT(uint framebuffer, enum mode); 1021 void FramebufferDrawBuffersEXT(uint framebuffer, sizei n, 1022 const enum *bufs) 1023 void FramebufferReadBufferEXT(uint framebuffer, enum mode); 1024 1025 <OpenGL 3.0: New framebuffer query> 1026 1027 void GetFramebufferParameterivEXT(uint framebuffer, enum pname, 1028 int *param); 1029 1030 <OpenGL 3.0: New buffer data copy command> 1031 void NamedCopyBufferSubDataEXT(uint readBuffer, uint writeBuffer, 1032 intptr readOffset, intptr writeOffset, 1033 sizeiptr size); 1034 1035 <EXT_geometry_shader4 or NV_gpu_program4: New framebuffer commands 1036 add "Named" prefix to name and replace "enum target" with "uint 1037 framebuffer"> 1038 1039 void NamedFramebufferTextureEXT(uint framebuffer, enum attachment, 1040 uint texture, int level); 1041 void NamedFramebufferTextureLayerEXT(uint framebuffer, 1042 enum attachment, 1043 uint texture, 1044 int level, int layer); 1045 void NamedFramebufferTextureFaceEXT(uint framebuffer, enum attachment, 1046 uint texture, 1047 int level, enum face); 1048 1049 <NV_explicit_multisample: New texture renderbuffer object command 1050 replaces "Tex" in name with "Texture" and add initial "uint texture" 1051 parameter> 1052 1053 void TextureRenderbufferEXT(uint texture, enum target, 1054 uint renderbuffer); 1055 1056 <NV_explicit_multisample: New multitexture texture renderbuffer command 1057 prefixes "Multi" before "Tex" and add an initial "enum texunit" 1058 parameter (to identify the texture unit)> 1059 1060 void MultiTexRenderbufferEXT(enum texunit, enum target, 1061 uint renderbuffer); 1062 1063 <OpenGL 3.0: New vertex array specification commands for vertex 1064 array objects prefix "VertexArray", add initial "uint vaobj" and 1065 "uint buffer" parameters, change "Pointer" suffix to "Offset", 1066 and change the final parameter from "const void *" to "intptr offset"> 1067 1068 void VertexArrayVertexOffsetEXT(uint vaobj, uint buffer, 1069 int size, enum type, sizei stride, 1070 intptr offset); 1071 void VertexArrayColorOffsetEXT(uint vaobj, uint buffer, 1072 int size, enum type, sizei stride, 1073 intptr offset); 1074 void VertexArrayEdgeFlagOffsetEXT(uint vaobj, uint buffer, 1075 sizei stride, intptr offset); 1076 void VertexArrayIndexOffsetEXT(uint vaobj, uint buffer, 1077 enum type, sizei stride, 1078 intptr offset); 1079 void VertexArrayNormalOffsetEXT(uint vaobj, uint buffer, 1080 enum type, sizei stride, 1081 intptr offset); 1082 void VertexArrayTexCoordOffsetEXT(uint vaobj, uint buffer, 1083 int size, enum type, sizei stride, 1084 intptr offset); 1085 void VertexArrayMultiTexCoordOffsetEXT(uint vaobj, uint buffer, 1086 enum texunit, 1087 int size, enum type, sizei stride, 1088 intptr offset); 1089 void VertexArrayFogCoordOffsetEXT(uint vaobj, uint buffer, 1090 enum type, sizei stride, 1091 intptr offset); 1092 void VertexArraySecondaryColorOffsetEXT(uint vaobj, uint buffer, 1093 int size, enum type, 1094 sizei stride, intptr offset); 1095 void VertexArrayVertexAttribOffsetEXT(uint vaobj, uint buffer, 1096 uint index, int size, 1097 enum type, boolean normalized, 1098 sizei stride, intptr offset); 1099 void VertexArrayVertexAttribIOffsetEXT(uint vaobj, uint buffer, 1100 uint index, int size, 1101 enum type, sizei stride, 1102 intptr offset); 1103 1104 <OpenGL 3.0: New vertex array enable commands for vertex array 1105 objects change "ClientState" to "VertexArray" and add an initial 1106 "uint vaobj" parameter> 1107 1108 void EnableVertexArrayEXT(uint vaobj, enum array); 1109 void DisableVertexArrayEXT(uint vaobj, enum array); 1110 1111 <OpenGL 3.0: New vertex attrib array enable commands for vertex 1112 array objects change "VertexAttribArray" to "VertexArrayAttrib" 1113 and add an initial "uint vaobj" parameter> 1114 1115 void EnableVertexArrayAttribEXT(uint vaobj, uint index); 1116 void DisableVertexArrayAttribEXT(uint vaobj, uint index); 1117 1118 <OpenGL 3.0: New queries for vertex array objects> 1119 1120 void GetVertexArrayIntegervEXT(uint vaobj, enum pname, 1121 int *param); 1122 void GetVertexArrayPointervEXT(uint vaobj, enum pname, 1123 void **param); 1124 void GetVertexArrayIntegeri_vEXT(uint vaobj, 1125 uint index, 1126 enum pname, 1127 int *param); 1128 void GetVertexArrayPointeri_vEXT(uint vaobj, 1129 uint index, 1130 enum pname, 1131 void **param); 1132 1133 <OpenGL 3.0: New buffer commands replace "Buffer" with "NamedBuffer" 1134 in name and replace "enum target" parameter with "uint buffer"> 1135 1136 void *MapNamedBufferRangeEXT(uint buffer, intptr offset, 1137 sizeiptr length, bitfield access); 1138 void FlushMappedNamedBufferRangeEXT(uint buffer, intptr offset, 1139 sizeiptr length); 1140 1141New Tokens 1142 1143 Accepted by the <pname> parameter of GetBooleanIndexedvEXT, 1144 GetIntegerIndexedvEXT, GetFloatIndexedvEXT, GetDoubleIndexedvEXT: 1145 GetBooleani_v, GetIntegeri_v, GetFloati_vEXT, GetDoublei_vEXT: 1146 1147 PROGRAM_MATRIX_EXT 0x8E2D 1148 TRANSPOSE_PROGRAM_MATRIX_EXT 0x8E2E 1149 PROGRAM_MATRIX_STACK_DEPTH_EXT 0x8E2F 1150 1151Additions to Chapter 2 of the OpenGL 3.0 Specification (OpenGL Operation) 1152 1153 Insert the following after the 2nd sentence in the 4th paragraph in 1154 Section 2.5 (Errors): 1155 1156 "Certain commands and queries provide direct state 1157 access to named objects (such as TextureParameteriEXT, 1158 NamedProgramLocalParameter4dEXT, NamedRenderbufferStorageEXT, 1159 NamedFramebufferTexture2DEXT, GetTextureImageEXT, etc.) and perform 1160 implicit object initialization when provided unused object names. 1161 When these commands and queries are given an object name not 1162 currently used, these commands and queries will first (prior to 1163 any further error checking) make the name used and appropriately 1164 initialize the named object to a new object state vector. After this 1165 object initialization for unused names takes place, the command may 1166 subsequently generate an error. In this case, the command's state 1167 update or query's result is ignored, but the name still becomes used 1168 and the object initialization still takes place." 1169 1170 Add after the paragraph describing EnableClientState in Section 2.8 1171 (Vertex Arrays): 1172 1173 "The following commands: 1174 1175 void EnableClientStateIndexedEXT(enum array, uint index); 1176 void DisableClientStateIndexedEXT(enum array, uint index); 1177 void EnableClientStateiEXT(enum array, uint index); 1178 void DisableClientStateiEXT(enum array, uint index); 1179 1180 are equivalent (assuming no errors) to the following: 1181 1182 if (array == TEXTURE_COORD_ARRAY) { 1183 int savedClientActiveTexture; 1184 1185 GetIntegerv(CLIENT_ACTIVE_TEXTURE, &savedClientActiveTexture); 1186 ClientActiveTexture(TEXTURE0+index); 1187 XXX(array); 1188 ClientActiveTexture(savedActiveTexture); 1189 } else { 1190 // Invalid enum 1191 } 1192 1193 where index is the index parameter to the listed commands and XXX is 1194 the name of the command without its "Indexed" or "i" suffix (either 1195 EnableClientState or DisableClientState). The error INVALID_VALUE 1196 is generated if index is greater or equal to the implementation's 1197 NUM_TEXTURE_COORDS value. The error INVALID_ENUM is generated if 1198 array is not TEXTURE_COORD_ARRAY." 1199 1200 Add before the last paragraph in Section 2.8 (Vertex Arrays): 1201 1202 "The following command: 1203 1204 void MultiTexCoordPointerEXT(enum texunit, int size, enum type, 1205 sizei stride, const void *pointer); 1206 1207 is equivalent (assuming no errors) to the following: 1208 1209 int savedClientActiveTexture; 1210 1211 GetIntegerv(CLIENT_ACTIVE_TEXTURE, &savedClientActiveTexture); 1212 ClientActiveTexture(texunit); 1213 TexCoordPointer(...); 1214 ClientActiveTexture(savedActiveTexture); 1215 1216 where ... is the list of the arguments for the command excluding 1217 the index parameter." 1218 1219 Add to the end of section 2.9 (Buffer Objects), before section 2.9.1 1220 (Vertex Arrays in Buffer Objects): 1221 1222 "The following commands: 1223 1224 void NamedBufferDataEXT(uint buffer, sizeiptr size, 1225 const void *data, enum usage); 1226 void NamedBufferSubDataEXT(uint buffer, intptr offset, 1227 sizeiptr size, const void *data); 1228 void* MapNamedBufferEXT(uint buffer, enum access); 1229 boolean UnmapNamedBufferEXT(uint buffer); 1230 void *MapNamedBufferRangeEXT(uint buffer, intptr offset, 1231 sizeiptr length, bitfield access); 1232 void FlushMappedNamedBufferRangeEXT(uint buffer, intptr offset, 1233 sizeiptr length); 1234 void NamedCopyBufferSubDataEXT(uint readBuffer, uint writeBuffer, 1235 intptr readOffset, intptr writeOffset, 1236 sizeiptr size); 1237 1238 operate identically to the corresponding command where "Named" is 1239 deleted from the name (and extension suffixes are dropped or updated 1240 appropriately) except, rather than updating the currently bound buffer 1241 for the buffer target parameter (a parameter not present for these 1242 listed commands), these "Named" commands update the buffer object 1243 named by the initial buffer parameter. The remaining parameters 1244 following the initial buffer parameter for the listed "Named" commands 1245 match the parameters for the corresponding non-"Named" buffer command 1246 (except the target parameter is not needed because the buffer object 1247 to update is identified by its name) and are interpreted as they 1248 are for the non-"Named" buffer command. If the buffer object named 1249 by the buffer parameter has not been previously bound or has been 1250 deleted since the last binding, the GL first creates a new state 1251 vector, initialized with a zero-sized memory buffer and comprising the 1252 state values listed in table 2.6. There is no buffer corresponding 1253 to the name zero, these commands generate the INVALID_OPERATION 1254 error if the buffer parameter is zero." 1255 1256 Add to the end of Section 2.10 (Vertex Array Objects): 1257 1258 "The following commands: 1259 1260 void VertexArrayVertexOffsetEXT(uint vaobj, uint buffer, 1261 int size, enum type, sizei stride, 1262 intptr offset); 1263 void VertexArrayColorOffsetEXT(uint vaobj, uint buffer, 1264 int size, enum type, sizei stride, 1265 intptr offset); 1266 void VertexArrayEdgeFlagOffsetEXT(uint vaobj, uint buffer, 1267 sizei stride, intptr offset); 1268 void VertexArrayIndexOffsetEXT(uint vaobj, uint buffer, 1269 enum type, sizei stride, 1270 intptr offset); 1271 void VertexArrayNormalOffsetEXT(uint vaobj, uint buffer, 1272 enum type, sizei stride, 1273 intptr offset); 1274 void VertexArrayTexCoordOffsetEXT(uint vaobj, uint buffer, 1275 int size, enum type, sizei stride, 1276 intptr offset); 1277 void VertexArrayMultiTexCoordOffsetEXT(uint vaobj, uint buffer, 1278 enum texunit, 1279 int size, enum type, sizei stride, 1280 intptr offset); 1281 void VertexArrayFogCoordOffsetEXT(uint vaobj, uint buffer, 1282 enum type, sizei stride, 1283 intptr offset); 1284 void VertexArraySecondaryColorOffsetEXT(uint vaobj, uint buffer, 1285 int size, enum type, 1286 sizei stride, intptr offset); 1287 void VertexArrayVertexAttribOffsetEXT(uint vaobj, uint buffer, 1288 uint index, int size, 1289 enum type, boolean normalized, 1290 sizei stride, intptr offset); 1291 void VertexArrayVertexAttribIOffsetEXT(uint vaobj, uint buffer, 1292 uint index, int size, 1293 enum type, sizei stride, 1294 intptr offset); 1295 1296 operate identically to the corresponding command where "VertexArray" 1297 is deleted from the name and "Offset" is changed to "Pointer" (and 1298 extension suffixes are dropped or updated appropriately) except, 1299 1) rather than updating the currently in use vertex array object, 1300 these "VertexArray" commands update the vertex array object named 1301 by the initial vaobj parameter, and 2) the corresponding command 1302 operates as if the ARRAY_BUFFER buffer binding is bound to the 1303 buffer named by the buffer parameter. The remaining parameters 1304 following the initial vaobj parameter for the listed "VertexArray" 1305 commands match the parameters for the corresponding non-"VertexArray" 1306 vertex array specification command and are interpreted as they 1307 are for the non-"VertexArray" vertex array specification command. 1308 The one exception is that final intptr offset parameter of the 1309 "VertexArray" command is cast to the final pointer parameter of the 1310 non-"VertexArray" command (intptr is guaranteed to be large enough 1311 to store any pointer value). 1312 1313 If the vertex array object named by the vaobj parameter has not 1314 been previously bound but has been generated (without subsequent 1315 deletion) by GenVertexArrays, the GL first creates a new state 1316 vector in the same manner as when BindVertexArray creates a new 1317 vertex array object. However these commands fail and an 1318 INVALID_OPERATION error is generated if vaobj is not a name returned 1319 from a previous call to GenVertexArrays, or if such a name has since 1320 been deleted with DeleteVertexArrays. 1321 1322 If the buffer object named by the buffer parameter is non-zero and 1323 has not been previously bound or has been deleted since the last 1324 binding, the GL first creates a new state vector, initialized with 1325 a zero-sized memory buffer and comprising the state values listed 1326 in table 2.6. If the buffer object named by the buffer parameter 1327 is zero, these commands update the vertex array client-state. 1328 1329 If the buffer object named by the buffer parameter is non-zero and 1330 the offset parameter is negative, generate the INVALID_VALUE error. 1331 No error is generated in the case where buffer is zero because the 1332 offset might be valid pointer than just happens to be negative when 1333 cast to a intptr type. 1334 1335 The following commands: 1336 1337 void EnableVertexArrayEXT(uint vaobj, enum array); 1338 void DisableVertexArrayEXT(uint vaobj, enum array); 1339 void EnableVertexArrayAttribEXT(uint vaobj, uint index); 1340 void DisableVertexArrayAttribEXT(uint vaobj, uint index); 1341 1342 operate identically to EnableClientState, DisableClientState, 1343 EnableVertexAttribArray, and DisableVertexAttribArray respectively 1344 except rather than updating the current vertex array client-state 1345 these "VertexArray" commands update the vertex array enables 1346 within the vertex array object named by the initial vaobj parameter. 1347 The array parameter matches the array parameter for the corresponding 1348 EnableClientState and DisableClientState commands. The index 1349 parameter matches the index parameter for the corresponding 1350 EnableVertexAttribArray and DisableVertexAttribArray commands. 1351 1352 Additionally EnableVertexArrayEXT and DisableVertexArrayEXT accept 1353 the tokens TEXTURE0 through TEXTUREn where n is less than the 1354 implementation-dependent limit of MAX_TEXTURE_COORDS. For these 1355 GL_TEXTUREi tokens, EnableVertexArrayEXT and DisableVertexArrayEXT 1356 act identically to EnableVertexArrayEXT(vaobj, TEXTURE_COORD_ARRAY) 1357 or DisableVertexArrayEXT(vaobj, TEXTURE_COORD_ARRAY) respectively 1358 as if the active client texture is set to texture coordinate set i 1359 based on the token TEXTUREi indicated by array. 1360 1361 If the vertex array object named by the vaobj parameter has not 1362 been previously bound but has been generated (without subsequent 1363 deletion) by GenVertexArrays, the GL first creates a new state 1364 vector in the same manner as when BindVertexArray creates a new 1365 vertex array object. However these commands fail and an 1366 INVALID_OPERATION error is generated if vaobj is not a name returned 1367 from a previous call to GenVertexArrays, or if such a name has since 1368 been deleted with DeleteVertexArrays." 1369 1370 Add to the end of Section 2.12.2 (Matrices): 1371 1372 "The following commands: 1373 1374 void MatrixLoadfEXT(enum matrixMode, const float *m); 1375 void MatrixLoaddEXT(enum matrixMode, const double *m); 1376 1377 void MatrixLoadTransposefEXT(enum matrixMode, const float *m); 1378 void MatrixLoadTransposedEXT(enum matrixMode, const double *m); 1379 1380 void MatrixMultfEXT(enum matrixMode, const float *m); 1381 void MatrixMultdEXT(enum matrixMode, const double *m); 1382 1383 void MatrixMultTransposefEXT(enum matrixMode, const float *m); 1384 void MatrixMultTransposedEXT(enum matrixMode, const double *m); 1385 1386 void MatrixLoadIdentityEXT(enum matrixMode); 1387 1388 void MatrixRotatefEXT(enum matrixMode, float angle, 1389 float x, float y, float z); 1390 void MatrixRotatedEXT(enum matrixMode, double angle, 1391 double x, double y, double z); 1392 1393 void MatrixScalefEXT(enum matrixMode, 1394 float x, float y, float z); 1395 void MatrixScaledEXT(enum matrixMode, 1396 double x, double y, double z); 1397 1398 void MatrixTranslatefEXT(enum matrixMode, 1399 float x, float y, float z); 1400 void MatrixTranslatedEXT(enum matrixMode, 1401 double x, double y, double z); 1402 1403 void MatrixOrthoEXT(enum matrixMode, double l, double r, 1404 double b, double t, double n, double f); 1405 void MatrixFrustumEXT(enum matrixMode, double l, double r, 1406 double b, double t, double n, double f); 1407 1408 void MatrixPushEXT(enum matrixMode); 1409 void MatrixPopEXT(enum matrixMode); 1410 1411 are equivalent (assuming no errors) to the following: 1412 1413 int savedMatrixMode; 1414 1415 GetIntegerv(MATRIX_MODE, &savedMatrixMode); 1416 if (matrixMode >= TEXTURE0 && matrixMode <= TEXTURE31) { 1417 int savedActiveTexture; 1418 1419 MatrixMode(TEXTURE); 1420 GetIntegerv(ACTIVE_TEXTURE, &savedActiveTexture); 1421 ActiveTexture(matrixMode); 1422 XXX(...); 1423 ActiveTexture(savedActiveTexture); 1424 } else { 1425 MatrixMode(matrixMode); 1426 XXX(...); 1427 } 1428 MatrixMode(savedMatrixMode); 1429 1430 where matrixMode is the matrixMode parameter to the listed commands, 1431 XXX is found in Table 2.selectorFreeMatrixCommands, and ... is the 1432 list of the remaining arguments for the command that follow the 1433 initial matrixMode parameter. 1434 1435 Table 2.selectorFreeMatrixCommands: 1436 1437 Selector-free Command Name XXX 1438 -------------------------- -------------------- 1439 MatrixLoadfEXT LoadMatrixf 1440 MatrixLoaddEXT LoadMatrixd 1441 1442 MatrixLoadTransposefEXT LoadTransposeMatrixf 1443 MatrixLoadTransposedEXT LoadTransposeMatrixd 1444 1445 MatrixMultfEXT MultMatrixf 1446 MatrixMultdEXT MultMatrixd 1447 1448 MatrixMultTransposefEXT MultTransposeMatrixf 1449 MatrixMultTransposedEXT MultTransposeMatrixd 1450 1451 MatrixLoadIdentityEXT LoadIdentity 1452 1453 MatrixRotatefEXT Rotatef 1454 MatrixRotatedEXT Rotated 1455 1456 MatrixScalefEXT Scalef 1457 MatrixScaledEXT Scaled 1458 1459 MatrixTranslatefEXT Translatef 1460 MatrixTranslatedEXT Translated 1461 1462 MatrixOrthoEXT Ortho 1463 MatrixFrustumEXT Frustum 1464 1465 MatrixPushEXT PushMatrix 1466 MatrixPopEXT PopMatrix" 1467 1468 Add to the end of Section 2.20.3 (Shader Variables): 1469 1470 "Program-specific Uniform Updates 1471 1472 The following commands: 1473 1474 void ProgramUniform1fEXT(uint program, int location, float v0); 1475 void ProgramUniform2fEXT(uint program, int location, 1476 float v0, float v1); 1477 void ProgramUniform3fEXT(uint program, int location, 1478 float v0, float v1, float v2); 1479 void ProgramUniform4fEXT(uint program, int location, 1480 float v0, float v1, float v2, float v3); 1481 1482 void ProgramUniform1iEXT(uint program, int location, int v0); 1483 void ProgramUniform2iEXT(uint program, int location, 1484 int v0, int v1); 1485 void ProgramUniform3iEXT(uint program, int location, 1486 int v0, int v1, int v2); 1487 void ProgramUniform4iEXT(uint program, int location, 1488 int v0, int v1, int v2, int v3); 1489 1490 void ProgramUniform1fvEXT(uint program, int location, 1491 sizei count, const float *value); 1492 void ProgramUniform2fvEXT(uint program, int location, 1493 sizei count, const float *value); 1494 void ProgramUniform3fvEXT(uint program, int location, 1495 sizei count, const float *value); 1496 void ProgramUniform4fvEXT(uint program, int location, 1497 sizei count, const float *value); 1498 1499 void ProgramUniform1ivEXT(uint program, int location, 1500 sizei count, const int *value); 1501 void ProgramUniform2ivEXT(uint program, int location, 1502 sizei count, const int *value); 1503 void ProgramUniform3ivEXT(uint program, int location, 1504 sizei count, const int *value); 1505 void ProgramUniform4ivEXT(uint program, int location, 1506 sizei count, const int *value); 1507 1508 void ProgramUniformMatrix2fvEXT(uint program, int location, 1509 sizei count, boolean transpose, 1510 const float *value); 1511 void ProgramUniformMatrix3fvEXT(uint program, int location, 1512 sizei count, boolean transpose, 1513 const float *value); 1514 void ProgramUniformMatrix4fvEXT(uint program, int location, 1515 sizei count, boolean transpose, 1516 const float *value); 1517 1518 void ProgramUniformMatrix2x3fvEXT(uint program, int location, 1519 sizei count, boolean transpose, 1520 const float *value); 1521 void ProgramUniformMatrix3x2fvEXT(uint program, int location, 1522 sizei count, boolean transpose, 1523 const float *value); 1524 void ProgramUniformMatrix2x4fvEXT(uint program, int location, 1525 sizei count, boolean transpose, 1526 const float *value); 1527 void ProgramUniformMatrix4x2fvEXT(uint program, int location, 1528 sizei count, boolean transpose, 1529 const float *value); 1530 void ProgramUniformMatrix3x4fvEXT(uint program, int location, 1531 sizei count, boolean transpose, 1532 const float *value); 1533 void ProgramUniformMatrix4x3fvEXT(uint program, int location, 1534 sizei count, boolean transpose, 1535 const float *value); 1536 1537 void ProgramUniform1uiEXT(uint program, int location, uint v0); 1538 void ProgramUniform2uiEXT(uint program, int location, 1539 uint v0, uint v1); 1540 void ProgramUniform3uiEXT(uint program, int location, 1541 uint v0, uint v1, uint v2); 1542 void ProgramUniform4uiEXT(uint program, int location, 1543 uint v0, uint v1, uint v2, uint v3); 1544 1545 void ProgramUniform1uivEXT(uint program, int location, 1546 sizei count, const uint *value); 1547 void ProgramUniform2uivEXT(uint program, int location, 1548 sizei count, const uint *value); 1549 void ProgramUniform3uivEXT(uint program, int location, 1550 sizei count, const uint *value); 1551 void ProgramUniform4uivEXT(uint program, int location, 1552 sizei count, const uint *value); 1553 1554 operate identically to the corresponding command where "Program" is 1555 deleted from the name (and extension suffixes are dropped or updated 1556 appropriately) except, rather than updating the currently in use 1557 program object, these "Program" commands update the program object 1558 named by the initial program parameter. The remaining parameters 1559 following the initial program parameter for the listed "Program" 1560 commands match the parameters for the corresponding non-"Program" 1561 uniform command and are interpreted as they are for the non-"Program" 1562 uniform command. If the program named by the program parameter 1563 is not created or has not been successfully linked, the error 1564 INVALID_OPERATION is generated." 1565 1566Additions to Chapter 3 of the OpenGL 3.0 Specification (Rasterization) 1567 1568 Add to the end of section 3.8.12 (Texture Objects): 1569 1570 "Texture Object State Update 1571 1572 The command 1573 1574 void BindMultiTextureEXT(enum texunit, enum target, uint texture); 1575 1576 operates identically to BindTexture except, rather than binding the 1577 named texture object to the current active texture's target binding 1578 specified by the target parameter, BindMultiTextureEXT binds the 1579 named texture to the specified target binding of texunit. 1580 1581 These texture object state update commands: 1582 1583 void TextureParameteriEXT(uint texture, enum target, 1584 enum pname, int param); 1585 void TextureParameterivEXT(uint texture, enum target, 1586 enum pname, const int *param); 1587 1588 void TextureParameterfEXT(uint texture, enum target, 1589 enum pname, float param); 1590 void TextureParameterfvEXT(uint texture, enum target, 1591 enum pname, const float *param); 1592 1593 void TextureParameterIivEXT(uint texture, enum target, 1594 enum pname, const int *params); 1595 void TextureParameterIuivEXT(uint texture, enum target, 1596 enum pname, const uint *params); 1597 1598 void TextureImage1DEXT(uint texture, enum target, 1599 int level, int internalformat, 1600 sizei width, int border, 1601 enum format, enum type, const void *pixels); 1602 void TextureImage2DEXT(uint texture, enum target, 1603 int level, int internalformat, 1604 sizei width, sizei height, int border, 1605 enum format, enum type, const void *pixels); 1606 1607 void TextureSubImage1DEXT(uint texture, enum target, 1608 int level, int xoffset, sizei width, 1609 enum format, enum type, 1610 const void *pixels); 1611 void TextureSubImage2DEXT(uint texture, enum target, 1612 int level, int xoffset, int yoffset, 1613 sizei width, sizei height, 1614 enum format, enum type, 1615 const void *pixels); 1616 1617 void CopyTextureImage1DEXT(uint texture, enum target, 1618 int level, enum internalformat, 1619 int x, int y, sizei width, int border); 1620 void CopyTextureImage2DEXT(uint texture, enum target, 1621 int level, enum internalformat, 1622 int x, int y, 1623 sizei width, sizei height, int border); 1624 1625 void CopyTextureSubImage1DEXT(uint texture, enum target, 1626 int level, int xoffset, 1627 int x, int y, sizei width); 1628 void CopyTextureSubImage2DEXT(uint texture, enum target, 1629 int level, int xoffset, int yoffset, 1630 int x, int y, 1631 sizei width, sizei height); 1632 1633 void TextureImage3DEXT(uint texture, enum target, 1634 int level, int internalformat, 1635 sizei width, sizei height, sizei depth, 1636 int border, 1637 enum format, enum type, const void *pixels); 1638 1639 void TextureSubImage3DEXT(uint texture, enum target, 1640 int level, 1641 int xoffset, int yoffset, int zoffset, 1642 sizei width, sizei height, sizei depth, 1643 enum format, enum type, 1644 const void *pixels); 1645 void CopyTextureSubImage3DEXT(uint texture, enum target, 1646 int level, 1647 int xoffset, int yoffset, int zoffset, 1648 int x, int y, 1649 sizei width, sizei height); 1650 1651 void TextureBufferEXT(uint texture, enum target, 1652 enum internalformat, uint buffer); 1653 1654 void CompressedTextureImage3DEXT(uint texture, enum target, int level, 1655 enum internalformat, 1656 sizei width, sizei height, 1657 sizei depth, int border, 1658 sizei imageSize, const void *data); 1659 void CompressedTextureImage2DEXT(uint texture, enum target, int level, 1660 enum internalformat, 1661 sizei width, sizei height, 1662 int border, sizei imageSize, 1663 const void *data); 1664 void CompressedTextureImage1DEXT(uint texture, enum target, int level, 1665 enum internalformat, 1666 sizei width, int border, 1667 sizei imageSize, const void *data); 1668 void CompressedTextureSubImage3DEXT(uint texture, enum target, int level, 1669 int xoffset, int yoffset, 1670 int zoffset, 1671 sizei width, sizei height, 1672 sizei depth, enum format, 1673 sizei imageSize, const void *data); 1674 void CompressedTextureSubImage2DEXT(uint texture, enum target, int level, 1675 int xoffset, int yoffset, 1676 sizei width, sizei height, 1677 enum format, 1678 sizei imageSize, const void *data); 1679 void CompressedTextureSubImage1DEXT(uint texture, enum target, int level, 1680 int xoffset, sizei width, 1681 enum format, 1682 sizei imageSize, const void *data); 1683 void CompressedTextureImage3DEXT(uint texture, enum target, int level, 1684 enum internalformat, 1685 sizei width, sizei height, 1686 sizei depth, int border, 1687 sizei imageSize, const void *data); 1688 1689 void TextureBufferEXT(uint texture, enum target, 1690 enum internalformat, uint buffer); 1691 1692 void TextureRenderbufferEXT(uint texture, enum target, 1693 uint renderbuffer); 1694 1695 operate identically to the corresponding command where "Texture" 1696 is substituted for "Tex" (and extension suffixes are dropped or 1697 updated appropriately) except, rather than updating the current bound 1698 texture for the texture unit indicated by the current active texture 1699 state and the target parameter, these "Texture" commands update the 1700 texture object named by the initial texture parameter. If the 1701 texture parameter is zero, then the target parameter selects the 1702 default texture of the specified target to update. The remaining 1703 parameters following the initial texture parameter for the listed 1704 "Texture" commands match the parameters for the corresponding "Tex" 1705 command and are interpreted as they are for the "Tex" command. 1706 If the texture parameter is for an unused name, the name becomes 1707 used and the named texture object is set to a new state vector, 1708 comprising all the state values listed in section 3.8.11, set 1709 to the same initial values prior to the command's state update. 1710 If the texture parameter is for a used name and that named texture 1711 object has a different target than the specified target parameter, 1712 the INVALID_OPERATION error is generated. One consequence of this 1713 error for commands that accepts TEXTURE_PROXY_* as a valid target 1714 parameter is TEXTURE_PROXY_* target tokens generate errors if used 1715 with a non-zero texture parameter because the target of a non-default 1716 (non-zero) texture object is never a proxy target." 1717 1718 Add before the last paragraph of Section 3.8.16 (Texture Application): 1719 1720 "The following commands (introduced by EXT_draw_buffers2): 1721 1722 void EnableIndexedEXT(enum cap, uint index); 1723 void Enablei(enum cap, uint index); 1724 void DisableIndexedEXT(enum cap, uint index); 1725 void Disablei(enum cap, uint index); 1726 1727 are equivalent (assuming no errors) to the following: 1728 1729 int savedActiveTexture; 1730 1731 GetIntegerv(ACTIVE_TEXTURE, &savedActiveTexture); 1732 ActiveTexture(TEXTURE0+index); 1733 XXX(cap); 1734 ActiveTexture(savedActiveTexture); 1735 1736 where index is the index parameter to the listed commands and XXX 1737 is the name of the command without its "Indexed" or "i" suffix 1738 (either Enable or Disable) when the cap parameter is one of 1739 the texture-related enable token depending on the active texture 1740 state, namely TEXTURE_1D, TEXTURE_2D, TEXTURE_3D, TEXTURE_CUBE_MAP, 1741 TEXTURE_RECTANGLE_ARB, TEXTURE_GEN_S, TEXTURE_GEN_T, TEXTURE_GEN_R, 1742 or TEXTURE_GEN_Q." 1743 1744 Add NEW section 3.8.X (Multitexture Commands): after section 3.8.16 1745 (Texture Application): 1746 1747 "These multitexture commands: 1748 1749 void MultiTexCoordPointerEXT(enum texunit, int size, enum type, 1750 sizei stride, const void *pointer); 1751 1752 void MultiTexEnvfEXT(enum texunit, enum target, enum pname, 1753 float param); 1754 void MultiTexEnvfvEXT(enum texunit, enum target, enum pname, 1755 const float *params); 1756 void MultiTexEnviEXT(enum texunit, enum target, enum pname, 1757 int param); 1758 void MultiTexEnvivEXT(enum texunit, enum target, enum pname, 1759 const int *params); 1760 1761 void MultiTexGendEXT(enum texunit, enum coord, enum pname, 1762 double param); 1763 void MultiTexGendvEXT(enum texunit, enum coord, enum pname, 1764 const double *params); 1765 void MultiTexGenfEXT(enum texunit, enum coord, enum pname, 1766 float param); 1767 void MultiTexGenfvEXT(enum texunit, enum coord, enum pname, 1768 const float *params); 1769 void MultiTexGeniEXT(enum texunit, enum coord, enum pname, 1770 int param); 1771 void MultiTexGenivEXT(enum texunit, enum coord, enum pname, 1772 const int *params); 1773 1774 void MultiTexParameteriEXT(enum texunit, enum target, 1775 enum pname, int param); 1776 void MultiTexParameterivEXT(enum texunit, enum target, 1777 enum pname, const int *param); 1778 1779 void MultiTexParameterfEXT(enum texunit, enum target, 1780 enum pname, float param); 1781 void MultiTexParameterfvEXT(enum texunit, enum target, 1782 enum pname, const float *param); 1783 1784 void MultiTexParameterIivEXT(enum texunit, enum target, 1785 enum pname, const int *params); 1786 void MultiTexParameterIuivEXT(enum texunit, enum target, 1787 enum pname, const uint *params); 1788 1789 void MultiTexImage1DEXT(enum texunit, enum target, 1790 int level, int internalformat, 1791 sizei width, int border, 1792 enum format, enum type, const void *pixels); 1793 void MultiTexImage2DEXT(enum texunit, enum target, 1794 int level, int internalformat, 1795 sizei width, sizei height, int border, 1796 enum format, enum type, const void *pixels); 1797 1798 void MultiTexSubImage1DEXT(enum texunit, enum target, 1799 int level, int xoffset, sizei width, 1800 enum format, enum type, 1801 const void *pixels); 1802 void MultiTexSubImage2DEXT(enum texunit, enum target, 1803 int level, int xoffset, int yoffset, 1804 sizei width, sizei height, 1805 enum format, enum type, 1806 const void *pixels); 1807 1808 void CopyMultiTexImage1DEXT(enum texunit, enum target, 1809 int level, enum internalformat, 1810 int x, int y, sizei width, int border); 1811 void CopyMultiTexImage2DEXT(enum texunit, enum target, 1812 int level, enum internalformat, 1813 int x, int y, 1814 sizei width, sizei height, int border); 1815 1816 void CopyMultiTexSubImage1DEXT(enum texunit, enum target, 1817 int level, int xoffset, 1818 int x, int y, sizei width); 1819 void CopyMultiTexSubImage2DEXT(enum texunit, enum target, 1820 int level, int xoffset, int yoffset, 1821 int x, int y, 1822 sizei width, sizei height); 1823 1824 void MultiTexImage3DEXT(enum texunit, enum target, 1825 int level, int internalformat, 1826 sizei width, sizei height, sizei depth, 1827 int border, 1828 enum format, enum type, const void *pixels); 1829 1830 void MultiTexSubImage3DEXT(enum texunit, enum target, 1831 int level, 1832 int xoffset, int yoffset, int zoffset, 1833 sizei width, sizei height, sizei depth, 1834 enum format, enum type, 1835 const void *pixels); 1836 void CopyMultiTexSubImage3DEXT(enum texunit, enum target, 1837 int level, 1838 int xoffset, int yoffset, int zoffset, 1839 int x, int y, 1840 sizei width, sizei height); 1841 1842 void CompressedMultiTexImage3DEXT(enum texunit, enum target, int level, 1843 enum internalformat, 1844 sizei width, sizei height, 1845 sizei depth, int border, 1846 sizei imageSize, const void *data); 1847 void CompressedMultiTexImage2DEXT(enum texunit, enum target, int level, 1848 enum internalformat, 1849 sizei width, sizei height, 1850 int border, sizei imageSize, 1851 const void *data); 1852 void CompressedMultiTexImage1DEXT(enum texunit, enum target, int level, 1853 enum internalformat, 1854 sizei width, int border, 1855 sizei imageSize, const void *data); 1856 void CompressedMultiTexSubImage3DEXT(enum texunit, enum target, int level, 1857 int xoffset, int yoffset, 1858 int zoffset, 1859 sizei width, sizei height, 1860 sizei depth, enum format, 1861 sizei imageSize, const void *data); 1862 void CompressedMultiTexSubImage2DEXT(enum texunit, enum target, int level, 1863 int xoffset, int yoffset, 1864 sizei width, sizei height, 1865 enum format, 1866 sizei imageSize, const void *data); 1867 void CompressedMultiTexSubImage1DEXT(enum texunit, enum target, int level, 1868 int xoffset, sizei width, 1869 enum format, 1870 sizei imageSize, const void *data); 1871 1872 void MultiTexBufferEXT(enum texunit, enum target, 1873 enum internalformat, uint buffer); 1874 1875 void MultiTexRenderbufferEXT(enum texunit, enum target, 1876 uint renderbuffer); 1877 1878 are equivalent (assuming no errors) to the following: 1879 1880 int savedActiveTexture; 1881 1882 GetIntegerv(ACTIVE_TEXTURE, &savedActiveTexture); 1883 ActiveTexture(texunit); 1884 XXX(...); 1885 ActiveTexture(savedActiveTexture); 1886 1887 where XXX is the name of the command without its "Multi" prefix 1888 (and extension suffixes are dropped or updated appropriately) 1889 and ... is the list of the arguments for the command excluding the 1890 index parameter." 1891 1892Additions to Chapter 4 of the OpenGL 3.0 Specification (Per-Fragment 1893Operations and the Frame Buffer) 1894 1895 Add new section 4.4.7 (Named Access): 1896 1897 "The following commands: 1898 1899 void NamedRenderbufferStorageEXT(uint renderbuffer, 1900 enum internalformat, 1901 sizei width, sizei height); 1902 1903 void NamedRenderbufferStorageMultisampleEXT(uint renderbuffer, 1904 sizei samples, 1905 enum internalformat, 1906 sizei width, sizei height); 1907 1908 void NamedRenderbufferStorageMultisampleCoverageEXT(uint renderbuffer, 1909 sizei coverageSamples, 1910 sizei colorSamples, 1911 enum internalformat, 1912 sizei width, 1913 sizei height); 1914 1915 operate identically to the corresponding command where "Named" is 1916 deleted from the name (and extension suffixes are dropped or updated 1917 appropriately) except, rather than updating the currently bound 1918 renderbuffer for the renderbuffer target parameter (a parameter not 1919 present for these listed commands), these "Named" commands update the 1920 renderbuffer object named by the initial renderbuffer parameter. 1921 The remaining parameters following the initial renderbuffer 1922 parameter for the listed "Named" commands match the parameters 1923 for the corresponding non-"Named" renderbuffer command and are 1924 interpreted as they are for the non-"Named" renderbuffer command; 1925 and the target parameter is assumed to be RENDERBUFFER. If the 1926 renderbuffer object named by the renderbuffer parameter has not 1927 been previously bound or has been deleted since the last binding, 1928 the GL first creates a new state vector in the same manner as when 1929 BindRenderbuffer creates a new renderbuffer object. 1930 1931 The following commands (and query): 1932 1933 void NamedFramebufferTexture1DEXT(uint framebuffer, 1934 enum attachment, 1935 enum textarget, uint texture, 1936 int level); 1937 void NamedFramebufferTexture2DEXT(uint framebuffer, 1938 enum attachment, 1939 enum textarget, uint texture, 1940 int level); 1941 void NamedFramebufferTexture3DEXT(uint framebuffer, 1942 enum attachment, 1943 enum textarget, uint texture, 1944 int level, int zoffset); 1945 1946 void NamedFramebufferRenderbufferEXT(uint framebuffer, 1947 enum attachment, 1948 enum renderbuffertarget, 1949 uint renderbuffer); 1950 1951 void NamedFramebufferTextureEXT(uint framebuffer, enum attachment, 1952 uint texture, int level); 1953 void NamedFramebufferTextureLayerEXT(uint framebuffer, 1954 enum attachment, 1955 uint texture, 1956 int level, int layer); 1957 void NamedFramebufferTextureFaceEXT(uint framebuffer, enum attachment, 1958 uint texture, 1959 int level, enum face); 1960 1961 void GetNamedFramebufferAttachmentParameterivEXT(uint framebuffer, 1962 enum attachment, 1963 enum pname, 1964 int *params); 1965 1966 operate identically to the corresponding command (or query) where 1967 "Named" is deleted from the name (and extension suffixes are dropped 1968 or updated appropriately) except, rather than updating the currently 1969 bound framebuffer for the framebuffer target parameter (a parameter 1970 not present for these listed commands and query), these "Named" 1971 commands update (or the query queries) the framebuffer object named by 1972 the initial framebuffer parameter. The remaining parameters following 1973 the initial framebuffer parameter for the listed "Named" commands 1974 (or query) match the parameters for the corresponding non-"Named" 1975 framebuffer command (or query) and are interpreted as they are for the 1976 non-"Named" framebuffer command (or query); and the target parameter is 1977 assumed to be FRAMEBUFFER. If the framebuffer object named by 1978 the framebuffer parameter has not been previously bound or has been 1979 deleted since the last binding, the GL first creates a new state 1980 vector in the same manner as when BindFramebuffer creates a new 1981 framebuffer object. 1982 1983 The commands 1984 1985 void FramebufferDrawBufferEXT(uint framebuffer, enum mode); 1986 void FramebufferDrawBuffersEXT(uint framebuffer, sizei n, 1987 const enum *bufs) 1988 void FramebufferReadBufferEXT(uint framebuffer, enum mode); 1989 1990 1991 operate identically to DrawBuffer, DrawBuffers, and ReadBuffer 1992 (without the initial framebuffer parameter) respectively except rather 1993 than updating the draw buffers or read buffer of the currently bound 1994 framebuffer object or the default window-system-provided framebuffer 1995 (i.e., FRAMEBUFFER_BINDING is zero), these commands update the 1996 draw buffers or read buffer of the framebuffer object named by the 1997 framebuffer parameter. When the framebuffer parameter is zero, 1998 the default window-system provided framebuffer is updated (even if 1999 the window-system-provided framebuffer is not currently bound). 2000 If the framebuffer object named by the framebuffer parameter has not 2001 been previously bound or has been deleted since the last binding, 2002 the GL first creates a new state vector in the same manner as when 2003 BindFramebuffer creates a new framebuffer object. 2004 2005 The query 2006 2007 void GetFramebufferParameterivEXT(uint framebuffer, enum pname, 2008 int *param); 2009 2010 returns the framebuffer state of the framebuffer object specified 2011 by the framebuffer parameter. The pname parameter must be one of 2012 framebuffer dependent values listed in either table 4.nnn (namely 2013 DRAW_BUFFER, READ_BUFFER, or DRAW_BUFFER0 through DRAW_BUFFER15). 2014 The query returns the same value in param that GetIntegerv would 2015 return if called with pname and param as if the framebuffer specified 2016 by the framebuffer parameter had been bound with BindFramebuffer. 2017 If the framebuffer object named by the framebuffer parameter has not 2018 been previously bound or has been deleted since the last binding, 2019 the GL first creates a new state vector in the same manner as when 2020 BindFramebuffer creates a new framebuffer object. 2021 2022 The command 2023 2024 enum CheckNamedFramebufferStatusEXT(uint framebuffer, 2025 enum target); 2026 2027 operates identically to CheckFramebufferStatus except rather 2028 than checking the currently bound framebuffer for the framebuffer 2029 target parameter, the status of the named framebuffer is checked 2030 where the target parameter indicates how the framebuffer would 2031 be bound. Because FRAMEBUFFER_UNSUPPORTED can be returned by 2032 CheckFramebufferStatus due to an implementation-dependent set of 2033 restrictions that might not be known until the framebuffer object is 2034 bound with BindFramebuffer, CheckNamedFramebufferStatusARB may in 2035 rare circumstances (ideally never) return FRAMEBUFFER_COMPLETE 2036 when CheckFramebufferStatus with the same framebuffer object bound 2037 would return FRAMEBUFFER_UNSUPPORTED. The framebuffer is checked 2038 for drawing if target is FRAMEBUFFER or DRAW_FRAMEBUFFER, 2039 and checked for reading if the target is READ_FRAMEBUFFER. 2040 If the framebuffer object named by the framebuffer parameter has not 2041 been previously bound or has been deleted since the last binding, 2042 the GL first creates a new state vector in the same manner as when 2043 BindFramebuffer creates a new framebuffer object. 2044 2045 The commands 2046 2047 void GenerateTextureMipmapEXT(uint texture, enum target); 2048 2049 void GenerateMultiTexMipmapEXT(enum texunit, enum target); 2050 2051 operate identically to GenerateMipmap except they use the 2052 texture specified by the named texture or specified texture unit 2053 respectively. The target parameter must be a token accepted by 2054 GenerateMipmap. 2055 2056 If GenerateTextureMipmapARB's texture parameter is for an unused 2057 name, the name becomes used and the named texture object is set 2058 to a new state vector, comprising all the state values listed in 2059 section 3.8.11, set to the same initial values prior to the command's 2060 state update. If the texture parameter is for a used name and that 2061 named texture object has a different target than the specified target 2062 parameter, the INVALID_OPERATION error is generated." 2063 2064Additions to Chapter 5 of the OpenGL 3.0 Specification (Special Functions) 2065 2066 In Section 5.4 (Display Lists): 2067 2068 Add to list (page 310) of "Client state" commands "not compiled into 2069 the display list but are executed immediately": 2070 2071 PushClientAttribDefaultEXT, ClientAttribDefaultEXT 2072 2073 Add to list (page 310) of "Framebuffer and renderbuffer objects" 2074 commands "not compiled into the display list but are executed 2075 immediately": 2076 2077 CheckNamedFramebufferStatusEXT, NamedRenderbufferStorageEXT, 2078 NamedFramebufferTexture1DEXT, NamedFramebufferTexture2DEXT, 2079 NamedFramebufferTexture3DEXT, NamedFramebufferRenderbufferEXT, 2080 GenerateTextureMipmapEXT, GenerateMultiTexMipmapEXT 2081 2082 Add to the list (page 310) of "Vertex Buffer Objects" commands 2083 "not compiled into the display list but are executed immediately": 2084 2085 NamedCopyBufferSubDataEXT 2086 2087Additions to Chapter 6 of the OpenGL 3.0 Specification (State and 2088State Requests) 2089 2090 Change section 6.1.1 (Simple Queries) so the second and third 2091 paragraphs read: 2092 2093 "Indexed simple state variables are queried with the commands: 2094 2095 void GetBooleani_v(enum target, uint index, boolean *data); 2096 void GetIntegeri_v(enum target, uint index, int *data); 2097 void GetFloati_vEXT(enum target, uint index, float *data); 2098 void GetDoublei_vEXT(enum target, uint index, double *data); 2099 2100 void GetBooleanIndexedvEXT(enum target, uint index, boolean *data); 2101 void GetIntegerIndexedvEXT(enum target, uint index, int *data); 2102 void GetFloatIndexedvEXT(enum target, uint index, float *data); 2103 void GetDoubleIndexedvEXT(enum target, uint index, double *data); 2104 2105 target is the name of the indexed state and index is the index of 2106 the particular element being queried. data is a pointer to a scalar 2107 or array of the indicated type in which to place the returned data. 2108 An INVALID_VALUE error is generated if index is outside the valide 2109 range for the indexed state target. 2110 2111 Table 6.indexedGenericQueryCommands: 2112 2113 Selector-free Command Name GetXXX 2114 -------------------------- -------------------- 2115 GetBooleanIndexedvEXT GetBooleanv 2116 GetIntegerIndexedvEXT GetIntegerv 2117 GetFloatIndexedvEXT GetFloatv 2118 GetDoubleIndexedvEXT GetDoublev 2119 GetBooleani_v GetBooleanv 2120 GetIntegeri_v GetIntegerv 2121 GetFloati_vEXT GetFloatv 2122 GetDoublei_vEXT GetDoublev 2123 2124 When the target to one of these indexed queries is one 2125 of PROGRAM_MATRIX_EXT, TRANSPOSE_PROGRAM_MATRIX_EXT, or 2126 PROGRAM_MATRIX_STACK_DEPTH_EXT, the query operates indentically to 2127 (assuming no errors): 2128 2129 int savedMatrixMode; 2130 GetIntegerv(MATRIX_MODE, &savedMatrixMode); 2131 MatrixMode(GL_MATRIX0_ARB+index); 2132 switch (target) { 2133 case PROGRAM_MATRIX_EXT: 2134 GetXXX(CURRENT_MATRIX_ARB, params); 2135 break; 2136 case TRANSPOSE_PROGRAM_MATRIX_EXT: 2137 GetXXX(TRANSPOSE_CURRENT_MATRIX_ARB, params); 2138 break; 2139 case PROGRAM_MATRIX_STACK_DEPTH_EXT: 2140 GetXXX(CURRENT_MATRIX_STACK_DEPTH_ARB, params); 2141 break; 2142 } 2143 MatrixMode(savedMatrixMode); 2144 2145 where GetXXX is found in Table 6.indexedGenericQueryCommands. 2146 2147 When the target to one of these indexed queries is one 2148 of CURRENT_MATRIX_NV, CURRENT_MATRIX_STACK_DEPTH_NV, 2149 CURRENT_RASTER_TEXTURE_COORDS, CURRENT_TEXTURE_COORDS, 2150 TEXTURE_BINDING_1D, TEXTURE_BINDING_1D_ARRAY, 2151 TEXTURE_BINDING_2D, TEXTURE_BINDING_2D_ARRAY, 2152 TEXTURE_BINDING_3D, TEXTURE_BINDING_BUFFER_EXT, 2153 TEXTURE_BINDING_CUBE_MAP, TEXTURE_BINDING_CUBE_MAP_ARRAY_NV, 2154 TEXTURE_BINDING_RECTANGLE_ARB, TEXTURE_BINDING_RENDERBUFFER_NV, 2155 TEXTURE_RENDERBUFFER_DATA_STORE_BINDING_NV, 2156 TEXTURE_BUFFER_DATA_STORE_BINDING_EXT, TEXTURE_BUFFER_FORMAT_EXT, 2157 TEXTURE_GEN_Q, TEXTURE_GEN_R, TEXTURE_GEN_S, TEXTURE_GEN_T, 2158 TEXTURE_MATRIX, TEXTURE_STACK_DEPTH, TRANSPOSE_TEXTURE_MATRIX, 2159 GL_TEXTURE_1D, GL_TEXTURE_2D, GL_TEXTURE_3D, GL_TEXTURE_CUBE_MAP, or 2160 GL_TEXTURE_RECTANGLE_ARB, the query operates indentically (assuming 2161 no errors) to: 2162 2163 int savedActiveTexture; 2164 GetIntegerv(ACTIVE_TEXTURE, &savedActiveTexture); 2165 ActiveTexture(TEXTURE0+index); 2166 GetXXX(target, params); 2167 ActiveTexture(savedActiveTexture); 2168 2169 where GetXXX is found in Table 6.indexedGenericQueryCommands. 2170 2171 When the target to one of these indexed queries is one of 2172 TEXTURE_COORD_ARRAY, TEXTURE_COORD_ARRAY_BUFFER_BINDING, 2173 TEXTURE_COORD_ARRAY_COUNT, TEXTURE_COORD_ARRAY_SIZE, 2174 TEXTURE_COORD_ARRAY_STRIDE, or TEXTURE_COORD_ARRAY_TYPE, the query 2175 operates indentically (assuming no errors) to: 2176 2177 int savedClientActiveTexture; 2178 GetIntegerv(CLIENT_ACTIVE_TEXTURE, &savedClientActiveTexture); 2179 ClientActiveTexture(TEXTURE0+index); 2180 GetXXX(target, params); 2181 ClientActiveTexture(savedClientActiveTexture); 2182 2183 where GetXXX is found in Table 6.indexedGenericQueryCommands. 2184 2185 Finally, 2186 2187 boolean IsEnabled(enum value); 2188 2189 can be used to determine if value is currently enabled (as with 2190 Enable) or disabled and the queries 2191 2192 boolean IsEnabledi(enum target, uint index); 2193 boolean IsEnabledIndexedEXT(enum cap, uint index); 2194 2195 can be used to determine if the indexed state corresponding to target 2196 and index is enabled or disabled. An INVALID_VALUE error is generated 2197 if index is outside the valid range for the indexed state target. 2198 2199 When the target to IsEnabledi or IsEnabledIndexedEXT is 2200 one of TEXTURE_1D, TEXTURE_2D, TEXTURE_3D, TEXTURE_CUBE_MAP, 2201 TEXTURE_RECTANGLE_ARB, TEXTURE_GEN_S, TEXTURE_GEN_T, TEXTURE_GEN_R, 2202 or TEXTURE_GEN_Q, the query operates indentically (assuming no 2203 errors) to: 2204 2205 int savedActiveTexture; 2206 boolean rv; 2207 GetIntegerv(ACTIVE_TEXTURE, &savedActiveTexture); 2208 ActiveTexture(TEXTURE0+index); 2209 rv = IsEnabled(cap); 2210 ActiveTexture(savedActiveTexture); 2211 return rv; 2212 2213 When the target to IsEnabledi or IsEnabledIndexedEXT is 2214 TEXTURE_COORD_ARRAY, the query operates indentically (assuming no 2215 errors) to: 2216 2217 int savedClientActiveTexture; 2218 boolean rv; 2219 GetIntegerv(CLIENT_ACTIVE_TEXTURE, &savedClientActiveTexture); 2220 ClientActiveTexture(TEXTURE0+index); 2221 rv = IsEnabled(cap); 2222 ClientActiveTexture(savedClientActiveTexture); 2223 return rv;" 2224 2225 Add new paragraph to the end of section 6.1.3 (Enumerated Queries): 2226 2227 "These commands 2228 2229 void GetTextureImageEXT(uint texture, enum target, 2230 int level, 2231 enum format, enum type, void *pixels); 2232 2233 void GetTextureParameterfvEXT(uint texture, enum target, 2234 enum pname, float *params); 2235 void GetTextureParameterivEXT(uint texture, enum target, 2236 enum pname, int *params); 2237 2238 void GetTextureLevelParameterfvEXT(uint texture, enum target, 2239 int level, 2240 enum pname, float *params); 2241 void GetTextureLevelParameterivEXT(uint texture, enum target, 2242 int level, 2243 enum pname, int *params); 2244 2245 void GetTextureParameterIivEXT(uint texture, enum target, 2246 enum pname, int *params); 2247 void GetTextureParameterIuivEXT(uint texture, enum target, 2248 enum pname, uint *params); 2249 2250 operate identically to the corresponding texture query command where 2251 "Texture" is substituted for "Tex" (and extension suffixes are dropped 2252 or updated appropriately) except, rather than querying the current 2253 bound texture for the texture unit indicated by the current active 2254 texture state and the target parameter, these "Texture" commands 2255 query the texture object named by the initial texture parameter. 2256 The remaining parameters following the initial texture parameter 2257 for the listed "Texture" commands match the parameters for the 2258 corresponding "Tex" command and are interpreted as they are for the 2259 "Tex" command." If the texture parameter is for an unused name, the 2260 name becomes used and the named texture object is set to a new state 2261 vector, comprising all the state values listed in section 3.8.11, 2262 set to the same initial values prior to the command's state query. 2263 If the texture parameter is for a used name and that named texture 2264 object has a different target than the specified target parameter, 2265 the INVALID_OPERATION error is generated. One consequence of this 2266 error for commands that accepts TEXTURE_PROXY_* as a valid target 2267 parameter (GetTextureLevelParameter*, but not GetTextureParameter*) 2268 is TEXTURE_PROXY_* target tokens generate errors if used with a 2269 non-zero texture parameter because the target of a non-default 2270 (non-zero) texture object is never a proxy target." 2271 2272 Add new paragraph after the GetPointerv description in section 6.1.11 2273 (Pointer and String Queries): 2274 2275 "The following query 2276 2277 void GetPointerIndexedvEXT(enum pname, uint index, void **params); 2278 2279 is equivalent (assuming no errors) to the following: 2280 2281 int savedClientActiveTexture; 2282 2283 GetIntegerv(CLIENT_ACTIVE_TEXTURE, &savedClientActiveTexture); 2284 ClientActiveTexture(TEXTURE0+index); 2285 GetPointerv(pname, params); 2286 ClientActiveTexture(savedClientActiveTexture); 2287 2288 where index is the index parameter to the listed queries and GetXXX 2289 is found in Table 6.indexedGenericQueryCommands. when the pname 2290 parameter is TEXTURE_COORD_ARRAY_POINTER." 2291 2292 Add new paragraph to the end of section 6.1.13 (Buffer Object Queries): 2293 2294 "These commands 2295 2296 void GetNamedBufferParameterivEXT(uint buffer, 2297 enum pname, int *params); 2298 void GetNamedBufferPointervEXT(uint buffer, 2299 enum pname, void* *params); 2300 void GetNamedBufferSubDataEXT(uint buffer, 2301 intptr offset, sizeiptr size, void *data); 2302 2303 operate identically to the corresponding command where "Named" is 2304 deleted from the name (and extension suffixes are dropped or updated 2305 appropriately) except, rather than querying the currently bound buffer 2306 for the buffer target parameter (a parameter not present for these 2307 listed commands), these "Named" commands query the buffer object 2308 named by the initial buffer parameter. The remaining parameters 2309 following the initial buffer parameter for the listed "Named" commands 2310 match the parameters for the corresponding non-"Named" buffer command 2311 (except the target parameter is not needed because the buffer object 2312 to query is identified by its name) and are interpreted as they 2313 are for the non-"Named" buffer command. If the buffer object named 2314 by the buffer parameter has not been previously bound or has been 2315 deleted since the last binding, the GL first creates a new state 2316 vector, initialized with a zero-sized memory buffer and comprising the 2317 state values listed in table 2.6. There is no buffer corresponding 2318 to the name zero, these commands generate the INVALID_OPERATION 2319 error if the buffer parameter is zero." 2320 2321 Add new paragraph to the end of section after 6.1.14 (Vertex Array 2322 Object Queries): 2323 2324 "The commands 2325 2326 void GetVertexArrayIntegervEXT(uint vaobj, enum pname, 2327 int *param); 2328 void GetVertexArrayPointervEXT(uint vaobj, enum pname, 2329 void **param); 2330 void GetVertexArrayIntegeri_vEXT(uint vaobj, 2331 uint index, 2332 enum pname, 2333 int *param); 2334 void GetVertexArrayPointeri_vEXT(uint vaobj, 2335 uint index, 2336 enum pname, 2337 void **param); 2338 2339 queries the parameters of the vertex array object named by vaobj. For 2340 GetVertexArrayIntegervEXT, pname must be one of the "Get value" tokens 2341 in tables 6.6, 6.7, 6.8, and 6.9 that use GetIntegerv, IsEnabled, or 2342 GetPointerv for their "Get command" (so excluding the VERTEX_ATTRIB_* 2343 tokens). For GetVertexArrayIntegeri_vEXT, pname must be one of the 2344 "Get value" tokens in tables 6.8 and 6.9 that use GetVertexAttribiv 2345 or GetVertexAttribPointerv (so allowing only the VERTEX_ATTRIB_* 2346 tokens) or a token of the form TEXTURE_COORD_ARRAY (the enable) or 2347 TEXTURE_COORD_ARRAY_*; index identifies the vertex attribute 2348 array to query or texture coordinate set index respectively. For 2349 GetVertexArrayPointervEXT, pname must be a *_ARRAY_POINTER token from 2350 tables 6.6, 6.7, and 6.8 excluding VERTEX_ATTRIB_ARRAY_POINTER. For 2351 GetVertexArrayPointeri_vEXT, pname must be VERTEX_ATTRIB_ARRAY_POINTER 2352 or TEXTURE_COORD_ARRAY_POINTER with the index parameter indicating 2353 the vertex attribute or texture coordindate set index. 2354 2355 If the state queried by GetVertexArrayIntegervEXT or 2356 GetVertexArrayVertexAttribIntegervEXT is maintained as a pointer, 2357 the least significant bits of the pointer that fit within an int are 2358 returned in case a pointer is larger than an int. This behavior 2359 allows pointers treated as offsets (when less than 2^31) to be 2360 returned as integer values. 2361 2362 If the vertex array object named by the vaobj parameter has not 2363 been previously bound but has been generated (without subsequent 2364 deletion) by GenVertexArrays, the GL first creates a new state 2365 vector in the same manner as when BindVertexArray creates a new 2366 vertex array object (hence the initial state will be returned). 2367 However these queries fail and an INVALID_OPERATION error is 2368 generated if vaobj is not a name returned from a previous call 2369 to GenVertexArrays, or if such a name has since been deleted with 2370 DeleteVertexArrays." 2371 2372 Add NEW section after 6.1.15 (Shader and Program Queries): 2373 2374 "16.1.X Multitexture Queries 2375 2376 These queries 2377 2378 void GetMultiTexEnvfvEXT(enum texunit, enum target, 2379 enum pname, float *params); 2380 void GetMultiTexEnvivEXT(enum texunit, enum target, 2381 enum pname, int *params); 2382 2383 void GetMultiTexGendvEXT(enum texunit, enum coord, 2384 enum pname, double *params); 2385 void GetMultiTexGenfvEXT(enum texunit, enum coord, 2386 enum pname, float *params); 2387 void GetMultiTexGenivEXT(enum texunit, enum coord, 2388 enum pname, int *params); 2389 2390 void GetMultiTexImageEXT(enum texunit, enum target, 2391 int level, 2392 enum format, enum type, void *pixels); 2393 2394 void GetMultiTexParameterfvEXT(enum texunit, enum target, 2395 enum pname, float *params); 2396 void GetMultiTexParameterivEXT(enum texunit, enum target, 2397 enum pname, int *params); 2398 2399 void GetMultiTexParameterIivEXT(enum texunit, enum target, 2400 enum pname, int *params); 2401 void GetMultiTexParameterIuivEXT(enum texunit, enum target, 2402 enum pname, uint *params); 2403 2404 void GetMultiTexLevelParameterfvEXT(enum texunit, enum target, 2405 int level, 2406 enum pname, float *params); 2407 void GetMultiTexLevelParameterivEXT(enum texunit, enum target, 2408 int level, 2409 enum pname, int *params); 2410 2411 void GetCompressedMultiTexImageEXT(enum texunit, enum target, 2412 int level, void *img); 2413 2414 are equivalent (assuming no errors) to the following: 2415 2416 int savedActiveTexture, savedClientActiveTexture; 2417 2418 GetIntegerv(ACTIVE_TEXTURE, &savedActiveTexture); 2419 ActiveTexture(texunit); 2420 GetXXX(...); 2421 ActiveTexture(savedActiveTexture); 2422 2423 where GetXXX is found in Table 6.MultiTexQueryCommands and 2424 ... is the list of the arguments for the command excluding the 2425 index parameter. 2426 2427 Table 6.MultiTexQueryCommands: 2428 2429 Selector-free Command Name GetXXX 2430 ------------------------------ -------------------- 2431 GetMultiTexEnvfvEXT GetTexEnvfv 2432 GetMultiTexEnvivEXT GetTexEnviv 2433 GetMultiTexGendvEXT GetTexGendv 2434 GetMultiTexGenfvEXT GetTexGenfv 2435 GetMultiTexGenivEXT GetTexGeniv 2436 GetMultiTexImageEXT GetTexImage 2437 GetMultiTexParameterfvEXT GetTexParameterfv 2438 GetMultiTexParameterivEXT GetTexParameteriv 2439 GetMultiTexParameterIivEXT GetTexParameterIiv 2440 GetMultiTexParameterIuivEXT GetTexParameterIuiv 2441 GetMultiTexLevelParameterivEXT GetTexLevelParameteriv 2442 GetMultiTexLevelParameterfvEXT GetTexLevelParameterfv 2443 GetCompressedMultiTexImageEXT GetCompressedTexImage 2444 2445 Add new paragraphs after the first paragraph of section 6.1.15 2446 (Saving and Restoring State): 2447 2448 "The command 2449 2450 void ClientAttribDefaultEXT(bitfield mask); 2451 2452 resets portions of the client state, depending on the bits set 2453 in the mask parameter, to the initial values of the state. 2454 When CLIENT_PIXEL_STORE_BIT is set in mask, the pixel store 2455 state is set to the initial values documented in table 6.23. 2456 When CLIENT_VERTEX_ARRAY_BIT is set in mask, the client vertex 2457 array state is set to the initial values documented in table 6.6, 2458 6.7, and 6.8. 2459 2460 The command 2461 2462 void PushClientAttribDefaultEXT(bitfield mask); 2463 2464 is equivalent to: 2465 2466 PushClientAttrib(mask); 2467 ClientAttribDefaultEXT(mask);" 2468 2469Additions to Appendix A of the OpenGL 3.0 Specification (Invariance) 2470 2471 None. 2472 2473Interactions with the ARB_texture_rectangle specification 2474 2475 If ARB_texture_rectangle (or NV_texture_rectangle or 2476 EXT_texture_rectangle) is NOT supported, ignore references to 2477 TEXTURE_RECTANGLE_ARB and GL_TEXTURE_BINDING_RECTANGLE_ARB in amended 2478 section 3.8.16 and new section 6.1.X. 2479 2480Interactions with the ARB_vertex_program specification 2481 2482 If ARB_vertex_program is NOT supported, ignore the support 2483 for PROGRAM_MATRIX_EXT, TRANSPOSE_PROGRAM_MATRIX_EXT, 2484 and PROGRAM_MATRIX_STACK_DEPTH_EXT described for the 2485 GetBooleanIndexedvEXT, GetIntegerIndexedvEXT, GetFloatIndexedvEXT, 2486 and GetDoubleIndexedvEXT commands in section 6.1.X. 2487 2488Additions to the ARB_vertex_program specification 2489 2490 Add to the end of section 2.14.1 (Program Objects): 2491 2492 "This command 2493 2494 void NamedProgramStringEXT(uint program, enum target, enum format, 2495 sizei len, const void *string); 2496 2497 operates identically to ProgramStringARB except, rather than 2498 specifying the string for the currently bound program for the program 2499 target parameter, NamedProgramStringARB specifies the program string 2500 for the program object named by the initial program parameter. 2501 2502 If the program parameter is for an unused program, the name becomes 2503 used and the named program object is set to a new program state 2504 vector as if BindProgramARB had been called on the unused program 2505 name with the given target parameter but without changing the target's 2506 program binding. 2507 2508 If the program parameter is for a used name and that named program 2509 object has a different target than the specified target parameter, 2510 the INVALID_OPERATION error is generated. 2511 2512 These commands 2513 2514 void NamedProgramLocalParameter4dEXT(uint program, enum target, 2515 uint index, 2516 double x, double y, 2517 double z, double w); 2518 void NamedProgramLocalParameter4dvEXT(uint program, enum target, 2519 uint index, 2520 const double *params); 2521 void NamedProgramLocalParameter4fEXT(uint program, enum target, 2522 uint index, 2523 float x, float y, 2524 float z, float w); 2525 void NamedProgramLocalParameter4fvEXT(uint program, enum target, 2526 uint index, 2527 const float *params); 2528 2529 operate identically to the corresponding command where "Named" 2530 is deleted from the name (and extension suffixes are updated to 2531 ARB appropriately) except, rather than updating the currently bound 2532 program for the program target parameter (a parameter not present for 2533 these listed commands), these "Named" commands update the program 2534 object named by the initial program parameter. If the program 2535 parameter is zero, then the target parameter selects the default 2536 program of the specified target to update. The remaining parameters 2537 following the initial program parameter for the listed "Named" 2538 commands match the parameters for the corresponding non-"Named" 2539 command and are interpreted as they are for the non-"Named" command. 2540 If the program parameter is for an unused name, the name becomes 2541 used and the named program object is assigned target-specific 2542 default values (see section 2.14.7 for vertex programs or section 2543 3.11.8 for fragment programs), set to the same initial values prior to 2544 the command's state update. If the program parameter is for a used 2545 name and that named program object has a different target than the 2546 specified target parameter, the INVALID_OPERATION error is generated." 2547 2548 Add to the end of section 6.1.12 (Program Queries): 2549 2550 "These queries 2551 2552 void GetNamedProgramLocalParameterdvEXT(uint program, enum target, 2553 uint index, 2554 double *params); 2555 void GetNamedProgramLocalParameterfvEXT(uint program, enum target, 2556 uint index, 2557 float *params); 2558 void GetNamedProgramivEXT(uint program, enum target, 2559 enum pname, int *params); 2560 void GetNamedProgramStringEXT(uint program, enum target, 2561 enum pname, void *string); 2562 2563 operate identically to the corresponding query where "Named" is 2564 deleted from the name (and extension suffixes are updated to ARB 2565 appropriately) except, rather than querying the currently bound 2566 program for the program target parameter (a parameter not present for 2567 these listed query), these "Named" queries query the program object 2568 named by the initial program parameter. If the program parameter 2569 is zero, then the target parameter selects the default program of 2570 the specified target to query. The remaining parameters following 2571 the initial program parameter for the listed "Named" queries match 2572 the parameters for the corresponding non-"Named" query and are 2573 interpreted as they are for the non-"Named" query. If the program 2574 parameter is for an unused name, the name becomes used and the named 2575 program object is assigned target-specific default values (see section 2576 2.14.7 for vertex programs or section 3.11.8 for fragment programs), 2577 set to the same initial values prior to the query's state query. 2578 If the program parameter is for a used name and that named program 2579 object has a different target than the specified target parameter, 2580 the INVALID_OPERATION error is generated." 2581 2582Additions to the EXT_gpu_program_parameters specification 2583 2584 Add to the end of section 2.14.1 (Program Objects): 2585 2586 "This command 2587 2588 void NamedProgramLocalParameters4fvEXT(uint program, enum target, 2589 uint index, sizei count, 2590 const float *params); 2591 2592 operate identically to ProgramLocalParameters4fvEXT except, rather 2593 than updating the currently bound program for the program target 2594 parameter (a parameter not present for these listed commands), these 2595 "Named" commands update the program object named by the initial 2596 program parameter. If the program parameter is zero, then the 2597 target parameter selects the default program of the specified target 2598 to update. The remaining parameters following the initial program 2599 parameter for the listed "Named" commands match the parameters for 2600 the corresponding non-"Named" command and are interpreted as they 2601 are for the non-"Named" command. If the program parameter is for 2602 an unused name, the name becomes used and the named program object 2603 is assigned target-specific default values (see section 2.14.7 2604 for vertex programs or section 3.11.8 for fragment programs), set 2605 to the same initial values prior to the command's state update. 2606 If the program parameter is for a used name and that named program 2607 object has a different target than the specified target parameter, 2608 the INVALID_OPERATION error is generated." 2609 2610Additions to the NV_gpu_program4 specification 2611 2612 Add to the end of section 2.14.1 (Program Objects): 2613 2614 "These commands 2615 2616 void NamedProgramLocalParameterI4iEXT(uint program, enum target, 2617 uint index, 2618 int x, int y, 2619 int z, int w); 2620 void NamedProgramLocalParameterI4ivEXT(uint program, enum target, 2621 uint index, 2622 const int *params); 2623 void NamedProgramLocalParametersI4ivEXT(uint program, enum target, 2624 uint index, sizei count, 2625 const int *params); 2626 void NamedProgramLocalParameterI4uiEXT(uint program, enum target, 2627 uint index, 2628 uint x, uint y, 2629 uint z, uint w); 2630 void NamedProgramLocalParameterI4uivEXT(uint program, enum target, 2631 uint index, 2632 const uint *params); 2633 void NamedProgramLocalParametersI4uivEXT(uint program, enum target, 2634 uint index, sizei count, 2635 const uint *params); 2636 2637 operate identically to the corresponding command where "Named" 2638 is deleted from the name (and extension suffixes are updated to 2639 NV appropriately) except, rather than updating the currently bound 2640 program for the program target parameter (a parameter not present for 2641 these listed commands), these "Named" commands update the program 2642 object named by the initial program parameter. If the program 2643 parameter is zero, then the target parameter selects the default 2644 program of the specified target to update. The remaining parameters 2645 following the initial program parameter for the listed "Named" 2646 commands match the parameters for the corresponding non-"Named" 2647 command and are interpreted as they are for the non-"Named" command. 2648 If the program parameter is for an unused name, the name becomes 2649 used and the named program object is assigned target-specific 2650 default values (see section 2.14.7 for vertex programs or section 2651 3.11.8 for fragment programs), set to the same initial values prior to 2652 the command's state update. If the program parameter is for a used 2653 name and that named program object has a different target than the 2654 specified target parameter, the INVALID_OPERATION error is generated." 2655 2656 Add to the end of section 6.1.12 (Program Queries): 2657 2658 "These queries 2659 2660 void GetNamedProgramLocalParameterIivEXT(uint program, enum target, uint index, 2661 int *params); 2662 void GetNamedProgramLocalParameterIuivEXT(uint program, enum target, uint index, 2663 uint *params); 2664 2665 operate identically to the corresponding query where "Named" is 2666 deleted from the name (and extension suffixes are updated to NV 2667 appropriately) except, rather than querying the currently bound 2668 program for the program target parameter (a parameter not present for 2669 these listed query), these "Named" queries query the program object 2670 named by the initial program parameter. If the program parameter 2671 is zero, then the target parameter selects the default program of 2672 the specified target to query. The remaining parameters following 2673 the initial program parameter for the listed "Named" queries match 2674 the parameters for the corresponding non-"Named" query and are 2675 interpreted as they are for the non-"Named" query. If the program 2676 parameter is for an unused name, the name becomes used and the named 2677 program object is assigned target-specific default values (see section 2678 2.14.7 for vertex programs or section 3.11.8 for fragment programs), 2679 set to the same initial values prior to the query's state query. 2680 If the program parameter is for a used name and that named program 2681 object has a different target than the specified target parameter, 2682 the INVALID_OPERATION error is generated." 2683 2684Interactions with OpenGL 3.0 or the EXT_texture_integer specification 2685 2686 If NEITHER OpenGL 3.0 nor EXT_texture_integer are supported, ignore 2687 the support for TextureParameterIivARB, TextureParameterIuivARB, 2688 GetTextureParameterIivARB, GetTextureParameterIuivARB, 2689 MultiTexParameterIivARB, MultiTexParameterIuivARB, 2690 GetMultiTexParameterIivARB, and GetMultiTexParameterIuivARB. 2691 2692Interactions with the EXT_texture_buffer_object specification 2693 2694 If EXT_texture_buffer_object is NOT supported, ignore the support 2695 for TextureBufferARB and MultiTexBufferARB. 2696 2697Interactions with OpenGL 3.0 or the APPLE_vertex_array_object 2698 2699 If NEITHER OpenGL 3.0 nor EXT_texture_integer are supported, ignore XXX 2700 2701 If either OpenGL 3.0 or APPLE_vertex_array_object is supported, then 2702 ClientAttribDefaultARB also sets the VERTEX_ARRAY_BINDING vertex-array 2703 state to zero if the mask parameter has CLIENT_VERTEX_ARRAY_BIT set. 2704 2705 This means PushClientAttribDefaultARB also sets the 2706 VERTEX_ARRAY_BINDING_APPLE vertex-array state to zero after pushing 2707 the client state. if the mask parameter has CLIENT_VERTEX_ARRAY_BIT 2708 set. 2709 2710Interactions with EXT_geometry_shader4 or NV_gpu_program4 2711 2712 If both EXT_geometry_shader4 and NV_gpu_program4 are NOT 2713 supported, ignore the support for NamedFramebufferTextureARB, 2714 NamedFramebufferTextureLayerARB, and NamedFramebufferTextureFaceARB. 2715 2716Interactions with OpenGL 3.0 or EXT_framebuffer_blit 2717 2718 If NEITHER OpenGL 3.0 nor EXT_framebuffer_blit are supported, 2719 ignore the references to DRAW_FRAMEBUFFER and READ_FRAMEBUFFER in 2720 the discussion of CheckNamedFramebufferStatusARB and do not allow 2721 these tokens for the command's target parameter. 2722 2723Interactions with OpenGL 3.0 or EXT_framebuffer_multisample 2724 2725 If NEITHER OpenGL 3.0 or EXT_framebuffer_multisample are supported, 2726 ignore the support for NamedRenderbufferStorageMultisampleARB. 2727 2728Interactions with NV_framebuffer_multisample_coverage 2729 2730 If NV_framebuffer_multisample_coverage is NOT supported, ignore the 2731 support for NamedRenderbufferStorageMultisampleCoverageARB. 2732 2733Interactions with the NV_explicit_multisample specification 2734 2735 If NV_explicit_multisample is NOT supported, ignore the 2736 support for TextureRenderbufferARB, MultiTexRenderbufferARB, 2737 TEXTURE_BINDING_RENDERBUFFER_NV, 2738 and TEXTURE_RENDERBUFFER_DATA_STORE_BINDING_NV. 2739 2740Interactions with the NV_texture_cube_map_array specification 2741 2742 If NV_texture_cube_map_array is NOT supported, ignore the support 2743 for TEXTURE_BINDING_CUBE_MAP_ARRAY_NV. 2744 2745Interactions with OpenGL 3.0 2746 2747 If OpenGL 3.0 is NOT supported, ignore the support for 2748 EnableClientStateiEXT, DisableClientStateiEXT, GetFloati_vEXT, 2749 GetDoublei_vEXT, GetPointeri_vEXT, VertexArrayVertexOffsetEXT, 2750 VertexArrayColorOffsetEXT, VertexArrayEdgeFlagOffsetEXT, 2751 VertexArrayIndexOffsetEXT, VertexArrayNormalOffsetEXT, 2752 VertexArrayTexCoordOffsetEXT, VertexArrayMultiTexCoordOffsetEXT, 2753 VertexArrayFogCoordOffsetEXT, VertexArraySecondaryColorOffsetEXT, 2754 VertexArrayVertexAttribOffsetEXT, 2755 VertexArrayVertexAttribIOffsetEXT, EnableVertexArrayEXT, 2756 DisableVertexArrayEXT, EnableVertexArrayAttribEXT, 2757 DisableVertexArrayAttribEXT, GetVertexArrayIntegervEXT, 2758 GetVertexArrayPointervEXT, GetVertexArrayVertexAttribParameterivEXT, 2759 GetVertexArrayVertexAttribPointervEXT, MapNamedBufferRangeEXT, 2760 and FlushMappedNamedBufferRangeEXT. 2761 2762 If OpenGL 3.0 is NOT supported, ignore references to Enablei, 2763 Disablei, IsEnabledi, GetBooleani_v, and GetIntegeri_v. 2764 2765Additions to the AGL/GLX/WGL Specifications 2766 2767 None. 2768 2769GLX Protocol 2770 2771 XXX incomplete! ZZZZ values need to be registered! 2772 XXX ARB_vertex_program support is specified. 2773 2774 The following rendering commands are sent to the server as part of a 2775 glXRender request: 2776 2777 NamedProgramLocalParameter4fvEXT 2778 2 36 rendering command length 2779 2 ZZZZ rendering command opcode 2780 4 ENUM program 2781 4 ENUM target 2782 4 CARD32 index 2783 4 FLOAT32 params[0] 2784 4 FLOAT32 params[1] 2785 4 FLOAT32 params[2] 2786 4 FLOAT32 params[3] 2787 2788 NamedProgramLocalParameter4dvEXT 2789 2 48 rendering command length 2790 2 ZZZZ rendering command opcode 2791 4 ENUM program 2792 4 ENUM target 2793 4 CARD32 index 2794 8 FLOAT64 params[0] 2795 8 FLOAT64 params[1] 2796 8 FLOAT64 params[2] 2797 8 FLOAT64 params[3] 2798 2799 The NamedProgramStringEXT is potentially large, and hence can be 2800 sent in a glXRender or glXRenderLarge request. 2801 2802 NamedProgramStringEXT 2803 2 20+len+p rendering command length 2804 2 ZZZZ rendering command opcode 2805 4 ENUM program 2806 4 ENUM target 2807 4 ENUM format 2808 4 sizei len 2809 len LISTofBYTE program 2810 p unused, p=pad(len) 2811 2812 If the command is encoded in a glxRenderLarge request, the command 2813 opcode and command length fields above are expanded to 4 bytes each: 2814 2815 4 20+len+p rendering command length 2816 4 ZZZZ rendering command opcode 2817 2818 The remaining commands are non-rendering commands. These commands are 2819 sent separately (i.e., not as part of a glXRender or glXRenderLarge 2820 request), using the glXVendorPrivateWithReply request: 2821 2822 GetNamedProgramLocalParameterfvEXT 2823 1 CARD8 opcode (X assigned) 2824 1 17 GLX opcode (glXVendorPrivateWithReply) 2825 2 6 request length 2826 4 ZZZZ vendor specific opcode 2827 4 GLX_CONTEXT_TAG context tag 2828 4 ENUM program 2829 4 ENUM target 2830 4 CARD32 index 2831 => 2832 1 1 reply 2833 1 unused 2834 2 CARD16 sequence number 2835 4 m reply length, m=(n==1?0:n) 2836 4 unused 2837 4 CARD32 n (number of parameter components) 2838 2839 if (n=1) this follows: 2840 2841 4 FLOAT32 params 2842 12 unused 2843 2844 otherwise this follows: 2845 2846 16 unused 2847 n*4 LISTofFLOAT32 params 2848 2849 GetNamedProgramLocalParameterdvEXT 2850 1 CARD8 opcode (X assigned) 2851 1 17 GLX opcode (glXVendorPrivateWithReply) 2852 2 6 request length 2853 4 ZZZZ vendor specific opcode 2854 4 GLX_CONTEXT_TAG context tag 2855 4 ENUM program 2856 4 CARD32 index 2857 4 ENUM target 2858 => 2859 1 1 reply 2860 1 unused 2861 2 CARD16 sequence number 2862 4 m reply length, m=(n==1?0:n*2) 2863 4 unused 2864 4 CARD32 n (number of parameter components) 2865 2866 if (n=1) this follows: 2867 2868 8 FLOAT64 params 2869 8 unused 2870 2871 otherwise this follows: 2872 2873 16 unused 2874 n*8 LISTofFLOAT64 params 2875 2876 GetNamedProgramivEXT 2877 1 CARD8 opcode (X assigned) 2878 1 17 GLX opcode (glXVendorPrivateWithReply) 2879 2 6 request length 2880 4 ZZZZ vendor specific opcode 2881 4 GLX_CONTEXT_TAG context tag 2882 4 ENUM program 2883 4 ENUM target 2884 4 ENUM pname 2885 => 2886 1 1 reply 2887 1 unused 2888 2 CARD16 sequence number 2889 4 m reply length, m=(n==1?0:n) 2890 4 unused 2891 4 CARD32 n 2892 2893 if (n=1) this follows: 2894 2895 4 INT32 params 2896 12 unused 2897 2898 otherwise this follows: 2899 2900 16 unused 2901 n*4 LISTofINT32 params 2902 2903 GetNamedProgramStringEXT 2904 1 CARD8 opcode (X assigned) 2905 1 17 GLX opcode (glXVendorPrivateWithReply) 2906 2 6 request length 2907 4 ZZZZ vendor specific opcode 2908 4 GLX_CONTEXT_TAG context tag 2909 4 ENUM program 2910 4 ENUM target 2911 4 ENUM pname 2912 => 2913 1 1 reply 2914 1 unused 2915 2 CARD16 sequence number 2916 4 (n+p)/4 reply length 2917 4 unused 2918 4 CARD32 n 2919 16 unused 2920 n STRING program 2921 p unused, p=pad(n) 2922 2923Errors 2924 2925 All the commands in this extension excepting ClientAttribDefaultEXT 2926 are expressed in terms of existing GL commands and the error that 2927 apply to those commands apply to the new commands. If an error 2928 occurs for any of the commands introduced by this extension, any 2929 selector used by the command is left undisturbed. 2930 2931 Several errors are truly "new" with this extension: 2932 2933 INVALID_OPERATION is generated by CopyTextureImage1DEXT, 2934 CopyTextureImage2DEXT, CopyTextureSubImage1DEXT, 2935 CopyTextureSubImage2DEXT, CopyTextureSubImage3DEXT, 2936 GetCompressedTextureImageEXT, GetTextureImageEXT, 2937 GetTextureLevelParameterfvEXT, GetTextureLevelParameterivEXT, 2938 GetTextureParameterfvEXT, GetTextureParameterIivEXT, 2939 GetTextureParameterIuivEXT, GetTextureParameterivEXT, 2940 TextureBufferEXT, TextureImage1DEXT, TextureImage2DEXT, 2941 TextureImage3DEXT, TextureParameterfEXT, TextureParameterfvEXT, 2942 TextureParameteriEXT, TextureParameterIivEXT, TextureParameterIuivEXT, 2943 TextureParameterivEXT, TextureSubImage1DEXT, TextureSubImage2DEXT, 2944 TextureSubImage3DEXT, and GenerateMultiTexMipmapEXT if the target 2945 parameter does not match the target type of the texture object named 2946 by the texture parameter. 2947 2948 INVALID_OPERATION is generated by GetNamedBufferParameterivEXT, 2949 GetNamedBufferPointervEXT, GetNamedBufferSubDataEXT, 2950 MapNamedBufferEXT, NamedBufferDataEXT, NamedBufferSubDataEXT, and 2951 UnmapNamedBufferEXT if the buffer parameter is zero. 2952 2953 INVALID_OPERATION is generated by ProgramUniform1fEXT, 2954 ProgramUniform2fEXT, ProgramUniform3fEXT, ProgramUniform4fEXT, 2955 ProgramUniform1iEXT, ProgramUniform2iEXT, ProgramUniform3iEXT, 2956 ProgramUniform4iEXT, ProgramUniform1fvEXT, ProgramUniform2fvEXT, 2957 ProgramUniform3fvEXT, ProgramUniform4fvEXT, ProgramUniform1ivEXT, 2958 ProgramUniform2ivEXT, ProgramUniform3ivEXT, ProgramUniform4ivEX, 2959 ProgramUniformMatrix2fvEXT, ProgramUniformMatrix3fvEXT, 2960 ProgramUniformMatrix4fvEXT, ProgramUniformMatrix2x3fv, 2961 ProgramUniformMatrix3x2fv, ProgramUniformMatrix2x4fv, 2962 ProgramUniformMatrix4x2fv, ProgramUniformMatrix3x4fv, 2963 ProgramUniformMatrix4x3fv, ProgramUniform1uiEXT, ProgramUniform2uiEXT, 2964 ProgramUniform3uiEXT, ProgramUniform4uiEXT, ProgramUniform1uivEXT, 2965 ProgramUniform2uivEXT, ProgramUniform3uivEXT, and 2966 ProgramUniform4uivEXT if the program named by the program parameter 2967 has not been successfully linked. 2968 2969 INVALID_VALUE is generated by NamedProgramLocalParameter4dEXT, 2970 NamedProgramLocalParameter4dvEXT, NamedProgramLocalParameter4fEXT, 2971 NamedProgramLocalParameter4fvEXT, GetNamedProgramLocalParameterdvEXT, 2972 GetNamedProgramLocalParameterfvEXT, GetNamedProgramivEXT, and 2973 GetNamedProgramStringEXT if the program named by the program parameter 2974 does not exist. 2975 2976 INVALID_OPERATION is generated by MultiTexCoordPointerEXT, 2977 VertexArrayMultiTexCoordOffsetEXT, MultiTexEnvfEXT, MultiTexEnvfvEXT, 2978 MultiTexEnviEXT, MultiTexEnvivEXT, MultiTexGendEXT, MultiTexGendvEXT, 2979 MultiTexGenfEXT, MultiTexGenfvEXT, MultiTexGeniEXT, MultiTexGenivEXT, 2980 MultiTexParameteriEXT, MultiTexParameterivEXT, MultiTexParameterfEXT, 2981 MultiTexParameterfvEXT, MultiTexParameterIivEXT, 2982 MultiTexParameterIuivEXT, MultiTexImage1DEXT, MultiTexImage2DEXT, 2983 MultiTexSubImage1DEXT, MultiTexSubImage2DEXT, CopyMultiTexImage1DEXT, 2984 CopyMultiTexImage2DEXT, CopyMultiTexSubImage1DEXT, 2985 CopyMultiTexSubImage2DEXT, MultiTexImage3DEXT, MultiTexSubImage3DEXT, 2986 CopyMultiTexSubImage3DEXT, MultiTexBufferEXT, GetMultiTexEnvfvEXT, 2987 GetMultiTexEnvivEXT, GetMultiTexGendvEXT, GetMultiTexGenfvEXT, 2988 GetMultiTexGenivEXT, GetMultiTexImageEXT, GetMultiTexParameterfvEXT, 2989 GetMultiTexParameterivEXT, GetMultiTexParameterIivEXT, 2990 GetMultiTexParameterIuivEXT, GetMultiTexLevelParameterivEXT, 2991 GetMultiTexLevelParameterfvEXT, and GetCompressedMultiTexImageEXT if 2992 the texunit parameter names a texture unit that is greater or equal in 2993 number to the implementations limit for maximum texture image units. 2994 2995 INVALID_OPERATION is generated by FramebufferDrawBuffersEXT if a 2996 color buffer not currently allocated to the GL context is specified. 2997 2998 INVALID_OPERATION is generated by FramebufferDrawBuffersEXT if <n> 2999 is greater than the state MAX_DRAW_BUFFERS. 3000 3001 INVALID_OPERATION is generated by FramebufferDrawBuffersEXT if value 3002 in <bufs> does not correspond to one of the allowed buffers. 3003 3004 INVALID_OPERATION is generated by FramebufferDrawBuffersEXT if a 3005 draw buffer other then NONE is specified more then once in <bufs>. 3006 3007New State 3008 3009 None. 3010 3011New Implementation Dependent State 3012 3013 None. 3014 3015NVIDIA Implementation Details 3016 3017 NVIDIA drivers prior to 330.00 (August 2013) have a bug where 3018 glMultiTexGeniEXT acts identically to glTexGeni (so glMultiTexGeniEXT 3019 ignores its texture unit parameter). 3020 3021 As a workaround, use glMultiTexGenivEXT. So problematic code written 3022 as: 3023 3024 glMultiTexGeniEXT(texUnit, coord, pname, value); 3025 3026 can be rewritten as: 3027 3028 GLenum pvalue = value; 3029 glMultiTexGenivEXT(texUnit, coord, pname, &pvalue); 3030 3031 NVIDIA drivers prior to 330.00 (August 2013) do not support 3032 the glEnableVertexArrayEXT and glDisableVertexArrayEXT with the 3033 GL_TEXTUREi tokens and instead generate a GL_INVALID_ENUM error. 3034 See issue 32. The only workaround is to change the texture 3035 unit selector (glActiveTexture) and bind the vertex array 3036 object (glBindVertexArray) and call glEnable or glDisable with 3037 GL_TEXTURE_COORD_ARRAY. Alternatively use generic vertex attribute 3038 arrays instead of texture coordinate arrays. 3039 3040Issues 3041 3042 (0) What is changed from version 1.0 to version 1.1 of this extension 3043 to support OpenGL 3.0? 3044 3045 RESOLVED: Changes are primarily cosmetic except the addition 3046 of API for selector-free access to vertex array objects since 3047 that functionality is part of OpenGL 3.0: 3048 3049 1) Update all references to section numbering to OpenGL 3.0 3050 section numbers. 3051 3052 2) Where EXT extensions have become part of OpenGL 3.0, refer 3053 to the functionality as part of OpenGL 3.0 rather than by 3054 extension name. 3055 3056 3) New selector-free API for vertex buffer objects since these 3057 were introduced by OpenGL 3.0. The EXT version specified 3058 a necessary glClientAttribDefaultEXT interaction with 3059 APPLE_vertex_buffer_object but didn't provide an selector-free 3060 API for vertex buffer objects. 3061 3062 4) Add new selector-free API for fine control over mapping 3063 buffer subranges into client space (glMapNamedBufferRangeEXT) 3064 and flushing modified data (glFlushMappedNamedBufferRangeEXT). 3065 3066 5) Add OpenGL 3.0-style aliases for the version 1.0 commands 3067 and queries that have "Indexed" in the name. OpenGL 3.0 has a 3068 convention where an "i" indexed indexed commands and queries. 3069 For example, glGetFloati_v and glGetFloatIndexedvEXT are 3070 identical queries. Likewise glEnableClientStateIndexedEXT and 3071 glEnableClientStateiEXT are identical commands. 3072 3073 (1) What should this extension be called? 3074 3075 RESOLVED: EXT_direct_state_access 3076 3077 "direct" means state updates and queries are not indirected 3078 through a selector such as the matrix mode, active texture 3079 unit, active client texture unit, current texture binding, 3080 current vertex/fragment/geometry program, current GLSL program, 3081 or current buffer binding. 3082 3083 "state" so there's not confusion about what this extension 3084 provides direct access to (not direct access to the hardware or 3085 the framebuffer, etc.). 3086 3087 "access" is because this extension applies to both queries (reads) 3088 and updates (writes) of OpenGL state. Access is general enough 3089 to encompass both queries and updates. 3090 3091 (2) Should we have a "direct_state_access" extension for each type 3092 of OpenGL state involved (matrix, program, GLSL, texture unit, 3093 texture object) or have one uber-extension? For example, 3094 EXT_direct_matrix_access, EXT_direct_texture_access, etc. 3095 3096 RESOLVED: One uber-extension. 3097 3098 This extension introduces no additional hardware functionality 3099 but rather provides commands to perform state updates and queries 3100 without having to change (and possibly query and restore) API 3101 selectors. 3102 3103 The dependencies sections make it clear that if some functionality 3104 (say, GLSL) is not supported, implementations supporting this 3105 extension ignore the direct access API for the particular missing 3106 functionality. 3107 3108 This simplifies the burden on applications to use the new direct 3109 access API. When this extension is supported, the application can 3110 assume all functionality supported by their respective extensions 3111 is available through the direct access commands introduced by 3112 this extension. 3113 3114 (3) Explain the methodology for naming selector-free commands. 3115 3116 The naming conventions seek to maximize consistency but 3117 differences between the various selectors and command subsets 3118 dictate differences in approach. 3119 3120 The chosen naming conventions has two guiding principles: 1) 3121 making the selector-free commands similar to the existing 3122 selector-based commands in naming but also clearly and 3123 consistently distinguished (at least within each group of 3124 commands) from the existing selector-based commands to which 3125 selector-free commands correspond by a simple pattern, and 2) 3126 being conscious of the length in characters of the resulting 3127 command names. 3128 3129 Selector-less matrix commands all start glMatrix* (rather than gl* 3130 or gl*Matrix[fd] for the corresponding selector-based commands). 3131 3132 Rationale: The selector-based matrix commands have the 3133 classic verb-noun format (example: glLoadMatrixf) described 3134 in Kurt Akeley's "Syntax Rules for OpenGL Extensions" document 3135 (henceforth abbreviated SRfOE) while the selector-free versions 3136 have a noun-verb format. This variance from SRfOE conventions 3137 is deemed warranted for the sake of consistent naming of all the 3138 selector-free matrix commands. 3139 3140 The alternative of using "NamedMatrix" as a suffix to the 3141 matrix commands was considered (example: glLoadNamedMatrixf 3142 rather than glLoadMatrixf) but most matrix commands do not 3143 contain the word Matrix so this leads to awkward constructions 3144 such as glFrustumNamedMatrix and glLoadIdentityNamedMatrix. 3145 glMatrixFrustum and glMatrixLoadIdentity were preferred despite 3146 the variance this creates with SRfOE. Also considered was 3147 adding "Named" or "NamedMatrix" as a prefix to the matrix 3148 commands (example: glNamedLoadMatrixf, glNamedFrustum, 3149 glNamedLoadIdentity; or glNamedMatrixLoadMatrixf, 3150 glNamedMatrixFrustum, glNamedMatrixLoadIdentity). But the 3151 "Named" prefix is awkward because it is not the frustum, 3152 etc. that is named but rather a matrix. The "NamedMatrix" prefix 3153 becomes awkward because of the length of the resulting commands 3154 while having a noun-verb format. The "Matrix" prefixed format 3155 (where "Matrix" appears in the command name only once) provides 3156 consistency of naming and minimizes command name length but 3157 at the consistency cost of varying with the SRfOE's verb-noun 3158 convention. 3159 3160 Selector-less texture object commands all start glTexture* 3161 or glGetTexture* (rather than glTex* and glGetTex* for the 3162 corresponding selector-based commands). 3163 3164 Rationale: SRfOE states "Tex" is an abbreviation for "Texture" 3165 in command names. However in the context of texture objects, the 3166 abbreviated "Texture" is used instead (example: glIsTexture, 3167 not glIsTex). The abbreviation "Tex" is used when texture is 3168 used as an adjective to describe state being specified (examples: 3169 glTexParameter* and glTexImage*). The unabbreviated "Texture" 3170 is used as a noun in command names. 3171 3172 The selector-free texture object commands use the unabbreviated 3173 "Texture" as an adjective since a texture object is accessed 3174 directly where the "Tex" commands refer to texture state accessed 3175 indirectly based on the currently bound texture object. 3176 3177 Selector-less multitexture texture unit commands and queries 3178 all replace "Tex" with "MultiTex" and a new initial texunit 3179 identifies the texture unit by token (mimicking how TexCoord2f 3180 is MultiTexCoord2f for multitexture immediate mode). 3181 3182 Selector-less generic enables (glEnable, glDisable) 3183 for texture unit enables make use of the convention for 3184 indexed queries introduced by EXT_draw_buffers2 and also 3185 used by EXT_transform_feedback so use glEnableIndexedEXT and 3186 glDisableIndexedEXT. 3187 3188 Selector-less generic queries (glGetIntegerv, glGetFloatv, 3189 glGetPointerv, etc) for texture unit state make use 3190 of the convention for indexed queries introduced by 3191 EXT_draw_buffers2 and also used by EXT_transform_feedback so use 3192 glGetIntegerIndexedvEXT, glGetFloatIndexedvEXT, 3193 glGetDoubleIndexedvEXT, glGetBooleanIndexedvEXT, and 3194 glIsEnabledIndexedEXT. 3195 3196 OpenGL 3.0 introduced a new naming convention for indexed 3197 state enables and queries so glGetIntegeri_v, glGetFloati_vEXT, 3198 glGetDoublei_vEXT, and glGetBooleani_v, glIsEnabledi operate 3199 identically respectively to the prior indexed query list. 3200 3201 Selector-less buffer object commands all start with glNamedBuffer 3202 or glGetNamedBuffer. 3203 3204 Selector-less program parameter commands (for 3205 ARB_vertex_program-based extensions) all start glNamedProgram 3206 or glGetNamedProgram. 3207 3208 Selector-less uniform commands for GLSL all start glProgramUniform. 3209 3210 Selector-less framebuffer object commands all start 3211 with glNamedFramebufer, glGetNamedFramebuffer, or 3212 glCheckNamedFramebuffer. The selector-less framebuffer 3213 control commands are glFramebufferDrawBufferEXT, 3214 glFramebufferDrawBuffersEXT, and glFramebufferReadBufferEXT. 3215 3216 Selector-less renderbuffer object commands all start 3217 with glNamedRenderbuffer or glGetNamedRenderbuffer. 3218 3219 (4) Should the selector-free glTexture* and glNamedProgram* commands 3220 and glGetTexture* and glGetNamedProgram* queries have target 3221 parameters (for passing GL_TEXTURE_2D or GL_VERTEX_PROGRAM_ARB, 3222 etc.)? 3223 3224 RESOLVED: Yes. 3225 3226 It would be desirable to update a texture parameter for a given 3227 texture object without having to know the target of the texture 3228 object. For example, one could change the GL_TEXTURE_MIN_FILTER 3229 of a texture object without knowing if the texture object was 3230 a 1D, 2D, 3D, or cube map texture. 3231 3232 As desirable as that might be, OpenGL's texture target scheme 3233 makes that difficult in general for several reasons. 3234 3235 First, a side-effect of glBindTexture is that a texture object of 3236 the indicated target is created if the specified texture object 3237 name does not map to an existent texture object. In this case, 3238 a texture object of the specified target is created and its state 3239 is initialized to the initial texture object state based on the 3240 specified target. The selector-free texture object commands 3241 should operate the same way if a non-existent texture object 3242 is specified. 3243 3244 Second, cube maps have face-specific targets 3245 (GL_TEXTURE_CUBE_MAP_POSITIVE_X, etc.) as well as the 3246 face-independent target (GL_TEXTURE_CUBE_MAP). Commands for 3247 texture image specification (glTexImage2D, etc.) and query 3248 (glGetTexImage) require the target parameter to select the 3249 appropriate face. 3250 3251 Assembly program commands have a similar need for a target 3252 parameter. Calling glBindProgramARB is specified to create an 3253 empty program of the specified target type of the bind. 3254 3255 Semantically, glTexture* commands (and glGetTexture* queries) are 3256 semantically equivalent of performing a glBindTexture followed 3257 atomically by the equivalent glTex* command (or equivalent 3258 glGetTex* query). 3259 3260 Likewise semantically, glNamedProgram* commands (and 3261 glGetNamedProgram* queries) are semantically equivalent of 3262 performing a glBindProgramARB followed atomically by the 3263 equivalent glProgram* command (or equivalent glGetProgram* query). 3264 3265 Note that buffer commands do not have this same need for a target 3266 parameter in their selector-less form. 3267 3268 (5) The OpenGL API has "latched" state. Explain latched state 3269 and how this extension addresses latched state. 3270 3271 RESOLVED: Examples of latched state in the OpenGL API are the 3272 current array and array element buffers and the pixel store 3273 pack/unpack state. Latched stated is all client-side state 3274 (pixel store or vertex array). 3275 3276 The state of the current array buffer acts as an extra parameter 3277 to all the gl*Pointer calls to configure vertex arrays. The state 3278 of the current element array buffer acts as an extra parameter to 3279 the glDrawElements family of commands. The pixel store unpack 3280 state acts as a collection of extra parameters to glTexImage*, 3281 glTexSubImage*, glDrawPixels, glBitmap, glColorTable, 3282 glPolygonStipple, glConvolutionFilter*, etc. The pixel store pack 3283 state acts as a collection of extra parameters to glReadPixels, 3284 glGetTexImage, glGetColorTable, etc. 3285 3286 Whereas a selector is an extra parameter that designates what 3287 state variable is to be updated or queried, latched state is 3288 actual state values the command uses to update other state 3289 variables or control the operation of the command. 3290 3291 Latched state is similar in its undesirability for layered 3292 libraries because it requires OpenGL state variables to be 3293 modified to update particular state variables or control the 3294 operation of the command. 3295 3296 Fixing the latched state problem with additional API is involved 3297 because it would require introducing a new command for every 3298 existing OpenGL command accepting a pointer to specify vertex 3299 arrays or pixel data or transform feedback buffer with a "uint 3300 buffer, intptr offset" set of parameters rather than a pointer. 3301 3302 This extension addresses latched state by adding a new command 3303 glClientAttribDefaultEXT that uses its mask parameter to set all 3304 the client vertex array or pixel store state to its default state. 3305 3306 The glPushClientAttribDefaultEXT performs the 3307 glClientAttribDefaultEXT in combination with a glPushClientAttrib 3308 command. This provides an inexpensive way to save-and-restore the 3309 latched client state so layered libraries that want well-defined 3310 latched client state can use these commands. 3311 3312 Because the state affected by glPushClientAttribDefaultEXT 3313 and glClientAttribDefaultEXT is all client-side, this state 3314 is inexpensive to update (unlike the glPushAttrib/glPopAttrib 3315 commands). 3316 3317 Some consideration was given to providing extra mask bits to 3318 control just the vertex array enables (to disable them all) or 3319 pixel store pack and unpack state independently (just the pack 3320 or just the unpack state). The entire set of vertex array and 3321 pixel store state is compact enough that it doesn't make sense 3322 to add extra mask bits for subsets of the state. 3323 3324 (6) How is the expense of a per-command specified texture object, 3325 assembly program object, buffer object, or GLSL program object 3326 name lookup minimized? 3327 3328 RESOLVED: Modern OpenGL driver implementations implementing 3329 this extension are expected to cache most recently used object 3330 names so accessing the last name repeatedly is fast. 3331 3332 The details of this is left up to the OpenGL implementation but 3333 developers can expect consecutive direct access commands to the 3334 same named object will be efficient. 3335 3336 (7) What should the selector-free glBindTexture routine be called? 3337 3338 RESOLVED: glBindMultiTextureEXT 3339 3340 This name shares the same "Multi" subword with the other routines 3341 (glMultiTexGen*, glMultiTexEnv*, glMultiTexParameter*, etc.). 3342 3343 The name uses "MultiTexture" instead of simply "MultiTex" because 3344 the glBindMultiTextureEXT command takes a texture object parameter 3345 (hence "Texture" instead of "Tex" used for texture unit-based 3346 commands) as well as a texture unit parameter. 3347 3348 (8) Should glGetIntegeri_v, glGetIntegerIndexedvEXT, glIsEnabledi, 3349 glIsEnabledIndexedEXT, etc. work of all query tokens or just 3350 query tokens for indexed state such as query tokens where the 3351 active texture or client active texture apply? 3352 3353 RESOLVED: Just for query tokens for indexed state. 3354 3355 This is consistent with how EXT_draw_buffers2 and 3356 EXT_transform_feedback work for their Indexed commands. 3357 3358 How the index parameter is interpreted depends on the queried state. 3359 For texture related state the index refers to the active texture unit 3360 or active client texture unit appropriately. 3361 3362 Said index texture tokens are: 3363 3364 GL_CURRENT_MATRIX_NV 3365 GL_CURRENT_MATRIX_STACK_DEPTH_NV 3366 GL_CURRENT_RASTER_TEXTURE_COORDS 3367 GL_CURRENT_TEXTURE_COORDS 3368 GL_TEXTURE_BINDING_1D 3369 GL_TEXTURE_BINDING_1D_ARRAY 3370 GL_TEXTURE_BINDING_2D 3371 GL_TEXTURE_BINDING_2D_ARRAY 3372 GL_TEXTURE_BINDING_3D 3373 GL_TEXTURE_BINDING_BUFFER_EXT 3374 GL_TEXTURE_BINDING_CUBE_MAP 3375 GL_TEXTURE_BINDING_CUBE_MAP_ARRAY_NV 3376 GL_TEXTURE_BINDING_RECTANGLE_ARB 3377 GL_TEXTURE_BUFFER_DATA_STORE_BINDING_EXT 3378 GL_TEXTURE_BUFFER_FORMAT_EXT 3379 GL_TEXTURE_COORD_ARRAY 3380 GL_TEXTURE_COORD_ARRAY_BUFFER_BINDING 3381 GL_TEXTURE_COORD_ARRAY_COUNT 3382 GL_TEXTURE_COORD_ARRAY_POINTER 3383 GL_TEXTURE_COORD_ARRAY_SIZE 3384 GL_TEXTURE_COORD_ARRAY_STRIDE 3385 GL_TEXTURE_COORD_ARRAY_TYPE 3386 GL_TEXTURE_GEN_Q 3387 GL_TEXTURE_GEN_R 3388 GL_TEXTURE_GEN_S 3389 GL_TEXTURE_GEN_T 3390 GL_TEXTURE_MATRIX 3391 GL_TEXTURE_STACK_DEPTH 3392 GL_TRANSPOSE_TEXTURE_MATRIX 3393 GL_TEXTURE_1D 3394 GL_TEXTURE_2D 3395 GL_TEXTURE_3D 3396 GL_TEXTURE_CUBE_MAP 3397 GL_TEXTURE_RECTANGLE_ARB 3398 3399 For EXT_draw_buffers2 or EXT_transform_feedback queries, the 3400 index refers to the draw buffer or transform feedback buffer 3401 appropriately. 3402 3403 (9) Why does the equivalent code for glGetIntegeri_v, 3404 glGetIntegerIndexedvEXT, glIsEnabledi, glIsEnabledIndexedEXT, 3405 etc. save and restore the active texture and client active 3406 texture state appropriately? 3407 3408 RESOLVED: Most query tokens use the active texture but some 3409 (those starting with GL_TEXTURE_COORD_ARRAY involving vertex 3410 arrays) use the client active texture. 3411 3412 For historical reasons, glEnable/glDisable can be used to 3413 enable/disable client state that would be better enabled/disabled 3414 with glEnableClientState/glDisableClientState. 3415 3416 The appropriate selector (active texture or client active texture) 3417 is saved or restored based on the query target. 3418 3419 (10) Can these selector-free state update commands be compiled into 3420 display lists? 3421 3422 RESOLVED: YES 3423 3424 The object name, texture unit, or matrix mode parameter is 3425 compiled into the display list by-value like any other value 3426 parameter. 3427 3428 This capability to compile selector-free commands into display 3429 lists is one of the significant benefits of this extension. 3430 Prior to this extension, the only reliable way to update 3431 state for a particular texture unit, matrix, buffer, or 3432 texture without disturbing OpenGL selector state was using 3433 glPushAttrib/glPopAttrib which is too expensive to be practical. 3434 3435 However the glGet* selector-free commands, being queries, cannot 3436 be compiled into display lists. 3437 3438 (11) Why are there no glGetProgramUniform* query commands for GLSL? 3439 3440 RESOLVED: OpenGL 2.0 already has glGetUniform* query commands 3441 that accept a program parameter as a parameter so are already 3442 selector-free. 3443 3444 (12) Is glMatrixLoadfEXT(GL_TEXTURE, matrixData), etc. legal? 3445 3446 RESOLVED: YES. 3447 3448 This will update the texture matrix based on the current active 3449 texture. This avoids the matrix mode selector but still relies 3450 on the active texture selector. 3451 3452 Use GL_TEXTUREn where n is the texture unit to reference a 3453 specific texture unit's texture matrix without changing either 3454 the matrix mode or active texture state. 3455 3456 (13) Some glTex* and glGetTex* routines accept proxy targets. How do 3457 proxy textures work with the selector-free commands? 3458 3459 RESOLVED: Proxy targets work with the glTex* (glTexImage*) 3460 and glGetTex* (glGetTexLevelParameter*) commands that support 3461 proxy textures BUT the texture name must be 0 to avoid a 3462 GL_INVALID_OPERATION error. 3463 3464 This is a consequence of the requirement that the target parameter 3465 must match the target of the named texture object. 3466 3467 Only the texture object name zero (which exists for all the 3468 supported texture targets, including proxies) exists as a 3469 proxy target. 3470 3471 This should work: 3472 3473 GLuint texobj = 0; 3474 GLint width; 3475 glTexureImage2D(texobj, GL_PROXY_TEXTURE_2D, 3476 0, GL_RGB, 32, 32, 0, GL_RGB, 3477 GL_UNSIGNED_BYTE, image); 3478 glGetTextureLevelParameterivEXT(texobj, GL_PROXY_TEXTURE_2D, 3479 GL_TEXTURE_WIDTH, &width) 3480 if (width > 0) { 3481 // 32x32 RGB texture supported by implementation 3482 } else { 3483 // 32x32 RGB texture NOT supported by implementation 3484 } 3485 3486 This same code would generate a GL_INVALID_OPERATION error if 3487 texobj was a non-zero value. 3488 3489 (14) What does glClientAttribDefaultEXT(GL_CLIENT_PIXEL_STORE_BIT) do? 3490 3491 RESOLVED: It is equivalent to: 3492 3493 glPixelStorei(GL_UNPACK_SWAP_BYTES, GL_FALSE); 3494 glPixelStorei(GL_UNPACK_LSB_FIRST, GL_FALSE); 3495 glPixelStorei(GL_UNPACK_IMAGE_HEIGHT, 0); 3496 glPixelStorei(GL_UNPACK_SKIP_IMAGES, 0); 3497 glPixelStorei(GL_UNPACK_ROW_LENGTH, 0); 3498 glPixelStorei(GL_UNPACK_SKIP_ROWS, 0); 3499 glPixelStorei(GL_UNPACK_SKIP_PIXELS, 0); 3500 glPixelStorei(GL_UNPACK_ALIGNMENT, 4); 3501 glPixelStorei(GL_PACK_SWAP_BYTES, GL_FALSE); 3502 glPixelStorei(GL_PACK_LSB_FIRST, GL_FALSE); 3503 glPixelStorei(GL_PACK_IMAGE_HEIGHT, 0); 3504 glPixelStorei(GL_PACK_SKIP_IMAGES, 0); 3505 glPixelStorei(GL_PACK_ROW_LENGTH, 0); 3506 glPixelStorei(GL_PACK_SKIP_ROWS, 0); 3507 glPixelStorei(GL_PACK_SKIP_PIXELS, 0); 3508 glPixelStorei(GL_PACK_ALIGNMENT, 4); 3509 3510 glBindBuffer(GL_PIXEL_UNPACK_BUFFER, 0); 3511 glBindBuffer(GL_PIXEL_PACK_BUFFER, 0); 3512 3513 Note both the pack and unpack state are set to their initial 3514 values. 3515 3516 Keep in mind that the initial unpack/pack alignment of 4, while 3517 the specified initial value, is often surprising to OpenGL 3518 developers who expect the alignment to be 1. 3519 3520 (15) What does glClientAttribDefaultEXT(GL_CLIENT_VERTEX_ARRAY_BIT) do? 3521 3522 RESOLVED: It is equivalent to: 3523 3524 int i; 3525 GLint max; 3526 3527 glBindBuffer(GL_ARRAY_BUFFER, 0); 3528 glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, 0); 3529 3530 glDisableClientState(GL_EDGE_FLAG_ARRAY); 3531 glEdgePointer(0, 0); 3532 3533 glDisableClientState(GL_INDEX_ARRAY); 3534 glIndexPointer(GL_FLOAT, 0, 0); 3535 3536 glDisableClientState(GL_SECONDARY_COLOR_ARRAY); 3537 glSecondaryColorPointer(4, GL_FLOAT, 0, 0); 3538 3539 glDisableClientState(GL_FOG_COORD_ARRAY); 3540 glFogCoordPointer(GL_FLOAT, 0, 0); 3541 3542 glGetIntegerv(GL_MAX_TEXTURE_COORDS, &max); 3543 for (i=0; i<max; i++) { 3544 glClientActiveTexture(GL_TEXTURE0 + i); 3545 glDisableClientState(GL_TEXTURE_COORD_ARRAY); 3546 glTexCoordPointer(4, GL_FLOAT, 0, 0); 3547 } 3548 3549 glDisableClientState(GL_COLOR_ARRAY); 3550 glColorPointer(4, GL_FLOAT, 0, 0); 3551 3552 glDisableClientState(GL_NORMAL_ARRAY); 3553 glNormalPointer(GL_FLOAT, 0, 0); 3554 3555 glDisableClientState(GL_VERTEX_ARRAY); 3556 glVertexPointer(4, GL_FLOAT, 0, 0); 3557 3558 glDisableClientState(GL_WEIGHT_ARRAY_ARB); 3559 glWeightPointerARB(0, GL_FLOAT, 0, 0); 3560 3561 glGetIntegerv(GL_MAX_VERTEX_ATTRIBS, &max); 3562 for (i=0; i<max; i++) { 3563 glDisableVertexAttribArray(i); 3564 glVertexAttribPointer(i, 4, GL_FLOAT, GL_FALSE, 0, 0); 3565 } 3566 3567 glClientActiveTexture(GL_TEXTURE0); 3568 3569 Keep in mind the initial state of the vertex array enable 3570 is disabled. Applications will typically at least 3571 want glEnableClientState(GL_VERTEX_ARRAY) called after 3572 glClientAttribDefaultEXT(GL_CLIENT_VERTEX_ARRAY_BIT) for this 3573 reason. 3574 3575 (16) Should glGetFloatIndexedvEXT and glGetDoubleIndexedvEXT return 3576 values for non-texture state parameters similar to the parameters 3577 that work for glGetIntegerIndexedvEXT and glGetBooleanIndexedvEXT 3578 that EXT_draw_buffers2, EXT_transform_feedback, and 3579 NV_transform_feedback support? 3580 3581 RESOLVED: glGetFloatIndexedvEXT and glGetDoubleIndexedvEXT 3582 should accept without error parameter tokens supported 3583 by glGetIntegerIndexedvEXT and glGetBooleanIndexedvEXT 3584 through the EXT_draw_buffers2, EXT_transform_feedback, and 3585 NV_transform_feedback extensions. In these cases, GLfloat or 3586 GLdouble values respectively of the indexed state should be 3587 returned. 3588 3589 The EXT_draw_buffers2 extension specifically considered adding 3590 glGetFloatIndexedvEXT and glGetDoubleIndexedvEXT queries but 3591 left them out since none of the indexed state introduced was 3592 floating-point. This extension adds floating-point indexed state 3593 and so adds glGetFloatIndexedvEXT and glGetDoubleIndexedvEXT 3594 and thereby enhances the functionality of these unrelated 3595 extensions supporting glGetIndexedv, etc. by introducing 3596 glGetFloatIndexedvEXT and glGetDoubleIndexedvEXT and expecting 3597 them to operate consistently with glGetIntegerIndexedvEXT except 3598 returning GLfloat and GLdouble versions of the queried state 3599 respectively. 3600 3601 Following the OpenGL 3.0 function naming convention for indexed 3602 state, version 1.1 of this specification adds glGetFloati_vEXT 3603 and glGetDoublei_vEXT queries. 3604 3605 (17) Should there be a selector-free way to query the "program" 3606 matrices introduced by ARB_vertex_program? 3607 3608 RESOLVED: Yes. The GL_PROGRAM_MATRIX_EXT, 3609 GL_TRANSPOSE_PROGRAM_MATRIX_EXT, and 3610 GL_PROGRAM_MATRIX_STACK_DEPTH_EXT tokens supported by 3611 glGetFloati_vEXT, glGetFloatIndexedvEXT, etc. query the program 3612 matrices specified by GL_MATRIX0_ARB, etc. 3613 3614 The ARB_vertex_program (and NV_vertex_program) introduced the 3615 GL_CURRENT_MATRIX_ARB, GL_TRANSPOSE_CURRENT_MATRIX_ARB, and 3616 GL_CURRENT_MATRIX_STACK_DEPTH_ARB query tokens to get back the 3617 current matrix based on the glMatrixMode state. This avoided 3618 adding a large set of tokens to query the matrix, transpose 3619 matrix, and matrix stack depth for all the program matrices. 3620 But this made querying these matrices always dependent on the 3621 matrix mode selector. The indexed glGet queries are allow 3622 indexed access to the program matrices but the above new query 3623 tokens must be added for this purpose. 3624 3625 (18) How does this extension interact with APPLE_vertex_array_object? 3626 3627 RESOLVED: The VERTEX_ARRAY_BINDING_APPLE state is 3628 client vertex-array state so glClientAttribDefaultEXT and 3629 glPushClientAttribDefaultEXT should, when their mask parameter has 3630 CLIENT_VERTEX_ARRAY_BIT set, set the VERTEX_ARRAY_BINDING_APPLE 3631 state to its initial value of zero. 3632 3633 This could go unsaid if the APPLE_vertex_array_object 3634 specification explicitly listed the VERTEX_ARRAY_BINDING_APPLE 3635 state in one of tables 6.6, 6.7, and 6.8. 3636 3637 (19) glGetProgramivARB queries per-program state corresponding to 3638 the current program for the specified target but also queries 3639 per-target state. Should glGetNamedProgramivEXT return 3640 only per-program state and not per-target state? Or should 3641 glGetNamedProgramivEXT return both per-program and per-target 3642 state? 3643 3644 RESOLVED: glGetNamedProgramivEXT should accept the same pname 3645 parameters as glGetProgramivARB and thus should handle BOTH 3646 per-program AND per-target queries. 3647 3648 However glGetNamedProgramivEXT does require the specified 3649 program object's target must match the specified (supported) 3650 target parameter otherwise an INVALID_OPERATION error occurs. 3651 Program object zero applies to all program targets so specifying 3652 program object zero avoids the possibility of this error. 3653 3654 This resolution avoids having to keep a list of allowed 3655 per-program vs. disallowed per-target tokens up-to-date with 3656 future extensions. 3657 3658 The ARB_vertex_program and ARB_fragment_program per-target 3659 program query tokens are GL_PROGRAM_BINDING_ARB, 3660 GL_MAX_PROGRAM_ENV_PARAMETERS_ARB, 3661 GL_MAX_PROGRAM_LOCAL_PARAMETERS_ARB, 3662 GL_MAX_PROGRAM_NATIVE_INSTRUCTIONS_ARB, 3663 GL_MAX_PROGRAM_INSTRUCTIONS_ARB, 3664 GL_MAX_PROGRAM_NATIVE_TEMPORARIES_ARB, 3665 GL_MAX_PROGRAM_TEMPORARIES_ARB, 3666 GL_MAX_PROGRAM_NATIVE_PARAMETERS_ARB, 3667 GL_MAX_PROGRAM_PARAMETERS_ARB, 3668 GL_MAX_PROGRAM_NATIVE_ATTRIBS_ARB, GL_MAX_PROGRAM_ATTRIBS_ARB, 3669 GL_MAX_PROGRAM_NATIVE_ADDRESS_REGISTERS_ARB, 3670 GL_MAX_PROGRAM_ADDRESS_REGISTERS_ARB, 3671 GL_MAX_PROGRAM_NATIVE_ALU_INSTRUCTIONS_ARB, 3672 GL_MAX_PROGRAM_ALU_INSTRUCTIONS_ARB, 3673 GL_MAX_PROGRAM_NATIVE_TEX_INSTRUCTIONS_ARB, 3674 GL_MAX_PROGRAM_TEX_INSTRUCTIONS_ARB, 3675 GL_MAX_PROGRAM_NATIVE_TEX_INDIRECTIONS_ARB, 3676 GL_MAX_PROGRAM_TEX_INDIRECTIONS_ARB, 3677 GL_MAX_PROGRAM_EXEC_INSTRUCTIONS_NV, GL_MAX_PROGRAM_CALL_DEPTH_NV, 3678 GL_MAX_PROGRAM_IF_DEPTH_NV, GL_MAX_PROGRAM_LOOP_DEPTH_NV, 3679 GL_MAX_PROGRAM_LOOP_COUNT_NV. The NV_gpu_program4 3680 extension adds GL_MAX_PROGRAM_ATTRIB_COMPONENTS_NV, 3681 GL_MAX_PROGRAM_RESULT_COMPONENTS_NV, 3682 GL_MAX_PROGRAM_GENERIC_ATTRIBS_NV, 3683 GL_MAX_PROGRAM_GENERIC_RESULTS_NV, 3684 GL_MAX_PROGRAM_OUTPUT_VERTICES_NV and 3685 GL_MAX_PROGRAM_TOTAL_OUTPUT_COMPONENTS_NV. 3686 The NV_parameter_buffer_object extension adds 3687 GL_MAX_PROGRAM_PARAMETER_BUFFER_BINDINGS_NV and 3688 GL_MAX_PROGRAM_PARAMETER_BUFFER_SIZE_NV. 3689 3690 The ARB_vertex_program and ARB_fragment_program per-program 3691 program query tokens are GL_PROGRAM_LENGTH_ARB, 3692 GL_PROGRAM_FORMAT_ARB, GL_PROGRAM_INSTRUCTIONS_ARB, 3693 GL_PROGRAM_TEMPORARIES_ARB, GL_PROGRAM_PARAMETERS_ARB, 3694 GL_PROGRAM_ATTRIBS_ARB, GL_PROGRAM_ADDRESS_REGISTERS_ARB, 3695 GL_PROGRAM_ALU_INSTRUCTIONS_ARB, GL_PROGRAM_TEX_INSTRUCTIONS_ARB, 3696 GL_PROGRAM_TEX_INDIRECTIONS_ARB, 3697 GL_PROGRAM_NATIVE_INSTRUCTIONS_ARB, 3698 GL_PROGRAM_NATIVE_TEMPORARIES_ARB, 3699 GL_PROGRAM_NATIVE_PARAMETERS_ARB, GL_PROGRAM_NATIVE_ATTRIBS_ARB, 3700 GL_PROGRAM_NATIVE_ADDRESS_REGISTERS_ARB, 3701 GL_PROGRAM_NATIVE_ALU_INSTRUCTIONS_ARB, 3702 GL_PROGRAM_NATIVE_TEX_INSTRUCTIONS_ARB, 3703 GL_PROGRAM_NATIVE_TEX_INDIRECTIONS_ARB, and 3704 GL_PROGRAM_UNDER_NATIVE_LIMITS_ARB. 3705 The NV_gpu_program4 extension adds GL_GEOMETRY_VERTICES_OUT_EXT, 3706 GL_GEOMETRY_INPUT_TYPE_EXT, GL_GEOMETRY_OUTPUT_TYPE_EXT, 3707 GL_PROGRAM_ATTRIB_COMPONENTS_NV, and 3708 GL_PROGRAM_RESULT_COMPONENTS_NV. 3709 3710 (20) When multiple contexts are sharing objects such as textures, 3711 programs, and/or buffers what expectations exist for when other 3712 contexts will see the state updates to textures, programs, 3713 and buffers manipulated by this extension? 3714 3715 RESOLVED: This extension doesn't change the expected semantics 3716 for multiple context sharing objects within a share group, but 3717 this is an appropriate place to document these expectations for 3718 both developers and implementers. 3719 3720 Object state updates are visible in two ways: 1) queries return 3721 the current (most recently updated) state, and 2) rendering 3722 results are affected by the updated state. 3723 3724 When a context updates objects, that updating context must observe 3725 those updates immediately for both queries and rendering results. 3726 This is a strong requirement for "sequential consistency" of 3727 updates and queries based on the context's own sequential stream 3728 of commands and queries. 3729 3730 Queries by other OpenGL rendering contexts in the same share 3731 group with a context updating some shared OpenGL object must 3732 observe the effect of another context's update with "transactional 3733 consistency". Program state updates and queries are treated as 3734 "transactions" that must be consistent with some serialized order. 3735 Implementations typically achieved this by guaranteeing mutual 3736 exclusion for all object updates and queries. This is a strong 3737 consistency requirement. 3738 3739 Rendering results based on updated state are subject to a 3740 weaker consistency requirement. Rendering results by other 3741 OpenGL rendering contexts in the same share group with a context 3742 updating some shared OpenGL object may see a stale version of 3743 the object's state if the those contexts sharing the object are 3744 bound to the object when the state update occurs. 3745 3746 Even so, the stale values of the object's state must always 3747 represent a consistent state of the object transactionally 3748 consistent when the object was last "bound" or otherwise used 3749 for rendering. We refer to this weaker consistency as "bind 3750 consistency". 3751 3752 This requirement means, for example, a texture object should NEVER 3753 observe the red and green components to be from one state update 3754 while the red and alpha components correspond to a subsequent 3755 state update. 3756 3757 A context other than the context performing an update is 3758 guaranteed to see a "transactional consistent" view of an 3759 object's state when the context next processes a command to bind 3760 or otherwise "use" an object for rendering. However if the 3761 object being updated is currently bound or "used" by another 3762 context, when this update is observed is not well-defined. 3763 So to guarantee an up-to-date version of a bound object's state, 3764 the context must re-bind to the updated object. 3765 3766 (UNRESOLVED: Should a re-bind require binding to a different 3767 object and then binding back to the object, or is simply rebinding 3768 to the same name already bound enough? As a performance 3769 optimization, an OpenGL implementation may treat binding to 3770 an already bound object as a no-op. However it would be nice 3771 if binding to any already bound object at least checked if the 3772 object had been updated since the last bind and, if an update 3773 has occurred, update the context's view of the object used for 3774 rendering.) 3775 3776 Some examples (with serialized order shown): 3777 3778 Sequential consistency for one thread: 3779 3780 thread A: 3781 glBindMultiTextureEXT(GL_TEXTURE1, GL_TEXTURE_2D, 23); 3782 glEnablei(GL_TEXTURE_2D, 1); 3783 glTextureParameterivEXT(23, GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR); 3784 glDrawElements(...); // first render 3785 glTextureParameterivEXT(23, GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST); 3786 glDrawElements(...); // second render 3787 3788 The first render must observer texture 23 using GL_LINEAR 3789 minification filtering while the second render must observe 3790 GL_NEAREST minification filtering. 3791 3792 Transactional consistency for queries by multiple sharing 3793 contexts: 3794 3795 thread A: 3796 glTextureParameteriv(23, GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR); 3797 glGetTextureParameteriv(23, GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, &geti1); 3798 thread B: 3799 glTextureParameteriv(23, GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST); 3800 thread A: 3801 glGetTextureParameteriv(23, GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, &geti2); 3802 3803 geti1 should return GL_LINEAR bug geti2 should return GL_NEAREST. 3804 3805 Bind consistency for rendering by multiple sharing contexts: 3806 3807 thread A: 3808 glBindMultiTextureEXT(GL_TEXTURE1, GL_TEXTURE_2D, 23); 3809 glEnablei(GL_TEXTURE_2D, 1); 3810 glTextureParameterivEXT(23, GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR); 3811 thread B: 3812 glTextureParameterivEXT(23, GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST); 3813 thread A: 3814 glDrawElements(...); // first render 3815 glBindMultiTextureEXT(GL_TEXTURE1, GL_TEXTURE_2D, 23); 3816 glDrawElements(...); // second render 3817 3818 The first render may or may not observe the minification 3819 filter be set to GL_NEAREST; an implementation could use the 3820 stale GL_LINEAR state. The second render should observe the 3821 minification filter be set to GL_NEAREST. 3822 3823 Perhaps a bind away might be required for consistency, binding 3824 away from 23, then back to 23: 3825 3826 thread A: 3827 glBindMultiTextureEXT(GL_TEXTURE1, GL_TEXTURE_2D, 0); 3828 glBindMultiTextureEXT(GL_TEXTURE1, GL_TEXTURE_2D, 23); 3829 glDrawElements(...); // second render 3830 3831 (20) Should direct access commands and queries be added for 3832 renderbuffer and framebuffer objects? 3833 3834 RESOLVED: Yes. 3835 3836 These should be added for completeness. 3837 3838 (21) Should the Named framebuffer and renderbuffer object commands take 3839 a target parameter in addition to the initial GLuint 3840 framebuffer/renderbuffer parameter? 3841 3842 RESOLVED: No, except for CheckNamedFramebufferStatusEXT (see 3843 the next issue). 3844 3845 The rationale for including a target parameter for the texture 3846 commands is that the default texture object zero and cube map 3847 face targets need the target for disambiguation. 3848 3849 Likewise assembly programs needs a target parameter to know 3850 how source text should be parsed, etc. Programs really have 3851 different target types (vertex, geometry, fragment). 3852 3853 Buffer objects do not include a target parameter in their Named 3854 commands because the target identifies the binding point for the 3855 buffer while buffers themselves do not have a target type so the 3856 target is relevant for binding buffers, but not accessing buffers. 3857 3858 The only legal values for target or RENDERBUFFER and 3859 FRAMEBUFFER respectively so there is really one type of 3860 renderbuffer and framebuffer respectively. 3861 3862 The target parameter could be used by future extensions but 3863 so far the several extensions that extend framebuffer and 3864 renderbuffer objects already (EXT_framebuffer_multisample, 3865 NV_framebuffer_multisample_coverage, EXT_geometry_shader4, 3866 and NV_gpu_program4) maintain a single legal framebuffer and 3867 renderbuffer target value. 3868 3869 This does not preclude new binding targets for renderbuffer or 3870 framebuffers in the way buffer objects support lots of binding 3871 targets but buffers themselves are target-free (unlike textures 3872 and programs). 3873 3874 (22) How should the target parameter work for 3875 glCheckNamedFramebufferStatusEXT? 3876 3877 RESOLVED: The target parameter determines whether the status 3878 check is for reading or drawing. 3879 3880 OpenGL 3.0 (by incorporating the EXT_framebuffer_blit extension) 3881 introduces GL_DRAW_FRAMEBUFFER and GL_READ_FRAMEBUFFER targets. 3882 A framebuffer object may be supported for drawing but perhaps 3883 not reading (or vice versa). glCheckNamedFramebufferStatusEXT 3884 uses its target parameter to determine whether the check is for 3885 reading or writing. 3886 3887 Because glCheckFramebufferStatus allows for "an 3888 implementation-dependent set of restrictions" for 3889 which GL_FRAMEBUFFER_UNSUPPORTED may be returned, 3890 it is possible for glCheckNamedFramebufferStatusEXT 3891 to return GL_FRAMEBUFFER_COMPLETE when binding to 3892 the framebuffer object with glBindFramebuffer and 3893 then calling glCheckFramebufferStatus may generate 3894 GL_FRAMEBUFFER_COMPLETE may be returned, it is possible 3895 for glCheckNamedFramebufferStatusEXT could return still return 3896 GL_FRAMEBUFFER_UNSUPPORTED. 3897 3898 Despite this allowance, the intent here however is that an 3899 application should be able to create a framebuffer object and 3900 determine in most cases that a framebuffer object can be supported 3901 with glCheckNamedFramebufferStatusEXT. 3902 3903 (23) Do we need glFramebufferDrawBufferEXT, glFramebufferDrawBuffersEXT 3904 and glFramebufferReadBufferEXT commands? 3905 3906 UNRESOLVED: Yes, add them. 3907 3908 The READ_BUFFER and DRAW_BUFFER state is per-framebuffer object 3909 and glDrawBuffers, glReadBuffer, and glDrawBuffer update the 3910 currently bound framebuffer object. These commands use the 3911 current framebuffer object binding as a selector so there should 3912 be selector-free versions of this commands. 3913 3914 Since these commands didn't have Framebuffer in the name before, 3915 we avoid saying "NamedFramebuffer" in the commands. 3916 3917 (24) Should there be a selector-free way to query the Framebuffer 3918 Dependent Values (table 9.nnn) for a named framebuffer object? 3919 3920 RESOLVED: No. 3921 3922 It makes sense to provide selector-free queries for API-settable 3923 state such as GL_READ_BUFFER, GL_DRAW_BUFFER, and GL_DRAW_BUFFERi 3924 but framebuffer dependent values of a framebuffer object state 3925 are really derived state value and depends on the status of a 3926 framebuffer object bind. 3927 3928 OpenGL 3.0 (by incorporating the EXT_framebuffer_object) 3929 describes per-framebuffer object state in its tables 4.nnn 3930 and 9.nnn. The framebuffer object API allows this state to be 3931 queried with glGetIntegerv, etc. based on the current framebuffer 3932 object binding (a selector). The glGetFramebufferParameteriv 3933 command queries table 4.nnn state, but not table 9.nnn state. 3934 3935 Issue #25 in the EXT_framebuffer_object specification is relevant 3936 here. Issue #25 (the issue could be more clear...) indicates 3937 that zero may be returned if a given buffer is not attached 3938 (the case where the framebuffer object is inconsistent). 3939 3940 The GL_FRAMEBUFFER_UNSUPPORTED status can occur due to "an 3941 implementation-dependent set of restrictions". Presumably these 3942 restrictions might not be evaluated until glBindFramebuffer 3943 time. This blanket "didn't work" status means the appropriate 3944 per-framebuffer state may not be determined without binding to 3945 the framebuffer object. 3946 3947 A future revision of this specification (such as its integration 3948 into an FBO-enabled core specification) may wish to reconsider 3949 this issue and add table 9.nnn state to the state queriable by 3950 glGetFramebufferParameteriv. 3951 3952 If so, there should also be a query 3953 glGetFramebufferMultisamplefvEXT for NV_explicit_multisample 3954 for similar reasons. 3955 3956 void GetFramebufferMultisamplefvEXT(uint framebuffer, 3957 enum pname, uint index, 3958 float *val); 3959 3960 (25) Should the selector-free versions of various OpenGL 3.0 and 3961 EXT_framebuffer_object framebuffer object commands not be allowed 3962 in display lists when the selector-based versions are specified 3963 to not be compiled into display lists? 3964 3965 RESOLVED: Yes, keep this same restriction. 3966 3967 It is unfortunate that commands such as glGenerateMipmap 3968 are explicitly specified to not be compiled into display lists; 3969 this extension simply retains these same restrictions. 3970 3971 (26) Direct state access commands and queries can implicit object 3972 initialization when provided unused object names. If implicit 3973 object initialization is required but the command would 3974 subsequently generate an error, should the object be initialized 3975 and the name now be used? 3976 3977 RESOLVED: Yes, an object for an unused name can be initialized 3978 but if the command generates an error, the object should still 3979 be initialized and the name now used. 3980 3981 Most OpenGL commands (excepting GL_OUT_OF_MEMORY errors) are 3982 ignored if an error occurs. 3983 3984 Direct state access commands are an exception because they 3985 should be "morally equivalent" to doing a glBind* followed by 3986 the selector-based command. For example: 3987 3988 GLuint update2D = 27; 3989 glTextureImage2D(update2D, GL_TEXTURE_2D, ...); 3990 3991 should be morally equivalent to: 3992 3993 GLuint update2D = 27; 3994 GLint bound2D; 3995 glGetIntegerv(GL_TEXTURE_BINDING_2D, &bound2D); 3996 glBindTexture(GL_TEXTURE_2D, update2D); 3997 glTexImage2D(GL_TEXTURE_2D, ...); 3998 glBindTexture(GL_TEXTURE_2D, bound2D); 3999 4000 If the ... arguments to glTexImage2D and glTextureImage2D 4001 resulted in an error (say a GL_INVALID_ENUM), in both cases we 4002 want texture object 27 to exist after the sequence. 4003 4004 The rationale for this behavior is an application lacking 4005 EXT_direct_state_access should be able to generate equivalent 4006 command sequences and have "morally equivalent" error behavior. 4007 4008 It is deemed undesirable for an non-EXT_direct_state_access path 4009 to behave differently (initializing unused objects on glBind*) 4010 despite an error in the subsequent state-setting command or 4011 state-querying query. 4012 4013 (27) How many entry points are introduced? 4014 4015 This extension adds just 3 tokens but specifies 214 functions 4016 (192 for version 1.0 plus 22 for OpenGL 3.0 support added by 4017 version 1.1). 4018 4019 Technically 5 of these functions were previously introduced by 4020 EXT_draw_buffers2 and are now part of OpenGL 3.0. 4021 4022 OpenGL 2.1 and 3.0 contains 583 and 666 functions respectively. 4023 So the OpenGL 2.1 subset of EXT_direct_state_access is +22% 4024 more functions beyond OpenGL 2.1's function set. 4025 4026 By comparison, OpenGL 2.0 added 93 functions (primarily for GLSL 4027 support) to OpenGL 1.5's 484 functions, a +19% increase in the 4028 function set. OpenGL 3.0 added 83 new functions. 4029 4030 OpenGL's immediate mode API function count is considerably 4031 larger than the number of EXT_direct_state_access functions. 4032 There are 212 "vertex attribute" functions (counting all core 4033 OpenGL 2.1 glVertex*, glColor*, glSecondaryColor*, glNormal*, 4034 glTexCoord*, glMultiTexCoord*, glVertexAttrib*, glMaterial*, 4035 glRasterPos*, and glWindowPos* variants). 4036 4037 So the core EXT_direct_state_access function count is 63% of 4038 the count of core OpenGL 2.1 "vertex attribute" functions. 4039 4040 Another way to measure the footprint of EXT_direct_state_access 4041 is in terms of the optimized compiled user-space driver 4042 the size (text+data) of a modern Windows XP OpenGL driver 4043 supporting EXT_direct_state_access compared to the same 4044 driver without EXT_direct_state_access supported compiled in. 4045 The EXT_direct_state_access driver is +2.5% larger. 4046 4047 (28) How should vertex array objects be supported? 4048 4049 RESOLVED: The EXT version of this specification didn't provide 4050 interactions with the glVertexArrayBindAPPLE selector introduced 4051 by the APPLE_vertex_buffer_object extension. Now that this 4052 extension is incorporated into OpenGL 3.0, it makes sense for 4053 an ARB extension to incorporate selector-free support for vertex 4054 buffer objects. 4055 4056 Selector-free versions of the vertex array specification commands 4057 are of the form (using glColorPointer as an example): 4058 4059 void glVertexArrayColorOffsetEXT(uint vaobj, uint buffer, 4060 int size, enum type, sizei stride, 4061 intptr offset); 4062 4063 There are two initial parameter for both the vertex array 4064 object selector (vaobj) and the latched buffer state (buffer). 4065 4066 The vaobj parameter is needed for the commands to be 4067 selector-free. The latched buffer is an explicit parameter to 4068 avoid having disturb the GL_ARRAY_BUFFER selector. 4069 4070 (While using glPushClientAttribDefaultEXT/glPopClientAttrib 4071 works to avoid disturbing latched client vertex array buffer 4072 binding state--ignoring client attrib stack overflows--that 4073 approach doesn't work for vertex array objects because 4074 glPushClientAttribDefaultARB/glPopClientAttrib would default all 4075 the initial values of the currently bound vertex array object.) 4076 4077 Also the last "const GLvoid * pointer" parameter is changed to 4078 an "intptr offset" parameter. This change reflects the more 4079 encouraged and generally more efficient usage of pulling vertex 4080 arrays from vertex buffer objects. This usage avoids having to 4081 always cast an offset to a pointer. 4082 4083 Because the GLintptr type has the same sizeof as a pointer, 4084 applications seeking to pass pointers with a zero value for the 4085 buffer parameter can do so by casting their pointer to a GLintptr. 4086 Example: 4087 4088 static GLfloat colors[3*20]; 4089 glVertexArrayColorOffsetEXT(27, /*client-state*/0, 4090 3, GL_FLOAT, 12, (GLintptr)colors); 4091 4092 Also added are selector-free vertex array object enable/disable 4093 commands and queries. The queries return GLintptr values to 4094 make sure pointers as well as offsets can be returned. 4095 4096 (29) How should vertex array object queries be supported? 4097 4098 RESOLVED: Provide both glGetVertexArray*Parameteriv and 4099 glGetVertexArray*Pointerv queries. 4100 4101 Rather than providing both integer and pointer queries, it is 4102 tempting to provide just a query accepting a GLintptr pointer. 4103 But that's a likely pitfall for 64-bit coding. Someone coding for 4104 32-bit could pass a GLint* without complaint from the compiler 4105 since both GLint* and GLintptr* are pointers to a 32-bit value, 4106 but in a 64-bit compilation environment, GLintptr* is a pointer 4107 to a 64-bit value. While 64-bit compilers are likely to error 4108 (or at least warn) about this situation, a GLintptr* is likely 4109 to encourage 64-bit portability problems. Having both a pointer 4110 and integer query avoids this problem. 4111 4112 (30) What should happen when a negative offset is passed to the 4113 glVertexArray*OffsetEXT routines? 4114 4115 RESOLVED: When the buffer is non-zero, the offset really should 4116 be a positive value so generate a GL_INVALID_VALUE if a negative 4117 offset is passed to these routines when buffer is non-zero. 4118 When the buffer is non-negative, the GLintptr offset parameter 4119 will be treated as a pointer; in this case, there should be 4120 no check for negative values of the offset parameter since the 4121 negative parameter could, in fact, be a valid pointer. 4122 4123 This raises the interesting point as to whether the several 4124 core OpenGL buffer API commands such as glBufferSubData, 4125 glMapBufferRange, and glFlushMappedBufferRange should actually 4126 have a type of GLsizeiptr for their offset parameter. Doing so 4127 would simplify the language in section 2.9 (Buffer Object) by 4128 eliminating the need to document GL_INVALID_OFFSET errors for 4129 negative offset parameters. Such a change could be made in a 4130 compatible way because GLintptr and GLsizeiptr are typedef'ed 4131 to the same underlying type (a signed int of the same size in 4132 bytes as a pointer). 4133 4134 (31) Should the internalformat parameter of various DSA versions of 4135 gl*Tex*Image* routines be a GLint or GLenum? 4136 4137 RESOLVED: Match the type for internalformat of the pre-DSA 4138 version of the routine. 4139 4140 This is a legacy of OpenGL 1.0 where the internalformat parameter 4141 to glTexImage1D and glTexImage2D was a GLint-typed value that 4142 could be 1, 2, 3, or 4 for the number of components. 4143 4144 In OpenGL 1.1, internal texture formats were introduced to provide 4145 more specificity to the internal representation of texels within 4146 a texture. This was part of introducing texture objects to OpenGL 4147 (a feature not originally in OpenGL 1.0). 4148 4149 The intent of this decision is to make it easier for existing 4150 code converting use the selector-free DSA routines without 4151 signed/unsigned warnings because GLenum is unsigned while GLint 4152 is signed. 4153 4154 This means the following commands take a GLint internalformat 4155 parameter: 4156 4157 glTextureImage1DEXT 4158 glTextureImage2DEXT 4159 glTextureImage3DEXT 4160 glMultiTexImage1DEXT 4161 glMultiTexImage2DEXT 4162 glMultiTexImage3DEXT 4163 4164 This means the following commands take a GLenum internalformat 4165 parameter: 4166 4167 glCopyTextureImage1DEXT 4168 glCopyTextureImage2DEXT 4169 glCopyMultiTexImage1DEXT 4170 glCopyMultiTexImage2DEXT 4171 4172 glCompressedTextureImage1DEXT 4173 glCompressedTextureImage2DEXT 4174 glCompressedTextureImage3DEXT 4175 glCompressedMultiTexImage1DEXT 4176 glCompressedMultiTexImage2DEXT 4177 glCompressedMultiTexImage3DEXT 4178 4179 glTextureBufferEXT 4180 glMultiTexBufferEXT 4181 glNamedRenderbufferStorageEXT 4182 glNamedRenderbufferStorageMultisampleEXT 4183 glNamedRenderbufferStorageMultisampleCoverageEXT 4184 4185 Warning: pre-July 2013 versions of glext.h have the DSA prototypes that 4186 should be using GLint internalformat using GLenum instead. See: 4187 4188 https://cvs.khronos.org/bugzilla/show_bug.cgi?id=10413 4189 4190 (32) How can a particular vertex array object's texture coordinate 4191 set array be updated without depending on the active client 4192 texture selector? 4193 4194 RESOLVED: The glEnableVertexArrayEXT and glDisableVertexArrayEXT 4195 commands should be extended to accept GL_TEXTUREi tokens where 4196 GL_TEXTUREi indicates the specific vertex array for texture 4197 coordinate set i to enable or disable respectively. 4198 4199 Due to a specification lapse, this behavior was not specified in 4200 the version 1.1 of this specification but was added for version 4201 1.2. 4202 4203 The use of a GL_TEXTUREi token follows the precedent set for how 4204 GL_TEXTUREi is supported for the selector-free matrix routines. 4205 4206 Implementations of EXT_direct_state_access prior to July 2013 4207 cannot be expected to implement this behavior and will generate 4208 a GL_INVALID_ENUM error instead. This error can be used to 4209 distinguish version 1.2 and earlier versions of this extension. 4210 4211 Calling glEnableVertexArrayEXT or glDisableVertexArrayEXT with 4212 GL_TEXTURE_COORD_ARRAY can be expected to update the texture 4213 coordinate array based on the current active client texture 4214 coordinate set of the indicated vertex array object, effectively 4215 depending on the current active texture selector but not the 4216 current bound vertex array object selector. 4217 4218 Querying the enable of multitexture texture coordinate arrays 4219 uses glGetVertexArrayIntegeri_vEXT with GL_TEXTURE_COORD_ARRAY 4220 for the pname. This behavior was not clearly specified before 4221 version 1.2. 4222 4223Revision History 4224 4225 Rev. Date Author Changes 4226 ---- -------- -------- ----------------------------------------- 4227 1 11/20/07 mjk Initial version 4228 2 12/03/07 mjk Feedback from JeffB 4229 3 01/02/08 mjk Formatting 4230 4 01/02/08 mjk NV_gpu_program4 additions 4231 5 01/02/08 mjk EXT_gpu_program_parameters additions 4232 6 03/06/08 mjk Switch from "MultiTex" to "Indexed" 4233 texture API 4234 7 03/27/08 mjk Feedback from TransGaming 4235 8 03/28/08 mjk Program matrix query and 4236 indexed query restructuring 4237 9 03/31/08 mjk MultiTex API complete 4238 10 04/03/08 mjk Fix CompressedTexture and CompressedMultiTex 4239 lapses noticed by Ian 4240 11 04/14/08 mjk Add target parameters to NamedProgram and 4241 GetNamedProgram calls 4242 12 04/17/08 mjk ARB_texture_rectangle interaction 4243 13 04/28/08 mjk Add issue #19 4244 14 05/02/08 mjk Add issue #20 about multi-thread 4245 interactions as suggested by Yanjun Zhang 4246 15 05/06/08 mjk Typos: glGetMultiTexCompressedTextureEXT 4247 prototype and GLX protocol suffixing 4248 16 05/22/08 mjk Add FBO support 4249 17 05/23/08 mjk Fix Generate{Texture,MultiTex}MipmapEXT 4250 18 06/06/08 mjk glCheckNamedFramebufferStatusEXT needs target 4251 Issues #22 and #23 4252 19 06/10/08 mjk Add FramebufferDrawBufferEXT, 4253 FramebufferDrawBuffersEXT, 4254 FramebufferReadBufferEXT 4255 20 07/01/08 mjk Add NV_explicit_multisample interaction 4256 21 07/07/08 mjk Typo fixes from Daniel Koch, error 4257 semantics, new issues, limit 4258 GetFramebufferParameterivEXT to 4.nnn state, 4259 fix NamedProgramStringEXT discussion, 4260 add EXT_texture_array and 4261 NV_texture_cube_map_array interactions 4262 22 07/15/08 mjk Just typos 4263 23 11/05/08 mjk Destineer support 4264 24 11/05/08 mjk Destineer support 4265 25 12/15/08 mjk Version 1.1 adds OpenGL 3.0 support 4266 26 12/19/08 mjk Fix VertexArrayVertexOffsetEXT duplicate 4267 entry point; eliminated version missing stride 4268 27 12/22/08 mjk NamedRenderbufferStorageEXT shouldn't have 4269 target parameter 4270 28 12/23/08 mjk Fixed various "index" functions for 3.0 4271 29 01/12/09 mjk Add error for negative offsets for 4272 glVertexArray*Offset commands when buffer 4273 parameter is non-zero 4274 30 01/26/09 mjk Correct glPopClientAttrib usage 4275 31 02/17/09 mjk Add glVertexArrayMultiTexCoordOffsetEXT 4276 New names: GetVertexArrayIntegeri_vEXT, 4277 GetVertexArrayIntegervEXT, 4278 GetVertexArrayPointeri_vEXT 4279 32 03/13/09 groth Add EXT_copy_buffer interaction 4280 33 06/10/09 mjk add VertexArrayMultiTexCoordOffsetEXT to 4281 list of errors for exceeding the maximum 4282 texture image units 4283 34 09/07/10 mjk some Get*Indexedv instanced needed EXT 4284 suffixes; issue 27 update 4285 35 06/18/13 mjk add issue 31; glext.h had GLenum internalformat 4286 when spec said GLint for gl*Tex*Image*EXT commands 4287 36 06/24/13 mjk fix glEnableVertexArrayEXT and 4288 glDisableVertexArrayEXT so they accept the 4289 GL_TEXTUREi tokens to be free of active 4290 client texture selector (issue 32) 4291 37 07/29/13 mjk document NVIDIA driver bugs 4292 38 10/22/13 mjk add Matrix*Transpose*EXT routines missing 4293 from section 2.12.2 list 4294 39 02/24/15 mjk add & operator to glMultiTexGenivEXT in NV Impl. 4295