1This is the registry of GLX opcodes, error codes, and event codes. It is 2very rarely modified since there is almost no interest in supporting GLX 3with modern OpenGL features, and the work of extending the XML schema to 4express it is not worthwhile. 5 6When new GLX protocol is needed for extension specifications, allocate it 7here and reflect it in the extension specification document as well as, if 8appropriate, glx.xml. 9 10Reserved opcode ranges assigned to vendors, and in some cases, opcodes 11actually assigned within that range are tracked here. Not all opcodes used 12by vendors are known. 13 14GLX Opcodes (8 bits) 15==================== 16 1-15 GLX 1.0 17 16 Vendor Private 18 17 Vendor Private with Reply 19 18-20 GLX 1.1 20 21-32 GLX 1.3 21 33 glXSetClientInfoARB (GLX_ARB_create_context) 22 34 glXCreateContextAttribsARB (GLX_ARB_create_context) 23 35 glXSetClientInfo2ARB (GLX_ARB_create_context) 24 25GLX Vendor Private / Vendor Private with Reply opcodes (32-bits) 26 (first 4 bytes past standard X header) 27================================================================ 28 29 0 255 EXT (various - contact SGI) 30 256 271 HP (originally Compaq) 31 (272-511 unused) 32 512 575 E&S 33 (576-1023 unused) 34 1024 1269 EXT (various - contact SGI) 35 1024 GLX_EXT_import_context 36 1270 1275 NV_register_combiners 37 1276 1280 NV_fence 38 1281 1292 NVIDIA (use TBD; was intended for NV_vertex_program) 39 1293 1308 NV_vertex_program / ARB_vertex_program / ARB_fragment_program 40 1309 NVIDIA (use TBD) 41 1310 1311 NV_fragment_program 42 1312 NV_fence 43 1313 1318 GLX_NV_video_output 44 1319 1320 NV_vertex_program 45 1321 1326 NVIDIA (use TBD) 46 1327 NV_register_combiners2 47 1328 1329 EXT_timer_query 48 1330 1331 GLX_EXT_texture_from_pixmap 49 1332 1339 NV_present_video 50 1340 NVIDIA (use TBD) 51 1341 GLX_NV_delay_before_swap 52 1342 1359 NVIDIA (use TBD) 53 1360 GLX_NV_copy_image 54 1361 1364 NVIDIA (use TBD) 55 1365 1368 NV_gpu_program4 56 1369 1386 NVIDIA (use TBD) 57 1387 1388 GLX_NV_copy_buffer 58 1389 1399 NVIDIA (use TBD) 59 1400 1415 NV_video_capture 60 1416 GLX_EXT_swap_control 61 1417 1420 NVIDIA (use TBD) 62 1421 OES_single_precision (Khronos OpenGL ES 1.0) 63 1422 1428 EXT_framebuffer_object 64 (1429-2047 unused) 65 2048 2064 SUN 66 3000 3999 IBM 67 4096 5151 SGI (4106-5151 unused) 68 4096 SGIS_detail_texture 69 4097 SGIS_sharpen_texture 70 4098 4100 SGI_color_table 71 4101 SGIS_texture_filter4 72 4102 4104 SGIX_instruments 73 4105 SGIX_flush_raster 74 5152 5184 Mesa (unknown use) 75 8192 8207 HP 76 16384 16399 ADD 77 65536 66575 SGI (various GLX extensions) 78 65536 GLX_SGI_swap_control 79 65537 GLX_SGI_make_current_read 80 65538 65539 GLX_SGIX_video_source 81 65540 65542 GLX_SGIX_fbconfig 82 65543 65546 GLX_SGIX_pbuffer 83 65547 GLX_SGIX_swap_group 84 65548 65549 GLX_SGIX_swap_barrier 85 65550 65553 GLX_SGIX_hyperpipe_group 86 65554 GLX_SGIX_query_board_num (internal, for shm) 87 88OpenGL Single Opcodes (8 Bits) 89=============================== 90 91 167-up Reserved 92 0 146 OpenGL 1.0/1.1 core 93 147 159 OpenGL 1.2 core 94 160 160 ARB_texture_compression 95 161 166 ARB_occlusion_query 96 167 178 ARB_shader_objects 97 179 181 ARB_vertex_shader 98 182 183 EXT_gpu_shader4 99 184 185 NV_vertex_program4 100 186 194 ARB_vertex_buffer_object 101 195 202 OpenGL 2.0 core 102 203 204 EXT_texture_integer 103 205 205 ARB_map_buffer_range 104 206 209 ARB_vertex_array_object 105 210 212 EXT_draw_buffers2 106 213 214 OpenGL 3.0 core 107 215 220 ARB_uniform_buffer_object 108 221 ARB_copy_buffer 109 110OpenGL Rendering Opcodes (16 Bits) 111================================== 112 113 0-1007 Reserved to ARB (231-1007 unused) 114 0 191 OpenGL 1.0 core (140 deprecated?) 115 192 194 OpenGL 1.1 core 116 195 196 OpenGL 1.2 core 117 197 213 ARB_multitexture 118 214 219 ARB_texture_compression 119 220 228 ARB_vertex_blend 120 229 ARB_multisample 121 230 ARB_window_pos 122 231 232 ARB_occlusion_query 123 233 ARB_draw_buffers 124 234 ARB_color_buffer_float 125 235 237 ARB_framebuffer_object 126 238 264 ARB_shader_object 127 265 ARB_vertex_shader 128 266 268 ARB_geometry_shader4 129 269 277 EXT_gpu_shader4 130 278 289 NV_vertex_program4 131 290 301 ARB_vertex_buffer_object 132 302 304 ARB_stencil_two_side 133 305 310 OpenGL 2.1 core 134 311 345 ARB_pixel_buffer_object 135 346 347 EXT_texture_integer 136 348 349 NV_conditional_render 137 350 351 ARB_vertex_array_object 138 352 354 EXT_draw_buffers2 139 355 363 OpenGL 3.0 core 140 364 365 NV_primitive_restart 141 366 ARB_uniform_buffer_object 142 367 ARB_texture_buffer_object 143 1008-1023 Reserved to IBM (unknown usage) 144 1024-1039 Reserved to HP (originally Compaq) (unknown usage) 145 1040-2047 Unused 146 2048-3071 Reserved to SGI (2083-3071 unused) 147 2048 2049 SGIS_multisample 148 2050 SGIX_tag_sample_buffer 149 2051 SGIS_detail_texture 150 2052 SGIS_sharpen_texture 151 2053 2056 SGI_color_table 152 2057 2058 SGIS_texture4D 153 2059 SGIX_pixel_texture 154 2060 2063 SGIX_sprite 155 2064 SGIS_texture_filter4 156 2065 2066 EXT_point_parameters/SGIS_point_parameters 157 2067 SGIS_fog_function 158 2068 unused? 159 2069 2070 SGIX_instruments 160 2071 SGIX_reference_plane 161 2072 SGIX_framezoom 162 2073 2076 unused? 163 2077 SGIX_instruments 164 2078 2081 SGIX_list_priority 165 2082 SGIS_texture_color_mask 166 3072-4095 Reserved to ARB (unused) 167 4096-5151 Reserved to EXT (4460-5151 unused) 168 4096 EXT_blend_color/1.2 169 4097 EXT_blend_minmax/1.2 170 4098 EXT_polygon_offset 171 4099 4100 EXT_subtexture 172 4101 4109 EXT_convolution/1.2 173 4110 4113 EXT_histogram/1.2 174 4114 EXT_texture3D/1.2 175 4115 EXT_subtexture/1.2 176 4116 EXT_vertex_array 177 4117 4118 EXT_texture_object/1.1 178 4119 4123 EXT_copy_texture/1.1 179 4124 4125 EXT_fog_coord 180 4126 4133 EXT_secondary_color 181 4134 EXT_blend_func_separate 182 4135 EXT_vertex_weighting 183 4136 4142 NV_register_combiners 184 4143 4144 NV_fence (4144 retired, used to be for FinishFence) 185 4145 4179 NVIDIA (use TBD; was intended for NV_vertex_program) 186 4180 4214 NV_vertex_program 187 4215 4217 ARB_vertex_program 188 4218 4219 NV_fragment_program 189 4220 EXT_stencil_two_side 190 4221 4222 NV_point_sprite 191 4223 EXT_stencil_clear_tag 192 4225 EXT_polygon_offset_clamp 193 4228 EXT_blend_equation_separate 194 4229 EXT_depth_bounds_test 195 4230 4239 ARB_vertex_program 196 4240 4264 NV_half_float 197 4265 4280 NVIDIA (use TBD) 198 4281 4282 EXT_gpu_program_parameters 199 4283 4285 NV_depth_buffer_float 200 4286 4290 NVIDIA (use TBD) 201 4291 NV_copy_image 202 4292 4293 EXT_texture_integer 203 4294 4307 NVIDIA (use TBD) 204 4308 4312 OES_single_precision (Khronos OpenGL ES 1.0) 205 4313 4315 SUN (use TBD) 206 4316 4325 EXT_framebuffer_object 207 4326 4329 ARB_matrix_palette 208 4330 EXT_framebuffer_blit 209 4331 EXT_framebuffer_multisample 210 4332 4347 NVIDIA (use TBD, bug 6720) 211 4348 NV_texture_barrier 212 4349 4459 NVIDIA (use TBD, bug 6720) 213 214 8192-8207 Reserved to HP (unknown usage) 215 16384-16415 Reserved to SUN (unknown usage) 216 24576-24607 Reserved to ADD (unknown usage) 217 218 219GLX Enumerateds (32 Bits) 220========================= 2210x0-0xFF Reserved to EXT (visual attribute names) 222 0x1 0x11 GLX 1.0 (attribute names) 223 0x12 0x1F unused? 224 0x20 GLX_EXT_visual_rating (attribute names) 225 0x21 unused? 226 0x22 0x28 GLX_EXT_visual_info (attribute names) 2270x2070-0x209F Reserved to ARB (shared with WGL) 228 0x2090 0x2094 GLX_ARB_create_context 229 0x2095 GL_ARB_vertex_buffer_object 2300x20A0-0x219F Reserved to NVIDIA (shared with WGL) 231 (many NV and EXT extensions, see glxenum.spec) 2320x8000-0x800F Reserved to EXT (0x800E-0x800F unused) 233 0x8000 0x8009 GLX_EXT_visual_info 234 0x800A 0x800C GLX_EXT_import_context 235 0x800D GLX_EXT_visual_rating 2360x8010-0x803F Reserved to SGI (0x8029-0x803F unused) 237 0x8010 0x8015 GLX_SGIX_fbconfig 238 0x8016 0x8023 GLX_SGIX_pbuffer 239 0x8024 GLX_SGIX_dm_buffer 240 0x8025 GLX_SGIS_blended_overlay 241 0x8026 0x8027 GLX_SGIS_shared_multisample 2420x8040-0x804F Reserved to OpenGL ARB 243 0x8040 0x8041 GLX 1.3 2440x8050-0x805F Reserved to 3Dfx 245 0x8050 0x8051 GLX_3DFX_multisample 2460x8060-0x806F Reserved to OpenML SIG 247 0x8060 0x8063 GLX_OML_swap_method 2480x8070-0x816F Reserved to NVIDIA 2490x8170-0x817F Reserved to SUN 2500x8180-0x818F Reserved to Intel 2510x9126 GLX_ARB_create_context_profile (shared with WGL) 252 253100000-100011 Reserved to SGI (100002-100011 unused) 254 100000 100001 GLX_SGIS_multisample/GLX_ARB_multisample 255 256GLX Error Codes 257=============== 258 259(Extension reservations for vendor extensions should start sufficiently 260high so they don't interfere with GLX core and GLX ARB extensions.) 261 2620 GLXBadContext OpenGL ARB (GLX core) 2631 GLXBadContextState OpenGL ARB (GLX core) 2642 GLXBadDrawable OpenGL ARB (GLX core) 2653 GLXBadPixmap OpenGL ARB (GLX core) 2664 GLXBadContextTag OpenGL ARB (GLX core) 2675 GLXBadCurrentWindow OpenGL ARB (GLX core) 2686 GLXBadRenderRequest OpenGL ARB (GLX core) 2697 GLXBadLargeRequest OpenGL ARB (GLX core) 2708 GLXUnsupportedPrivateRequest OpenGL ARB (GLX core) 2719 GLXBadFBConfig OpenGL ARB (GLX core) 27210 GLXBadPbuffer OpenGL ARB (GLX core) 27311 GLXBadCurrentDrawable OpenGL ARB (GLX core) 27412 GLXBadWindow OpenGL ARB (GLX core) 27513 GLXBadProfileARB OpenGL ARB (GLX_ARB_create_context) 276 277 278GLX Event Masks 279=============== 2800x08000000 GLX 1.3 / SGIX_pbuffer 2810x04000000 Intel (INTEL_swap_event) 282 283GLX Event Codes 284=============== 285 286(The X.org/Mesa GLX implementation derived from the SGI Sample 287Implementation has __GLX_NUMBER_EVENTS == 17, suggesting that vendor 288events should be allocated downwards from the first free value <= 16 289(14), and core GLX events allocated upwards). 290 2910 OpenGL ARB (GLX_PbufferClobber in GLX 1.3) 29215 Intel (GLX_BufferSwapINTEL) 29316 SGI (GLX_PbufferClobberSGIX) 29464 SGI 295 296GLX protocol encoding for GL >= 2.0 297=================================== 298 299(This section - this whole file really - should eventually be incorporated 300in a proper update of the GLX protocol specification.) 301 302OpenGL 2.0 303---------- 304 305 DeleteShader 306 307 1 CARD8 opcode (X assigned) 308 1 195 GLX opcode 309 2 3 request length 310 4 GLX_CONTEXT_TAG context tag 311 4 CARD32 shader 312 313 IsShader 314 315 1 CARD8 opcode (X assigned) 316 1 196 GLX opcode 317 2 3 request length 318 4 GLX_CONTEXT_TAG context tag 319 4 CARD32 shader 320 => 321 1 1 reply 322 1 unused 323 2 CARD16 sequence number 324 4 0 reply length 325 4 BOOL32 return value 326 20 unused 327 328 IsProgram 329 330 1 CARD8 opcode (X assigned) 331 1 197 GLX opcode 332 2 3 request length 333 4 GLX_CONTEXT_TAG context tag 334 4 CARD32 program 335 => 336 1 1 reply 337 1 unused 338 2 CARD16 sequence number 339 4 0 reply length 340 4 BOOL32 return value 341 20 unused 342 343 GetShaderiv 344 345 1 CARD8 opcode (X assigned) 346 1 198 GLX opcode 347 2 4 request length 348 4 GLX_CONTEXT_TAG context tag 349 4 CARD32 program 350 4 CARD32 pname 351 => 352 1 1 reply 353 1 unused 354 2 CARD16 sequence number 355 4 m reply length, m = (n == 1 ? 0 : n) 356 4 unused 357 4 CARD32 n 358 359 if (n == 1) this follows: 360 361 4 CARD32 params 362 12 unused 363 364 otherwise this follows: 365 366 16 unused 367 n*4 LISTOFCARD32 params 368 369 Note that n may be 0, indicating that a GL error occurred. 370 371 GetProgramiv 372 373 1 CARD8 opcode (X assigned) 374 1 199 GLX opcode 375 2 4 request length 376 4 GLX_CONTEXT_TAG context tag 377 4 CARD32 program 378 4 CARD32 pname 379 => 380 1 1 reply 381 1 unused 382 2 CARD16 sequence number 383 4 m reply length, m = (n == 1 ? 0 : n) 384 4 unused 385 4 CARD32 n 386 387 if (n == 1) this follows: 388 389 4 CARD32 params 390 12 unused 391 392 otherwise this follows: 393 394 16 unused 395 n*4 LISTofCARD32 params 396 397 Note that n may be 0, indicating that a GL error occurred. 398 399 GetShaderInfoLog 400 401 1 CARD8 opcode (X assigned) 402 1 200 GLX opcode 403 2 4 request length 404 4 GLX_CONTEXT_TAG context tag 405 4 CARD32 shader 406 4 CARD32 bufSize 407 => 408 1 1 reply 409 1 unused 410 2 CARD16 sequence number 411 4 m reply length, m = (n + p) / 4 412 4 unused 413 4 CARD32 n, n = length + 1 414 16 unused 415 n LISTofBYTE infoLog 416 p unused, p=pad(n) 417 418 Note that n may be 0, indicating that a GL error occurred. 419 420 GetProgramInfoLog 421 422 1 CARD8 opcode (X assigned) 423 1 201 GLX opcode 424 2 4 request length 425 4 GLX_CONTEXT_TAG context tag 426 4 CARD32 program 427 4 CARD32 bufSize 428 => 429 1 1 reply 430 1 unused 431 2 CARD16 sequence number 432 4 m reply length, m = (n + p) / 4 433 4 unused 434 4 CARD32 n, n = length + 1 435 16 unused 436 n LISTofBYTE infoLog 437 p unused, p=pad(n) 438 439 Note that n may be 0, indicating that a GL error occurred. 440 441 DeleteProgram 442 443 1 CARD8 opcode (X assigned) 444 1 202 GLX opcode 445 2 3 request length 446 4 GLX_CONTEXT_TAG context tag 447 4 CARD32 program 448 449OpenGL 2.1 450---------- 451 452 UniformMatrix2x3fv 453 454 2 16+4*count*2*3 rendering command length 455 2 305 rendering command opcode 456 4 CARD32 location 457 4 CARD32 count 458 1 BOOL transpose 459 3 unused 460 4*count*2*3 LISTofFLOAT32 value 461 462 If the command is encoded in a glXRenderLarge request, the 463 command opcode and command length fields above are expanded to 464 4 bytes each: 465 466 4 20+4*count*2*2 rendering command length 467 4 305 rendering command opcode 468 469 UniformMatrix3x2fv 470 471 2 16+4*count*3*2 rendering command length 472 2 306 rendering command opcode 473 4 CARD32 location 474 4 CARD32 count 475 1 BOOL transpose 476 3 unused 477 4*count*3*2 LISTofFLOAT32 value 478 479 If the command is encoded in a glXRenderLarge request, the 480 command opcode and command length fields above are expanded to 481 4 bytes each: 482 483 4 20+4*count*3*2 rendering command length 484 4 306 rendering command opcode 485 486 UniformMatrix2x4fv 487 488 2 16+4*count*2*4 rendering command length 489 2 307 rendering command opcode 490 4 CARD32 location 491 4 CARD32 count 492 1 BOOL transpose 493 3 unused 494 4*count*2*4 LISTofFLOAT32 value 495 496 If the command is encoded in a glXRenderLarge request, the 497 command opcode and command length fields above are expanded to 498 4 bytes each: 499 500 4 20+4*count*2*4 rendering command length 501 4 307 rendering command opcode 502 503 UniformMatrix4x2fv 504 505 2 16+4*count*4*2 rendering command length 506 2 308 rendering command opcode 507 4 CARD32 location 508 4 CARD32 count 509 1 BOOL transpose 510 3 unused 511 4*count*4*2 LISTofFLOAT32 value 512 513 If the command is encoded in a glXRenderLarge request, the 514 command opcode and command length fields above are expanded to 515 4 bytes each: 516 517 4 20+4*count*4*2 rendering command length 518 4 308 rendering command opcode 519 520 UniformMatrix3x4fv 521 522 2 16+4*count*3*4 rendering command length 523 2 309 rendering command opcode 524 4 CARD32 location 525 4 CARD32 count 526 1 BOOL transpose 527 3 unused 528 4*count*3*4 LISTofFLOAT32 value 529 530 If the command is encoded in a glXRenderLarge request, the 531 command opcode and command length fields above are expanded to 532 4 bytes each: 533 534 4 20+4*count*3*4 rendering command length 535 4 309 rendering command opcode 536 537 UniformMatrix4x3fv 538 539 2 16+4*count*4*3 rendering command length 540 2 310 rendering command opcode 541 4 CARD32 location 542 4 CARD32 count 543 1 BOOL transpose 544 3 unused 545 4*count*4*3 LISTofFLOAT32 value 546 547 If the command is encoded in a glXRenderLarge request, the 548 command opcode and command length fields above are expanded to 549 4 bytes each: 550 551 4 20+4*count*4*3 rendering command length 552 4 310 rendering command opcode 553 554OpenGL 3.0 555---------- 556 557 The following rendering commands are sent to the sever as part of a 558 glXRender request: 559 560 BindBufferRange 561 562 2 32 rendering command length 563 2 355 rendering command opcode 564 8 INT64 offset 565 8 INT64 size 566 4 ENUM target 567 4 CARD32 index 568 4 CARD32 buffer 569 570 BindBufferBase 571 572 2 16 rendering command length 573 2 356 rendering command opcode 574 4 ENUM target 575 4 CARD32 index 576 4 CARD32 buffer 577 578 BeginTransformFeedback 579 580 2 8 rendering command length 581 2 357 rendering command opcode 582 4 ENUM primitiveMode 583 584 EndTransformFeedback 585 586 2 4 rendering command length 587 2 358 rendering command opcode 588 589 ClearBufferfi 590 591 2 20 rendering command length 592 2 360 rendering command opcode 593 4 ENUM buffer 594 4 CARD32 drawbuffer 595 4 FLOAT32 depth 596 4 CARD32 stencil 597 598 ClearBufferfv 599 600 2 12+(4*n) rendering command length 601 2 361 rendering command opcode 602 4 ENUM buffer 603 0x1800 n=4 GL_COLOR 604 0x1801 n=1 GL_STENCIL 605 0x1802 n=1 GL_DEPTH 606 else n=0 607 4 CARD32 drawbuffer 608 4*n LISTofFLOAT32 value 609 610 ClearBufferiv 611 612 2 12+(4*n) rendering command length 613 2 362 rendering command opcode 614 4 ENUM buffer 615 0x1800 n=4 GL_COLOR 616 0x1801 n=1 GL_STENCIL 617 0x1802 n=1 GL_DEPTH 618 else n=0 619 4 CARD32 drawbuffer 620 4*n LISTofINT32 value 621 622 ClearBufferuiv 623 624 2 12+(4*n) rendering command length 625 2 363 rendering command opcode 626 4 ENUM buffer 627 0x1800 n=4 GL_COLOR 628 0x1801 n=1 GL_STENCIL 629 0x1802 n=1 GL_DEPTH 630 else n=0 631 4 CARD32 drawbuffer 632 4*n LISTofCARD32 value 633 634 The following rendering commands can be sent in a glXRender 635 or glXRenderLarge request. 636 637 TransformFeedbackVaryings 638 639 2 16+(n*4)+s+p rendering command length 640 2 359 rendering command opcode 641 4 CARD32 program 642 4 INT32 count 643 4 ENUM buffermode 644 n*4 LISTofINT32 lengths[n], n = count 645 s LISTofCHAR varyings, s = sum of all entries in the lengths 646 array 647 p unused, p = pad(s) 648 649 If the command is encoded in a glXRenderLarge request, the command 650 opcode and command length fields are expanded to 4 bytes each. 651 652 4 20+(n*4)+s+p rendering command length 653 4 359 rendering command opcode 654 655 lengths[i] is calculated as strlen(varyings[i]) + 1. The NUL terminator 656 is included when sending the varyings. 657 658 The following single commands are sent to the server as part of a 659 glXSingle request: 660 661 GetTransformFeedbackVarying 662 663 1 CARD8 opcode(X assigned) 664 1 213 GLX opcode 665 2 5 request length 666 4 GLX_CONTEXT_TAG context tag 667 4 CARD32 program 668 4 CARD32 index 669 4 CARD32 bufsize 670 => 671 1 1 reply 672 1 unused 673 2 CARD16 sequence number 674 4 m reply length, m = (n == 0 ? 0 : (n + p) / 4) 675 4 unused 676 4 n-1 length 677 4 INT32 size 678 4 INT32 type 679 8 unused 680 n LISTofCHAR name, n = strlen(name)+1 681 p unused, p = pad(m) 682 683 GetStringi 684 685 1 CARD8 opcode (X assigned) 686 1 214 GLX opcode 687 2 4 request length 688 4 GLX_CONTEXT_TAG context tag 689 4 ENUM name 690 4 CARD32 index 691 => 692 1 1 reply 693 1 1 unused 694 2 CARD16 sequence number 695 4 m reply length, m = (n + p) / 4 696 4 unused 697 4 CARD32 n 698 16 unused 699 n STRING8 string 700 p unused, p=pad(n) 701