gldebug.go (81260B)
1 // Copyright 2014 The Go Authors. All rights reserved. 2 // Use of this source code is governed by a BSD-style 3 // license that can be found in the LICENSE file. 4 5 // Code generated from gl.go using go generate. DO NOT EDIT. 6 // See doc.go for details. 7 8 //go:build (darwin || linux || openbsd || windows) && gldebug 9 // +build darwin linux openbsd windows 10 // +build gldebug 11 12 package gl 13 14 import ( 15 "fmt" 16 "log" 17 "math" 18 "sync/atomic" 19 "unsafe" 20 ) 21 22 func (ctx *context) errDrain() string { 23 var errs []Enum 24 for { 25 e := ctx.GetError() 26 if e == 0 { 27 break 28 } 29 errs = append(errs, e) 30 } 31 if len(errs) > 0 { 32 return fmt.Sprintf(" error: %v", errs) 33 } 34 return "" 35 } 36 37 func (ctx *context) enqueueDebug(c call) uintptr { 38 numCalls := atomic.AddInt32(&ctx.debug, 1) 39 if numCalls > 1 { 40 panic("concurrent calls made to the same GL context") 41 } 42 defer func() { 43 if atomic.AddInt32(&ctx.debug, -1) > 0 { 44 select {} // block so you see us in the panic 45 } 46 }() 47 48 return ctx.enqueue(c) 49 } 50 51 func (v Enum) String() string { 52 switch v { 53 case 0x0: 54 return "0" 55 case 0x1: 56 return "1" 57 case 0x2: 58 return "2" 59 case 0x3: 60 return "LINE_STRIP" 61 case 0x4: 62 return "4" 63 case 0x5: 64 return "TRIANGLE_STRIP" 65 case 0x6: 66 return "TRIANGLE_FAN" 67 case 0x300: 68 return "SRC_COLOR" 69 case 0x301: 70 return "ONE_MINUS_SRC_COLOR" 71 case 0x302: 72 return "SRC_ALPHA" 73 case 0x303: 74 return "ONE_MINUS_SRC_ALPHA" 75 case 0x304: 76 return "DST_ALPHA" 77 case 0x305: 78 return "ONE_MINUS_DST_ALPHA" 79 case 0x306: 80 return "DST_COLOR" 81 case 0x307: 82 return "ONE_MINUS_DST_COLOR" 83 case 0x308: 84 return "SRC_ALPHA_SATURATE" 85 case 0x8006: 86 return "FUNC_ADD" 87 case 0x8009: 88 return "32777" 89 case 0x883d: 90 return "BLEND_EQUATION_ALPHA" 91 case 0x800a: 92 return "FUNC_SUBTRACT" 93 case 0x800b: 94 return "FUNC_REVERSE_SUBTRACT" 95 case 0x80c8: 96 return "BLEND_DST_RGB" 97 case 0x80c9: 98 return "BLEND_SRC_RGB" 99 case 0x80ca: 100 return "BLEND_DST_ALPHA" 101 case 0x80cb: 102 return "BLEND_SRC_ALPHA" 103 case 0x8001: 104 return "CONSTANT_COLOR" 105 case 0x8002: 106 return "ONE_MINUS_CONSTANT_COLOR" 107 case 0x8003: 108 return "CONSTANT_ALPHA" 109 case 0x8004: 110 return "ONE_MINUS_CONSTANT_ALPHA" 111 case 0x8005: 112 return "BLEND_COLOR" 113 case 0x8892: 114 return "ARRAY_BUFFER" 115 case 0x8893: 116 return "ELEMENT_ARRAY_BUFFER" 117 case 0x8894: 118 return "ARRAY_BUFFER_BINDING" 119 case 0x8895: 120 return "ELEMENT_ARRAY_BUFFER_BINDING" 121 case 0x88e0: 122 return "STREAM_DRAW" 123 case 0x88e4: 124 return "STATIC_DRAW" 125 case 0x88e8: 126 return "DYNAMIC_DRAW" 127 case 0x8764: 128 return "BUFFER_SIZE" 129 case 0x8765: 130 return "BUFFER_USAGE" 131 case 0x8626: 132 return "CURRENT_VERTEX_ATTRIB" 133 case 0x404: 134 return "FRONT" 135 case 0x405: 136 return "BACK" 137 case 0x408: 138 return "FRONT_AND_BACK" 139 case 0xde1: 140 return "TEXTURE_2D" 141 case 0xb44: 142 return "CULL_FACE" 143 case 0xbe2: 144 return "BLEND" 145 case 0xbd0: 146 return "DITHER" 147 case 0xb90: 148 return "STENCIL_TEST" 149 case 0xb71: 150 return "DEPTH_TEST" 151 case 0xc11: 152 return "SCISSOR_TEST" 153 case 0x8037: 154 return "POLYGON_OFFSET_FILL" 155 case 0x809e: 156 return "SAMPLE_ALPHA_TO_COVERAGE" 157 case 0x80a0: 158 return "SAMPLE_COVERAGE" 159 case 0x500: 160 return "INVALID_ENUM" 161 case 0x501: 162 return "INVALID_VALUE" 163 case 0x502: 164 return "INVALID_OPERATION" 165 case 0x505: 166 return "OUT_OF_MEMORY" 167 case 0x900: 168 return "CW" 169 case 0x901: 170 return "CCW" 171 case 0xb21: 172 return "LINE_WIDTH" 173 case 0x846d: 174 return "ALIASED_POINT_SIZE_RANGE" 175 case 0x846e: 176 return "ALIASED_LINE_WIDTH_RANGE" 177 case 0xb45: 178 return "CULL_FACE_MODE" 179 case 0xb46: 180 return "FRONT_FACE" 181 case 0xb70: 182 return "DEPTH_RANGE" 183 case 0xb72: 184 return "DEPTH_WRITEMASK" 185 case 0xb73: 186 return "DEPTH_CLEAR_VALUE" 187 case 0xb74: 188 return "DEPTH_FUNC" 189 case 0xb91: 190 return "STENCIL_CLEAR_VALUE" 191 case 0xb92: 192 return "STENCIL_FUNC" 193 case 0xb94: 194 return "STENCIL_FAIL" 195 case 0xb95: 196 return "STENCIL_PASS_DEPTH_FAIL" 197 case 0xb96: 198 return "STENCIL_PASS_DEPTH_PASS" 199 case 0xb97: 200 return "STENCIL_REF" 201 case 0xb93: 202 return "STENCIL_VALUE_MASK" 203 case 0xb98: 204 return "STENCIL_WRITEMASK" 205 case 0x8800: 206 return "STENCIL_BACK_FUNC" 207 case 0x8801: 208 return "STENCIL_BACK_FAIL" 209 case 0x8802: 210 return "STENCIL_BACK_PASS_DEPTH_FAIL" 211 case 0x8803: 212 return "STENCIL_BACK_PASS_DEPTH_PASS" 213 case 0x8ca3: 214 return "STENCIL_BACK_REF" 215 case 0x8ca4: 216 return "STENCIL_BACK_VALUE_MASK" 217 case 0x8ca5: 218 return "STENCIL_BACK_WRITEMASK" 219 case 0xba2: 220 return "VIEWPORT" 221 case 0xc10: 222 return "SCISSOR_BOX" 223 case 0xc22: 224 return "COLOR_CLEAR_VALUE" 225 case 0xc23: 226 return "COLOR_WRITEMASK" 227 case 0xcf5: 228 return "UNPACK_ALIGNMENT" 229 case 0xd05: 230 return "PACK_ALIGNMENT" 231 case 0xd33: 232 return "MAX_TEXTURE_SIZE" 233 case 0xd3a: 234 return "MAX_VIEWPORT_DIMS" 235 case 0xd50: 236 return "SUBPIXEL_BITS" 237 case 0xd52: 238 return "RED_BITS" 239 case 0xd53: 240 return "GREEN_BITS" 241 case 0xd54: 242 return "BLUE_BITS" 243 case 0xd55: 244 return "ALPHA_BITS" 245 case 0xd56: 246 return "DEPTH_BITS" 247 case 0xd57: 248 return "STENCIL_BITS" 249 case 0x2a00: 250 return "POLYGON_OFFSET_UNITS" 251 case 0x8038: 252 return "POLYGON_OFFSET_FACTOR" 253 case 0x8069: 254 return "TEXTURE_BINDING_2D" 255 case 0x80a8: 256 return "SAMPLE_BUFFERS" 257 case 0x80a9: 258 return "SAMPLES" 259 case 0x80aa: 260 return "SAMPLE_COVERAGE_VALUE" 261 case 0x80ab: 262 return "SAMPLE_COVERAGE_INVERT" 263 case 0x86a2: 264 return "NUM_COMPRESSED_TEXTURE_FORMATS" 265 case 0x86a3: 266 return "COMPRESSED_TEXTURE_FORMATS" 267 case 0x1100: 268 return "DONT_CARE" 269 case 0x1101: 270 return "FASTEST" 271 case 0x1102: 272 return "NICEST" 273 case 0x8192: 274 return "GENERATE_MIPMAP_HINT" 275 case 0x1400: 276 return "BYTE" 277 case 0x1401: 278 return "UNSIGNED_BYTE" 279 case 0x1402: 280 return "SHORT" 281 case 0x1403: 282 return "UNSIGNED_SHORT" 283 case 0x1404: 284 return "INT" 285 case 0x1405: 286 return "UNSIGNED_INT" 287 case 0x1406: 288 return "FLOAT" 289 case 0x140c: 290 return "FIXED" 291 case 0x1902: 292 return "DEPTH_COMPONENT" 293 case 0x1906: 294 return "ALPHA" 295 case 0x1907: 296 return "RGB" 297 case 0x1908: 298 return "RGBA" 299 case 0x1909: 300 return "LUMINANCE" 301 case 0x190a: 302 return "LUMINANCE_ALPHA" 303 case 0x8033: 304 return "UNSIGNED_SHORT_4_4_4_4" 305 case 0x8034: 306 return "UNSIGNED_SHORT_5_5_5_1" 307 case 0x8363: 308 return "UNSIGNED_SHORT_5_6_5" 309 case 0x8869: 310 return "MAX_VERTEX_ATTRIBS" 311 case 0x8dfb: 312 return "MAX_VERTEX_UNIFORM_VECTORS" 313 case 0x8dfc: 314 return "MAX_VARYING_VECTORS" 315 case 0x8b4d: 316 return "MAX_COMBINED_TEXTURE_IMAGE_UNITS" 317 case 0x8b4c: 318 return "MAX_VERTEX_TEXTURE_IMAGE_UNITS" 319 case 0x8872: 320 return "MAX_TEXTURE_IMAGE_UNITS" 321 case 0x8dfd: 322 return "MAX_FRAGMENT_UNIFORM_VECTORS" 323 case 0x8b4f: 324 return "SHADER_TYPE" 325 case 0x8b80: 326 return "DELETE_STATUS" 327 case 0x8b82: 328 return "LINK_STATUS" 329 case 0x8b83: 330 return "VALIDATE_STATUS" 331 case 0x8b85: 332 return "ATTACHED_SHADERS" 333 case 0x8b86: 334 return "ACTIVE_UNIFORMS" 335 case 0x8b87: 336 return "ACTIVE_UNIFORM_MAX_LENGTH" 337 case 0x8b89: 338 return "ACTIVE_ATTRIBUTES" 339 case 0x8b8a: 340 return "ACTIVE_ATTRIBUTE_MAX_LENGTH" 341 case 0x8b8c: 342 return "SHADING_LANGUAGE_VERSION" 343 case 0x8b8d: 344 return "CURRENT_PROGRAM" 345 case 0x200: 346 return "NEVER" 347 case 0x201: 348 return "LESS" 349 case 0x202: 350 return "EQUAL" 351 case 0x203: 352 return "LEQUAL" 353 case 0x204: 354 return "GREATER" 355 case 0x205: 356 return "NOTEQUAL" 357 case 0x206: 358 return "GEQUAL" 359 case 0x207: 360 return "ALWAYS" 361 case 0x1e00: 362 return "KEEP" 363 case 0x1e01: 364 return "REPLACE" 365 case 0x1e02: 366 return "INCR" 367 case 0x1e03: 368 return "DECR" 369 case 0x150a: 370 return "INVERT" 371 case 0x8507: 372 return "INCR_WRAP" 373 case 0x8508: 374 return "DECR_WRAP" 375 case 0x1f00: 376 return "VENDOR" 377 case 0x1f01: 378 return "RENDERER" 379 case 0x1f02: 380 return "VERSION" 381 case 0x1f03: 382 return "EXTENSIONS" 383 case 0x2600: 384 return "NEAREST" 385 case 0x2601: 386 return "LINEAR" 387 case 0x2700: 388 return "NEAREST_MIPMAP_NEAREST" 389 case 0x2701: 390 return "LINEAR_MIPMAP_NEAREST" 391 case 0x2702: 392 return "NEAREST_MIPMAP_LINEAR" 393 case 0x2703: 394 return "LINEAR_MIPMAP_LINEAR" 395 case 0x2800: 396 return "TEXTURE_MAG_FILTER" 397 case 0x2801: 398 return "TEXTURE_MIN_FILTER" 399 case 0x2802: 400 return "TEXTURE_WRAP_S" 401 case 0x2803: 402 return "TEXTURE_WRAP_T" 403 case 0x1702: 404 return "TEXTURE" 405 case 0x8513: 406 return "TEXTURE_CUBE_MAP" 407 case 0x8514: 408 return "TEXTURE_BINDING_CUBE_MAP" 409 case 0x8515: 410 return "TEXTURE_CUBE_MAP_POSITIVE_X" 411 case 0x8516: 412 return "TEXTURE_CUBE_MAP_NEGATIVE_X" 413 case 0x8517: 414 return "TEXTURE_CUBE_MAP_POSITIVE_Y" 415 case 0x8518: 416 return "TEXTURE_CUBE_MAP_NEGATIVE_Y" 417 case 0x8519: 418 return "TEXTURE_CUBE_MAP_POSITIVE_Z" 419 case 0x851a: 420 return "TEXTURE_CUBE_MAP_NEGATIVE_Z" 421 case 0x851c: 422 return "MAX_CUBE_MAP_TEXTURE_SIZE" 423 case 0x84c0: 424 return "TEXTURE0" 425 case 0x84c1: 426 return "TEXTURE1" 427 case 0x84c2: 428 return "TEXTURE2" 429 case 0x84c3: 430 return "TEXTURE3" 431 case 0x84c4: 432 return "TEXTURE4" 433 case 0x84c5: 434 return "TEXTURE5" 435 case 0x84c6: 436 return "TEXTURE6" 437 case 0x84c7: 438 return "TEXTURE7" 439 case 0x84c8: 440 return "TEXTURE8" 441 case 0x84c9: 442 return "TEXTURE9" 443 case 0x84ca: 444 return "TEXTURE10" 445 case 0x84cb: 446 return "TEXTURE11" 447 case 0x84cc: 448 return "TEXTURE12" 449 case 0x84cd: 450 return "TEXTURE13" 451 case 0x84ce: 452 return "TEXTURE14" 453 case 0x84cf: 454 return "TEXTURE15" 455 case 0x84d0: 456 return "TEXTURE16" 457 case 0x84d1: 458 return "TEXTURE17" 459 case 0x84d2: 460 return "TEXTURE18" 461 case 0x84d3: 462 return "TEXTURE19" 463 case 0x84d4: 464 return "TEXTURE20" 465 case 0x84d5: 466 return "TEXTURE21" 467 case 0x84d6: 468 return "TEXTURE22" 469 case 0x84d7: 470 return "TEXTURE23" 471 case 0x84d8: 472 return "TEXTURE24" 473 case 0x84d9: 474 return "TEXTURE25" 475 case 0x84da: 476 return "TEXTURE26" 477 case 0x84db: 478 return "TEXTURE27" 479 case 0x84dc: 480 return "TEXTURE28" 481 case 0x84dd: 482 return "TEXTURE29" 483 case 0x84de: 484 return "TEXTURE30" 485 case 0x84df: 486 return "TEXTURE31" 487 case 0x84e0: 488 return "ACTIVE_TEXTURE" 489 case 0x2901: 490 return "REPEAT" 491 case 0x812f: 492 return "CLAMP_TO_EDGE" 493 case 0x8370: 494 return "MIRRORED_REPEAT" 495 case 0x8622: 496 return "VERTEX_ATTRIB_ARRAY_ENABLED" 497 case 0x8623: 498 return "VERTEX_ATTRIB_ARRAY_SIZE" 499 case 0x8624: 500 return "VERTEX_ATTRIB_ARRAY_STRIDE" 501 case 0x8625: 502 return "VERTEX_ATTRIB_ARRAY_TYPE" 503 case 0x886a: 504 return "VERTEX_ATTRIB_ARRAY_NORMALIZED" 505 case 0x8645: 506 return "VERTEX_ATTRIB_ARRAY_POINTER" 507 case 0x889f: 508 return "VERTEX_ATTRIB_ARRAY_BUFFER_BINDING" 509 case 0x8b9a: 510 return "IMPLEMENTATION_COLOR_READ_TYPE" 511 case 0x8b9b: 512 return "IMPLEMENTATION_COLOR_READ_FORMAT" 513 case 0x8b81: 514 return "COMPILE_STATUS" 515 case 0x8b84: 516 return "INFO_LOG_LENGTH" 517 case 0x8b88: 518 return "SHADER_SOURCE_LENGTH" 519 case 0x8dfa: 520 return "SHADER_COMPILER" 521 case 0x8df8: 522 return "SHADER_BINARY_FORMATS" 523 case 0x8df9: 524 return "NUM_SHADER_BINARY_FORMATS" 525 case 0x8df0: 526 return "LOW_FLOAT" 527 case 0x8df1: 528 return "MEDIUM_FLOAT" 529 case 0x8df2: 530 return "HIGH_FLOAT" 531 case 0x8df3: 532 return "LOW_INT" 533 case 0x8df4: 534 return "MEDIUM_INT" 535 case 0x8df5: 536 return "HIGH_INT" 537 case 0x8d40: 538 return "FRAMEBUFFER" 539 case 0x8d41: 540 return "RENDERBUFFER" 541 case 0x8056: 542 return "RGBA4" 543 case 0x8057: 544 return "RGB5_A1" 545 case 0x8d62: 546 return "RGB565" 547 case 0x81a5: 548 return "DEPTH_COMPONENT16" 549 case 0x8d48: 550 return "STENCIL_INDEX8" 551 case 0x8d42: 552 return "RENDERBUFFER_WIDTH" 553 case 0x8d43: 554 return "RENDERBUFFER_HEIGHT" 555 case 0x8d44: 556 return "RENDERBUFFER_INTERNAL_FORMAT" 557 case 0x8d50: 558 return "RENDERBUFFER_RED_SIZE" 559 case 0x8d51: 560 return "RENDERBUFFER_GREEN_SIZE" 561 case 0x8d52: 562 return "RENDERBUFFER_BLUE_SIZE" 563 case 0x8d53: 564 return "RENDERBUFFER_ALPHA_SIZE" 565 case 0x8d54: 566 return "RENDERBUFFER_DEPTH_SIZE" 567 case 0x8d55: 568 return "RENDERBUFFER_STENCIL_SIZE" 569 case 0x8cd0: 570 return "FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE" 571 case 0x8cd1: 572 return "FRAMEBUFFER_ATTACHMENT_OBJECT_NAME" 573 case 0x8cd2: 574 return "FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL" 575 case 0x8cd3: 576 return "FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE" 577 case 0x8ce0: 578 return "COLOR_ATTACHMENT0" 579 case 0x8d00: 580 return "DEPTH_ATTACHMENT" 581 case 0x8d20: 582 return "STENCIL_ATTACHMENT" 583 case 0x8cd5: 584 return "FRAMEBUFFER_COMPLETE" 585 case 0x8cd6: 586 return "FRAMEBUFFER_INCOMPLETE_ATTACHMENT" 587 case 0x8cd7: 588 return "FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT" 589 case 0x8cd9: 590 return "FRAMEBUFFER_INCOMPLETE_DIMENSIONS" 591 case 0x8cdd: 592 return "FRAMEBUFFER_UNSUPPORTED" 593 case 0x8ca6: 594 return "36006" 595 case 0x8ca7: 596 return "RENDERBUFFER_BINDING" 597 case 0x84e8: 598 return "MAX_RENDERBUFFER_SIZE" 599 case 0x506: 600 return "INVALID_FRAMEBUFFER_OPERATION" 601 case 0x100: 602 return "DEPTH_BUFFER_BIT" 603 case 0x400: 604 return "STENCIL_BUFFER_BIT" 605 case 0x4000: 606 return "COLOR_BUFFER_BIT" 607 case 0x8b50: 608 return "FLOAT_VEC2" 609 case 0x8b51: 610 return "FLOAT_VEC3" 611 case 0x8b52: 612 return "FLOAT_VEC4" 613 case 0x8b53: 614 return "INT_VEC2" 615 case 0x8b54: 616 return "INT_VEC3" 617 case 0x8b55: 618 return "INT_VEC4" 619 case 0x8b56: 620 return "BOOL" 621 case 0x8b57: 622 return "BOOL_VEC2" 623 case 0x8b58: 624 return "BOOL_VEC3" 625 case 0x8b59: 626 return "BOOL_VEC4" 627 case 0x8b5a: 628 return "FLOAT_MAT2" 629 case 0x8b5b: 630 return "FLOAT_MAT3" 631 case 0x8b5c: 632 return "FLOAT_MAT4" 633 case 0x8b5e: 634 return "SAMPLER_2D" 635 case 0x8b60: 636 return "SAMPLER_CUBE" 637 case 0x8b30: 638 return "FRAGMENT_SHADER" 639 case 0x8b31: 640 return "VERTEX_SHADER" 641 case 0x8a35: 642 return "ACTIVE_UNIFORM_BLOCK_MAX_NAME_LENGTH" 643 case 0x8a36: 644 return "ACTIVE_UNIFORM_BLOCKS" 645 case 0x911a: 646 return "ALREADY_SIGNALED" 647 case 0x8c2f: 648 return "ANY_SAMPLES_PASSED" 649 case 0x8d6a: 650 return "ANY_SAMPLES_PASSED_CONSERVATIVE" 651 case 0x1905: 652 return "BLUE" 653 case 0x911f: 654 return "BUFFER_ACCESS_FLAGS" 655 case 0x9120: 656 return "BUFFER_MAP_LENGTH" 657 case 0x9121: 658 return "BUFFER_MAP_OFFSET" 659 case 0x88bc: 660 return "BUFFER_MAPPED" 661 case 0x88bd: 662 return "BUFFER_MAP_POINTER" 663 case 0x1800: 664 return "COLOR" 665 case 0x8cea: 666 return "COLOR_ATTACHMENT10" 667 case 0x8ce1: 668 return "COLOR_ATTACHMENT1" 669 case 0x8ceb: 670 return "COLOR_ATTACHMENT11" 671 case 0x8cec: 672 return "COLOR_ATTACHMENT12" 673 case 0x8ced: 674 return "COLOR_ATTACHMENT13" 675 case 0x8cee: 676 return "COLOR_ATTACHMENT14" 677 case 0x8cef: 678 return "COLOR_ATTACHMENT15" 679 case 0x8ce2: 680 return "COLOR_ATTACHMENT2" 681 case 0x8ce3: 682 return "COLOR_ATTACHMENT3" 683 case 0x8ce4: 684 return "COLOR_ATTACHMENT4" 685 case 0x8ce5: 686 return "COLOR_ATTACHMENT5" 687 case 0x8ce6: 688 return "COLOR_ATTACHMENT6" 689 case 0x8ce7: 690 return "COLOR_ATTACHMENT7" 691 case 0x8ce8: 692 return "COLOR_ATTACHMENT8" 693 case 0x8ce9: 694 return "COLOR_ATTACHMENT9" 695 case 0x884e: 696 return "COMPARE_REF_TO_TEXTURE" 697 case 0x9270: 698 return "COMPRESSED_R11_EAC" 699 case 0x9272: 700 return "COMPRESSED_RG11_EAC" 701 case 0x9274: 702 return "COMPRESSED_RGB8_ETC2" 703 case 0x9276: 704 return "COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2" 705 case 0x9278: 706 return "COMPRESSED_RGBA8_ETC2_EAC" 707 case 0x9271: 708 return "COMPRESSED_SIGNED_R11_EAC" 709 case 0x9273: 710 return "COMPRESSED_SIGNED_RG11_EAC" 711 case 0x9279: 712 return "COMPRESSED_SRGB8_ALPHA8_ETC2_EAC" 713 case 0x9275: 714 return "COMPRESSED_SRGB8_ETC2" 715 case 0x9277: 716 return "COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2" 717 case 0x911c: 718 return "CONDITION_SATISFIED" 719 case 0x8f36: 720 return "36662" 721 case 0x8f37: 722 return "36663" 723 case 0x8865: 724 return "CURRENT_QUERY" 725 case 0x1801: 726 return "DEPTH" 727 case 0x88f0: 728 return "DEPTH24_STENCIL8" 729 case 0x8cad: 730 return "DEPTH32F_STENCIL8" 731 case 0x81a6: 732 return "DEPTH_COMPONENT24" 733 case 0x8cac: 734 return "DEPTH_COMPONENT32F" 735 case 0x84f9: 736 return "DEPTH_STENCIL" 737 case 0x821a: 738 return "DEPTH_STENCIL_ATTACHMENT" 739 case 0x8825: 740 return "DRAW_BUFFER0" 741 case 0x882f: 742 return "DRAW_BUFFER10" 743 case 0x8826: 744 return "DRAW_BUFFER1" 745 case 0x8830: 746 return "DRAW_BUFFER11" 747 case 0x8831: 748 return "DRAW_BUFFER12" 749 case 0x8832: 750 return "DRAW_BUFFER13" 751 case 0x8833: 752 return "DRAW_BUFFER14" 753 case 0x8834: 754 return "DRAW_BUFFER15" 755 case 0x8827: 756 return "DRAW_BUFFER2" 757 case 0x8828: 758 return "DRAW_BUFFER3" 759 case 0x8829: 760 return "DRAW_BUFFER4" 761 case 0x882a: 762 return "DRAW_BUFFER5" 763 case 0x882b: 764 return "DRAW_BUFFER6" 765 case 0x882c: 766 return "DRAW_BUFFER7" 767 case 0x882d: 768 return "DRAW_BUFFER8" 769 case 0x882e: 770 return "DRAW_BUFFER9" 771 case 0x8ca9: 772 return "DRAW_FRAMEBUFFER" 773 case 0x88ea: 774 return "DYNAMIC_COPY" 775 case 0x88e9: 776 return "DYNAMIC_READ" 777 case 0x8dad: 778 return "FLOAT_32_UNSIGNED_INT_24_8_REV" 779 case 0x8b65: 780 return "FLOAT_MAT2x3" 781 case 0x8b66: 782 return "FLOAT_MAT2x4" 783 case 0x8b67: 784 return "FLOAT_MAT3x2" 785 case 0x8b68: 786 return "FLOAT_MAT3x4" 787 case 0x8b69: 788 return "FLOAT_MAT4x2" 789 case 0x8b6a: 790 return "FLOAT_MAT4x3" 791 case 0x8b8b: 792 return "FRAGMENT_SHADER_DERIVATIVE_HINT" 793 case 0x8215: 794 return "FRAMEBUFFER_ATTACHMENT_ALPHA_SIZE" 795 case 0x8214: 796 return "FRAMEBUFFER_ATTACHMENT_BLUE_SIZE" 797 case 0x8210: 798 return "FRAMEBUFFER_ATTACHMENT_COLOR_ENCODING" 799 case 0x8211: 800 return "FRAMEBUFFER_ATTACHMENT_COMPONENT_TYPE" 801 case 0x8216: 802 return "FRAMEBUFFER_ATTACHMENT_DEPTH_SIZE" 803 case 0x8213: 804 return "FRAMEBUFFER_ATTACHMENT_GREEN_SIZE" 805 case 0x8212: 806 return "FRAMEBUFFER_ATTACHMENT_RED_SIZE" 807 case 0x8217: 808 return "FRAMEBUFFER_ATTACHMENT_STENCIL_SIZE" 809 case 0x8cd4: 810 return "FRAMEBUFFER_ATTACHMENT_TEXTURE_LAYER" 811 case 0x8218: 812 return "FRAMEBUFFER_DEFAULT" 813 case 0x8d56: 814 return "FRAMEBUFFER_INCOMPLETE_MULTISAMPLE" 815 case 0x8219: 816 return "FRAMEBUFFER_UNDEFINED" 817 case 0x1904: 818 return "GREEN" 819 case 0x140b: 820 return "HALF_FLOAT" 821 case 0x8d9f: 822 return "INT_2_10_10_10_REV" 823 case 0x8c8c: 824 return "INTERLEAVED_ATTRIBS" 825 case 0x8dca: 826 return "INT_SAMPLER_2D" 827 case 0x8dcf: 828 return "INT_SAMPLER_2D_ARRAY" 829 case 0x8dcb: 830 return "INT_SAMPLER_3D" 831 case 0x8dcc: 832 return "INT_SAMPLER_CUBE" 833 case 0xffffffff: 834 return "INVALID_INDEX" 835 case 0x821b: 836 return "MAJOR_VERSION" 837 case 0x10: 838 return "MAP_FLUSH_EXPLICIT_BIT" 839 case 0x8: 840 return "MAP_INVALIDATE_BUFFER_BIT" 841 case 0x20: 842 return "MAP_UNSYNCHRONIZED_BIT" 843 case 0x8008: 844 return "MAX" 845 case 0x8073: 846 return "MAX_3D_TEXTURE_SIZE" 847 case 0x88ff: 848 return "MAX_ARRAY_TEXTURE_LAYERS" 849 case 0x8cdf: 850 return "MAX_COLOR_ATTACHMENTS" 851 case 0x8a33: 852 return "MAX_COMBINED_FRAGMENT_UNIFORM_COMPONENTS" 853 case 0x8a2e: 854 return "MAX_COMBINED_UNIFORM_BLOCKS" 855 case 0x8a31: 856 return "MAX_COMBINED_VERTEX_UNIFORM_COMPONENTS" 857 case 0x8824: 858 return "MAX_DRAW_BUFFERS" 859 case 0x8d6b: 860 return "MAX_ELEMENT_INDEX" 861 case 0x80e9: 862 return "MAX_ELEMENTS_INDICES" 863 case 0x80e8: 864 return "MAX_ELEMENTS_VERTICES" 865 case 0x9125: 866 return "MAX_FRAGMENT_INPUT_COMPONENTS" 867 case 0x8a2d: 868 return "MAX_FRAGMENT_UNIFORM_BLOCKS" 869 case 0x8b49: 870 return "MAX_FRAGMENT_UNIFORM_COMPONENTS" 871 case 0x8905: 872 return "MAX_PROGRAM_TEXEL_OFFSET" 873 case 0x8d57: 874 return "MAX_SAMPLES" 875 case 0x9111: 876 return "MAX_SERVER_WAIT_TIMEOUT" 877 case 0x84fd: 878 return "MAX_TEXTURE_LOD_BIAS" 879 case 0x8c8a: 880 return "MAX_TRANSFORM_FEEDBACK_INTERLEAVED_COMPONENTS" 881 case 0x8c8b: 882 return "MAX_TRANSFORM_FEEDBACK_SEPARATE_ATTRIBS" 883 case 0x8c80: 884 return "MAX_TRANSFORM_FEEDBACK_SEPARATE_COMPONENTS" 885 case 0x8a30: 886 return "MAX_UNIFORM_BLOCK_SIZE" 887 case 0x8a2f: 888 return "MAX_UNIFORM_BUFFER_BINDINGS" 889 case 0x8b4b: 890 return "MAX_VARYING_COMPONENTS" 891 case 0x9122: 892 return "MAX_VERTEX_OUTPUT_COMPONENTS" 893 case 0x8a2b: 894 return "MAX_VERTEX_UNIFORM_BLOCKS" 895 case 0x8b4a: 896 return "MAX_VERTEX_UNIFORM_COMPONENTS" 897 case 0x8007: 898 return "MIN" 899 case 0x821c: 900 return "MINOR_VERSION" 901 case 0x8904: 902 return "MIN_PROGRAM_TEXEL_OFFSET" 903 case 0x821d: 904 return "NUM_EXTENSIONS" 905 case 0x87fe: 906 return "NUM_PROGRAM_BINARY_FORMATS" 907 case 0x9380: 908 return "NUM_SAMPLE_COUNTS" 909 case 0x9112: 910 return "OBJECT_TYPE" 911 case 0xd02: 912 return "PACK_ROW_LENGTH" 913 case 0xd04: 914 return "PACK_SKIP_PIXELS" 915 case 0xd03: 916 return "PACK_SKIP_ROWS" 917 case 0x88eb: 918 return "PIXEL_PACK_BUFFER" 919 case 0x88ed: 920 return "PIXEL_PACK_BUFFER_BINDING" 921 case 0x88ec: 922 return "PIXEL_UNPACK_BUFFER" 923 case 0x88ef: 924 return "PIXEL_UNPACK_BUFFER_BINDING" 925 case 0x8d69: 926 return "PRIMITIVE_RESTART_FIXED_INDEX" 927 case 0x87ff: 928 return "PROGRAM_BINARY_FORMATS" 929 case 0x8741: 930 return "PROGRAM_BINARY_LENGTH" 931 case 0x8257: 932 return "PROGRAM_BINARY_RETRIEVABLE_HINT" 933 case 0x8866: 934 return "QUERY_RESULT" 935 case 0x8867: 936 return "QUERY_RESULT_AVAILABLE" 937 case 0x8c3a: 938 return "R11F_G11F_B10F" 939 case 0x822d: 940 return "R16F" 941 case 0x8233: 942 return "R16I" 943 case 0x8234: 944 return "R16UI" 945 case 0x822e: 946 return "R32F" 947 case 0x8235: 948 return "R32I" 949 case 0x8236: 950 return "R32UI" 951 case 0x8229: 952 return "R8" 953 case 0x8231: 954 return "R8I" 955 case 0x8f94: 956 return "R8_SNORM" 957 case 0x8232: 958 return "R8UI" 959 case 0x8c89: 960 return "RASTERIZER_DISCARD" 961 case 0xc02: 962 return "READ_BUFFER" 963 case 0x8ca8: 964 return "READ_FRAMEBUFFER" 965 case 0x8caa: 966 return "READ_FRAMEBUFFER_BINDING" 967 case 0x1903: 968 return "RED" 969 case 0x8d94: 970 return "RED_INTEGER" 971 case 0x8cab: 972 return "RENDERBUFFER_SAMPLES" 973 case 0x8227: 974 return "RG" 975 case 0x822f: 976 return "RG16F" 977 case 0x8239: 978 return "RG16I" 979 case 0x823a: 980 return "RG16UI" 981 case 0x8230: 982 return "RG32F" 983 case 0x823b: 984 return "RG32I" 985 case 0x823c: 986 return "RG32UI" 987 case 0x822b: 988 return "RG8" 989 case 0x8237: 990 return "RG8I" 991 case 0x8f95: 992 return "RG8_SNORM" 993 case 0x8238: 994 return "RG8UI" 995 case 0x8059: 996 return "RGB10_A2" 997 case 0x906f: 998 return "RGB10_A2UI" 999 case 0x881b: 1000 return "RGB16F" 1001 case 0x8d89: 1002 return "RGB16I" 1003 case 0x8d77: 1004 return "RGB16UI" 1005 case 0x8815: 1006 return "RGB32F" 1007 case 0x8d83: 1008 return "RGB32I" 1009 case 0x8d71: 1010 return "RGB32UI" 1011 case 0x8051: 1012 return "RGB8" 1013 case 0x8d8f: 1014 return "RGB8I" 1015 case 0x8f96: 1016 return "RGB8_SNORM" 1017 case 0x8d7d: 1018 return "RGB8UI" 1019 case 0x8c3d: 1020 return "RGB9_E5" 1021 case 0x881a: 1022 return "RGBA16F" 1023 case 0x8d88: 1024 return "RGBA16I" 1025 case 0x8d76: 1026 return "RGBA16UI" 1027 case 0x8814: 1028 return "RGBA32F" 1029 case 0x8d82: 1030 return "RGBA32I" 1031 case 0x8d70: 1032 return "RGBA32UI" 1033 case 0x8058: 1034 return "RGBA8" 1035 case 0x8d8e: 1036 return "RGBA8I" 1037 case 0x8f97: 1038 return "RGBA8_SNORM" 1039 case 0x8d7c: 1040 return "RGBA8UI" 1041 case 0x8d99: 1042 return "RGBA_INTEGER" 1043 case 0x8d98: 1044 return "RGB_INTEGER" 1045 case 0x8228: 1046 return "RG_INTEGER" 1047 case 0x8dc1: 1048 return "SAMPLER_2D_ARRAY" 1049 case 0x8dc4: 1050 return "SAMPLER_2D_ARRAY_SHADOW" 1051 case 0x8b62: 1052 return "SAMPLER_2D_SHADOW" 1053 case 0x8b5f: 1054 return "SAMPLER_3D" 1055 case 0x8919: 1056 return "SAMPLER_BINDING" 1057 case 0x8dc5: 1058 return "SAMPLER_CUBE_SHADOW" 1059 case 0x8c8d: 1060 return "SEPARATE_ATTRIBS" 1061 case 0x9119: 1062 return "SIGNALED" 1063 case 0x8f9c: 1064 return "SIGNED_NORMALIZED" 1065 case 0x8c40: 1066 return "SRGB" 1067 case 0x8c41: 1068 return "SRGB8" 1069 case 0x8c43: 1070 return "SRGB8_ALPHA8" 1071 case 0x88e6: 1072 return "STATIC_COPY" 1073 case 0x88e5: 1074 return "STATIC_READ" 1075 case 0x1802: 1076 return "STENCIL" 1077 case 0x88e2: 1078 return "STREAM_COPY" 1079 case 0x88e1: 1080 return "STREAM_READ" 1081 case 0x9113: 1082 return "SYNC_CONDITION" 1083 case 0x9116: 1084 return "SYNC_FENCE" 1085 case 0x9115: 1086 return "SYNC_FLAGS" 1087 case 0x9117: 1088 return "SYNC_GPU_COMMANDS_COMPLETE" 1089 case 0x9114: 1090 return "SYNC_STATUS" 1091 case 0x8c1a: 1092 return "TEXTURE_2D_ARRAY" 1093 case 0x806f: 1094 return "TEXTURE_3D" 1095 case 0x813c: 1096 return "TEXTURE_BASE_LEVEL" 1097 case 0x8c1d: 1098 return "TEXTURE_BINDING_2D_ARRAY" 1099 case 0x806a: 1100 return "TEXTURE_BINDING_3D" 1101 case 0x884d: 1102 return "TEXTURE_COMPARE_FUNC" 1103 case 0x884c: 1104 return "TEXTURE_COMPARE_MODE" 1105 case 0x912f: 1106 return "TEXTURE_IMMUTABLE_FORMAT" 1107 case 0x82df: 1108 return "TEXTURE_IMMUTABLE_LEVELS" 1109 case 0x813d: 1110 return "TEXTURE_MAX_LEVEL" 1111 case 0x813b: 1112 return "TEXTURE_MAX_LOD" 1113 case 0x813a: 1114 return "TEXTURE_MIN_LOD" 1115 case 0x8e45: 1116 return "TEXTURE_SWIZZLE_A" 1117 case 0x8e44: 1118 return "TEXTURE_SWIZZLE_B" 1119 case 0x8e43: 1120 return "TEXTURE_SWIZZLE_G" 1121 case 0x8e42: 1122 return "TEXTURE_SWIZZLE_R" 1123 case 0x8072: 1124 return "TEXTURE_WRAP_R" 1125 case 0x911b: 1126 return "TIMEOUT_EXPIRED" 1127 case 0x8e22: 1128 return "TRANSFORM_FEEDBACK" 1129 case 0x8e24: 1130 return "TRANSFORM_FEEDBACK_ACTIVE" 1131 case 0x8e25: 1132 return "TRANSFORM_FEEDBACK_BINDING" 1133 case 0x8c8e: 1134 return "TRANSFORM_FEEDBACK_BUFFER" 1135 case 0x8c8f: 1136 return "TRANSFORM_FEEDBACK_BUFFER_BINDING" 1137 case 0x8c7f: 1138 return "TRANSFORM_FEEDBACK_BUFFER_MODE" 1139 case 0x8c85: 1140 return "TRANSFORM_FEEDBACK_BUFFER_SIZE" 1141 case 0x8c84: 1142 return "TRANSFORM_FEEDBACK_BUFFER_START" 1143 case 0x8e23: 1144 return "TRANSFORM_FEEDBACK_PAUSED" 1145 case 0x8c88: 1146 return "TRANSFORM_FEEDBACK_PRIMITIVES_WRITTEN" 1147 case 0x8c76: 1148 return "TRANSFORM_FEEDBACK_VARYING_MAX_LENGTH" 1149 case 0x8c83: 1150 return "TRANSFORM_FEEDBACK_VARYINGS" 1151 case 0x8a3c: 1152 return "UNIFORM_ARRAY_STRIDE" 1153 case 0x8a43: 1154 return "UNIFORM_BLOCK_ACTIVE_UNIFORM_INDICES" 1155 case 0x8a42: 1156 return "UNIFORM_BLOCK_ACTIVE_UNIFORMS" 1157 case 0x8a3f: 1158 return "UNIFORM_BLOCK_BINDING" 1159 case 0x8a40: 1160 return "UNIFORM_BLOCK_DATA_SIZE" 1161 case 0x8a3a: 1162 return "UNIFORM_BLOCK_INDEX" 1163 case 0x8a41: 1164 return "UNIFORM_BLOCK_NAME_LENGTH" 1165 case 0x8a46: 1166 return "UNIFORM_BLOCK_REFERENCED_BY_FRAGMENT_SHADER" 1167 case 0x8a44: 1168 return "UNIFORM_BLOCK_REFERENCED_BY_VERTEX_SHADER" 1169 case 0x8a11: 1170 return "UNIFORM_BUFFER" 1171 case 0x8a28: 1172 return "UNIFORM_BUFFER_BINDING" 1173 case 0x8a34: 1174 return "UNIFORM_BUFFER_OFFSET_ALIGNMENT" 1175 case 0x8a2a: 1176 return "UNIFORM_BUFFER_SIZE" 1177 case 0x8a29: 1178 return "UNIFORM_BUFFER_START" 1179 case 0x8a3e: 1180 return "UNIFORM_IS_ROW_MAJOR" 1181 case 0x8a3d: 1182 return "UNIFORM_MATRIX_STRIDE" 1183 case 0x8a39: 1184 return "UNIFORM_NAME_LENGTH" 1185 case 0x8a3b: 1186 return "UNIFORM_OFFSET" 1187 case 0x8a38: 1188 return "UNIFORM_SIZE" 1189 case 0x8a37: 1190 return "UNIFORM_TYPE" 1191 case 0x806e: 1192 return "UNPACK_IMAGE_HEIGHT" 1193 case 0xcf2: 1194 return "UNPACK_ROW_LENGTH" 1195 case 0x806d: 1196 return "UNPACK_SKIP_IMAGES" 1197 case 0xcf4: 1198 return "UNPACK_SKIP_PIXELS" 1199 case 0xcf3: 1200 return "UNPACK_SKIP_ROWS" 1201 case 0x9118: 1202 return "UNSIGNALED" 1203 case 0x8c3b: 1204 return "UNSIGNED_INT_10F_11F_11F_REV" 1205 case 0x8368: 1206 return "UNSIGNED_INT_2_10_10_10_REV" 1207 case 0x84fa: 1208 return "UNSIGNED_INT_24_8" 1209 case 0x8c3e: 1210 return "UNSIGNED_INT_5_9_9_9_REV" 1211 case 0x8dd2: 1212 return "UNSIGNED_INT_SAMPLER_2D" 1213 case 0x8dd7: 1214 return "UNSIGNED_INT_SAMPLER_2D_ARRAY" 1215 case 0x8dd3: 1216 return "UNSIGNED_INT_SAMPLER_3D" 1217 case 0x8dd4: 1218 return "UNSIGNED_INT_SAMPLER_CUBE" 1219 case 0x8dc6: 1220 return "UNSIGNED_INT_VEC2" 1221 case 0x8dc7: 1222 return "UNSIGNED_INT_VEC3" 1223 case 0x8dc8: 1224 return "UNSIGNED_INT_VEC4" 1225 case 0x8c17: 1226 return "UNSIGNED_NORMALIZED" 1227 case 0x85b5: 1228 return "VERTEX_ARRAY_BINDING" 1229 case 0x88fe: 1230 return "VERTEX_ATTRIB_ARRAY_DIVISOR" 1231 case 0x88fd: 1232 return "VERTEX_ATTRIB_ARRAY_INTEGER" 1233 case 0x911d: 1234 return "WAIT_FAILED" 1235 default: 1236 return fmt.Sprintf("gl.Enum(0x%x)", uint32(v)) 1237 } 1238 } 1239 1240 func (ctx *context) ActiveTexture(texture Enum) { 1241 defer func() { 1242 errstr := ctx.errDrain() 1243 log.Printf("gl.ActiveTexture(%v) %v", texture, errstr) 1244 }() 1245 ctx.enqueueDebug(call{ 1246 args: fnargs{ 1247 fn: glfnActiveTexture, 1248 a0: texture.c(), 1249 }, 1250 blocking: true}) 1251 } 1252 1253 func (ctx *context) AttachShader(p Program, s Shader) { 1254 defer func() { 1255 errstr := ctx.errDrain() 1256 log.Printf("gl.AttachShader(%v, %v) %v", p, s, errstr) 1257 }() 1258 ctx.enqueueDebug(call{ 1259 args: fnargs{ 1260 fn: glfnAttachShader, 1261 a0: p.c(), 1262 a1: s.c(), 1263 }, 1264 blocking: true}) 1265 } 1266 1267 func (ctx *context) BindAttribLocation(p Program, a Attrib, name string) { 1268 defer func() { 1269 errstr := ctx.errDrain() 1270 log.Printf("gl.BindAttribLocation(%v, %v, %v) %v", p, a, name, errstr) 1271 }() 1272 s, free := ctx.cString(name) 1273 defer free() 1274 ctx.enqueueDebug(call{ 1275 args: fnargs{ 1276 fn: glfnBindAttribLocation, 1277 a0: p.c(), 1278 a1: a.c(), 1279 a2: s, 1280 }, 1281 blocking: true, 1282 }) 1283 } 1284 1285 func (ctx *context) BindBuffer(target Enum, b Buffer) { 1286 defer func() { 1287 errstr := ctx.errDrain() 1288 log.Printf("gl.BindBuffer(%v, %v) %v", target, b, errstr) 1289 }() 1290 ctx.enqueueDebug(call{ 1291 args: fnargs{ 1292 fn: glfnBindBuffer, 1293 a0: target.c(), 1294 a1: b.c(), 1295 }, 1296 blocking: true}) 1297 } 1298 1299 func (ctx *context) BindFramebuffer(target Enum, fb Framebuffer) { 1300 defer func() { 1301 errstr := ctx.errDrain() 1302 log.Printf("gl.BindFramebuffer(%v, %v) %v", target, fb, errstr) 1303 }() 1304 ctx.enqueueDebug(call{ 1305 args: fnargs{ 1306 fn: glfnBindFramebuffer, 1307 a0: target.c(), 1308 a1: fb.c(), 1309 }, 1310 blocking: true}) 1311 } 1312 1313 func (ctx *context) BindRenderbuffer(target Enum, rb Renderbuffer) { 1314 defer func() { 1315 errstr := ctx.errDrain() 1316 log.Printf("gl.BindRenderbuffer(%v, %v) %v", target, rb, errstr) 1317 }() 1318 ctx.enqueueDebug(call{ 1319 args: fnargs{ 1320 fn: glfnBindRenderbuffer, 1321 a0: target.c(), 1322 a1: rb.c(), 1323 }, 1324 blocking: true}) 1325 } 1326 1327 func (ctx *context) BindTexture(target Enum, t Texture) { 1328 defer func() { 1329 errstr := ctx.errDrain() 1330 log.Printf("gl.BindTexture(%v, %v) %v", target, t, errstr) 1331 }() 1332 ctx.enqueueDebug(call{ 1333 args: fnargs{ 1334 fn: glfnBindTexture, 1335 a0: target.c(), 1336 a1: t.c(), 1337 }, 1338 blocking: true}) 1339 } 1340 1341 func (ctx *context) BindVertexArray(va VertexArray) { 1342 defer func() { 1343 errstr := ctx.errDrain() 1344 log.Printf("gl.BindVertexArray(%v) %v", va, errstr) 1345 }() 1346 ctx.enqueueDebug(call{ 1347 args: fnargs{ 1348 fn: glfnBindVertexArray, 1349 a0: va.c(), 1350 }, 1351 blocking: true}) 1352 } 1353 1354 func (ctx *context) BlendColor(red, green, blue, alpha float32) { 1355 defer func() { 1356 errstr := ctx.errDrain() 1357 log.Printf("gl.BlendColor(%v, %v, %v, %v) %v", red, green, blue, alpha, errstr) 1358 }() 1359 ctx.enqueueDebug(call{ 1360 args: fnargs{ 1361 fn: glfnBlendColor, 1362 a0: uintptr(math.Float32bits(red)), 1363 a1: uintptr(math.Float32bits(green)), 1364 a2: uintptr(math.Float32bits(blue)), 1365 a3: uintptr(math.Float32bits(alpha)), 1366 }, 1367 blocking: true}) 1368 } 1369 1370 func (ctx *context) BlendEquation(mode Enum) { 1371 defer func() { 1372 errstr := ctx.errDrain() 1373 log.Printf("gl.BlendEquation(%v) %v", mode, errstr) 1374 }() 1375 ctx.enqueueDebug(call{ 1376 args: fnargs{ 1377 fn: glfnBlendEquation, 1378 a0: mode.c(), 1379 }, 1380 blocking: true}) 1381 } 1382 1383 func (ctx *context) BlendEquationSeparate(modeRGB, modeAlpha Enum) { 1384 defer func() { 1385 errstr := ctx.errDrain() 1386 log.Printf("gl.BlendEquationSeparate(%v, %v) %v", modeRGB, modeAlpha, errstr) 1387 }() 1388 ctx.enqueueDebug(call{ 1389 args: fnargs{ 1390 fn: glfnBlendEquationSeparate, 1391 a0: modeRGB.c(), 1392 a1: modeAlpha.c(), 1393 }, 1394 blocking: true}) 1395 } 1396 1397 func (ctx *context) BlendFunc(sfactor, dfactor Enum) { 1398 defer func() { 1399 errstr := ctx.errDrain() 1400 log.Printf("gl.BlendFunc(%v, %v) %v", sfactor, dfactor, errstr) 1401 }() 1402 ctx.enqueueDebug(call{ 1403 args: fnargs{ 1404 fn: glfnBlendFunc, 1405 a0: sfactor.c(), 1406 a1: dfactor.c(), 1407 }, 1408 blocking: true}) 1409 } 1410 1411 func (ctx *context) BlendFuncSeparate(sfactorRGB, dfactorRGB, sfactorAlpha, dfactorAlpha Enum) { 1412 defer func() { 1413 errstr := ctx.errDrain() 1414 log.Printf("gl.BlendFuncSeparate(%v, %v, %v, %v) %v", sfactorRGB, dfactorRGB, sfactorAlpha, dfactorAlpha, errstr) 1415 }() 1416 ctx.enqueueDebug(call{ 1417 args: fnargs{ 1418 fn: glfnBlendFuncSeparate, 1419 a0: sfactorRGB.c(), 1420 a1: dfactorRGB.c(), 1421 a2: sfactorAlpha.c(), 1422 a3: dfactorAlpha.c(), 1423 }, 1424 blocking: true}) 1425 } 1426 1427 func (ctx *context) BufferData(target Enum, src []byte, usage Enum) { 1428 defer func() { 1429 errstr := ctx.errDrain() 1430 log.Printf("gl.BufferData(%v, len(%d), %v) %v", target, len(src), usage, errstr) 1431 }() 1432 parg := unsafe.Pointer(nil) 1433 if len(src) > 0 { 1434 parg = unsafe.Pointer(&src[0]) 1435 } 1436 ctx.enqueueDebug(call{ 1437 args: fnargs{ 1438 fn: glfnBufferData, 1439 a0: target.c(), 1440 a1: uintptr(len(src)), 1441 a2: usage.c(), 1442 }, 1443 parg: parg, 1444 blocking: true, 1445 }) 1446 } 1447 1448 func (ctx *context) BufferInit(target Enum, size int, usage Enum) { 1449 defer func() { 1450 errstr := ctx.errDrain() 1451 log.Printf("gl.BufferInit(%v, %v, %v) %v", target, size, usage, errstr) 1452 }() 1453 ctx.enqueueDebug(call{ 1454 args: fnargs{ 1455 fn: glfnBufferData, 1456 a0: target.c(), 1457 a1: uintptr(size), 1458 a2: usage.c(), 1459 }, 1460 parg: unsafe.Pointer(nil), 1461 blocking: true}) 1462 } 1463 1464 func (ctx *context) BufferSubData(target Enum, offset int, data []byte) { 1465 defer func() { 1466 errstr := ctx.errDrain() 1467 log.Printf("gl.BufferSubData(%v, %v, len(%d)) %v", target, offset, len(data), errstr) 1468 }() 1469 ctx.enqueueDebug(call{ 1470 args: fnargs{ 1471 fn: glfnBufferSubData, 1472 a0: target.c(), 1473 a1: uintptr(offset), 1474 a2: uintptr(len(data)), 1475 }, 1476 parg: unsafe.Pointer(&data[0]), 1477 blocking: true, 1478 }) 1479 } 1480 1481 func (ctx *context) CheckFramebufferStatus(target Enum) (r0 Enum) { 1482 defer func() { 1483 errstr := ctx.errDrain() 1484 log.Printf("gl.CheckFramebufferStatus(%v) %v%v", target, r0, errstr) 1485 }() 1486 return Enum(ctx.enqueue(call{ 1487 args: fnargs{ 1488 fn: glfnCheckFramebufferStatus, 1489 a0: target.c(), 1490 }, 1491 blocking: true, 1492 })) 1493 } 1494 1495 func (ctx *context) Clear(mask Enum) { 1496 defer func() { 1497 errstr := ctx.errDrain() 1498 log.Printf("gl.Clear(%v) %v", mask, errstr) 1499 }() 1500 ctx.enqueueDebug(call{ 1501 args: fnargs{ 1502 fn: glfnClear, 1503 a0: uintptr(mask), 1504 }, 1505 blocking: true}) 1506 } 1507 1508 func (ctx *context) ClearColor(red, green, blue, alpha float32) { 1509 defer func() { 1510 errstr := ctx.errDrain() 1511 log.Printf("gl.ClearColor(%v, %v, %v, %v) %v", red, green, blue, alpha, errstr) 1512 }() 1513 ctx.enqueueDebug(call{ 1514 args: fnargs{ 1515 fn: glfnClearColor, 1516 a0: uintptr(math.Float32bits(red)), 1517 a1: uintptr(math.Float32bits(green)), 1518 a2: uintptr(math.Float32bits(blue)), 1519 a3: uintptr(math.Float32bits(alpha)), 1520 }, 1521 blocking: true}) 1522 } 1523 1524 func (ctx *context) ClearDepthf(d float32) { 1525 defer func() { 1526 errstr := ctx.errDrain() 1527 log.Printf("gl.ClearDepthf(%v) %v", d, errstr) 1528 }() 1529 ctx.enqueueDebug(call{ 1530 args: fnargs{ 1531 fn: glfnClearDepthf, 1532 a0: uintptr(math.Float32bits(d)), 1533 }, 1534 blocking: true}) 1535 } 1536 1537 func (ctx *context) ClearStencil(s int) { 1538 defer func() { 1539 errstr := ctx.errDrain() 1540 log.Printf("gl.ClearStencil(%v) %v", s, errstr) 1541 }() 1542 ctx.enqueueDebug(call{ 1543 args: fnargs{ 1544 fn: glfnClearStencil, 1545 a0: uintptr(s), 1546 }, 1547 blocking: true}) 1548 } 1549 1550 func (ctx *context) ColorMask(red, green, blue, alpha bool) { 1551 defer func() { 1552 errstr := ctx.errDrain() 1553 log.Printf("gl.ColorMask(%v, %v, %v, %v) %v", red, green, blue, alpha, errstr) 1554 }() 1555 ctx.enqueueDebug(call{ 1556 args: fnargs{ 1557 fn: glfnColorMask, 1558 a0: glBoolean(red), 1559 a1: glBoolean(green), 1560 a2: glBoolean(blue), 1561 a3: glBoolean(alpha), 1562 }, 1563 blocking: true}) 1564 } 1565 1566 func (ctx *context) CompileShader(s Shader) { 1567 defer func() { 1568 errstr := ctx.errDrain() 1569 log.Printf("gl.CompileShader(%v) %v", s, errstr) 1570 }() 1571 ctx.enqueueDebug(call{ 1572 args: fnargs{ 1573 fn: glfnCompileShader, 1574 a0: s.c(), 1575 }, 1576 blocking: true}) 1577 } 1578 1579 func (ctx *context) CompressedTexImage2D(target Enum, level int, internalformat Enum, width, height, border int, data []byte) { 1580 defer func() { 1581 errstr := ctx.errDrain() 1582 log.Printf("gl.CompressedTexImage2D(%v, %v, %v, %v, %v, %v, len(%d)) %v", target, level, internalformat, width, height, border, len(data), errstr) 1583 }() 1584 ctx.enqueueDebug(call{ 1585 args: fnargs{ 1586 fn: glfnCompressedTexImage2D, 1587 a0: target.c(), 1588 a1: uintptr(level), 1589 a2: internalformat.c(), 1590 a3: uintptr(width), 1591 a4: uintptr(height), 1592 a5: uintptr(border), 1593 a6: uintptr(len(data)), 1594 }, 1595 parg: unsafe.Pointer(&data[0]), 1596 blocking: true, 1597 }) 1598 } 1599 1600 func (ctx *context) CompressedTexSubImage2D(target Enum, level, xoffset, yoffset, width, height int, format Enum, data []byte) { 1601 defer func() { 1602 errstr := ctx.errDrain() 1603 log.Printf("gl.CompressedTexSubImage2D(%v, %v, %v, %v, %v, %v, %v, len(%d)) %v", target, level, xoffset, yoffset, width, height, format, len(data), errstr) 1604 }() 1605 ctx.enqueueDebug(call{ 1606 args: fnargs{ 1607 fn: glfnCompressedTexSubImage2D, 1608 a0: target.c(), 1609 a1: uintptr(level), 1610 a2: uintptr(xoffset), 1611 a3: uintptr(yoffset), 1612 a4: uintptr(width), 1613 a5: uintptr(height), 1614 a6: format.c(), 1615 a7: uintptr(len(data)), 1616 }, 1617 parg: unsafe.Pointer(&data[0]), 1618 blocking: true, 1619 }) 1620 } 1621 1622 func (ctx *context) CopyTexImage2D(target Enum, level int, internalformat Enum, x, y, width, height, border int) { 1623 defer func() { 1624 errstr := ctx.errDrain() 1625 log.Printf("gl.CopyTexImage2D(%v, %v, %v, %v, %v, %v, %v, %v) %v", target, level, internalformat, x, y, width, height, border, errstr) 1626 }() 1627 ctx.enqueueDebug(call{ 1628 args: fnargs{ 1629 fn: glfnCopyTexImage2D, 1630 a0: target.c(), 1631 a1: uintptr(level), 1632 a2: internalformat.c(), 1633 a3: uintptr(x), 1634 a4: uintptr(y), 1635 a5: uintptr(width), 1636 a6: uintptr(height), 1637 a7: uintptr(border), 1638 }, 1639 blocking: true}) 1640 } 1641 1642 func (ctx *context) CopyTexSubImage2D(target Enum, level, xoffset, yoffset, x, y, width, height int) { 1643 defer func() { 1644 errstr := ctx.errDrain() 1645 log.Printf("gl.CopyTexSubImage2D(%v, %v, %v, %v, %v, %v, %v, %v) %v", target, level, xoffset, yoffset, x, y, width, height, errstr) 1646 }() 1647 ctx.enqueueDebug(call{ 1648 args: fnargs{ 1649 fn: glfnCopyTexSubImage2D, 1650 a0: target.c(), 1651 a1: uintptr(level), 1652 a2: uintptr(xoffset), 1653 a3: uintptr(yoffset), 1654 a4: uintptr(x), 1655 a5: uintptr(y), 1656 a6: uintptr(width), 1657 a7: uintptr(height), 1658 }, 1659 blocking: true}) 1660 } 1661 1662 func (ctx *context) CreateBuffer() (r0 Buffer) { 1663 defer func() { 1664 errstr := ctx.errDrain() 1665 log.Printf("gl.CreateBuffer() %v%v", r0, errstr) 1666 }() 1667 return Buffer{Value: uint32(ctx.enqueue(call{ 1668 args: fnargs{ 1669 fn: glfnGenBuffer, 1670 }, 1671 blocking: true, 1672 }))} 1673 } 1674 1675 func (ctx *context) CreateFramebuffer() (r0 Framebuffer) { 1676 defer func() { 1677 errstr := ctx.errDrain() 1678 log.Printf("gl.CreateFramebuffer() %v%v", r0, errstr) 1679 }() 1680 return Framebuffer{Value: uint32(ctx.enqueue(call{ 1681 args: fnargs{ 1682 fn: glfnGenFramebuffer, 1683 }, 1684 blocking: true, 1685 }))} 1686 } 1687 1688 func (ctx *context) CreateProgram() (r0 Program) { 1689 defer func() { 1690 errstr := ctx.errDrain() 1691 log.Printf("gl.CreateProgram() %v%v", r0, errstr) 1692 }() 1693 return Program{ 1694 Init: true, 1695 Value: uint32(ctx.enqueue(call{ 1696 args: fnargs{ 1697 fn: glfnCreateProgram, 1698 }, 1699 blocking: true, 1700 }, 1701 ))} 1702 } 1703 1704 func (ctx *context) CreateRenderbuffer() (r0 Renderbuffer) { 1705 defer func() { 1706 errstr := ctx.errDrain() 1707 log.Printf("gl.CreateRenderbuffer() %v%v", r0, errstr) 1708 }() 1709 return Renderbuffer{Value: uint32(ctx.enqueue(call{ 1710 args: fnargs{ 1711 fn: glfnGenRenderbuffer, 1712 }, 1713 blocking: true, 1714 }))} 1715 } 1716 1717 func (ctx *context) CreateShader(ty Enum) (r0 Shader) { 1718 defer func() { 1719 errstr := ctx.errDrain() 1720 log.Printf("gl.CreateShader(%v) %v%v", ty, r0, errstr) 1721 }() 1722 return Shader{Value: uint32(ctx.enqueue(call{ 1723 args: fnargs{ 1724 fn: glfnCreateShader, 1725 a0: uintptr(ty), 1726 }, 1727 blocking: true, 1728 }))} 1729 } 1730 1731 func (ctx *context) CreateTexture() (r0 Texture) { 1732 defer func() { 1733 errstr := ctx.errDrain() 1734 log.Printf("gl.CreateTexture() %v%v", r0, errstr) 1735 }() 1736 return Texture{Value: uint32(ctx.enqueue(call{ 1737 args: fnargs{ 1738 fn: glfnGenTexture, 1739 }, 1740 blocking: true, 1741 }))} 1742 } 1743 1744 func (ctx *context) CreateVertexArray() (r0 VertexArray) { 1745 defer func() { 1746 errstr := ctx.errDrain() 1747 log.Printf("gl.CreateVertexArray() %v%v", r0, errstr) 1748 }() 1749 return VertexArray{Value: uint32(ctx.enqueue(call{ 1750 args: fnargs{ 1751 fn: glfnGenVertexArray, 1752 }, 1753 blocking: true, 1754 }))} 1755 } 1756 1757 func (ctx *context) CullFace(mode Enum) { 1758 defer func() { 1759 errstr := ctx.errDrain() 1760 log.Printf("gl.CullFace(%v) %v", mode, errstr) 1761 }() 1762 ctx.enqueueDebug(call{ 1763 args: fnargs{ 1764 fn: glfnCullFace, 1765 a0: mode.c(), 1766 }, 1767 blocking: true}) 1768 } 1769 1770 func (ctx *context) DeleteBuffer(v Buffer) { 1771 defer func() { 1772 errstr := ctx.errDrain() 1773 log.Printf("gl.DeleteBuffer(%v) %v", v, errstr) 1774 }() 1775 ctx.enqueueDebug(call{ 1776 args: fnargs{ 1777 fn: glfnDeleteBuffer, 1778 a0: v.c(), 1779 }, 1780 blocking: true}) 1781 } 1782 1783 func (ctx *context) DeleteFramebuffer(v Framebuffer) { 1784 defer func() { 1785 errstr := ctx.errDrain() 1786 log.Printf("gl.DeleteFramebuffer(%v) %v", v, errstr) 1787 }() 1788 ctx.enqueueDebug(call{ 1789 args: fnargs{ 1790 fn: glfnDeleteFramebuffer, 1791 a0: v.c(), 1792 }, 1793 blocking: true}) 1794 } 1795 1796 func (ctx *context) DeleteProgram(p Program) { 1797 defer func() { 1798 errstr := ctx.errDrain() 1799 log.Printf("gl.DeleteProgram(%v) %v", p, errstr) 1800 }() 1801 ctx.enqueueDebug(call{ 1802 args: fnargs{ 1803 fn: glfnDeleteProgram, 1804 a0: p.c(), 1805 }, 1806 blocking: true}) 1807 } 1808 1809 func (ctx *context) DeleteRenderbuffer(v Renderbuffer) { 1810 defer func() { 1811 errstr := ctx.errDrain() 1812 log.Printf("gl.DeleteRenderbuffer(%v) %v", v, errstr) 1813 }() 1814 ctx.enqueueDebug(call{ 1815 args: fnargs{ 1816 fn: glfnDeleteRenderbuffer, 1817 a0: v.c(), 1818 }, 1819 blocking: true}) 1820 } 1821 1822 func (ctx *context) DeleteShader(s Shader) { 1823 defer func() { 1824 errstr := ctx.errDrain() 1825 log.Printf("gl.DeleteShader(%v) %v", s, errstr) 1826 }() 1827 ctx.enqueueDebug(call{ 1828 args: fnargs{ 1829 fn: glfnDeleteShader, 1830 a0: s.c(), 1831 }, 1832 blocking: true}) 1833 } 1834 1835 func (ctx *context) DeleteTexture(v Texture) { 1836 defer func() { 1837 errstr := ctx.errDrain() 1838 log.Printf("gl.DeleteTexture(%v) %v", v, errstr) 1839 }() 1840 ctx.enqueueDebug(call{ 1841 args: fnargs{ 1842 fn: glfnDeleteTexture, 1843 a0: v.c(), 1844 }, 1845 blocking: true}) 1846 } 1847 1848 func (ctx *context) DeleteVertexArray(v VertexArray) { 1849 defer func() { 1850 errstr := ctx.errDrain() 1851 log.Printf("gl.DeleteVertexArray(%v) %v", v, errstr) 1852 }() 1853 ctx.enqueueDebug(call{ 1854 args: fnargs{ 1855 fn: glfnDeleteVertexArray, 1856 a0: v.c(), 1857 }, 1858 blocking: true}) 1859 } 1860 1861 func (ctx *context) DepthFunc(fn Enum) { 1862 defer func() { 1863 errstr := ctx.errDrain() 1864 log.Printf("gl.DepthFunc(%v) %v", fn, errstr) 1865 }() 1866 ctx.enqueueDebug(call{ 1867 args: fnargs{ 1868 fn: glfnDepthFunc, 1869 a0: fn.c(), 1870 }, 1871 blocking: true}) 1872 } 1873 1874 func (ctx *context) DepthMask(flag bool) { 1875 defer func() { 1876 errstr := ctx.errDrain() 1877 log.Printf("gl.DepthMask(%v) %v", flag, errstr) 1878 }() 1879 ctx.enqueueDebug(call{ 1880 args: fnargs{ 1881 fn: glfnDepthMask, 1882 a0: glBoolean(flag), 1883 }, 1884 blocking: true}) 1885 } 1886 1887 func (ctx *context) DepthRangef(n, f float32) { 1888 defer func() { 1889 errstr := ctx.errDrain() 1890 log.Printf("gl.DepthRangef(%v, %v) %v", n, f, errstr) 1891 }() 1892 ctx.enqueueDebug(call{ 1893 args: fnargs{ 1894 fn: glfnDepthRangef, 1895 a0: uintptr(math.Float32bits(n)), 1896 a1: uintptr(math.Float32bits(f)), 1897 }, 1898 blocking: true}) 1899 } 1900 1901 func (ctx *context) DetachShader(p Program, s Shader) { 1902 defer func() { 1903 errstr := ctx.errDrain() 1904 log.Printf("gl.DetachShader(%v, %v) %v", p, s, errstr) 1905 }() 1906 ctx.enqueueDebug(call{ 1907 args: fnargs{ 1908 fn: glfnDetachShader, 1909 a0: p.c(), 1910 a1: s.c(), 1911 }, 1912 blocking: true}) 1913 } 1914 1915 func (ctx *context) Disable(cap Enum) { 1916 defer func() { 1917 errstr := ctx.errDrain() 1918 log.Printf("gl.Disable(%v) %v", cap, errstr) 1919 }() 1920 ctx.enqueueDebug(call{ 1921 args: fnargs{ 1922 fn: glfnDisable, 1923 a0: cap.c(), 1924 }, 1925 blocking: true}) 1926 } 1927 1928 func (ctx *context) DisableVertexAttribArray(a Attrib) { 1929 defer func() { 1930 errstr := ctx.errDrain() 1931 log.Printf("gl.DisableVertexAttribArray(%v) %v", a, errstr) 1932 }() 1933 ctx.enqueueDebug(call{ 1934 args: fnargs{ 1935 fn: glfnDisableVertexAttribArray, 1936 a0: a.c(), 1937 }, 1938 blocking: true}) 1939 } 1940 1941 func (ctx *context) DrawArrays(mode Enum, first, count int) { 1942 defer func() { 1943 errstr := ctx.errDrain() 1944 log.Printf("gl.DrawArrays(%v, %v, %v) %v", mode, first, count, errstr) 1945 }() 1946 ctx.enqueueDebug(call{ 1947 args: fnargs{ 1948 fn: glfnDrawArrays, 1949 a0: mode.c(), 1950 a1: uintptr(first), 1951 a2: uintptr(count), 1952 }, 1953 blocking: true}) 1954 } 1955 1956 func (ctx *context) DrawElements(mode Enum, count int, ty Enum, offset int) { 1957 defer func() { 1958 errstr := ctx.errDrain() 1959 log.Printf("gl.DrawElements(%v, %v, %v, %v) %v", mode, count, ty, offset, errstr) 1960 }() 1961 ctx.enqueueDebug(call{ 1962 args: fnargs{ 1963 fn: glfnDrawElements, 1964 a0: mode.c(), 1965 a1: uintptr(count), 1966 a2: ty.c(), 1967 a3: uintptr(offset), 1968 }, 1969 blocking: true}) 1970 } 1971 1972 func (ctx *context) Enable(cap Enum) { 1973 defer func() { 1974 errstr := ctx.errDrain() 1975 log.Printf("gl.Enable(%v) %v", cap, errstr) 1976 }() 1977 ctx.enqueueDebug(call{ 1978 args: fnargs{ 1979 fn: glfnEnable, 1980 a0: cap.c(), 1981 }, 1982 blocking: true}) 1983 } 1984 1985 func (ctx *context) EnableVertexAttribArray(a Attrib) { 1986 defer func() { 1987 errstr := ctx.errDrain() 1988 log.Printf("gl.EnableVertexAttribArray(%v) %v", a, errstr) 1989 }() 1990 ctx.enqueueDebug(call{ 1991 args: fnargs{ 1992 fn: glfnEnableVertexAttribArray, 1993 a0: a.c(), 1994 }, 1995 blocking: true}) 1996 } 1997 1998 func (ctx *context) Finish() { 1999 defer func() { 2000 errstr := ctx.errDrain() 2001 log.Printf("gl.Finish() %v", errstr) 2002 }() 2003 ctx.enqueueDebug(call{ 2004 args: fnargs{ 2005 fn: glfnFinish, 2006 }, 2007 blocking: true, 2008 }) 2009 } 2010 2011 func (ctx *context) Flush() { 2012 defer func() { 2013 errstr := ctx.errDrain() 2014 log.Printf("gl.Flush() %v", errstr) 2015 }() 2016 ctx.enqueueDebug(call{ 2017 args: fnargs{ 2018 fn: glfnFlush, 2019 }, 2020 blocking: true, 2021 }) 2022 } 2023 2024 func (ctx *context) FramebufferRenderbuffer(target, attachment, rbTarget Enum, rb Renderbuffer) { 2025 defer func() { 2026 errstr := ctx.errDrain() 2027 log.Printf("gl.FramebufferRenderbuffer(%v, %v, %v, %v) %v", target, attachment, rbTarget, rb, errstr) 2028 }() 2029 ctx.enqueueDebug(call{ 2030 args: fnargs{ 2031 fn: glfnFramebufferRenderbuffer, 2032 a0: target.c(), 2033 a1: attachment.c(), 2034 a2: rbTarget.c(), 2035 a3: rb.c(), 2036 }, 2037 blocking: true}) 2038 } 2039 2040 func (ctx *context) FramebufferTexture2D(target, attachment, texTarget Enum, t Texture, level int) { 2041 defer func() { 2042 errstr := ctx.errDrain() 2043 log.Printf("gl.FramebufferTexture2D(%v, %v, %v, %v, %v) %v", target, attachment, texTarget, t, level, errstr) 2044 }() 2045 ctx.enqueueDebug(call{ 2046 args: fnargs{ 2047 fn: glfnFramebufferTexture2D, 2048 a0: target.c(), 2049 a1: attachment.c(), 2050 a2: texTarget.c(), 2051 a3: t.c(), 2052 a4: uintptr(level), 2053 }, 2054 blocking: true}) 2055 } 2056 2057 func (ctx *context) FrontFace(mode Enum) { 2058 defer func() { 2059 errstr := ctx.errDrain() 2060 log.Printf("gl.FrontFace(%v) %v", mode, errstr) 2061 }() 2062 ctx.enqueueDebug(call{ 2063 args: fnargs{ 2064 fn: glfnFrontFace, 2065 a0: mode.c(), 2066 }, 2067 blocking: true}) 2068 } 2069 2070 func (ctx *context) GenerateMipmap(target Enum) { 2071 defer func() { 2072 errstr := ctx.errDrain() 2073 log.Printf("gl.GenerateMipmap(%v) %v", target, errstr) 2074 }() 2075 ctx.enqueueDebug(call{ 2076 args: fnargs{ 2077 fn: glfnGenerateMipmap, 2078 a0: target.c(), 2079 }, 2080 blocking: true}) 2081 } 2082 2083 func (ctx *context) GetActiveAttrib(p Program, index uint32) (name string, size int, ty Enum) { 2084 defer func() { 2085 errstr := ctx.errDrain() 2086 log.Printf("gl.GetActiveAttrib(%v, %v) (%v, %v, %v) %v", p, index, name, size, ty, errstr) 2087 }() 2088 bufSize := ctx.GetProgrami(p, ACTIVE_ATTRIBUTE_MAX_LENGTH) 2089 buf := make([]byte, bufSize) 2090 var cType int 2091 cSize := ctx.enqueue(call{ 2092 args: fnargs{ 2093 fn: glfnGetActiveAttrib, 2094 a0: p.c(), 2095 a1: uintptr(index), 2096 a2: uintptr(bufSize), 2097 a3: uintptr(unsafe.Pointer(&cType)), 2098 }, 2099 parg: unsafe.Pointer(&buf[0]), 2100 blocking: true, 2101 }) 2102 return goString(buf), int(cSize), Enum(cType) 2103 } 2104 2105 func (ctx *context) GetActiveUniform(p Program, index uint32) (name string, size int, ty Enum) { 2106 defer func() { 2107 errstr := ctx.errDrain() 2108 log.Printf("gl.GetActiveUniform(%v, %v) (%v, %v, %v) %v", p, index, name, size, ty, errstr) 2109 }() 2110 bufSize := ctx.GetProgrami(p, ACTIVE_UNIFORM_MAX_LENGTH) 2111 buf := make([]byte, bufSize+8) 2112 var cType int 2113 cSize := ctx.enqueue(call{ 2114 args: fnargs{ 2115 fn: glfnGetActiveUniform, 2116 a0: p.c(), 2117 a1: uintptr(index), 2118 a2: uintptr(bufSize), 2119 a3: uintptr(unsafe.Pointer(&cType)), 2120 }, 2121 parg: unsafe.Pointer(&buf[0]), 2122 blocking: true, 2123 }) 2124 return goString(buf), int(cSize), Enum(cType) 2125 } 2126 2127 func (ctx *context) GetAttachedShaders(p Program) (r0 []Shader) { 2128 defer func() { 2129 errstr := ctx.errDrain() 2130 log.Printf("gl.GetAttachedShaders(%v) %v%v", p, r0, errstr) 2131 }() 2132 shadersLen := ctx.GetProgrami(p, ATTACHED_SHADERS) 2133 if shadersLen == 0 { 2134 return nil 2135 } 2136 buf := make([]uint32, shadersLen) 2137 n := int(ctx.enqueue(call{ 2138 args: fnargs{ 2139 fn: glfnGetAttachedShaders, 2140 a0: p.c(), 2141 a1: uintptr(shadersLen), 2142 }, 2143 parg: unsafe.Pointer(&buf[0]), 2144 blocking: true, 2145 })) 2146 buf = buf[:int(n)] 2147 shaders := make([]Shader, len(buf)) 2148 for i, s := range buf { 2149 shaders[i] = Shader{Value: uint32(s)} 2150 } 2151 return shaders 2152 } 2153 2154 func (ctx *context) GetAttribLocation(p Program, name string) (r0 Attrib) { 2155 defer func() { 2156 errstr := ctx.errDrain() 2157 r0.name = name 2158 log.Printf("gl.GetAttribLocation(%v, %v) %v%v", p, name, r0, errstr) 2159 }() 2160 s, free := ctx.cString(name) 2161 defer free() 2162 return Attrib{Value: uint(ctx.enqueue(call{ 2163 args: fnargs{ 2164 fn: glfnGetAttribLocation, 2165 a0: p.c(), 2166 a1: s, 2167 }, 2168 blocking: true, 2169 }))} 2170 } 2171 2172 func (ctx *context) GetBooleanv(dst []bool, pname Enum) { 2173 defer func() { 2174 errstr := ctx.errDrain() 2175 log.Printf("gl.GetBooleanv(%v, %v) %v", dst, pname, errstr) 2176 }() 2177 buf := make([]int32, len(dst)) 2178 ctx.enqueueDebug(call{ 2179 args: fnargs{ 2180 fn: glfnGetBooleanv, 2181 a0: pname.c(), 2182 }, 2183 parg: unsafe.Pointer(&buf[0]), 2184 blocking: true, 2185 }) 2186 for i, v := range buf { 2187 dst[i] = v != 0 2188 } 2189 } 2190 2191 func (ctx *context) GetFloatv(dst []float32, pname Enum) { 2192 defer func() { 2193 errstr := ctx.errDrain() 2194 log.Printf("gl.GetFloatv(len(%d), %v) %v", len(dst), pname, errstr) 2195 }() 2196 ctx.enqueueDebug(call{ 2197 args: fnargs{ 2198 fn: glfnGetFloatv, 2199 a0: pname.c(), 2200 }, 2201 parg: unsafe.Pointer(&dst[0]), 2202 blocking: true, 2203 }) 2204 } 2205 2206 func (ctx *context) GetIntegerv(dst []int32, pname Enum) { 2207 defer func() { 2208 errstr := ctx.errDrain() 2209 log.Printf("gl.GetIntegerv(%v, %v) %v", dst, pname, errstr) 2210 }() 2211 ctx.enqueueDebug(call{ 2212 args: fnargs{ 2213 fn: glfnGetIntegerv, 2214 a0: pname.c(), 2215 }, 2216 parg: unsafe.Pointer(&dst[0]), 2217 blocking: true, 2218 }) 2219 } 2220 2221 func (ctx *context) GetInteger(pname Enum) (r0 int) { 2222 defer func() { 2223 errstr := ctx.errDrain() 2224 log.Printf("gl.GetInteger(%v) %v%v", pname, r0, errstr) 2225 }() 2226 var v [1]int32 2227 ctx.GetIntegerv(v[:], pname) 2228 return int(v[0]) 2229 } 2230 2231 func (ctx *context) GetBufferParameteri(target, value Enum) (r0 int) { 2232 defer func() { 2233 errstr := ctx.errDrain() 2234 log.Printf("gl.GetBufferParameteri(%v, %v) %v%v", target, value, r0, errstr) 2235 }() 2236 return int(ctx.enqueue(call{ 2237 args: fnargs{ 2238 fn: glfnGetBufferParameteri, 2239 a0: target.c(), 2240 a1: value.c(), 2241 }, 2242 blocking: true, 2243 })) 2244 } 2245 2246 func (ctx *context) GetError() (r0 Enum) { 2247 return Enum(ctx.enqueue(call{ 2248 args: fnargs{ 2249 fn: glfnGetError, 2250 }, 2251 blocking: true, 2252 })) 2253 } 2254 2255 func (ctx *context) GetFramebufferAttachmentParameteri(target, attachment, pname Enum) (r0 int) { 2256 defer func() { 2257 errstr := ctx.errDrain() 2258 log.Printf("gl.GetFramebufferAttachmentParameteri(%v, %v, %v) %v%v", target, attachment, pname, r0, errstr) 2259 }() 2260 return int(ctx.enqueue(call{ 2261 args: fnargs{ 2262 fn: glfnGetFramebufferAttachmentParameteriv, 2263 a0: target.c(), 2264 a1: attachment.c(), 2265 a2: pname.c(), 2266 }, 2267 blocking: true, 2268 })) 2269 } 2270 2271 func (ctx *context) GetProgrami(p Program, pname Enum) (r0 int) { 2272 defer func() { 2273 errstr := ctx.errDrain() 2274 log.Printf("gl.GetProgrami(%v, %v) %v%v", p, pname, r0, errstr) 2275 }() 2276 return int(ctx.enqueue(call{ 2277 args: fnargs{ 2278 fn: glfnGetProgramiv, 2279 a0: p.c(), 2280 a1: pname.c(), 2281 }, 2282 blocking: true, 2283 })) 2284 } 2285 2286 func (ctx *context) GetProgramInfoLog(p Program) (r0 string) { 2287 defer func() { 2288 errstr := ctx.errDrain() 2289 log.Printf("gl.GetProgramInfoLog(%v) %v%v", p, r0, errstr) 2290 }() 2291 infoLen := ctx.GetProgrami(p, INFO_LOG_LENGTH) 2292 if infoLen == 0 { 2293 return "" 2294 } 2295 buf := make([]byte, infoLen) 2296 ctx.enqueueDebug(call{ 2297 args: fnargs{ 2298 fn: glfnGetProgramInfoLog, 2299 a0: p.c(), 2300 a1: uintptr(infoLen), 2301 }, 2302 parg: unsafe.Pointer(&buf[0]), 2303 blocking: true, 2304 }) 2305 return goString(buf) 2306 } 2307 2308 func (ctx *context) GetRenderbufferParameteri(target, pname Enum) (r0 int) { 2309 defer func() { 2310 errstr := ctx.errDrain() 2311 log.Printf("gl.GetRenderbufferParameteri(%v, %v) %v%v", target, pname, r0, errstr) 2312 }() 2313 return int(ctx.enqueue(call{ 2314 args: fnargs{ 2315 fn: glfnGetRenderbufferParameteriv, 2316 a0: target.c(), 2317 a1: pname.c(), 2318 }, 2319 blocking: true, 2320 })) 2321 } 2322 2323 func (ctx *context) GetShaderi(s Shader, pname Enum) (r0 int) { 2324 defer func() { 2325 errstr := ctx.errDrain() 2326 log.Printf("gl.GetShaderi(%v, %v) %v%v", s, pname, r0, errstr) 2327 }() 2328 return int(ctx.enqueue(call{ 2329 args: fnargs{ 2330 fn: glfnGetShaderiv, 2331 a0: s.c(), 2332 a1: pname.c(), 2333 }, 2334 blocking: true, 2335 })) 2336 } 2337 2338 func (ctx *context) GetShaderInfoLog(s Shader) (r0 string) { 2339 defer func() { 2340 errstr := ctx.errDrain() 2341 log.Printf("gl.GetShaderInfoLog(%v) %v%v", s, r0, errstr) 2342 }() 2343 infoLen := ctx.GetShaderi(s, INFO_LOG_LENGTH) 2344 if infoLen == 0 { 2345 return "" 2346 } 2347 buf := make([]byte, infoLen) 2348 ctx.enqueueDebug(call{ 2349 args: fnargs{ 2350 fn: glfnGetShaderInfoLog, 2351 a0: s.c(), 2352 a1: uintptr(infoLen), 2353 }, 2354 parg: unsafe.Pointer(&buf[0]), 2355 blocking: true, 2356 }) 2357 return goString(buf) 2358 } 2359 2360 func (ctx *context) GetShaderPrecisionFormat(shadertype, precisiontype Enum) (rangeLow, rangeHigh, precision int) { 2361 defer func() { 2362 errstr := ctx.errDrain() 2363 log.Printf("gl.GetShaderPrecisionFormat(%v, %v) (%v, %v, %v) %v", shadertype, precisiontype, rangeLow, rangeHigh, precision, errstr) 2364 }() 2365 var rangeAndPrec [3]int32 2366 ctx.enqueueDebug(call{ 2367 args: fnargs{ 2368 fn: glfnGetShaderPrecisionFormat, 2369 a0: shadertype.c(), 2370 a1: precisiontype.c(), 2371 }, 2372 parg: unsafe.Pointer(&rangeAndPrec[0]), 2373 blocking: true, 2374 }) 2375 return int(rangeAndPrec[0]), int(rangeAndPrec[1]), int(rangeAndPrec[2]) 2376 } 2377 2378 func (ctx *context) GetShaderSource(s Shader) (r0 string) { 2379 defer func() { 2380 errstr := ctx.errDrain() 2381 log.Printf("gl.GetShaderSource(%v) %v%v", s, r0, errstr) 2382 }() 2383 sourceLen := ctx.GetShaderi(s, SHADER_SOURCE_LENGTH) 2384 if sourceLen == 0 { 2385 return "" 2386 } 2387 buf := make([]byte, sourceLen) 2388 ctx.enqueueDebug(call{ 2389 args: fnargs{ 2390 fn: glfnGetShaderSource, 2391 a0: s.c(), 2392 a1: uintptr(sourceLen), 2393 }, 2394 parg: unsafe.Pointer(&buf[0]), 2395 blocking: true, 2396 }) 2397 return goString(buf) 2398 } 2399 2400 func (ctx *context) GetString(pname Enum) (r0 string) { 2401 defer func() { 2402 errstr := ctx.errDrain() 2403 log.Printf("gl.GetString(%v) %v%v", pname, r0, errstr) 2404 }() 2405 ret := ctx.enqueue(call{ 2406 args: fnargs{ 2407 fn: glfnGetString, 2408 a0: pname.c(), 2409 }, 2410 blocking: true, 2411 }) 2412 retp := unsafe.Pointer(ret) 2413 buf := (*[1 << 24]byte)(retp)[:] 2414 return goString(buf) 2415 } 2416 2417 func (ctx *context) GetTexParameterfv(dst []float32, target, pname Enum) { 2418 defer func() { 2419 errstr := ctx.errDrain() 2420 log.Printf("gl.GetTexParameterfv(len(%d), %v, %v) %v", len(dst), target, pname, errstr) 2421 }() 2422 ctx.enqueueDebug(call{ 2423 args: fnargs{ 2424 fn: glfnGetTexParameterfv, 2425 a0: target.c(), 2426 a1: pname.c(), 2427 }, 2428 parg: unsafe.Pointer(&dst[0]), 2429 blocking: true, 2430 }) 2431 } 2432 2433 func (ctx *context) GetTexParameteriv(dst []int32, target, pname Enum) { 2434 defer func() { 2435 errstr := ctx.errDrain() 2436 log.Printf("gl.GetTexParameteriv(%v, %v, %v) %v", dst, target, pname, errstr) 2437 }() 2438 ctx.enqueueDebug(call{ 2439 args: fnargs{ 2440 fn: glfnGetTexParameteriv, 2441 a0: target.c(), 2442 a1: pname.c(), 2443 }, 2444 blocking: true, 2445 }) 2446 } 2447 2448 func (ctx *context) GetUniformfv(dst []float32, src Uniform, p Program) { 2449 defer func() { 2450 errstr := ctx.errDrain() 2451 log.Printf("gl.GetUniformfv(len(%d), %v, %v) %v", len(dst), src, p, errstr) 2452 }() 2453 ctx.enqueueDebug(call{ 2454 args: fnargs{ 2455 fn: glfnGetUniformfv, 2456 a0: p.c(), 2457 a1: src.c(), 2458 }, 2459 parg: unsafe.Pointer(&dst[0]), 2460 blocking: true, 2461 }) 2462 } 2463 2464 func (ctx *context) GetUniformiv(dst []int32, src Uniform, p Program) { 2465 defer func() { 2466 errstr := ctx.errDrain() 2467 log.Printf("gl.GetUniformiv(%v, %v, %v) %v", dst, src, p, errstr) 2468 }() 2469 ctx.enqueueDebug(call{ 2470 args: fnargs{ 2471 fn: glfnGetUniformiv, 2472 a0: p.c(), 2473 a1: src.c(), 2474 }, 2475 parg: unsafe.Pointer(&dst[0]), 2476 blocking: true, 2477 }) 2478 } 2479 2480 func (ctx *context) GetUniformLocation(p Program, name string) (r0 Uniform) { 2481 defer func() { 2482 errstr := ctx.errDrain() 2483 r0.name = name 2484 log.Printf("gl.GetUniformLocation(%v, %v) %v%v", p, name, r0, errstr) 2485 }() 2486 s, free := ctx.cString(name) 2487 defer free() 2488 return Uniform{Value: int32(ctx.enqueue(call{ 2489 args: fnargs{ 2490 fn: glfnGetUniformLocation, 2491 a0: p.c(), 2492 a1: s, 2493 }, 2494 blocking: true, 2495 }))} 2496 } 2497 2498 func (ctx *context) GetVertexAttribf(src Attrib, pname Enum) (r0 float32) { 2499 defer func() { 2500 errstr := ctx.errDrain() 2501 log.Printf("gl.GetVertexAttribf(%v, %v) %v%v", src, pname, r0, errstr) 2502 }() 2503 var params [1]float32 2504 ctx.GetVertexAttribfv(params[:], src, pname) 2505 return params[0] 2506 } 2507 2508 func (ctx *context) GetVertexAttribfv(dst []float32, src Attrib, pname Enum) { 2509 defer func() { 2510 errstr := ctx.errDrain() 2511 log.Printf("gl.GetVertexAttribfv(len(%d), %v, %v) %v", len(dst), src, pname, errstr) 2512 }() 2513 ctx.enqueueDebug(call{ 2514 args: fnargs{ 2515 fn: glfnGetVertexAttribfv, 2516 a0: src.c(), 2517 a1: pname.c(), 2518 }, 2519 parg: unsafe.Pointer(&dst[0]), 2520 blocking: true, 2521 }) 2522 } 2523 2524 func (ctx *context) GetVertexAttribi(src Attrib, pname Enum) (r0 int32) { 2525 defer func() { 2526 errstr := ctx.errDrain() 2527 log.Printf("gl.GetVertexAttribi(%v, %v) %v%v", src, pname, r0, errstr) 2528 }() 2529 var params [1]int32 2530 ctx.GetVertexAttribiv(params[:], src, pname) 2531 return params[0] 2532 } 2533 2534 func (ctx *context) GetVertexAttribiv(dst []int32, src Attrib, pname Enum) { 2535 defer func() { 2536 errstr := ctx.errDrain() 2537 log.Printf("gl.GetVertexAttribiv(%v, %v, %v) %v", dst, src, pname, errstr) 2538 }() 2539 ctx.enqueueDebug(call{ 2540 args: fnargs{ 2541 fn: glfnGetVertexAttribiv, 2542 a0: src.c(), 2543 a1: pname.c(), 2544 }, 2545 parg: unsafe.Pointer(&dst[0]), 2546 blocking: true, 2547 }) 2548 } 2549 2550 func (ctx *context) Hint(target, mode Enum) { 2551 defer func() { 2552 errstr := ctx.errDrain() 2553 log.Printf("gl.Hint(%v, %v) %v", target, mode, errstr) 2554 }() 2555 ctx.enqueueDebug(call{ 2556 args: fnargs{ 2557 fn: glfnHint, 2558 a0: target.c(), 2559 a1: mode.c(), 2560 }, 2561 blocking: true}) 2562 } 2563 2564 func (ctx *context) IsBuffer(b Buffer) (r0 bool) { 2565 defer func() { 2566 errstr := ctx.errDrain() 2567 log.Printf("gl.IsBuffer(%v) %v%v", b, r0, errstr) 2568 }() 2569 return 0 != ctx.enqueue(call{ 2570 args: fnargs{ 2571 fn: glfnIsBuffer, 2572 a0: b.c(), 2573 }, 2574 blocking: true, 2575 }) 2576 } 2577 2578 func (ctx *context) IsEnabled(cap Enum) (r0 bool) { 2579 defer func() { 2580 errstr := ctx.errDrain() 2581 log.Printf("gl.IsEnabled(%v) %v%v", cap, r0, errstr) 2582 }() 2583 return 0 != ctx.enqueue(call{ 2584 args: fnargs{ 2585 fn: glfnIsEnabled, 2586 a0: cap.c(), 2587 }, 2588 blocking: true, 2589 }) 2590 } 2591 2592 func (ctx *context) IsFramebuffer(fb Framebuffer) (r0 bool) { 2593 defer func() { 2594 errstr := ctx.errDrain() 2595 log.Printf("gl.IsFramebuffer(%v) %v%v", fb, r0, errstr) 2596 }() 2597 return 0 != ctx.enqueue(call{ 2598 args: fnargs{ 2599 fn: glfnIsFramebuffer, 2600 a0: fb.c(), 2601 }, 2602 blocking: true, 2603 }) 2604 } 2605 2606 func (ctx *context) IsProgram(p Program) (r0 bool) { 2607 defer func() { 2608 errstr := ctx.errDrain() 2609 log.Printf("gl.IsProgram(%v) %v%v", p, r0, errstr) 2610 }() 2611 return 0 != ctx.enqueue(call{ 2612 args: fnargs{ 2613 fn: glfnIsProgram, 2614 a0: p.c(), 2615 }, 2616 blocking: true, 2617 }) 2618 } 2619 2620 func (ctx *context) IsRenderbuffer(rb Renderbuffer) (r0 bool) { 2621 defer func() { 2622 errstr := ctx.errDrain() 2623 log.Printf("gl.IsRenderbuffer(%v) %v%v", rb, r0, errstr) 2624 }() 2625 return 0 != ctx.enqueue(call{ 2626 args: fnargs{ 2627 fn: glfnIsRenderbuffer, 2628 a0: rb.c(), 2629 }, 2630 blocking: true, 2631 }) 2632 } 2633 2634 func (ctx *context) IsShader(s Shader) (r0 bool) { 2635 defer func() { 2636 errstr := ctx.errDrain() 2637 log.Printf("gl.IsShader(%v) %v%v", s, r0, errstr) 2638 }() 2639 return 0 != ctx.enqueue(call{ 2640 args: fnargs{ 2641 fn: glfnIsShader, 2642 a0: s.c(), 2643 }, 2644 blocking: true, 2645 }) 2646 } 2647 2648 func (ctx *context) IsTexture(t Texture) (r0 bool) { 2649 defer func() { 2650 errstr := ctx.errDrain() 2651 log.Printf("gl.IsTexture(%v) %v%v", t, r0, errstr) 2652 }() 2653 return 0 != ctx.enqueue(call{ 2654 args: fnargs{ 2655 fn: glfnIsTexture, 2656 a0: t.c(), 2657 }, 2658 blocking: true, 2659 }) 2660 } 2661 2662 func (ctx *context) LineWidth(width float32) { 2663 defer func() { 2664 errstr := ctx.errDrain() 2665 log.Printf("gl.LineWidth(%v) %v", width, errstr) 2666 }() 2667 ctx.enqueueDebug(call{ 2668 args: fnargs{ 2669 fn: glfnLineWidth, 2670 a0: uintptr(math.Float32bits(width)), 2671 }, 2672 blocking: true}) 2673 } 2674 2675 func (ctx *context) LinkProgram(p Program) { 2676 defer func() { 2677 errstr := ctx.errDrain() 2678 log.Printf("gl.LinkProgram(%v) %v", p, errstr) 2679 }() 2680 ctx.enqueueDebug(call{ 2681 args: fnargs{ 2682 fn: glfnLinkProgram, 2683 a0: p.c(), 2684 }, 2685 blocking: true}) 2686 } 2687 2688 func (ctx *context) PixelStorei(pname Enum, param int32) { 2689 defer func() { 2690 errstr := ctx.errDrain() 2691 log.Printf("gl.PixelStorei(%v, %v) %v", pname, param, errstr) 2692 }() 2693 ctx.enqueueDebug(call{ 2694 args: fnargs{ 2695 fn: glfnPixelStorei, 2696 a0: pname.c(), 2697 a1: uintptr(param), 2698 }, 2699 blocking: true}) 2700 } 2701 2702 func (ctx *context) PolygonOffset(factor, units float32) { 2703 defer func() { 2704 errstr := ctx.errDrain() 2705 log.Printf("gl.PolygonOffset(%v, %v) %v", factor, units, errstr) 2706 }() 2707 ctx.enqueueDebug(call{ 2708 args: fnargs{ 2709 fn: glfnPolygonOffset, 2710 a0: uintptr(math.Float32bits(factor)), 2711 a1: uintptr(math.Float32bits(units)), 2712 }, 2713 blocking: true}) 2714 } 2715 2716 func (ctx *context) ReadPixels(dst []byte, x, y, width, height int, format, ty Enum) { 2717 defer func() { 2718 errstr := ctx.errDrain() 2719 log.Printf("gl.ReadPixels(len(%d), %v, %v, %v, %v, %v, %v) %v", len(dst), x, y, width, height, format, ty, errstr) 2720 }() 2721 ctx.enqueueDebug(call{ 2722 args: fnargs{ 2723 fn: glfnReadPixels, 2724 2725 a0: uintptr(x), 2726 a1: uintptr(y), 2727 a2: uintptr(width), 2728 a3: uintptr(height), 2729 a4: format.c(), 2730 a5: ty.c(), 2731 }, 2732 parg: unsafe.Pointer(&dst[0]), 2733 blocking: true, 2734 }) 2735 } 2736 2737 func (ctx *context) ReleaseShaderCompiler() { 2738 defer func() { 2739 errstr := ctx.errDrain() 2740 log.Printf("gl.ReleaseShaderCompiler() %v", errstr) 2741 }() 2742 ctx.enqueueDebug(call{ 2743 args: fnargs{ 2744 fn: glfnReleaseShaderCompiler, 2745 }, 2746 blocking: true}) 2747 } 2748 2749 func (ctx *context) RenderbufferStorage(target, internalFormat Enum, width, height int) { 2750 defer func() { 2751 errstr := ctx.errDrain() 2752 log.Printf("gl.RenderbufferStorage(%v, %v, %v, %v) %v", target, internalFormat, width, height, errstr) 2753 }() 2754 ctx.enqueueDebug(call{ 2755 args: fnargs{ 2756 fn: glfnRenderbufferStorage, 2757 a0: target.c(), 2758 a1: internalFormat.c(), 2759 a2: uintptr(width), 2760 a3: uintptr(height), 2761 }, 2762 blocking: true}) 2763 } 2764 2765 func (ctx *context) SampleCoverage(value float32, invert bool) { 2766 defer func() { 2767 errstr := ctx.errDrain() 2768 log.Printf("gl.SampleCoverage(%v, %v) %v", value, invert, errstr) 2769 }() 2770 ctx.enqueueDebug(call{ 2771 args: fnargs{ 2772 fn: glfnSampleCoverage, 2773 a0: uintptr(math.Float32bits(value)), 2774 a1: glBoolean(invert), 2775 }, 2776 blocking: true}) 2777 } 2778 2779 func (ctx *context) Scissor(x, y, width, height int32) { 2780 defer func() { 2781 errstr := ctx.errDrain() 2782 log.Printf("gl.Scissor(%v, %v, %v, %v) %v", x, y, width, height, errstr) 2783 }() 2784 ctx.enqueueDebug(call{ 2785 args: fnargs{ 2786 fn: glfnScissor, 2787 a0: uintptr(x), 2788 a1: uintptr(y), 2789 a2: uintptr(width), 2790 a3: uintptr(height), 2791 }, 2792 blocking: true}) 2793 } 2794 2795 func (ctx *context) ShaderSource(s Shader, src string) { 2796 defer func() { 2797 errstr := ctx.errDrain() 2798 log.Printf("gl.ShaderSource(%v, %v) %v", s, src, errstr) 2799 }() 2800 strp, free := ctx.cStringPtr(src) 2801 defer free() 2802 ctx.enqueueDebug(call{ 2803 args: fnargs{ 2804 fn: glfnShaderSource, 2805 a0: s.c(), 2806 a1: 1, 2807 a2: strp, 2808 }, 2809 blocking: true, 2810 }) 2811 } 2812 2813 func (ctx *context) StencilFunc(fn Enum, ref int, mask uint32) { 2814 defer func() { 2815 errstr := ctx.errDrain() 2816 log.Printf("gl.StencilFunc(%v, %v, %v) %v", fn, ref, mask, errstr) 2817 }() 2818 ctx.enqueueDebug(call{ 2819 args: fnargs{ 2820 fn: glfnStencilFunc, 2821 a0: fn.c(), 2822 a1: uintptr(ref), 2823 a2: uintptr(mask), 2824 }, 2825 blocking: true}) 2826 } 2827 2828 func (ctx *context) StencilFuncSeparate(face, fn Enum, ref int, mask uint32) { 2829 defer func() { 2830 errstr := ctx.errDrain() 2831 log.Printf("gl.StencilFuncSeparate(%v, %v, %v, %v) %v", face, fn, ref, mask, errstr) 2832 }() 2833 ctx.enqueueDebug(call{ 2834 args: fnargs{ 2835 fn: glfnStencilFuncSeparate, 2836 a0: face.c(), 2837 a1: fn.c(), 2838 a2: uintptr(ref), 2839 a3: uintptr(mask), 2840 }, 2841 blocking: true}) 2842 } 2843 2844 func (ctx *context) StencilMask(mask uint32) { 2845 defer func() { 2846 errstr := ctx.errDrain() 2847 log.Printf("gl.StencilMask(%v) %v", mask, errstr) 2848 }() 2849 ctx.enqueueDebug(call{ 2850 args: fnargs{ 2851 fn: glfnStencilMask, 2852 a0: uintptr(mask), 2853 }, 2854 blocking: true}) 2855 } 2856 2857 func (ctx *context) StencilMaskSeparate(face Enum, mask uint32) { 2858 defer func() { 2859 errstr := ctx.errDrain() 2860 log.Printf("gl.StencilMaskSeparate(%v, %v) %v", face, mask, errstr) 2861 }() 2862 ctx.enqueueDebug(call{ 2863 args: fnargs{ 2864 fn: glfnStencilMaskSeparate, 2865 a0: face.c(), 2866 a1: uintptr(mask), 2867 }, 2868 blocking: true}) 2869 } 2870 2871 func (ctx *context) StencilOp(fail, zfail, zpass Enum) { 2872 defer func() { 2873 errstr := ctx.errDrain() 2874 log.Printf("gl.StencilOp(%v, %v, %v) %v", fail, zfail, zpass, errstr) 2875 }() 2876 ctx.enqueueDebug(call{ 2877 args: fnargs{ 2878 fn: glfnStencilOp, 2879 a0: fail.c(), 2880 a1: zfail.c(), 2881 a2: zpass.c(), 2882 }, 2883 blocking: true}) 2884 } 2885 2886 func (ctx *context) StencilOpSeparate(face, sfail, dpfail, dppass Enum) { 2887 defer func() { 2888 errstr := ctx.errDrain() 2889 log.Printf("gl.StencilOpSeparate(%v, %v, %v, %v) %v", face, sfail, dpfail, dppass, errstr) 2890 }() 2891 ctx.enqueueDebug(call{ 2892 args: fnargs{ 2893 fn: glfnStencilOpSeparate, 2894 a0: face.c(), 2895 a1: sfail.c(), 2896 a2: dpfail.c(), 2897 a3: dppass.c(), 2898 }, 2899 blocking: true}) 2900 } 2901 2902 func (ctx *context) TexImage2D(target Enum, level int, internalFormat int, width, height int, format Enum, ty Enum, data []byte) { 2903 defer func() { 2904 errstr := ctx.errDrain() 2905 log.Printf("gl.TexImage2D(%v, %v, %v, %v, %v, %v, %v, len(%d)) %v", target, level, internalFormat, width, height, format, ty, len(data), errstr) 2906 }() 2907 parg := unsafe.Pointer(nil) 2908 if len(data) > 0 { 2909 parg = unsafe.Pointer(&data[0]) 2910 } 2911 ctx.enqueueDebug(call{ 2912 args: fnargs{ 2913 fn: glfnTexImage2D, 2914 2915 a0: target.c(), 2916 a1: uintptr(level), 2917 a2: uintptr(internalFormat), 2918 a3: uintptr(width), 2919 a4: uintptr(height), 2920 a5: format.c(), 2921 a6: ty.c(), 2922 }, 2923 parg: parg, 2924 blocking: true, 2925 }) 2926 } 2927 2928 func (ctx *context) TexSubImage2D(target Enum, level int, x, y, width, height int, format, ty Enum, data []byte) { 2929 defer func() { 2930 errstr := ctx.errDrain() 2931 log.Printf("gl.TexSubImage2D(%v, %v, %v, %v, %v, %v, %v, %v, len(%d)) %v", target, level, x, y, width, height, format, ty, len(data), errstr) 2932 }() 2933 ctx.enqueueDebug(call{ 2934 args: fnargs{ 2935 fn: glfnTexSubImage2D, 2936 2937 a0: target.c(), 2938 a1: uintptr(level), 2939 a2: uintptr(x), 2940 a3: uintptr(y), 2941 a4: uintptr(width), 2942 a5: uintptr(height), 2943 a6: format.c(), 2944 a7: ty.c(), 2945 }, 2946 parg: unsafe.Pointer(&data[0]), 2947 blocking: true, 2948 }) 2949 } 2950 2951 func (ctx *context) TexParameterf(target, pname Enum, param float32) { 2952 defer func() { 2953 errstr := ctx.errDrain() 2954 log.Printf("gl.TexParameterf(%v, %v, %v) %v", target, pname, param, errstr) 2955 }() 2956 ctx.enqueueDebug(call{ 2957 args: fnargs{ 2958 fn: glfnTexParameterf, 2959 a0: target.c(), 2960 a1: pname.c(), 2961 a2: uintptr(math.Float32bits(param)), 2962 }, 2963 blocking: true}) 2964 } 2965 2966 func (ctx *context) TexParameterfv(target, pname Enum, params []float32) { 2967 defer func() { 2968 errstr := ctx.errDrain() 2969 log.Printf("gl.TexParameterfv(%v, %v, len(%d)) %v", target, pname, len(params), errstr) 2970 }() 2971 ctx.enqueueDebug(call{ 2972 args: fnargs{ 2973 fn: glfnTexParameterfv, 2974 a0: target.c(), 2975 a1: pname.c(), 2976 }, 2977 parg: unsafe.Pointer(¶ms[0]), 2978 blocking: true, 2979 }) 2980 } 2981 2982 func (ctx *context) TexParameteri(target, pname Enum, param int) { 2983 defer func() { 2984 errstr := ctx.errDrain() 2985 log.Printf("gl.TexParameteri(%v, %v, %v) %v", target, pname, param, errstr) 2986 }() 2987 ctx.enqueueDebug(call{ 2988 args: fnargs{ 2989 fn: glfnTexParameteri, 2990 a0: target.c(), 2991 a1: pname.c(), 2992 a2: uintptr(param), 2993 }, 2994 blocking: true}) 2995 } 2996 2997 func (ctx *context) TexParameteriv(target, pname Enum, params []int32) { 2998 defer func() { 2999 errstr := ctx.errDrain() 3000 log.Printf("gl.TexParameteriv(%v, %v, %v) %v", target, pname, params, errstr) 3001 }() 3002 ctx.enqueueDebug(call{ 3003 args: fnargs{ 3004 fn: glfnTexParameteriv, 3005 a0: target.c(), 3006 a1: pname.c(), 3007 }, 3008 parg: unsafe.Pointer(¶ms[0]), 3009 blocking: true, 3010 }) 3011 } 3012 3013 func (ctx *context) Uniform1f(dst Uniform, v float32) { 3014 defer func() { 3015 errstr := ctx.errDrain() 3016 log.Printf("gl.Uniform1f(%v, %v) %v", dst, v, errstr) 3017 }() 3018 ctx.enqueueDebug(call{ 3019 args: fnargs{ 3020 fn: glfnUniform1f, 3021 a0: dst.c(), 3022 a1: uintptr(math.Float32bits(v)), 3023 }, 3024 blocking: true}) 3025 } 3026 3027 func (ctx *context) Uniform1fv(dst Uniform, src []float32) { 3028 defer func() { 3029 errstr := ctx.errDrain() 3030 log.Printf("gl.Uniform1fv(%v, len(%d)) %v", dst, len(src), errstr) 3031 }() 3032 ctx.enqueueDebug(call{ 3033 args: fnargs{ 3034 fn: glfnUniform1fv, 3035 a0: dst.c(), 3036 a1: uintptr(len(src)), 3037 }, 3038 parg: unsafe.Pointer(&src[0]), 3039 blocking: true, 3040 }) 3041 } 3042 3043 func (ctx *context) Uniform1i(dst Uniform, v int) { 3044 defer func() { 3045 errstr := ctx.errDrain() 3046 log.Printf("gl.Uniform1i(%v, %v) %v", dst, v, errstr) 3047 }() 3048 ctx.enqueueDebug(call{ 3049 args: fnargs{ 3050 fn: glfnUniform1i, 3051 a0: dst.c(), 3052 a1: uintptr(v), 3053 }, 3054 blocking: true}) 3055 } 3056 3057 func (ctx *context) Uniform1iv(dst Uniform, src []int32) { 3058 defer func() { 3059 errstr := ctx.errDrain() 3060 log.Printf("gl.Uniform1iv(%v, %v) %v", dst, src, errstr) 3061 }() 3062 ctx.enqueueDebug(call{ 3063 args: fnargs{ 3064 fn: glfnUniform1iv, 3065 a0: dst.c(), 3066 a1: uintptr(len(src)), 3067 }, 3068 parg: unsafe.Pointer(&src[0]), 3069 blocking: true, 3070 }) 3071 } 3072 3073 func (ctx *context) Uniform2f(dst Uniform, v0, v1 float32) { 3074 defer func() { 3075 errstr := ctx.errDrain() 3076 log.Printf("gl.Uniform2f(%v, %v, %v) %v", dst, v0, v1, errstr) 3077 }() 3078 ctx.enqueueDebug(call{ 3079 args: fnargs{ 3080 fn: glfnUniform2f, 3081 a0: dst.c(), 3082 a1: uintptr(math.Float32bits(v0)), 3083 a2: uintptr(math.Float32bits(v1)), 3084 }, 3085 blocking: true}) 3086 } 3087 3088 func (ctx *context) Uniform2fv(dst Uniform, src []float32) { 3089 defer func() { 3090 errstr := ctx.errDrain() 3091 log.Printf("gl.Uniform2fv(%v, len(%d)) %v", dst, len(src), errstr) 3092 }() 3093 ctx.enqueueDebug(call{ 3094 args: fnargs{ 3095 fn: glfnUniform2fv, 3096 a0: dst.c(), 3097 a1: uintptr(len(src) / 2), 3098 }, 3099 parg: unsafe.Pointer(&src[0]), 3100 blocking: true, 3101 }) 3102 } 3103 3104 func (ctx *context) Uniform2i(dst Uniform, v0, v1 int) { 3105 defer func() { 3106 errstr := ctx.errDrain() 3107 log.Printf("gl.Uniform2i(%v, %v, %v) %v", dst, v0, v1, errstr) 3108 }() 3109 ctx.enqueueDebug(call{ 3110 args: fnargs{ 3111 fn: glfnUniform2i, 3112 a0: dst.c(), 3113 a1: uintptr(v0), 3114 a2: uintptr(v1), 3115 }, 3116 blocking: true}) 3117 } 3118 3119 func (ctx *context) Uniform2iv(dst Uniform, src []int32) { 3120 defer func() { 3121 errstr := ctx.errDrain() 3122 log.Printf("gl.Uniform2iv(%v, %v) %v", dst, src, errstr) 3123 }() 3124 ctx.enqueueDebug(call{ 3125 args: fnargs{ 3126 fn: glfnUniform2iv, 3127 a0: dst.c(), 3128 a1: uintptr(len(src) / 2), 3129 }, 3130 parg: unsafe.Pointer(&src[0]), 3131 blocking: true, 3132 }) 3133 } 3134 3135 func (ctx *context) Uniform3f(dst Uniform, v0, v1, v2 float32) { 3136 defer func() { 3137 errstr := ctx.errDrain() 3138 log.Printf("gl.Uniform3f(%v, %v, %v, %v) %v", dst, v0, v1, v2, errstr) 3139 }() 3140 ctx.enqueueDebug(call{ 3141 args: fnargs{ 3142 fn: glfnUniform3f, 3143 a0: dst.c(), 3144 a1: uintptr(math.Float32bits(v0)), 3145 a2: uintptr(math.Float32bits(v1)), 3146 a3: uintptr(math.Float32bits(v2)), 3147 }, 3148 blocking: true}) 3149 } 3150 3151 func (ctx *context) Uniform3fv(dst Uniform, src []float32) { 3152 defer func() { 3153 errstr := ctx.errDrain() 3154 log.Printf("gl.Uniform3fv(%v, len(%d)) %v", dst, len(src), errstr) 3155 }() 3156 ctx.enqueueDebug(call{ 3157 args: fnargs{ 3158 fn: glfnUniform3fv, 3159 a0: dst.c(), 3160 a1: uintptr(len(src) / 3), 3161 }, 3162 parg: unsafe.Pointer(&src[0]), 3163 blocking: true, 3164 }) 3165 } 3166 3167 func (ctx *context) Uniform3i(dst Uniform, v0, v1, v2 int32) { 3168 defer func() { 3169 errstr := ctx.errDrain() 3170 log.Printf("gl.Uniform3i(%v, %v, %v, %v) %v", dst, v0, v1, v2, errstr) 3171 }() 3172 ctx.enqueueDebug(call{ 3173 args: fnargs{ 3174 fn: glfnUniform3i, 3175 a0: dst.c(), 3176 a1: uintptr(v0), 3177 a2: uintptr(v1), 3178 a3: uintptr(v2), 3179 }, 3180 blocking: true}) 3181 } 3182 3183 func (ctx *context) Uniform3iv(dst Uniform, src []int32) { 3184 defer func() { 3185 errstr := ctx.errDrain() 3186 log.Printf("gl.Uniform3iv(%v, %v) %v", dst, src, errstr) 3187 }() 3188 ctx.enqueueDebug(call{ 3189 args: fnargs{ 3190 fn: glfnUniform3iv, 3191 a0: dst.c(), 3192 a1: uintptr(len(src) / 3), 3193 }, 3194 parg: unsafe.Pointer(&src[0]), 3195 blocking: true, 3196 }) 3197 } 3198 3199 func (ctx *context) Uniform4f(dst Uniform, v0, v1, v2, v3 float32) { 3200 defer func() { 3201 errstr := ctx.errDrain() 3202 log.Printf("gl.Uniform4f(%v, %v, %v, %v, %v) %v", dst, v0, v1, v2, v3, errstr) 3203 }() 3204 ctx.enqueueDebug(call{ 3205 args: fnargs{ 3206 fn: glfnUniform4f, 3207 a0: dst.c(), 3208 a1: uintptr(math.Float32bits(v0)), 3209 a2: uintptr(math.Float32bits(v1)), 3210 a3: uintptr(math.Float32bits(v2)), 3211 a4: uintptr(math.Float32bits(v3)), 3212 }, 3213 blocking: true}) 3214 } 3215 3216 func (ctx *context) Uniform4fv(dst Uniform, src []float32) { 3217 defer func() { 3218 errstr := ctx.errDrain() 3219 log.Printf("gl.Uniform4fv(%v, len(%d)) %v", dst, len(src), errstr) 3220 }() 3221 ctx.enqueueDebug(call{ 3222 args: fnargs{ 3223 fn: glfnUniform4fv, 3224 a0: dst.c(), 3225 a1: uintptr(len(src) / 4), 3226 }, 3227 parg: unsafe.Pointer(&src[0]), 3228 blocking: true, 3229 }) 3230 } 3231 3232 func (ctx *context) Uniform4i(dst Uniform, v0, v1, v2, v3 int32) { 3233 defer func() { 3234 errstr := ctx.errDrain() 3235 log.Printf("gl.Uniform4i(%v, %v, %v, %v, %v) %v", dst, v0, v1, v2, v3, errstr) 3236 }() 3237 ctx.enqueueDebug(call{ 3238 args: fnargs{ 3239 fn: glfnUniform4i, 3240 a0: dst.c(), 3241 a1: uintptr(v0), 3242 a2: uintptr(v1), 3243 a3: uintptr(v2), 3244 a4: uintptr(v3), 3245 }, 3246 blocking: true}) 3247 } 3248 3249 func (ctx *context) Uniform4iv(dst Uniform, src []int32) { 3250 defer func() { 3251 errstr := ctx.errDrain() 3252 log.Printf("gl.Uniform4iv(%v, %v) %v", dst, src, errstr) 3253 }() 3254 ctx.enqueueDebug(call{ 3255 args: fnargs{ 3256 fn: glfnUniform4iv, 3257 a0: dst.c(), 3258 a1: uintptr(len(src) / 4), 3259 }, 3260 parg: unsafe.Pointer(&src[0]), 3261 blocking: true, 3262 }) 3263 } 3264 3265 func (ctx *context) UniformMatrix2fv(dst Uniform, src []float32) { 3266 defer func() { 3267 errstr := ctx.errDrain() 3268 log.Printf("gl.UniformMatrix2fv(%v, len(%d)) %v", dst, len(src), errstr) 3269 }() 3270 ctx.enqueueDebug(call{ 3271 args: fnargs{ 3272 fn: glfnUniformMatrix2fv, 3273 3274 a0: dst.c(), 3275 a1: uintptr(len(src) / 4), 3276 }, 3277 parg: unsafe.Pointer(&src[0]), 3278 blocking: true, 3279 }) 3280 } 3281 3282 func (ctx *context) UniformMatrix3fv(dst Uniform, src []float32) { 3283 defer func() { 3284 errstr := ctx.errDrain() 3285 log.Printf("gl.UniformMatrix3fv(%v, len(%d)) %v", dst, len(src), errstr) 3286 }() 3287 ctx.enqueueDebug(call{ 3288 args: fnargs{ 3289 fn: glfnUniformMatrix3fv, 3290 a0: dst.c(), 3291 a1: uintptr(len(src) / 9), 3292 }, 3293 parg: unsafe.Pointer(&src[0]), 3294 blocking: true, 3295 }) 3296 } 3297 3298 func (ctx *context) UniformMatrix4fv(dst Uniform, src []float32) { 3299 defer func() { 3300 errstr := ctx.errDrain() 3301 log.Printf("gl.UniformMatrix4fv(%v, len(%d)) %v", dst, len(src), errstr) 3302 }() 3303 ctx.enqueueDebug(call{ 3304 args: fnargs{ 3305 fn: glfnUniformMatrix4fv, 3306 a0: dst.c(), 3307 a1: uintptr(len(src) / 16), 3308 }, 3309 parg: unsafe.Pointer(&src[0]), 3310 blocking: true, 3311 }) 3312 } 3313 3314 func (ctx *context) UseProgram(p Program) { 3315 defer func() { 3316 errstr := ctx.errDrain() 3317 log.Printf("gl.UseProgram(%v) %v", p, errstr) 3318 }() 3319 ctx.enqueueDebug(call{ 3320 args: fnargs{ 3321 fn: glfnUseProgram, 3322 a0: p.c(), 3323 }, 3324 blocking: true}) 3325 } 3326 3327 func (ctx *context) ValidateProgram(p Program) { 3328 defer func() { 3329 errstr := ctx.errDrain() 3330 log.Printf("gl.ValidateProgram(%v) %v", p, errstr) 3331 }() 3332 ctx.enqueueDebug(call{ 3333 args: fnargs{ 3334 fn: glfnValidateProgram, 3335 a0: p.c(), 3336 }, 3337 blocking: true}) 3338 } 3339 3340 func (ctx *context) VertexAttrib1f(dst Attrib, x float32) { 3341 defer func() { 3342 errstr := ctx.errDrain() 3343 log.Printf("gl.VertexAttrib1f(%v, %v) %v", dst, x, errstr) 3344 }() 3345 ctx.enqueueDebug(call{ 3346 args: fnargs{ 3347 fn: glfnVertexAttrib1f, 3348 a0: dst.c(), 3349 a1: uintptr(math.Float32bits(x)), 3350 }, 3351 blocking: true}) 3352 } 3353 3354 func (ctx *context) VertexAttrib1fv(dst Attrib, src []float32) { 3355 defer func() { 3356 errstr := ctx.errDrain() 3357 log.Printf("gl.VertexAttrib1fv(%v, len(%d)) %v", dst, len(src), errstr) 3358 }() 3359 ctx.enqueueDebug(call{ 3360 args: fnargs{ 3361 fn: glfnVertexAttrib1fv, 3362 a0: dst.c(), 3363 }, 3364 parg: unsafe.Pointer(&src[0]), 3365 blocking: true, 3366 }) 3367 } 3368 3369 func (ctx *context) VertexAttrib2f(dst Attrib, x, y float32) { 3370 defer func() { 3371 errstr := ctx.errDrain() 3372 log.Printf("gl.VertexAttrib2f(%v, %v, %v) %v", dst, x, y, errstr) 3373 }() 3374 ctx.enqueueDebug(call{ 3375 args: fnargs{ 3376 fn: glfnVertexAttrib2f, 3377 a0: dst.c(), 3378 a1: uintptr(math.Float32bits(x)), 3379 a2: uintptr(math.Float32bits(y)), 3380 }, 3381 blocking: true}) 3382 } 3383 3384 func (ctx *context) VertexAttrib2fv(dst Attrib, src []float32) { 3385 defer func() { 3386 errstr := ctx.errDrain() 3387 log.Printf("gl.VertexAttrib2fv(%v, len(%d)) %v", dst, len(src), errstr) 3388 }() 3389 ctx.enqueueDebug(call{ 3390 args: fnargs{ 3391 fn: glfnVertexAttrib2fv, 3392 a0: dst.c(), 3393 }, 3394 parg: unsafe.Pointer(&src[0]), 3395 blocking: true, 3396 }) 3397 } 3398 3399 func (ctx *context) VertexAttrib3f(dst Attrib, x, y, z float32) { 3400 defer func() { 3401 errstr := ctx.errDrain() 3402 log.Printf("gl.VertexAttrib3f(%v, %v, %v, %v) %v", dst, x, y, z, errstr) 3403 }() 3404 ctx.enqueueDebug(call{ 3405 args: fnargs{ 3406 fn: glfnVertexAttrib3f, 3407 a0: dst.c(), 3408 a1: uintptr(math.Float32bits(x)), 3409 a2: uintptr(math.Float32bits(y)), 3410 a3: uintptr(math.Float32bits(z)), 3411 }, 3412 blocking: true}) 3413 } 3414 3415 func (ctx *context) VertexAttrib3fv(dst Attrib, src []float32) { 3416 defer func() { 3417 errstr := ctx.errDrain() 3418 log.Printf("gl.VertexAttrib3fv(%v, len(%d)) %v", dst, len(src), errstr) 3419 }() 3420 ctx.enqueueDebug(call{ 3421 args: fnargs{ 3422 fn: glfnVertexAttrib3fv, 3423 a0: dst.c(), 3424 }, 3425 parg: unsafe.Pointer(&src[0]), 3426 blocking: true, 3427 }) 3428 } 3429 3430 func (ctx *context) VertexAttrib4f(dst Attrib, x, y, z, w float32) { 3431 defer func() { 3432 errstr := ctx.errDrain() 3433 log.Printf("gl.VertexAttrib4f(%v, %v, %v, %v, %v) %v", dst, x, y, z, w, errstr) 3434 }() 3435 ctx.enqueueDebug(call{ 3436 args: fnargs{ 3437 fn: glfnVertexAttrib4f, 3438 a0: dst.c(), 3439 a1: uintptr(math.Float32bits(x)), 3440 a2: uintptr(math.Float32bits(y)), 3441 a3: uintptr(math.Float32bits(z)), 3442 a4: uintptr(math.Float32bits(w)), 3443 }, 3444 blocking: true}) 3445 } 3446 3447 func (ctx *context) VertexAttrib4fv(dst Attrib, src []float32) { 3448 defer func() { 3449 errstr := ctx.errDrain() 3450 log.Printf("gl.VertexAttrib4fv(%v, len(%d)) %v", dst, len(src), errstr) 3451 }() 3452 ctx.enqueueDebug(call{ 3453 args: fnargs{ 3454 fn: glfnVertexAttrib4fv, 3455 a0: dst.c(), 3456 }, 3457 parg: unsafe.Pointer(&src[0]), 3458 blocking: true, 3459 }) 3460 } 3461 3462 func (ctx *context) VertexAttribPointer(dst Attrib, size int, ty Enum, normalized bool, stride, offset int) { 3463 defer func() { 3464 errstr := ctx.errDrain() 3465 log.Printf("gl.VertexAttribPointer(%v, %v, %v, %v, %v, %v) %v", dst, size, ty, normalized, stride, offset, errstr) 3466 }() 3467 ctx.enqueueDebug(call{ 3468 args: fnargs{ 3469 fn: glfnVertexAttribPointer, 3470 a0: dst.c(), 3471 a1: uintptr(size), 3472 a2: ty.c(), 3473 a3: glBoolean(normalized), 3474 a4: uintptr(stride), 3475 a5: uintptr(offset), 3476 }, 3477 blocking: true}) 3478 } 3479 3480 func (ctx *context) Viewport(x, y, width, height int) { 3481 defer func() { 3482 errstr := ctx.errDrain() 3483 log.Printf("gl.Viewport(%v, %v, %v, %v) %v", x, y, width, height, errstr) 3484 }() 3485 ctx.enqueueDebug(call{ 3486 args: fnargs{ 3487 fn: glfnViewport, 3488 a0: uintptr(x), 3489 a1: uintptr(y), 3490 a2: uintptr(width), 3491 a3: uintptr(height), 3492 }, 3493 blocking: true}) 3494 } 3495 3496 func (ctx context3) UniformMatrix2x3fv(dst Uniform, src []float32) { 3497 defer func() { 3498 errstr := ctx.errDrain() 3499 log.Printf("gl.UniformMatrix2x3fv(%v, len(%d)) %v", dst, len(src), errstr) 3500 }() 3501 ctx.enqueueDebug(call{ 3502 args: fnargs{ 3503 fn: glfnUniformMatrix2x3fv, 3504 a0: dst.c(), 3505 a1: uintptr(len(src) / 6), 3506 }, 3507 parg: unsafe.Pointer(&src[0]), 3508 blocking: true, 3509 }) 3510 } 3511 3512 func (ctx context3) UniformMatrix3x2fv(dst Uniform, src []float32) { 3513 defer func() { 3514 errstr := ctx.errDrain() 3515 log.Printf("gl.UniformMatrix3x2fv(%v, len(%d)) %v", dst, len(src), errstr) 3516 }() 3517 ctx.enqueueDebug(call{ 3518 args: fnargs{ 3519 fn: glfnUniformMatrix3x2fv, 3520 a0: dst.c(), 3521 a1: uintptr(len(src) / 6), 3522 }, 3523 parg: unsafe.Pointer(&src[0]), 3524 blocking: true, 3525 }) 3526 } 3527 3528 func (ctx context3) UniformMatrix2x4fv(dst Uniform, src []float32) { 3529 defer func() { 3530 errstr := ctx.errDrain() 3531 log.Printf("gl.UniformMatrix2x4fv(%v, len(%d)) %v", dst, len(src), errstr) 3532 }() 3533 ctx.enqueueDebug(call{ 3534 args: fnargs{ 3535 fn: glfnUniformMatrix2x4fv, 3536 a0: dst.c(), 3537 a1: uintptr(len(src) / 8), 3538 }, 3539 parg: unsafe.Pointer(&src[0]), 3540 blocking: true, 3541 }) 3542 } 3543 3544 func (ctx context3) UniformMatrix4x2fv(dst Uniform, src []float32) { 3545 defer func() { 3546 errstr := ctx.errDrain() 3547 log.Printf("gl.UniformMatrix4x2fv(%v, len(%d)) %v", dst, len(src), errstr) 3548 }() 3549 ctx.enqueueDebug(call{ 3550 args: fnargs{ 3551 fn: glfnUniformMatrix4x2fv, 3552 a0: dst.c(), 3553 a1: uintptr(len(src) / 8), 3554 }, 3555 parg: unsafe.Pointer(&src[0]), 3556 blocking: true, 3557 }) 3558 } 3559 3560 func (ctx context3) UniformMatrix3x4fv(dst Uniform, src []float32) { 3561 defer func() { 3562 errstr := ctx.errDrain() 3563 log.Printf("gl.UniformMatrix3x4fv(%v, len(%d)) %v", dst, len(src), errstr) 3564 }() 3565 ctx.enqueueDebug(call{ 3566 args: fnargs{ 3567 fn: glfnUniformMatrix3x4fv, 3568 a0: dst.c(), 3569 a1: uintptr(len(src) / 12), 3570 }, 3571 parg: unsafe.Pointer(&src[0]), 3572 blocking: true, 3573 }) 3574 } 3575 3576 func (ctx context3) UniformMatrix4x3fv(dst Uniform, src []float32) { 3577 defer func() { 3578 errstr := ctx.errDrain() 3579 log.Printf("gl.UniformMatrix4x3fv(%v, len(%d)) %v", dst, len(src), errstr) 3580 }() 3581 ctx.enqueueDebug(call{ 3582 args: fnargs{ 3583 fn: glfnUniformMatrix4x3fv, 3584 a0: dst.c(), 3585 a1: uintptr(len(src) / 12), 3586 }, 3587 parg: unsafe.Pointer(&src[0]), 3588 blocking: true, 3589 }) 3590 } 3591 3592 func (ctx context3) BlitFramebuffer(srcX0, srcY0, srcX1, srcY1, dstX0, dstY0, dstX1, dstY1 int, mask uint, filter Enum) { 3593 defer func() { 3594 errstr := ctx.errDrain() 3595 log.Printf("gl.BlitFramebuffer(%v, %v, %v, %v, %v, %v, %v, %v, %v, %v) %v", srcX0, srcY0, srcX1, srcY1, dstX0, dstY0, dstX1, dstY1, mask, filter, errstr) 3596 }() 3597 ctx.enqueueDebug(call{ 3598 args: fnargs{ 3599 fn: glfnBlitFramebuffer, 3600 a0: uintptr(srcX0), 3601 a1: uintptr(srcY0), 3602 a2: uintptr(srcX1), 3603 a3: uintptr(srcY1), 3604 a4: uintptr(dstX0), 3605 a5: uintptr(dstY0), 3606 a6: uintptr(dstX1), 3607 a7: uintptr(dstY1), 3608 a8: uintptr(mask), 3609 a9: filter.c(), 3610 }, 3611 blocking: true}) 3612 } 3613 3614 func (ctx context3) Uniform1ui(dst Uniform, v uint32) { 3615 defer func() { 3616 errstr := ctx.errDrain() 3617 log.Printf("gl.Uniform1ui(%v, %v) %v", dst, v, errstr) 3618 }() 3619 ctx.enqueueDebug(call{ 3620 args: fnargs{ 3621 fn: glfnUniform1ui, 3622 a0: dst.c(), 3623 a1: uintptr(v), 3624 }, 3625 blocking: true}) 3626 } 3627 3628 func (ctx context3) Uniform2ui(dst Uniform, v0, v1 uint32) { 3629 defer func() { 3630 errstr := ctx.errDrain() 3631 log.Printf("gl.Uniform2ui(%v, %v, %v) %v", dst, v0, v1, errstr) 3632 }() 3633 ctx.enqueueDebug(call{ 3634 args: fnargs{ 3635 fn: glfnUniform2ui, 3636 a0: dst.c(), 3637 a1: uintptr(v0), 3638 a2: uintptr(v1), 3639 }, 3640 blocking: true}) 3641 } 3642 3643 func (ctx context3) Uniform3ui(dst Uniform, v0, v1, v2 uint) { 3644 defer func() { 3645 errstr := ctx.errDrain() 3646 log.Printf("gl.Uniform3ui(%v, %v, %v, %v) %v", dst, v0, v1, v2, errstr) 3647 }() 3648 ctx.enqueueDebug(call{ 3649 args: fnargs{ 3650 fn: glfnUniform3ui, 3651 a0: dst.c(), 3652 a1: uintptr(v0), 3653 a2: uintptr(v1), 3654 a3: uintptr(v2), 3655 }, 3656 blocking: true}) 3657 } 3658 3659 func (ctx context3) Uniform4ui(dst Uniform, v0, v1, v2, v3 uint32) { 3660 defer func() { 3661 errstr := ctx.errDrain() 3662 log.Printf("gl.Uniform4ui(%v, %v, %v, %v, %v) %v", dst, v0, v1, v2, v3, errstr) 3663 }() 3664 ctx.enqueueDebug(call{ 3665 args: fnargs{ 3666 fn: glfnUniform4ui, 3667 a0: dst.c(), 3668 a1: uintptr(v0), 3669 a2: uintptr(v1), 3670 a3: uintptr(v2), 3671 a4: uintptr(v3), 3672 }, 3673 blocking: true}) 3674 }