indirect_dispatch_swap.c (162722B)
1 /* DO NOT EDIT - This file generated automatically by glX_proto_recv.py (from Mesa) script */ 2 3 /* 4 * (C) Copyright IBM Corporation 2005 5 * All Rights Reserved. 6 * 7 * Permission is hereby granted, free of charge, to any person obtaining a 8 * copy of this software and associated documentation files (the "Software"), 9 * to deal in the Software without restriction, including without limitation 10 * the rights to use, copy, modify, merge, publish, distribute, sub license, 11 * and/or sell copies of the Software, and to permit persons to whom the 12 * Software is furnished to do so, subject to the following conditions: 13 * 14 * The above copyright notice and this permission notice (including the next 15 * paragraph) shall be included in all copies or substantial portions of the 16 * Software. 17 * 18 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 19 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 20 * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL 21 * IBM, 22 * AND/OR THEIR SUPPLIERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, 23 * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF 24 * OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 25 * SOFTWARE. 26 */ 27 28 #include <inttypes.h> 29 #include "glxserver.h" 30 #include "indirect_size.h" 31 #include "indirect_size_get.h" 32 #include "indirect_dispatch.h" 33 #include "glxbyteorder.h" 34 #include "indirect_util.h" 35 #include "singlesize.h" 36 37 #define __GLX_PAD(x) (((x) + 3) & ~3) 38 39 typedef struct { 40 __GLX_PIXEL_3D_HDR; 41 } __GLXpixel3DHeader; 42 43 extern GLboolean __glXErrorOccured(void); 44 extern void __glXClearErrorOccured(void); 45 46 static const unsigned dummy_answer[2] = { 0, 0 }; 47 48 static GLsizei 49 bswap_CARD32(const void *src) 50 { 51 union { 52 uint32_t dst; 53 GLsizei ret; 54 } x; 55 56 x.dst = bswap_32(*(uint32_t *) src); 57 return x.ret; 58 } 59 60 static GLshort 61 bswap_CARD16(const void *src) 62 { 63 union { 64 uint16_t dst; 65 GLshort ret; 66 } x; 67 68 x.dst = bswap_16(*(uint16_t *) src); 69 return x.ret; 70 } 71 72 static GLenum 73 bswap_ENUM(const void *src) 74 { 75 union { 76 uint32_t dst; 77 GLenum ret; 78 } x; 79 80 x.dst = bswap_32(*(uint32_t *) src); 81 return x.ret; 82 } 83 84 static GLdouble 85 bswap_FLOAT64(const void *src) 86 { 87 union { 88 uint64_t dst; 89 GLdouble ret; 90 } x; 91 92 x.dst = bswap_64(*(uint64_t *) src); 93 return x.ret; 94 } 95 96 static GLfloat 97 bswap_FLOAT32(const void *src) 98 { 99 union { 100 uint32_t dst; 101 GLfloat ret; 102 } x; 103 104 x.dst = bswap_32(*(uint32_t *) src); 105 return x.ret; 106 } 107 108 static void * 109 bswap_16_array(uint16_t * src, unsigned count) 110 { 111 unsigned i; 112 113 for (i = 0; i < count; i++) { 114 uint16_t temp = bswap_16(src[i]); 115 116 src[i] = temp; 117 } 118 119 return src; 120 } 121 122 static void * 123 bswap_32_array(uint32_t * src, unsigned count) 124 { 125 unsigned i; 126 127 for (i = 0; i < count; i++) { 128 uint32_t temp = bswap_32(src[i]); 129 130 src[i] = temp; 131 } 132 133 return src; 134 } 135 136 static void * 137 bswap_64_array(uint64_t * src, unsigned count) 138 { 139 unsigned i; 140 141 for (i = 0; i < count; i++) { 142 uint64_t temp = bswap_64(src[i]); 143 144 src[i] = temp; 145 } 146 147 return src; 148 } 149 150 int 151 __glXDispSwap_NewList(__GLXclientState * cl, GLbyte * pc) 152 { 153 xGLXSingleReq *const req = (xGLXSingleReq *) pc; 154 int error; 155 __GLXcontext *const cx = 156 __glXForceCurrent(cl, bswap_CARD32(&req->contextTag), &error); 157 158 pc += __GLX_SINGLE_HDR_SIZE; 159 if (cx != NULL) { 160 glNewList((GLuint) bswap_CARD32(pc + 0), (GLenum) bswap_ENUM(pc + 4)); 161 error = Success; 162 } 163 164 return error; 165 } 166 167 int 168 __glXDispSwap_EndList(__GLXclientState * cl, GLbyte * pc) 169 { 170 xGLXSingleReq *const req = (xGLXSingleReq *) pc; 171 int error; 172 __GLXcontext *const cx = 173 __glXForceCurrent(cl, bswap_CARD32(&req->contextTag), &error); 174 175 pc += __GLX_SINGLE_HDR_SIZE; 176 if (cx != NULL) { 177 glEndList(); 178 error = Success; 179 } 180 181 return error; 182 } 183 184 void 185 __glXDispSwap_CallList(GLbyte * pc) 186 { 187 glCallList((GLuint) bswap_CARD32(pc + 0)); 188 } 189 190 void 191 __glXDispSwap_CallLists(GLbyte * pc) 192 { 193 const GLsizei n = (GLsizei) bswap_CARD32(pc + 0); 194 const GLenum type = (GLenum) bswap_ENUM(pc + 4); 195 const GLvoid *lists; 196 197 switch (type) { 198 case GL_BYTE: 199 case GL_UNSIGNED_BYTE: 200 case GL_2_BYTES: 201 case GL_3_BYTES: 202 case GL_4_BYTES: 203 lists = (const GLvoid *) (pc + 8); 204 break; 205 case GL_SHORT: 206 case GL_UNSIGNED_SHORT: 207 lists = (const GLvoid *) bswap_16_array((uint16_t *) (pc + 8), n); 208 break; 209 case GL_INT: 210 case GL_UNSIGNED_INT: 211 case GL_FLOAT: 212 lists = (const GLvoid *) bswap_32_array((uint32_t *) (pc + 8), n); 213 break; 214 default: 215 return; 216 } 217 218 glCallLists(n, type, lists); 219 } 220 221 int 222 __glXDispSwap_DeleteLists(__GLXclientState * cl, GLbyte * pc) 223 { 224 xGLXSingleReq *const req = (xGLXSingleReq *) pc; 225 int error; 226 __GLXcontext *const cx = 227 __glXForceCurrent(cl, bswap_CARD32(&req->contextTag), &error); 228 229 pc += __GLX_SINGLE_HDR_SIZE; 230 if (cx != NULL) { 231 glDeleteLists((GLuint) bswap_CARD32(pc + 0), 232 (GLsizei) bswap_CARD32(pc + 4)); 233 error = Success; 234 } 235 236 return error; 237 } 238 239 int 240 __glXDispSwap_GenLists(__GLXclientState * cl, GLbyte * pc) 241 { 242 xGLXSingleReq *const req = (xGLXSingleReq *) pc; 243 int error; 244 __GLXcontext *const cx = 245 __glXForceCurrent(cl, bswap_CARD32(&req->contextTag), &error); 246 247 pc += __GLX_SINGLE_HDR_SIZE; 248 if (cx != NULL) { 249 GLuint retval; 250 251 retval = glGenLists((GLsizei) bswap_CARD32(pc + 0)); 252 __glXSendReplySwap(cl->client, dummy_answer, 0, 0, GL_FALSE, retval); 253 error = Success; 254 } 255 256 return error; 257 } 258 259 void 260 __glXDispSwap_ListBase(GLbyte * pc) 261 { 262 glListBase((GLuint) bswap_CARD32(pc + 0)); 263 } 264 265 void 266 __glXDispSwap_Begin(GLbyte * pc) 267 { 268 glBegin((GLenum) bswap_ENUM(pc + 0)); 269 } 270 271 void 272 __glXDispSwap_Bitmap(GLbyte * pc) 273 { 274 const GLubyte *const bitmap = (const GLubyte *) ((pc + 44)); 275 __GLXpixelHeader *const hdr = (__GLXpixelHeader *) (pc); 276 277 glPixelStorei(GL_UNPACK_LSB_FIRST, hdr->lsbFirst); 278 glPixelStorei(GL_UNPACK_ROW_LENGTH, (GLint) bswap_CARD32(&hdr->rowLength)); 279 glPixelStorei(GL_UNPACK_SKIP_ROWS, (GLint) bswap_CARD32(&hdr->skipRows)); 280 glPixelStorei(GL_UNPACK_SKIP_PIXELS, 281 (GLint) bswap_CARD32(&hdr->skipPixels)); 282 glPixelStorei(GL_UNPACK_ALIGNMENT, (GLint) bswap_CARD32(&hdr->alignment)); 283 284 glBitmap((GLsizei) bswap_CARD32(pc + 20), 285 (GLsizei) bswap_CARD32(pc + 24), 286 (GLfloat) bswap_FLOAT32(pc + 28), 287 (GLfloat) bswap_FLOAT32(pc + 32), 288 (GLfloat) bswap_FLOAT32(pc + 36), 289 (GLfloat) bswap_FLOAT32(pc + 40), bitmap); 290 } 291 292 void 293 __glXDispSwap_Color3bv(GLbyte * pc) 294 { 295 glColor3bv((const GLbyte *) (pc + 0)); 296 } 297 298 void 299 __glXDispSwap_Color3dv(GLbyte * pc) 300 { 301 #ifdef __GLX_ALIGN64 302 if ((unsigned long) (pc) & 7) { 303 (void) memmove(pc - 4, pc, 24); 304 pc -= 4; 305 } 306 #endif 307 308 glColor3dv((const GLdouble *) bswap_64_array((uint64_t *) (pc + 0), 3)); 309 } 310 311 void 312 __glXDispSwap_Color3fv(GLbyte * pc) 313 { 314 glColor3fv((const GLfloat *) bswap_32_array((uint32_t *) (pc + 0), 3)); 315 } 316 317 void 318 __glXDispSwap_Color3iv(GLbyte * pc) 319 { 320 glColor3iv((const GLint *) bswap_32_array((uint32_t *) (pc + 0), 3)); 321 } 322 323 void 324 __glXDispSwap_Color3sv(GLbyte * pc) 325 { 326 glColor3sv((const GLshort *) bswap_16_array((uint16_t *) (pc + 0), 3)); 327 } 328 329 void 330 __glXDispSwap_Color3ubv(GLbyte * pc) 331 { 332 glColor3ubv((const GLubyte *) (pc + 0)); 333 } 334 335 void 336 __glXDispSwap_Color3uiv(GLbyte * pc) 337 { 338 glColor3uiv((const GLuint *) bswap_32_array((uint32_t *) (pc + 0), 3)); 339 } 340 341 void 342 __glXDispSwap_Color3usv(GLbyte * pc) 343 { 344 glColor3usv((const GLushort *) bswap_16_array((uint16_t *) (pc + 0), 3)); 345 } 346 347 void 348 __glXDispSwap_Color4bv(GLbyte * pc) 349 { 350 glColor4bv((const GLbyte *) (pc + 0)); 351 } 352 353 void 354 __glXDispSwap_Color4dv(GLbyte * pc) 355 { 356 #ifdef __GLX_ALIGN64 357 if ((unsigned long) (pc) & 7) { 358 (void) memmove(pc - 4, pc, 32); 359 pc -= 4; 360 } 361 #endif 362 363 glColor4dv((const GLdouble *) bswap_64_array((uint64_t *) (pc + 0), 4)); 364 } 365 366 void 367 __glXDispSwap_Color4fv(GLbyte * pc) 368 { 369 glColor4fv((const GLfloat *) bswap_32_array((uint32_t *) (pc + 0), 4)); 370 } 371 372 void 373 __glXDispSwap_Color4iv(GLbyte * pc) 374 { 375 glColor4iv((const GLint *) bswap_32_array((uint32_t *) (pc + 0), 4)); 376 } 377 378 void 379 __glXDispSwap_Color4sv(GLbyte * pc) 380 { 381 glColor4sv((const GLshort *) bswap_16_array((uint16_t *) (pc + 0), 4)); 382 } 383 384 void 385 __glXDispSwap_Color4ubv(GLbyte * pc) 386 { 387 glColor4ubv((const GLubyte *) (pc + 0)); 388 } 389 390 void 391 __glXDispSwap_Color4uiv(GLbyte * pc) 392 { 393 glColor4uiv((const GLuint *) bswap_32_array((uint32_t *) (pc + 0), 4)); 394 } 395 396 void 397 __glXDispSwap_Color4usv(GLbyte * pc) 398 { 399 glColor4usv((const GLushort *) bswap_16_array((uint16_t *) (pc + 0), 4)); 400 } 401 402 void 403 __glXDispSwap_EdgeFlagv(GLbyte * pc) 404 { 405 glEdgeFlagv((const GLboolean *) (pc + 0)); 406 } 407 408 void 409 __glXDispSwap_End(GLbyte * pc) 410 { 411 glEnd(); 412 } 413 414 void 415 __glXDispSwap_Indexdv(GLbyte * pc) 416 { 417 #ifdef __GLX_ALIGN64 418 if ((unsigned long) (pc) & 7) { 419 (void) memmove(pc - 4, pc, 8); 420 pc -= 4; 421 } 422 #endif 423 424 glIndexdv((const GLdouble *) bswap_64_array((uint64_t *) (pc + 0), 1)); 425 } 426 427 void 428 __glXDispSwap_Indexfv(GLbyte * pc) 429 { 430 glIndexfv((const GLfloat *) bswap_32_array((uint32_t *) (pc + 0), 1)); 431 } 432 433 void 434 __glXDispSwap_Indexiv(GLbyte * pc) 435 { 436 glIndexiv((const GLint *) bswap_32_array((uint32_t *) (pc + 0), 1)); 437 } 438 439 void 440 __glXDispSwap_Indexsv(GLbyte * pc) 441 { 442 glIndexsv((const GLshort *) bswap_16_array((uint16_t *) (pc + 0), 1)); 443 } 444 445 void 446 __glXDispSwap_Normal3bv(GLbyte * pc) 447 { 448 glNormal3bv((const GLbyte *) (pc + 0)); 449 } 450 451 void 452 __glXDispSwap_Normal3dv(GLbyte * pc) 453 { 454 #ifdef __GLX_ALIGN64 455 if ((unsigned long) (pc) & 7) { 456 (void) memmove(pc - 4, pc, 24); 457 pc -= 4; 458 } 459 #endif 460 461 glNormal3dv((const GLdouble *) bswap_64_array((uint64_t *) (pc + 0), 3)); 462 } 463 464 void 465 __glXDispSwap_Normal3fv(GLbyte * pc) 466 { 467 glNormal3fv((const GLfloat *) bswap_32_array((uint32_t *) (pc + 0), 3)); 468 } 469 470 void 471 __glXDispSwap_Normal3iv(GLbyte * pc) 472 { 473 glNormal3iv((const GLint *) bswap_32_array((uint32_t *) (pc + 0), 3)); 474 } 475 476 void 477 __glXDispSwap_Normal3sv(GLbyte * pc) 478 { 479 glNormal3sv((const GLshort *) bswap_16_array((uint16_t *) (pc + 0), 3)); 480 } 481 482 void 483 __glXDispSwap_RasterPos2dv(GLbyte * pc) 484 { 485 #ifdef __GLX_ALIGN64 486 if ((unsigned long) (pc) & 7) { 487 (void) memmove(pc - 4, pc, 16); 488 pc -= 4; 489 } 490 #endif 491 492 glRasterPos2dv((const GLdouble *) bswap_64_array((uint64_t *) (pc + 0), 2)); 493 } 494 495 void 496 __glXDispSwap_RasterPos2fv(GLbyte * pc) 497 { 498 glRasterPos2fv((const GLfloat *) bswap_32_array((uint32_t *) (pc + 0), 2)); 499 } 500 501 void 502 __glXDispSwap_RasterPos2iv(GLbyte * pc) 503 { 504 glRasterPos2iv((const GLint *) bswap_32_array((uint32_t *) (pc + 0), 2)); 505 } 506 507 void 508 __glXDispSwap_RasterPos2sv(GLbyte * pc) 509 { 510 glRasterPos2sv((const GLshort *) bswap_16_array((uint16_t *) (pc + 0), 2)); 511 } 512 513 void 514 __glXDispSwap_RasterPos3dv(GLbyte * pc) 515 { 516 #ifdef __GLX_ALIGN64 517 if ((unsigned long) (pc) & 7) { 518 (void) memmove(pc - 4, pc, 24); 519 pc -= 4; 520 } 521 #endif 522 523 glRasterPos3dv((const GLdouble *) bswap_64_array((uint64_t *) (pc + 0), 3)); 524 } 525 526 void 527 __glXDispSwap_RasterPos3fv(GLbyte * pc) 528 { 529 glRasterPos3fv((const GLfloat *) bswap_32_array((uint32_t *) (pc + 0), 3)); 530 } 531 532 void 533 __glXDispSwap_RasterPos3iv(GLbyte * pc) 534 { 535 glRasterPos3iv((const GLint *) bswap_32_array((uint32_t *) (pc + 0), 3)); 536 } 537 538 void 539 __glXDispSwap_RasterPos3sv(GLbyte * pc) 540 { 541 glRasterPos3sv((const GLshort *) bswap_16_array((uint16_t *) (pc + 0), 3)); 542 } 543 544 void 545 __glXDispSwap_RasterPos4dv(GLbyte * pc) 546 { 547 #ifdef __GLX_ALIGN64 548 if ((unsigned long) (pc) & 7) { 549 (void) memmove(pc - 4, pc, 32); 550 pc -= 4; 551 } 552 #endif 553 554 glRasterPos4dv((const GLdouble *) bswap_64_array((uint64_t *) (pc + 0), 4)); 555 } 556 557 void 558 __glXDispSwap_RasterPos4fv(GLbyte * pc) 559 { 560 glRasterPos4fv((const GLfloat *) bswap_32_array((uint32_t *) (pc + 0), 4)); 561 } 562 563 void 564 __glXDispSwap_RasterPos4iv(GLbyte * pc) 565 { 566 glRasterPos4iv((const GLint *) bswap_32_array((uint32_t *) (pc + 0), 4)); 567 } 568 569 void 570 __glXDispSwap_RasterPos4sv(GLbyte * pc) 571 { 572 glRasterPos4sv((const GLshort *) bswap_16_array((uint16_t *) (pc + 0), 4)); 573 } 574 575 void 576 __glXDispSwap_Rectdv(GLbyte * pc) 577 { 578 #ifdef __GLX_ALIGN64 579 if ((unsigned long) (pc) & 7) { 580 (void) memmove(pc - 4, pc, 32); 581 pc -= 4; 582 } 583 #endif 584 585 glRectdv((const GLdouble *) bswap_64_array((uint64_t *) (pc + 0), 2), 586 (const GLdouble *) bswap_64_array((uint64_t *) (pc + 16), 2)); 587 } 588 589 void 590 __glXDispSwap_Rectfv(GLbyte * pc) 591 { 592 glRectfv((const GLfloat *) bswap_32_array((uint32_t *) (pc + 0), 2), 593 (const GLfloat *) bswap_32_array((uint32_t *) (pc + 8), 2)); 594 } 595 596 void 597 __glXDispSwap_Rectiv(GLbyte * pc) 598 { 599 glRectiv((const GLint *) bswap_32_array((uint32_t *) (pc + 0), 2), 600 (const GLint *) bswap_32_array((uint32_t *) (pc + 8), 2)); 601 } 602 603 void 604 __glXDispSwap_Rectsv(GLbyte * pc) 605 { 606 glRectsv((const GLshort *) bswap_16_array((uint16_t *) (pc + 0), 2), 607 (const GLshort *) bswap_16_array((uint16_t *) (pc + 4), 2)); 608 } 609 610 void 611 __glXDispSwap_TexCoord1dv(GLbyte * pc) 612 { 613 #ifdef __GLX_ALIGN64 614 if ((unsigned long) (pc) & 7) { 615 (void) memmove(pc - 4, pc, 8); 616 pc -= 4; 617 } 618 #endif 619 620 glTexCoord1dv((const GLdouble *) bswap_64_array((uint64_t *) (pc + 0), 1)); 621 } 622 623 void 624 __glXDispSwap_TexCoord1fv(GLbyte * pc) 625 { 626 glTexCoord1fv((const GLfloat *) bswap_32_array((uint32_t *) (pc + 0), 1)); 627 } 628 629 void 630 __glXDispSwap_TexCoord1iv(GLbyte * pc) 631 { 632 glTexCoord1iv((const GLint *) bswap_32_array((uint32_t *) (pc + 0), 1)); 633 } 634 635 void 636 __glXDispSwap_TexCoord1sv(GLbyte * pc) 637 { 638 glTexCoord1sv((const GLshort *) bswap_16_array((uint16_t *) (pc + 0), 1)); 639 } 640 641 void 642 __glXDispSwap_TexCoord2dv(GLbyte * pc) 643 { 644 #ifdef __GLX_ALIGN64 645 if ((unsigned long) (pc) & 7) { 646 (void) memmove(pc - 4, pc, 16); 647 pc -= 4; 648 } 649 #endif 650 651 glTexCoord2dv((const GLdouble *) bswap_64_array((uint64_t *) (pc + 0), 2)); 652 } 653 654 void 655 __glXDispSwap_TexCoord2fv(GLbyte * pc) 656 { 657 glTexCoord2fv((const GLfloat *) bswap_32_array((uint32_t *) (pc + 0), 2)); 658 } 659 660 void 661 __glXDispSwap_TexCoord2iv(GLbyte * pc) 662 { 663 glTexCoord2iv((const GLint *) bswap_32_array((uint32_t *) (pc + 0), 2)); 664 } 665 666 void 667 __glXDispSwap_TexCoord2sv(GLbyte * pc) 668 { 669 glTexCoord2sv((const GLshort *) bswap_16_array((uint16_t *) (pc + 0), 2)); 670 } 671 672 void 673 __glXDispSwap_TexCoord3dv(GLbyte * pc) 674 { 675 #ifdef __GLX_ALIGN64 676 if ((unsigned long) (pc) & 7) { 677 (void) memmove(pc - 4, pc, 24); 678 pc -= 4; 679 } 680 #endif 681 682 glTexCoord3dv((const GLdouble *) bswap_64_array((uint64_t *) (pc + 0), 3)); 683 } 684 685 void 686 __glXDispSwap_TexCoord3fv(GLbyte * pc) 687 { 688 glTexCoord3fv((const GLfloat *) bswap_32_array((uint32_t *) (pc + 0), 3)); 689 } 690 691 void 692 __glXDispSwap_TexCoord3iv(GLbyte * pc) 693 { 694 glTexCoord3iv((const GLint *) bswap_32_array((uint32_t *) (pc + 0), 3)); 695 } 696 697 void 698 __glXDispSwap_TexCoord3sv(GLbyte * pc) 699 { 700 glTexCoord3sv((const GLshort *) bswap_16_array((uint16_t *) (pc + 0), 3)); 701 } 702 703 void 704 __glXDispSwap_TexCoord4dv(GLbyte * pc) 705 { 706 #ifdef __GLX_ALIGN64 707 if ((unsigned long) (pc) & 7) { 708 (void) memmove(pc - 4, pc, 32); 709 pc -= 4; 710 } 711 #endif 712 713 glTexCoord4dv((const GLdouble *) bswap_64_array((uint64_t *) (pc + 0), 4)); 714 } 715 716 void 717 __glXDispSwap_TexCoord4fv(GLbyte * pc) 718 { 719 glTexCoord4fv((const GLfloat *) bswap_32_array((uint32_t *) (pc + 0), 4)); 720 } 721 722 void 723 __glXDispSwap_TexCoord4iv(GLbyte * pc) 724 { 725 glTexCoord4iv((const GLint *) bswap_32_array((uint32_t *) (pc + 0), 4)); 726 } 727 728 void 729 __glXDispSwap_TexCoord4sv(GLbyte * pc) 730 { 731 glTexCoord4sv((const GLshort *) bswap_16_array((uint16_t *) (pc + 0), 4)); 732 } 733 734 void 735 __glXDispSwap_Vertex2dv(GLbyte * pc) 736 { 737 #ifdef __GLX_ALIGN64 738 if ((unsigned long) (pc) & 7) { 739 (void) memmove(pc - 4, pc, 16); 740 pc -= 4; 741 } 742 #endif 743 744 glVertex2dv((const GLdouble *) bswap_64_array((uint64_t *) (pc + 0), 2)); 745 } 746 747 void 748 __glXDispSwap_Vertex2fv(GLbyte * pc) 749 { 750 glVertex2fv((const GLfloat *) bswap_32_array((uint32_t *) (pc + 0), 2)); 751 } 752 753 void 754 __glXDispSwap_Vertex2iv(GLbyte * pc) 755 { 756 glVertex2iv((const GLint *) bswap_32_array((uint32_t *) (pc + 0), 2)); 757 } 758 759 void 760 __glXDispSwap_Vertex2sv(GLbyte * pc) 761 { 762 glVertex2sv((const GLshort *) bswap_16_array((uint16_t *) (pc + 0), 2)); 763 } 764 765 void 766 __glXDispSwap_Vertex3dv(GLbyte * pc) 767 { 768 #ifdef __GLX_ALIGN64 769 if ((unsigned long) (pc) & 7) { 770 (void) memmove(pc - 4, pc, 24); 771 pc -= 4; 772 } 773 #endif 774 775 glVertex3dv((const GLdouble *) bswap_64_array((uint64_t *) (pc + 0), 3)); 776 } 777 778 void 779 __glXDispSwap_Vertex3fv(GLbyte * pc) 780 { 781 glVertex3fv((const GLfloat *) bswap_32_array((uint32_t *) (pc + 0), 3)); 782 } 783 784 void 785 __glXDispSwap_Vertex3iv(GLbyte * pc) 786 { 787 glVertex3iv((const GLint *) bswap_32_array((uint32_t *) (pc + 0), 3)); 788 } 789 790 void 791 __glXDispSwap_Vertex3sv(GLbyte * pc) 792 { 793 glVertex3sv((const GLshort *) bswap_16_array((uint16_t *) (pc + 0), 3)); 794 } 795 796 void 797 __glXDispSwap_Vertex4dv(GLbyte * pc) 798 { 799 #ifdef __GLX_ALIGN64 800 if ((unsigned long) (pc) & 7) { 801 (void) memmove(pc - 4, pc, 32); 802 pc -= 4; 803 } 804 #endif 805 806 glVertex4dv((const GLdouble *) bswap_64_array((uint64_t *) (pc + 0), 4)); 807 } 808 809 void 810 __glXDispSwap_Vertex4fv(GLbyte * pc) 811 { 812 glVertex4fv((const GLfloat *) bswap_32_array((uint32_t *) (pc + 0), 4)); 813 } 814 815 void 816 __glXDispSwap_Vertex4iv(GLbyte * pc) 817 { 818 glVertex4iv((const GLint *) bswap_32_array((uint32_t *) (pc + 0), 4)); 819 } 820 821 void 822 __glXDispSwap_Vertex4sv(GLbyte * pc) 823 { 824 glVertex4sv((const GLshort *) bswap_16_array((uint16_t *) (pc + 0), 4)); 825 } 826 827 void 828 __glXDispSwap_ClipPlane(GLbyte * pc) 829 { 830 #ifdef __GLX_ALIGN64 831 if ((unsigned long) (pc) & 7) { 832 (void) memmove(pc - 4, pc, 36); 833 pc -= 4; 834 } 835 #endif 836 837 glClipPlane((GLenum) bswap_ENUM(pc + 32), 838 (const GLdouble *) bswap_64_array((uint64_t *) (pc + 0), 4)); 839 } 840 841 void 842 __glXDispSwap_ColorMaterial(GLbyte * pc) 843 { 844 glColorMaterial((GLenum) bswap_ENUM(pc + 0), (GLenum) bswap_ENUM(pc + 4)); 845 } 846 847 void 848 __glXDispSwap_CullFace(GLbyte * pc) 849 { 850 glCullFace((GLenum) bswap_ENUM(pc + 0)); 851 } 852 853 void 854 __glXDispSwap_Fogf(GLbyte * pc) 855 { 856 glFogf((GLenum) bswap_ENUM(pc + 0), (GLfloat) bswap_FLOAT32(pc + 4)); 857 } 858 859 void 860 __glXDispSwap_Fogfv(GLbyte * pc) 861 { 862 const GLenum pname = (GLenum) bswap_ENUM(pc + 0); 863 const GLfloat *params; 864 865 params = 866 (const GLfloat *) bswap_32_array((uint32_t *) (pc + 4), 867 __glFogfv_size(pname)); 868 869 glFogfv(pname, params); 870 } 871 872 void 873 __glXDispSwap_Fogi(GLbyte * pc) 874 { 875 glFogi((GLenum) bswap_ENUM(pc + 0), (GLint) bswap_CARD32(pc + 4)); 876 } 877 878 void 879 __glXDispSwap_Fogiv(GLbyte * pc) 880 { 881 const GLenum pname = (GLenum) bswap_ENUM(pc + 0); 882 const GLint *params; 883 884 params = 885 (const GLint *) bswap_32_array((uint32_t *) (pc + 4), 886 __glFogiv_size(pname)); 887 888 glFogiv(pname, params); 889 } 890 891 void 892 __glXDispSwap_FrontFace(GLbyte * pc) 893 { 894 glFrontFace((GLenum) bswap_ENUM(pc + 0)); 895 } 896 897 void 898 __glXDispSwap_Hint(GLbyte * pc) 899 { 900 glHint((GLenum) bswap_ENUM(pc + 0), (GLenum) bswap_ENUM(pc + 4)); 901 } 902 903 void 904 __glXDispSwap_Lightf(GLbyte * pc) 905 { 906 glLightf((GLenum) bswap_ENUM(pc + 0), 907 (GLenum) bswap_ENUM(pc + 4), (GLfloat) bswap_FLOAT32(pc + 8)); 908 } 909 910 void 911 __glXDispSwap_Lightfv(GLbyte * pc) 912 { 913 const GLenum pname = (GLenum) bswap_ENUM(pc + 4); 914 const GLfloat *params; 915 916 params = 917 (const GLfloat *) bswap_32_array((uint32_t *) (pc + 8), 918 __glLightfv_size(pname)); 919 920 glLightfv((GLenum) bswap_ENUM(pc + 0), pname, params); 921 } 922 923 void 924 __glXDispSwap_Lighti(GLbyte * pc) 925 { 926 glLighti((GLenum) bswap_ENUM(pc + 0), 927 (GLenum) bswap_ENUM(pc + 4), (GLint) bswap_CARD32(pc + 8)); 928 } 929 930 void 931 __glXDispSwap_Lightiv(GLbyte * pc) 932 { 933 const GLenum pname = (GLenum) bswap_ENUM(pc + 4); 934 const GLint *params; 935 936 params = 937 (const GLint *) bswap_32_array((uint32_t *) (pc + 8), 938 __glLightiv_size(pname)); 939 940 glLightiv((GLenum) bswap_ENUM(pc + 0), pname, params); 941 } 942 943 void 944 __glXDispSwap_LightModelf(GLbyte * pc) 945 { 946 glLightModelf((GLenum) bswap_ENUM(pc + 0), (GLfloat) bswap_FLOAT32(pc + 4)); 947 } 948 949 void 950 __glXDispSwap_LightModelfv(GLbyte * pc) 951 { 952 const GLenum pname = (GLenum) bswap_ENUM(pc + 0); 953 const GLfloat *params; 954 955 params = 956 (const GLfloat *) bswap_32_array((uint32_t *) (pc + 4), 957 __glLightModelfv_size(pname)); 958 959 glLightModelfv(pname, params); 960 } 961 962 void 963 __glXDispSwap_LightModeli(GLbyte * pc) 964 { 965 glLightModeli((GLenum) bswap_ENUM(pc + 0), (GLint) bswap_CARD32(pc + 4)); 966 } 967 968 void 969 __glXDispSwap_LightModeliv(GLbyte * pc) 970 { 971 const GLenum pname = (GLenum) bswap_ENUM(pc + 0); 972 const GLint *params; 973 974 params = 975 (const GLint *) bswap_32_array((uint32_t *) (pc + 4), 976 __glLightModeliv_size(pname)); 977 978 glLightModeliv(pname, params); 979 } 980 981 void 982 __glXDispSwap_LineStipple(GLbyte * pc) 983 { 984 glLineStipple((GLint) bswap_CARD32(pc + 0), 985 (GLushort) bswap_CARD16(pc + 4)); 986 } 987 988 void 989 __glXDispSwap_LineWidth(GLbyte * pc) 990 { 991 glLineWidth((GLfloat) bswap_FLOAT32(pc + 0)); 992 } 993 994 void 995 __glXDispSwap_Materialf(GLbyte * pc) 996 { 997 glMaterialf((GLenum) bswap_ENUM(pc + 0), 998 (GLenum) bswap_ENUM(pc + 4), (GLfloat) bswap_FLOAT32(pc + 8)); 999 } 1000 1001 void 1002 __glXDispSwap_Materialfv(GLbyte * pc) 1003 { 1004 const GLenum pname = (GLenum) bswap_ENUM(pc + 4); 1005 const GLfloat *params; 1006 1007 params = 1008 (const GLfloat *) bswap_32_array((uint32_t *) (pc + 8), 1009 __glMaterialfv_size(pname)); 1010 1011 glMaterialfv((GLenum) bswap_ENUM(pc + 0), pname, params); 1012 } 1013 1014 void 1015 __glXDispSwap_Materiali(GLbyte * pc) 1016 { 1017 glMateriali((GLenum) bswap_ENUM(pc + 0), 1018 (GLenum) bswap_ENUM(pc + 4), (GLint) bswap_CARD32(pc + 8)); 1019 } 1020 1021 void 1022 __glXDispSwap_Materialiv(GLbyte * pc) 1023 { 1024 const GLenum pname = (GLenum) bswap_ENUM(pc + 4); 1025 const GLint *params; 1026 1027 params = 1028 (const GLint *) bswap_32_array((uint32_t *) (pc + 8), 1029 __glMaterialiv_size(pname)); 1030 1031 glMaterialiv((GLenum) bswap_ENUM(pc + 0), pname, params); 1032 } 1033 1034 void 1035 __glXDispSwap_PointSize(GLbyte * pc) 1036 { 1037 glPointSize((GLfloat) bswap_FLOAT32(pc + 0)); 1038 } 1039 1040 void 1041 __glXDispSwap_PolygonMode(GLbyte * pc) 1042 { 1043 glPolygonMode((GLenum) bswap_ENUM(pc + 0), (GLenum) bswap_ENUM(pc + 4)); 1044 } 1045 1046 void 1047 __glXDispSwap_PolygonStipple(GLbyte * pc) 1048 { 1049 const GLubyte *const mask = (const GLubyte *) ((pc + 20)); 1050 __GLXpixelHeader *const hdr = (__GLXpixelHeader *) (pc); 1051 1052 glPixelStorei(GL_UNPACK_LSB_FIRST, hdr->lsbFirst); 1053 glPixelStorei(GL_UNPACK_ROW_LENGTH, (GLint) bswap_CARD32(&hdr->rowLength)); 1054 glPixelStorei(GL_UNPACK_SKIP_ROWS, (GLint) bswap_CARD32(&hdr->skipRows)); 1055 glPixelStorei(GL_UNPACK_SKIP_PIXELS, 1056 (GLint) bswap_CARD32(&hdr->skipPixels)); 1057 glPixelStorei(GL_UNPACK_ALIGNMENT, (GLint) bswap_CARD32(&hdr->alignment)); 1058 1059 glPolygonStipple(mask); 1060 } 1061 1062 void 1063 __glXDispSwap_Scissor(GLbyte * pc) 1064 { 1065 glScissor((GLint) bswap_CARD32(pc + 0), 1066 (GLint) bswap_CARD32(pc + 4), 1067 (GLsizei) bswap_CARD32(pc + 8), (GLsizei) bswap_CARD32(pc + 12)); 1068 } 1069 1070 void 1071 __glXDispSwap_ShadeModel(GLbyte * pc) 1072 { 1073 glShadeModel((GLenum) bswap_ENUM(pc + 0)); 1074 } 1075 1076 void 1077 __glXDispSwap_TexParameterf(GLbyte * pc) 1078 { 1079 glTexParameterf((GLenum) bswap_ENUM(pc + 0), 1080 (GLenum) bswap_ENUM(pc + 4), 1081 (GLfloat) bswap_FLOAT32(pc + 8)); 1082 } 1083 1084 void 1085 __glXDispSwap_TexParameterfv(GLbyte * pc) 1086 { 1087 const GLenum pname = (GLenum) bswap_ENUM(pc + 4); 1088 const GLfloat *params; 1089 1090 params = 1091 (const GLfloat *) bswap_32_array((uint32_t *) (pc + 8), 1092 __glTexParameterfv_size(pname)); 1093 1094 glTexParameterfv((GLenum) bswap_ENUM(pc + 0), pname, params); 1095 } 1096 1097 void 1098 __glXDispSwap_TexParameteri(GLbyte * pc) 1099 { 1100 glTexParameteri((GLenum) bswap_ENUM(pc + 0), 1101 (GLenum) bswap_ENUM(pc + 4), (GLint) bswap_CARD32(pc + 8)); 1102 } 1103 1104 void 1105 __glXDispSwap_TexParameteriv(GLbyte * pc) 1106 { 1107 const GLenum pname = (GLenum) bswap_ENUM(pc + 4); 1108 const GLint *params; 1109 1110 params = 1111 (const GLint *) bswap_32_array((uint32_t *) (pc + 8), 1112 __glTexParameteriv_size(pname)); 1113 1114 glTexParameteriv((GLenum) bswap_ENUM(pc + 0), pname, params); 1115 } 1116 1117 void 1118 __glXDispSwap_TexImage1D(GLbyte * pc) 1119 { 1120 const GLvoid *const pixels = (const GLvoid *) ((pc + 52)); 1121 __GLXpixelHeader *const hdr = (__GLXpixelHeader *) (pc); 1122 1123 glPixelStorei(GL_UNPACK_SWAP_BYTES, hdr->swapBytes); 1124 glPixelStorei(GL_UNPACK_LSB_FIRST, hdr->lsbFirst); 1125 glPixelStorei(GL_UNPACK_ROW_LENGTH, (GLint) bswap_CARD32(&hdr->rowLength)); 1126 glPixelStorei(GL_UNPACK_SKIP_ROWS, (GLint) bswap_CARD32(&hdr->skipRows)); 1127 glPixelStorei(GL_UNPACK_SKIP_PIXELS, 1128 (GLint) bswap_CARD32(&hdr->skipPixels)); 1129 glPixelStorei(GL_UNPACK_ALIGNMENT, (GLint) bswap_CARD32(&hdr->alignment)); 1130 1131 glTexImage1D((GLenum) bswap_ENUM(pc + 20), 1132 (GLint) bswap_CARD32(pc + 24), 1133 (GLint) bswap_CARD32(pc + 28), 1134 (GLsizei) bswap_CARD32(pc + 32), 1135 (GLint) bswap_CARD32(pc + 40), 1136 (GLenum) bswap_ENUM(pc + 44), 1137 (GLenum) bswap_ENUM(pc + 48), pixels); 1138 } 1139 1140 void 1141 __glXDispSwap_TexImage2D(GLbyte * pc) 1142 { 1143 const GLvoid *const pixels = (const GLvoid *) ((pc + 52)); 1144 __GLXpixelHeader *const hdr = (__GLXpixelHeader *) (pc); 1145 1146 glPixelStorei(GL_UNPACK_SWAP_BYTES, hdr->swapBytes); 1147 glPixelStorei(GL_UNPACK_LSB_FIRST, hdr->lsbFirst); 1148 glPixelStorei(GL_UNPACK_ROW_LENGTH, (GLint) bswap_CARD32(&hdr->rowLength)); 1149 glPixelStorei(GL_UNPACK_SKIP_ROWS, (GLint) bswap_CARD32(&hdr->skipRows)); 1150 glPixelStorei(GL_UNPACK_SKIP_PIXELS, 1151 (GLint) bswap_CARD32(&hdr->skipPixels)); 1152 glPixelStorei(GL_UNPACK_ALIGNMENT, (GLint) bswap_CARD32(&hdr->alignment)); 1153 1154 glTexImage2D((GLenum) bswap_ENUM(pc + 20), 1155 (GLint) bswap_CARD32(pc + 24), 1156 (GLint) bswap_CARD32(pc + 28), 1157 (GLsizei) bswap_CARD32(pc + 32), 1158 (GLsizei) bswap_CARD32(pc + 36), 1159 (GLint) bswap_CARD32(pc + 40), 1160 (GLenum) bswap_ENUM(pc + 44), 1161 (GLenum) bswap_ENUM(pc + 48), pixels); 1162 } 1163 1164 void 1165 __glXDispSwap_TexEnvf(GLbyte * pc) 1166 { 1167 glTexEnvf((GLenum) bswap_ENUM(pc + 0), 1168 (GLenum) bswap_ENUM(pc + 4), (GLfloat) bswap_FLOAT32(pc + 8)); 1169 } 1170 1171 void 1172 __glXDispSwap_TexEnvfv(GLbyte * pc) 1173 { 1174 const GLenum pname = (GLenum) bswap_ENUM(pc + 4); 1175 const GLfloat *params; 1176 1177 params = 1178 (const GLfloat *) bswap_32_array((uint32_t *) (pc + 8), 1179 __glTexEnvfv_size(pname)); 1180 1181 glTexEnvfv((GLenum) bswap_ENUM(pc + 0), pname, params); 1182 } 1183 1184 void 1185 __glXDispSwap_TexEnvi(GLbyte * pc) 1186 { 1187 glTexEnvi((GLenum) bswap_ENUM(pc + 0), 1188 (GLenum) bswap_ENUM(pc + 4), (GLint) bswap_CARD32(pc + 8)); 1189 } 1190 1191 void 1192 __glXDispSwap_TexEnviv(GLbyte * pc) 1193 { 1194 const GLenum pname = (GLenum) bswap_ENUM(pc + 4); 1195 const GLint *params; 1196 1197 params = 1198 (const GLint *) bswap_32_array((uint32_t *) (pc + 8), 1199 __glTexEnviv_size(pname)); 1200 1201 glTexEnviv((GLenum) bswap_ENUM(pc + 0), pname, params); 1202 } 1203 1204 void 1205 __glXDispSwap_TexGend(GLbyte * pc) 1206 { 1207 #ifdef __GLX_ALIGN64 1208 if ((unsigned long) (pc) & 7) { 1209 (void) memmove(pc - 4, pc, 16); 1210 pc -= 4; 1211 } 1212 #endif 1213 1214 glTexGend((GLenum) bswap_ENUM(pc + 8), 1215 (GLenum) bswap_ENUM(pc + 12), (GLdouble) bswap_FLOAT64(pc + 0)); 1216 } 1217 1218 void 1219 __glXDispSwap_TexGendv(GLbyte * pc) 1220 { 1221 const GLenum pname = (GLenum) bswap_ENUM(pc + 4); 1222 const GLdouble *params; 1223 1224 #ifdef __GLX_ALIGN64 1225 const GLuint compsize = __glTexGendv_size(pname); 1226 const GLuint cmdlen = 12 + __GLX_PAD((compsize * 8)) - 4; 1227 1228 if ((unsigned long) (pc) & 7) { 1229 (void) memmove(pc - 4, pc, cmdlen); 1230 pc -= 4; 1231 } 1232 #endif 1233 1234 params = 1235 (const GLdouble *) bswap_64_array((uint64_t *) (pc + 8), 1236 __glTexGendv_size(pname)); 1237 1238 glTexGendv((GLenum) bswap_ENUM(pc + 0), pname, params); 1239 } 1240 1241 void 1242 __glXDispSwap_TexGenf(GLbyte * pc) 1243 { 1244 glTexGenf((GLenum) bswap_ENUM(pc + 0), 1245 (GLenum) bswap_ENUM(pc + 4), (GLfloat) bswap_FLOAT32(pc + 8)); 1246 } 1247 1248 void 1249 __glXDispSwap_TexGenfv(GLbyte * pc) 1250 { 1251 const GLenum pname = (GLenum) bswap_ENUM(pc + 4); 1252 const GLfloat *params; 1253 1254 params = 1255 (const GLfloat *) bswap_32_array((uint32_t *) (pc + 8), 1256 __glTexGenfv_size(pname)); 1257 1258 glTexGenfv((GLenum) bswap_ENUM(pc + 0), pname, params); 1259 } 1260 1261 void 1262 __glXDispSwap_TexGeni(GLbyte * pc) 1263 { 1264 glTexGeni((GLenum) bswap_ENUM(pc + 0), 1265 (GLenum) bswap_ENUM(pc + 4), (GLint) bswap_CARD32(pc + 8)); 1266 } 1267 1268 void 1269 __glXDispSwap_TexGeniv(GLbyte * pc) 1270 { 1271 const GLenum pname = (GLenum) bswap_ENUM(pc + 4); 1272 const GLint *params; 1273 1274 params = 1275 (const GLint *) bswap_32_array((uint32_t *) (pc + 8), 1276 __glTexGeniv_size(pname)); 1277 1278 glTexGeniv((GLenum) bswap_ENUM(pc + 0), pname, params); 1279 } 1280 1281 void 1282 __glXDispSwap_InitNames(GLbyte * pc) 1283 { 1284 glInitNames(); 1285 } 1286 1287 void 1288 __glXDispSwap_LoadName(GLbyte * pc) 1289 { 1290 glLoadName((GLuint) bswap_CARD32(pc + 0)); 1291 } 1292 1293 void 1294 __glXDispSwap_PassThrough(GLbyte * pc) 1295 { 1296 glPassThrough((GLfloat) bswap_FLOAT32(pc + 0)); 1297 } 1298 1299 void 1300 __glXDispSwap_PopName(GLbyte * pc) 1301 { 1302 glPopName(); 1303 } 1304 1305 void 1306 __glXDispSwap_PushName(GLbyte * pc) 1307 { 1308 glPushName((GLuint) bswap_CARD32(pc + 0)); 1309 } 1310 1311 void 1312 __glXDispSwap_DrawBuffer(GLbyte * pc) 1313 { 1314 glDrawBuffer((GLenum) bswap_ENUM(pc + 0)); 1315 } 1316 1317 void 1318 __glXDispSwap_Clear(GLbyte * pc) 1319 { 1320 glClear((GLbitfield) bswap_CARD32(pc + 0)); 1321 } 1322 1323 void 1324 __glXDispSwap_ClearAccum(GLbyte * pc) 1325 { 1326 glClearAccum((GLfloat) bswap_FLOAT32(pc + 0), 1327 (GLfloat) bswap_FLOAT32(pc + 4), 1328 (GLfloat) bswap_FLOAT32(pc + 8), 1329 (GLfloat) bswap_FLOAT32(pc + 12)); 1330 } 1331 1332 void 1333 __glXDispSwap_ClearIndex(GLbyte * pc) 1334 { 1335 glClearIndex((GLfloat) bswap_FLOAT32(pc + 0)); 1336 } 1337 1338 void 1339 __glXDispSwap_ClearColor(GLbyte * pc) 1340 { 1341 glClearColor((GLclampf) bswap_FLOAT32(pc + 0), 1342 (GLclampf) bswap_FLOAT32(pc + 4), 1343 (GLclampf) bswap_FLOAT32(pc + 8), 1344 (GLclampf) bswap_FLOAT32(pc + 12)); 1345 } 1346 1347 void 1348 __glXDispSwap_ClearStencil(GLbyte * pc) 1349 { 1350 glClearStencil((GLint) bswap_CARD32(pc + 0)); 1351 } 1352 1353 void 1354 __glXDispSwap_ClearDepth(GLbyte * pc) 1355 { 1356 #ifdef __GLX_ALIGN64 1357 if ((unsigned long) (pc) & 7) { 1358 (void) memmove(pc - 4, pc, 8); 1359 pc -= 4; 1360 } 1361 #endif 1362 1363 glClearDepth((GLclampd) bswap_FLOAT64(pc + 0)); 1364 } 1365 1366 void 1367 __glXDispSwap_StencilMask(GLbyte * pc) 1368 { 1369 glStencilMask((GLuint) bswap_CARD32(pc + 0)); 1370 } 1371 1372 void 1373 __glXDispSwap_ColorMask(GLbyte * pc) 1374 { 1375 glColorMask(*(GLboolean *) (pc + 0), 1376 *(GLboolean *) (pc + 1), 1377 *(GLboolean *) (pc + 2), *(GLboolean *) (pc + 3)); 1378 } 1379 1380 void 1381 __glXDispSwap_DepthMask(GLbyte * pc) 1382 { 1383 glDepthMask(*(GLboolean *) (pc + 0)); 1384 } 1385 1386 void 1387 __glXDispSwap_IndexMask(GLbyte * pc) 1388 { 1389 glIndexMask((GLuint) bswap_CARD32(pc + 0)); 1390 } 1391 1392 void 1393 __glXDispSwap_Accum(GLbyte * pc) 1394 { 1395 glAccum((GLenum) bswap_ENUM(pc + 0), (GLfloat) bswap_FLOAT32(pc + 4)); 1396 } 1397 1398 void 1399 __glXDispSwap_Disable(GLbyte * pc) 1400 { 1401 glDisable((GLenum) bswap_ENUM(pc + 0)); 1402 } 1403 1404 void 1405 __glXDispSwap_Enable(GLbyte * pc) 1406 { 1407 glEnable((GLenum) bswap_ENUM(pc + 0)); 1408 } 1409 1410 void 1411 __glXDispSwap_PopAttrib(GLbyte * pc) 1412 { 1413 glPopAttrib(); 1414 } 1415 1416 void 1417 __glXDispSwap_PushAttrib(GLbyte * pc) 1418 { 1419 glPushAttrib((GLbitfield) bswap_CARD32(pc + 0)); 1420 } 1421 1422 void 1423 __glXDispSwap_MapGrid1d(GLbyte * pc) 1424 { 1425 #ifdef __GLX_ALIGN64 1426 if ((unsigned long) (pc) & 7) { 1427 (void) memmove(pc - 4, pc, 20); 1428 pc -= 4; 1429 } 1430 #endif 1431 1432 glMapGrid1d((GLint) bswap_CARD32(pc + 16), 1433 (GLdouble) bswap_FLOAT64(pc + 0), 1434 (GLdouble) bswap_FLOAT64(pc + 8)); 1435 } 1436 1437 void 1438 __glXDispSwap_MapGrid1f(GLbyte * pc) 1439 { 1440 glMapGrid1f((GLint) bswap_CARD32(pc + 0), 1441 (GLfloat) bswap_FLOAT32(pc + 4), 1442 (GLfloat) bswap_FLOAT32(pc + 8)); 1443 } 1444 1445 void 1446 __glXDispSwap_MapGrid2d(GLbyte * pc) 1447 { 1448 #ifdef __GLX_ALIGN64 1449 if ((unsigned long) (pc) & 7) { 1450 (void) memmove(pc - 4, pc, 40); 1451 pc -= 4; 1452 } 1453 #endif 1454 1455 glMapGrid2d((GLint) bswap_CARD32(pc + 32), 1456 (GLdouble) bswap_FLOAT64(pc + 0), 1457 (GLdouble) bswap_FLOAT64(pc + 8), 1458 (GLint) bswap_CARD32(pc + 36), 1459 (GLdouble) bswap_FLOAT64(pc + 16), 1460 (GLdouble) bswap_FLOAT64(pc + 24)); 1461 } 1462 1463 void 1464 __glXDispSwap_MapGrid2f(GLbyte * pc) 1465 { 1466 glMapGrid2f((GLint) bswap_CARD32(pc + 0), 1467 (GLfloat) bswap_FLOAT32(pc + 4), 1468 (GLfloat) bswap_FLOAT32(pc + 8), 1469 (GLint) bswap_CARD32(pc + 12), 1470 (GLfloat) bswap_FLOAT32(pc + 16), 1471 (GLfloat) bswap_FLOAT32(pc + 20)); 1472 } 1473 1474 void 1475 __glXDispSwap_EvalCoord1dv(GLbyte * pc) 1476 { 1477 #ifdef __GLX_ALIGN64 1478 if ((unsigned long) (pc) & 7) { 1479 (void) memmove(pc - 4, pc, 8); 1480 pc -= 4; 1481 } 1482 #endif 1483 1484 glEvalCoord1dv((const GLdouble *) bswap_64_array((uint64_t *) (pc + 0), 1)); 1485 } 1486 1487 void 1488 __glXDispSwap_EvalCoord1fv(GLbyte * pc) 1489 { 1490 glEvalCoord1fv((const GLfloat *) bswap_32_array((uint32_t *) (pc + 0), 1)); 1491 } 1492 1493 void 1494 __glXDispSwap_EvalCoord2dv(GLbyte * pc) 1495 { 1496 #ifdef __GLX_ALIGN64 1497 if ((unsigned long) (pc) & 7) { 1498 (void) memmove(pc - 4, pc, 16); 1499 pc -= 4; 1500 } 1501 #endif 1502 1503 glEvalCoord2dv((const GLdouble *) bswap_64_array((uint64_t *) (pc + 0), 2)); 1504 } 1505 1506 void 1507 __glXDispSwap_EvalCoord2fv(GLbyte * pc) 1508 { 1509 glEvalCoord2fv((const GLfloat *) bswap_32_array((uint32_t *) (pc + 0), 2)); 1510 } 1511 1512 void 1513 __glXDispSwap_EvalMesh1(GLbyte * pc) 1514 { 1515 glEvalMesh1((GLenum) bswap_ENUM(pc + 0), 1516 (GLint) bswap_CARD32(pc + 4), (GLint) bswap_CARD32(pc + 8)); 1517 } 1518 1519 void 1520 __glXDispSwap_EvalPoint1(GLbyte * pc) 1521 { 1522 glEvalPoint1((GLint) bswap_CARD32(pc + 0)); 1523 } 1524 1525 void 1526 __glXDispSwap_EvalMesh2(GLbyte * pc) 1527 { 1528 glEvalMesh2((GLenum) bswap_ENUM(pc + 0), 1529 (GLint) bswap_CARD32(pc + 4), 1530 (GLint) bswap_CARD32(pc + 8), 1531 (GLint) bswap_CARD32(pc + 12), (GLint) bswap_CARD32(pc + 16)); 1532 } 1533 1534 void 1535 __glXDispSwap_EvalPoint2(GLbyte * pc) 1536 { 1537 glEvalPoint2((GLint) bswap_CARD32(pc + 0), (GLint) bswap_CARD32(pc + 4)); 1538 } 1539 1540 void 1541 __glXDispSwap_AlphaFunc(GLbyte * pc) 1542 { 1543 glAlphaFunc((GLenum) bswap_ENUM(pc + 0), (GLclampf) bswap_FLOAT32(pc + 4)); 1544 } 1545 1546 void 1547 __glXDispSwap_BlendFunc(GLbyte * pc) 1548 { 1549 glBlendFunc((GLenum) bswap_ENUM(pc + 0), (GLenum) bswap_ENUM(pc + 4)); 1550 } 1551 1552 void 1553 __glXDispSwap_LogicOp(GLbyte * pc) 1554 { 1555 glLogicOp((GLenum) bswap_ENUM(pc + 0)); 1556 } 1557 1558 void 1559 __glXDispSwap_StencilFunc(GLbyte * pc) 1560 { 1561 glStencilFunc((GLenum) bswap_ENUM(pc + 0), 1562 (GLint) bswap_CARD32(pc + 4), (GLuint) bswap_CARD32(pc + 8)); 1563 } 1564 1565 void 1566 __glXDispSwap_StencilOp(GLbyte * pc) 1567 { 1568 glStencilOp((GLenum) bswap_ENUM(pc + 0), 1569 (GLenum) bswap_ENUM(pc + 4), (GLenum) bswap_ENUM(pc + 8)); 1570 } 1571 1572 void 1573 __glXDispSwap_DepthFunc(GLbyte * pc) 1574 { 1575 glDepthFunc((GLenum) bswap_ENUM(pc + 0)); 1576 } 1577 1578 void 1579 __glXDispSwap_PixelZoom(GLbyte * pc) 1580 { 1581 glPixelZoom((GLfloat) bswap_FLOAT32(pc + 0), 1582 (GLfloat) bswap_FLOAT32(pc + 4)); 1583 } 1584 1585 void 1586 __glXDispSwap_PixelTransferf(GLbyte * pc) 1587 { 1588 glPixelTransferf((GLenum) bswap_ENUM(pc + 0), 1589 (GLfloat) bswap_FLOAT32(pc + 4)); 1590 } 1591 1592 void 1593 __glXDispSwap_PixelTransferi(GLbyte * pc) 1594 { 1595 glPixelTransferi((GLenum) bswap_ENUM(pc + 0), (GLint) bswap_CARD32(pc + 4)); 1596 } 1597 1598 int 1599 __glXDispSwap_PixelStoref(__GLXclientState * cl, GLbyte * pc) 1600 { 1601 xGLXSingleReq *const req = (xGLXSingleReq *) pc; 1602 int error; 1603 __GLXcontext *const cx = 1604 __glXForceCurrent(cl, bswap_CARD32(&req->contextTag), &error); 1605 1606 pc += __GLX_SINGLE_HDR_SIZE; 1607 if (cx != NULL) { 1608 glPixelStoref((GLenum) bswap_ENUM(pc + 0), 1609 (GLfloat) bswap_FLOAT32(pc + 4)); 1610 error = Success; 1611 } 1612 1613 return error; 1614 } 1615 1616 int 1617 __glXDispSwap_PixelStorei(__GLXclientState * cl, GLbyte * pc) 1618 { 1619 xGLXSingleReq *const req = (xGLXSingleReq *) pc; 1620 int error; 1621 __GLXcontext *const cx = 1622 __glXForceCurrent(cl, bswap_CARD32(&req->contextTag), &error); 1623 1624 pc += __GLX_SINGLE_HDR_SIZE; 1625 if (cx != NULL) { 1626 glPixelStorei((GLenum) bswap_ENUM(pc + 0), 1627 (GLint) bswap_CARD32(pc + 4)); 1628 error = Success; 1629 } 1630 1631 return error; 1632 } 1633 1634 void 1635 __glXDispSwap_PixelMapfv(GLbyte * pc) 1636 { 1637 const GLsizei mapsize = (GLsizei) bswap_CARD32(pc + 4); 1638 1639 glPixelMapfv((GLenum) bswap_ENUM(pc + 0), 1640 mapsize, 1641 (const GLfloat *) bswap_32_array((uint32_t *) (pc + 8), 0)); 1642 } 1643 1644 void 1645 __glXDispSwap_PixelMapuiv(GLbyte * pc) 1646 { 1647 const GLsizei mapsize = (GLsizei) bswap_CARD32(pc + 4); 1648 1649 glPixelMapuiv((GLenum) bswap_ENUM(pc + 0), 1650 mapsize, 1651 (const GLuint *) bswap_32_array((uint32_t *) (pc + 8), 0)); 1652 } 1653 1654 void 1655 __glXDispSwap_PixelMapusv(GLbyte * pc) 1656 { 1657 const GLsizei mapsize = (GLsizei) bswap_CARD32(pc + 4); 1658 1659 glPixelMapusv((GLenum) bswap_ENUM(pc + 0), 1660 mapsize, 1661 (const GLushort *) bswap_16_array((uint16_t *) (pc + 8), 0)); 1662 } 1663 1664 void 1665 __glXDispSwap_ReadBuffer(GLbyte * pc) 1666 { 1667 glReadBuffer((GLenum) bswap_ENUM(pc + 0)); 1668 } 1669 1670 void 1671 __glXDispSwap_CopyPixels(GLbyte * pc) 1672 { 1673 glCopyPixels((GLint) bswap_CARD32(pc + 0), 1674 (GLint) bswap_CARD32(pc + 4), 1675 (GLsizei) bswap_CARD32(pc + 8), 1676 (GLsizei) bswap_CARD32(pc + 12), (GLenum) bswap_ENUM(pc + 16)); 1677 } 1678 1679 void 1680 __glXDispSwap_DrawPixels(GLbyte * pc) 1681 { 1682 const GLvoid *const pixels = (const GLvoid *) ((pc + 36)); 1683 __GLXpixelHeader *const hdr = (__GLXpixelHeader *) (pc); 1684 1685 glPixelStorei(GL_UNPACK_SWAP_BYTES, hdr->swapBytes); 1686 glPixelStorei(GL_UNPACK_LSB_FIRST, hdr->lsbFirst); 1687 glPixelStorei(GL_UNPACK_ROW_LENGTH, (GLint) bswap_CARD32(&hdr->rowLength)); 1688 glPixelStorei(GL_UNPACK_SKIP_ROWS, (GLint) bswap_CARD32(&hdr->skipRows)); 1689 glPixelStorei(GL_UNPACK_SKIP_PIXELS, 1690 (GLint) bswap_CARD32(&hdr->skipPixels)); 1691 glPixelStorei(GL_UNPACK_ALIGNMENT, (GLint) bswap_CARD32(&hdr->alignment)); 1692 1693 glDrawPixels((GLsizei) bswap_CARD32(pc + 20), 1694 (GLsizei) bswap_CARD32(pc + 24), 1695 (GLenum) bswap_ENUM(pc + 28), 1696 (GLenum) bswap_ENUM(pc + 32), pixels); 1697 } 1698 1699 int 1700 __glXDispSwap_GetBooleanv(__GLXclientState * cl, GLbyte * pc) 1701 { 1702 xGLXSingleReq *const req = (xGLXSingleReq *) pc; 1703 int error; 1704 __GLXcontext *const cx = 1705 __glXForceCurrent(cl, bswap_CARD32(&req->contextTag), &error); 1706 1707 pc += __GLX_SINGLE_HDR_SIZE; 1708 if (cx != NULL) { 1709 const GLenum pname = (GLenum) bswap_ENUM(pc + 0); 1710 1711 const GLuint compsize = __glGetBooleanv_size(pname); 1712 GLboolean answerBuffer[200]; 1713 GLboolean *params = 1714 __glXGetAnswerBuffer(cl, compsize, answerBuffer, 1715 sizeof(answerBuffer), 1); 1716 1717 if (params == NULL) 1718 return BadAlloc; 1719 __glXClearErrorOccured(); 1720 1721 glGetBooleanv(pname, params); 1722 __glXSendReplySwap(cl->client, params, compsize, 1, GL_FALSE, 0); 1723 error = Success; 1724 } 1725 1726 return error; 1727 } 1728 1729 int 1730 __glXDispSwap_GetClipPlane(__GLXclientState * cl, GLbyte * pc) 1731 { 1732 xGLXSingleReq *const req = (xGLXSingleReq *) pc; 1733 int error; 1734 __GLXcontext *const cx = 1735 __glXForceCurrent(cl, bswap_CARD32(&req->contextTag), &error); 1736 1737 pc += __GLX_SINGLE_HDR_SIZE; 1738 if (cx != NULL) { 1739 GLdouble equation[4]; 1740 1741 glGetClipPlane((GLenum) bswap_ENUM(pc + 0), equation); 1742 (void) bswap_64_array((uint64_t *) equation, 4); 1743 __glXSendReplySwap(cl->client, equation, 4, 8, GL_TRUE, 0); 1744 error = Success; 1745 } 1746 1747 return error; 1748 } 1749 1750 int 1751 __glXDispSwap_GetDoublev(__GLXclientState * cl, GLbyte * pc) 1752 { 1753 xGLXSingleReq *const req = (xGLXSingleReq *) pc; 1754 int error; 1755 __GLXcontext *const cx = 1756 __glXForceCurrent(cl, bswap_CARD32(&req->contextTag), &error); 1757 1758 pc += __GLX_SINGLE_HDR_SIZE; 1759 if (cx != NULL) { 1760 const GLenum pname = (GLenum) bswap_ENUM(pc + 0); 1761 1762 const GLuint compsize = __glGetDoublev_size(pname); 1763 GLdouble answerBuffer[200]; 1764 GLdouble *params = 1765 __glXGetAnswerBuffer(cl, compsize * 8, answerBuffer, 1766 sizeof(answerBuffer), 8); 1767 1768 if (params == NULL) 1769 return BadAlloc; 1770 __glXClearErrorOccured(); 1771 1772 glGetDoublev(pname, params); 1773 (void) bswap_64_array((uint64_t *) params, compsize); 1774 __glXSendReplySwap(cl->client, params, compsize, 8, GL_FALSE, 0); 1775 error = Success; 1776 } 1777 1778 return error; 1779 } 1780 1781 int 1782 __glXDispSwap_GetError(__GLXclientState * cl, GLbyte * pc) 1783 { 1784 xGLXSingleReq *const req = (xGLXSingleReq *) pc; 1785 int error; 1786 __GLXcontext *const cx = 1787 __glXForceCurrent(cl, bswap_CARD32(&req->contextTag), &error); 1788 1789 pc += __GLX_SINGLE_HDR_SIZE; 1790 if (cx != NULL) { 1791 GLenum retval; 1792 1793 retval = glGetError(); 1794 __glXSendReplySwap(cl->client, dummy_answer, 0, 0, GL_FALSE, retval); 1795 error = Success; 1796 } 1797 1798 return error; 1799 } 1800 1801 int 1802 __glXDispSwap_GetFloatv(__GLXclientState * cl, GLbyte * pc) 1803 { 1804 xGLXSingleReq *const req = (xGLXSingleReq *) pc; 1805 int error; 1806 __GLXcontext *const cx = 1807 __glXForceCurrent(cl, bswap_CARD32(&req->contextTag), &error); 1808 1809 pc += __GLX_SINGLE_HDR_SIZE; 1810 if (cx != NULL) { 1811 const GLenum pname = (GLenum) bswap_ENUM(pc + 0); 1812 1813 const GLuint compsize = __glGetFloatv_size(pname); 1814 GLfloat answerBuffer[200]; 1815 GLfloat *params = 1816 __glXGetAnswerBuffer(cl, compsize * 4, answerBuffer, 1817 sizeof(answerBuffer), 4); 1818 1819 if (params == NULL) 1820 return BadAlloc; 1821 __glXClearErrorOccured(); 1822 1823 glGetFloatv(pname, params); 1824 (void) bswap_32_array((uint32_t *) params, compsize); 1825 __glXSendReplySwap(cl->client, params, compsize, 4, GL_FALSE, 0); 1826 error = Success; 1827 } 1828 1829 return error; 1830 } 1831 1832 int 1833 __glXDispSwap_GetIntegerv(__GLXclientState * cl, GLbyte * pc) 1834 { 1835 xGLXSingleReq *const req = (xGLXSingleReq *) pc; 1836 int error; 1837 __GLXcontext *const cx = 1838 __glXForceCurrent(cl, bswap_CARD32(&req->contextTag), &error); 1839 1840 pc += __GLX_SINGLE_HDR_SIZE; 1841 if (cx != NULL) { 1842 const GLenum pname = (GLenum) bswap_ENUM(pc + 0); 1843 1844 const GLuint compsize = __glGetIntegerv_size(pname); 1845 GLint answerBuffer[200]; 1846 GLint *params = 1847 __glXGetAnswerBuffer(cl, compsize * 4, answerBuffer, 1848 sizeof(answerBuffer), 4); 1849 1850 if (params == NULL) 1851 return BadAlloc; 1852 __glXClearErrorOccured(); 1853 1854 glGetIntegerv(pname, params); 1855 (void) bswap_32_array((uint32_t *) params, compsize); 1856 __glXSendReplySwap(cl->client, params, compsize, 4, GL_FALSE, 0); 1857 error = Success; 1858 } 1859 1860 return error; 1861 } 1862 1863 int 1864 __glXDispSwap_GetLightfv(__GLXclientState * cl, GLbyte * pc) 1865 { 1866 xGLXSingleReq *const req = (xGLXSingleReq *) pc; 1867 int error; 1868 __GLXcontext *const cx = 1869 __glXForceCurrent(cl, bswap_CARD32(&req->contextTag), &error); 1870 1871 pc += __GLX_SINGLE_HDR_SIZE; 1872 if (cx != NULL) { 1873 const GLenum pname = (GLenum) bswap_ENUM(pc + 4); 1874 1875 const GLuint compsize = __glGetLightfv_size(pname); 1876 GLfloat answerBuffer[200]; 1877 GLfloat *params = 1878 __glXGetAnswerBuffer(cl, compsize * 4, answerBuffer, 1879 sizeof(answerBuffer), 4); 1880 1881 if (params == NULL) 1882 return BadAlloc; 1883 __glXClearErrorOccured(); 1884 1885 glGetLightfv((GLenum) bswap_ENUM(pc + 0), pname, params); 1886 (void) bswap_32_array((uint32_t *) params, compsize); 1887 __glXSendReplySwap(cl->client, params, compsize, 4, GL_FALSE, 0); 1888 error = Success; 1889 } 1890 1891 return error; 1892 } 1893 1894 int 1895 __glXDispSwap_GetLightiv(__GLXclientState * cl, GLbyte * pc) 1896 { 1897 xGLXSingleReq *const req = (xGLXSingleReq *) pc; 1898 int error; 1899 __GLXcontext *const cx = 1900 __glXForceCurrent(cl, bswap_CARD32(&req->contextTag), &error); 1901 1902 pc += __GLX_SINGLE_HDR_SIZE; 1903 if (cx != NULL) { 1904 const GLenum pname = (GLenum) bswap_ENUM(pc + 4); 1905 1906 const GLuint compsize = __glGetLightiv_size(pname); 1907 GLint answerBuffer[200]; 1908 GLint *params = 1909 __glXGetAnswerBuffer(cl, compsize * 4, answerBuffer, 1910 sizeof(answerBuffer), 4); 1911 1912 if (params == NULL) 1913 return BadAlloc; 1914 __glXClearErrorOccured(); 1915 1916 glGetLightiv((GLenum) bswap_ENUM(pc + 0), pname, params); 1917 (void) bswap_32_array((uint32_t *) params, compsize); 1918 __glXSendReplySwap(cl->client, params, compsize, 4, GL_FALSE, 0); 1919 error = Success; 1920 } 1921 1922 return error; 1923 } 1924 1925 int 1926 __glXDispSwap_GetMapdv(__GLXclientState * cl, GLbyte * pc) 1927 { 1928 xGLXSingleReq *const req = (xGLXSingleReq *) pc; 1929 int error; 1930 __GLXcontext *const cx = 1931 __glXForceCurrent(cl, bswap_CARD32(&req->contextTag), &error); 1932 1933 pc += __GLX_SINGLE_HDR_SIZE; 1934 if (cx != NULL) { 1935 const GLenum target = (GLenum) bswap_ENUM(pc + 0); 1936 const GLenum query = (GLenum) bswap_ENUM(pc + 4); 1937 1938 const GLuint compsize = __glGetMapdv_size(target, query); 1939 GLdouble answerBuffer[200]; 1940 GLdouble *v = 1941 __glXGetAnswerBuffer(cl, compsize * 8, answerBuffer, 1942 sizeof(answerBuffer), 8); 1943 1944 if (v == NULL) 1945 return BadAlloc; 1946 __glXClearErrorOccured(); 1947 1948 glGetMapdv(target, query, v); 1949 (void) bswap_64_array((uint64_t *) v, compsize); 1950 __glXSendReplySwap(cl->client, v, compsize, 8, GL_FALSE, 0); 1951 error = Success; 1952 } 1953 1954 return error; 1955 } 1956 1957 int 1958 __glXDispSwap_GetMapfv(__GLXclientState * cl, GLbyte * pc) 1959 { 1960 xGLXSingleReq *const req = (xGLXSingleReq *) pc; 1961 int error; 1962 __GLXcontext *const cx = 1963 __glXForceCurrent(cl, bswap_CARD32(&req->contextTag), &error); 1964 1965 pc += __GLX_SINGLE_HDR_SIZE; 1966 if (cx != NULL) { 1967 const GLenum target = (GLenum) bswap_ENUM(pc + 0); 1968 const GLenum query = (GLenum) bswap_ENUM(pc + 4); 1969 1970 const GLuint compsize = __glGetMapfv_size(target, query); 1971 GLfloat answerBuffer[200]; 1972 GLfloat *v = 1973 __glXGetAnswerBuffer(cl, compsize * 4, answerBuffer, 1974 sizeof(answerBuffer), 4); 1975 1976 if (v == NULL) 1977 return BadAlloc; 1978 __glXClearErrorOccured(); 1979 1980 glGetMapfv(target, query, v); 1981 (void) bswap_32_array((uint32_t *) v, compsize); 1982 __glXSendReplySwap(cl->client, v, compsize, 4, GL_FALSE, 0); 1983 error = Success; 1984 } 1985 1986 return error; 1987 } 1988 1989 int 1990 __glXDispSwap_GetMapiv(__GLXclientState * cl, GLbyte * pc) 1991 { 1992 xGLXSingleReq *const req = (xGLXSingleReq *) pc; 1993 int error; 1994 __GLXcontext *const cx = 1995 __glXForceCurrent(cl, bswap_CARD32(&req->contextTag), &error); 1996 1997 pc += __GLX_SINGLE_HDR_SIZE; 1998 if (cx != NULL) { 1999 const GLenum target = (GLenum) bswap_ENUM(pc + 0); 2000 const GLenum query = (GLenum) bswap_ENUM(pc + 4); 2001 2002 const GLuint compsize = __glGetMapiv_size(target, query); 2003 GLint answerBuffer[200]; 2004 GLint *v = 2005 __glXGetAnswerBuffer(cl, compsize * 4, answerBuffer, 2006 sizeof(answerBuffer), 4); 2007 2008 if (v == NULL) 2009 return BadAlloc; 2010 __glXClearErrorOccured(); 2011 2012 glGetMapiv(target, query, v); 2013 (void) bswap_32_array((uint32_t *) v, compsize); 2014 __glXSendReplySwap(cl->client, v, compsize, 4, GL_FALSE, 0); 2015 error = Success; 2016 } 2017 2018 return error; 2019 } 2020 2021 int 2022 __glXDispSwap_GetMaterialfv(__GLXclientState * cl, GLbyte * pc) 2023 { 2024 xGLXSingleReq *const req = (xGLXSingleReq *) pc; 2025 int error; 2026 __GLXcontext *const cx = 2027 __glXForceCurrent(cl, bswap_CARD32(&req->contextTag), &error); 2028 2029 pc += __GLX_SINGLE_HDR_SIZE; 2030 if (cx != NULL) { 2031 const GLenum pname = (GLenum) bswap_ENUM(pc + 4); 2032 2033 const GLuint compsize = __glGetMaterialfv_size(pname); 2034 GLfloat answerBuffer[200]; 2035 GLfloat *params = 2036 __glXGetAnswerBuffer(cl, compsize * 4, answerBuffer, 2037 sizeof(answerBuffer), 4); 2038 2039 if (params == NULL) 2040 return BadAlloc; 2041 __glXClearErrorOccured(); 2042 2043 glGetMaterialfv((GLenum) bswap_ENUM(pc + 0), pname, params); 2044 (void) bswap_32_array((uint32_t *) params, compsize); 2045 __glXSendReplySwap(cl->client, params, compsize, 4, GL_FALSE, 0); 2046 error = Success; 2047 } 2048 2049 return error; 2050 } 2051 2052 int 2053 __glXDispSwap_GetMaterialiv(__GLXclientState * cl, GLbyte * pc) 2054 { 2055 xGLXSingleReq *const req = (xGLXSingleReq *) pc; 2056 int error; 2057 __GLXcontext *const cx = 2058 __glXForceCurrent(cl, bswap_CARD32(&req->contextTag), &error); 2059 2060 pc += __GLX_SINGLE_HDR_SIZE; 2061 if (cx != NULL) { 2062 const GLenum pname = (GLenum) bswap_ENUM(pc + 4); 2063 2064 const GLuint compsize = __glGetMaterialiv_size(pname); 2065 GLint answerBuffer[200]; 2066 GLint *params = 2067 __glXGetAnswerBuffer(cl, compsize * 4, answerBuffer, 2068 sizeof(answerBuffer), 4); 2069 2070 if (params == NULL) 2071 return BadAlloc; 2072 __glXClearErrorOccured(); 2073 2074 glGetMaterialiv((GLenum) bswap_ENUM(pc + 0), pname, params); 2075 (void) bswap_32_array((uint32_t *) params, compsize); 2076 __glXSendReplySwap(cl->client, params, compsize, 4, GL_FALSE, 0); 2077 error = Success; 2078 } 2079 2080 return error; 2081 } 2082 2083 int 2084 __glXDispSwap_GetPixelMapfv(__GLXclientState * cl, GLbyte * pc) 2085 { 2086 xGLXSingleReq *const req = (xGLXSingleReq *) pc; 2087 int error; 2088 __GLXcontext *const cx = 2089 __glXForceCurrent(cl, bswap_CARD32(&req->contextTag), &error); 2090 2091 pc += __GLX_SINGLE_HDR_SIZE; 2092 if (cx != NULL) { 2093 const GLenum map = (GLenum) bswap_ENUM(pc + 0); 2094 2095 const GLuint compsize = __glGetPixelMapfv_size(map); 2096 GLfloat answerBuffer[200]; 2097 GLfloat *values = 2098 __glXGetAnswerBuffer(cl, compsize * 4, answerBuffer, 2099 sizeof(answerBuffer), 4); 2100 2101 if (values == NULL) 2102 return BadAlloc; 2103 __glXClearErrorOccured(); 2104 2105 glGetPixelMapfv(map, values); 2106 (void) bswap_32_array((uint32_t *) values, compsize); 2107 __glXSendReplySwap(cl->client, values, compsize, 4, GL_FALSE, 0); 2108 error = Success; 2109 } 2110 2111 return error; 2112 } 2113 2114 int 2115 __glXDispSwap_GetPixelMapuiv(__GLXclientState * cl, GLbyte * pc) 2116 { 2117 xGLXSingleReq *const req = (xGLXSingleReq *) pc; 2118 int error; 2119 __GLXcontext *const cx = 2120 __glXForceCurrent(cl, bswap_CARD32(&req->contextTag), &error); 2121 2122 pc += __GLX_SINGLE_HDR_SIZE; 2123 if (cx != NULL) { 2124 const GLenum map = (GLenum) bswap_ENUM(pc + 0); 2125 2126 const GLuint compsize = __glGetPixelMapuiv_size(map); 2127 GLuint answerBuffer[200]; 2128 GLuint *values = 2129 __glXGetAnswerBuffer(cl, compsize * 4, answerBuffer, 2130 sizeof(answerBuffer), 4); 2131 2132 if (values == NULL) 2133 return BadAlloc; 2134 __glXClearErrorOccured(); 2135 2136 glGetPixelMapuiv(map, values); 2137 (void) bswap_32_array((uint32_t *) values, compsize); 2138 __glXSendReplySwap(cl->client, values, compsize, 4, GL_FALSE, 0); 2139 error = Success; 2140 } 2141 2142 return error; 2143 } 2144 2145 int 2146 __glXDispSwap_GetPixelMapusv(__GLXclientState * cl, GLbyte * pc) 2147 { 2148 xGLXSingleReq *const req = (xGLXSingleReq *) pc; 2149 int error; 2150 __GLXcontext *const cx = 2151 __glXForceCurrent(cl, bswap_CARD32(&req->contextTag), &error); 2152 2153 pc += __GLX_SINGLE_HDR_SIZE; 2154 if (cx != NULL) { 2155 const GLenum map = (GLenum) bswap_ENUM(pc + 0); 2156 2157 const GLuint compsize = __glGetPixelMapusv_size(map); 2158 GLushort answerBuffer[200]; 2159 GLushort *values = 2160 __glXGetAnswerBuffer(cl, compsize * 2, answerBuffer, 2161 sizeof(answerBuffer), 2); 2162 2163 if (values == NULL) 2164 return BadAlloc; 2165 __glXClearErrorOccured(); 2166 2167 glGetPixelMapusv(map, values); 2168 (void) bswap_16_array((uint16_t *) values, compsize); 2169 __glXSendReplySwap(cl->client, values, compsize, 2, GL_FALSE, 0); 2170 error = Success; 2171 } 2172 2173 return error; 2174 } 2175 2176 int 2177 __glXDispSwap_GetTexEnvfv(__GLXclientState * cl, GLbyte * pc) 2178 { 2179 xGLXSingleReq *const req = (xGLXSingleReq *) pc; 2180 int error; 2181 __GLXcontext *const cx = 2182 __glXForceCurrent(cl, bswap_CARD32(&req->contextTag), &error); 2183 2184 pc += __GLX_SINGLE_HDR_SIZE; 2185 if (cx != NULL) { 2186 const GLenum pname = (GLenum) bswap_ENUM(pc + 4); 2187 2188 const GLuint compsize = __glGetTexEnvfv_size(pname); 2189 GLfloat answerBuffer[200]; 2190 GLfloat *params = 2191 __glXGetAnswerBuffer(cl, compsize * 4, answerBuffer, 2192 sizeof(answerBuffer), 4); 2193 2194 if (params == NULL) 2195 return BadAlloc; 2196 __glXClearErrorOccured(); 2197 2198 glGetTexEnvfv((GLenum) bswap_ENUM(pc + 0), pname, params); 2199 (void) bswap_32_array((uint32_t *) params, compsize); 2200 __glXSendReplySwap(cl->client, params, compsize, 4, GL_FALSE, 0); 2201 error = Success; 2202 } 2203 2204 return error; 2205 } 2206 2207 int 2208 __glXDispSwap_GetTexEnviv(__GLXclientState * cl, GLbyte * pc) 2209 { 2210 xGLXSingleReq *const req = (xGLXSingleReq *) pc; 2211 int error; 2212 __GLXcontext *const cx = 2213 __glXForceCurrent(cl, bswap_CARD32(&req->contextTag), &error); 2214 2215 pc += __GLX_SINGLE_HDR_SIZE; 2216 if (cx != NULL) { 2217 const GLenum pname = (GLenum) bswap_ENUM(pc + 4); 2218 2219 const GLuint compsize = __glGetTexEnviv_size(pname); 2220 GLint answerBuffer[200]; 2221 GLint *params = 2222 __glXGetAnswerBuffer(cl, compsize * 4, answerBuffer, 2223 sizeof(answerBuffer), 4); 2224 2225 if (params == NULL) 2226 return BadAlloc; 2227 __glXClearErrorOccured(); 2228 2229 glGetTexEnviv((GLenum) bswap_ENUM(pc + 0), pname, params); 2230 (void) bswap_32_array((uint32_t *) params, compsize); 2231 __glXSendReplySwap(cl->client, params, compsize, 4, GL_FALSE, 0); 2232 error = Success; 2233 } 2234 2235 return error; 2236 } 2237 2238 int 2239 __glXDispSwap_GetTexGendv(__GLXclientState * cl, GLbyte * pc) 2240 { 2241 xGLXSingleReq *const req = (xGLXSingleReq *) pc; 2242 int error; 2243 __GLXcontext *const cx = 2244 __glXForceCurrent(cl, bswap_CARD32(&req->contextTag), &error); 2245 2246 pc += __GLX_SINGLE_HDR_SIZE; 2247 if (cx != NULL) { 2248 const GLenum pname = (GLenum) bswap_ENUM(pc + 4); 2249 2250 const GLuint compsize = __glGetTexGendv_size(pname); 2251 GLdouble answerBuffer[200]; 2252 GLdouble *params = 2253 __glXGetAnswerBuffer(cl, compsize * 8, answerBuffer, 2254 sizeof(answerBuffer), 8); 2255 2256 if (params == NULL) 2257 return BadAlloc; 2258 __glXClearErrorOccured(); 2259 2260 glGetTexGendv((GLenum) bswap_ENUM(pc + 0), pname, params); 2261 (void) bswap_64_array((uint64_t *) params, compsize); 2262 __glXSendReplySwap(cl->client, params, compsize, 8, GL_FALSE, 0); 2263 error = Success; 2264 } 2265 2266 return error; 2267 } 2268 2269 int 2270 __glXDispSwap_GetTexGenfv(__GLXclientState * cl, GLbyte * pc) 2271 { 2272 xGLXSingleReq *const req = (xGLXSingleReq *) pc; 2273 int error; 2274 __GLXcontext *const cx = 2275 __glXForceCurrent(cl, bswap_CARD32(&req->contextTag), &error); 2276 2277 pc += __GLX_SINGLE_HDR_SIZE; 2278 if (cx != NULL) { 2279 const GLenum pname = (GLenum) bswap_ENUM(pc + 4); 2280 2281 const GLuint compsize = __glGetTexGenfv_size(pname); 2282 GLfloat answerBuffer[200]; 2283 GLfloat *params = 2284 __glXGetAnswerBuffer(cl, compsize * 4, answerBuffer, 2285 sizeof(answerBuffer), 4); 2286 2287 if (params == NULL) 2288 return BadAlloc; 2289 __glXClearErrorOccured(); 2290 2291 glGetTexGenfv((GLenum) bswap_ENUM(pc + 0), pname, params); 2292 (void) bswap_32_array((uint32_t *) params, compsize); 2293 __glXSendReplySwap(cl->client, params, compsize, 4, GL_FALSE, 0); 2294 error = Success; 2295 } 2296 2297 return error; 2298 } 2299 2300 int 2301 __glXDispSwap_GetTexGeniv(__GLXclientState * cl, GLbyte * pc) 2302 { 2303 xGLXSingleReq *const req = (xGLXSingleReq *) pc; 2304 int error; 2305 __GLXcontext *const cx = 2306 __glXForceCurrent(cl, bswap_CARD32(&req->contextTag), &error); 2307 2308 pc += __GLX_SINGLE_HDR_SIZE; 2309 if (cx != NULL) { 2310 const GLenum pname = (GLenum) bswap_ENUM(pc + 4); 2311 2312 const GLuint compsize = __glGetTexGeniv_size(pname); 2313 GLint answerBuffer[200]; 2314 GLint *params = 2315 __glXGetAnswerBuffer(cl, compsize * 4, answerBuffer, 2316 sizeof(answerBuffer), 4); 2317 2318 if (params == NULL) 2319 return BadAlloc; 2320 __glXClearErrorOccured(); 2321 2322 glGetTexGeniv((GLenum) bswap_ENUM(pc + 0), pname, params); 2323 (void) bswap_32_array((uint32_t *) params, compsize); 2324 __glXSendReplySwap(cl->client, params, compsize, 4, GL_FALSE, 0); 2325 error = Success; 2326 } 2327 2328 return error; 2329 } 2330 2331 int 2332 __glXDispSwap_GetTexParameterfv(__GLXclientState * cl, GLbyte * pc) 2333 { 2334 xGLXSingleReq *const req = (xGLXSingleReq *) pc; 2335 int error; 2336 __GLXcontext *const cx = 2337 __glXForceCurrent(cl, bswap_CARD32(&req->contextTag), &error); 2338 2339 pc += __GLX_SINGLE_HDR_SIZE; 2340 if (cx != NULL) { 2341 const GLenum pname = (GLenum) bswap_ENUM(pc + 4); 2342 2343 const GLuint compsize = __glGetTexParameterfv_size(pname); 2344 GLfloat answerBuffer[200]; 2345 GLfloat *params = 2346 __glXGetAnswerBuffer(cl, compsize * 4, answerBuffer, 2347 sizeof(answerBuffer), 4); 2348 2349 if (params == NULL) 2350 return BadAlloc; 2351 __glXClearErrorOccured(); 2352 2353 glGetTexParameterfv((GLenum) bswap_ENUM(pc + 0), pname, params); 2354 (void) bswap_32_array((uint32_t *) params, compsize); 2355 __glXSendReplySwap(cl->client, params, compsize, 4, GL_FALSE, 0); 2356 error = Success; 2357 } 2358 2359 return error; 2360 } 2361 2362 int 2363 __glXDispSwap_GetTexParameteriv(__GLXclientState * cl, GLbyte * pc) 2364 { 2365 xGLXSingleReq *const req = (xGLXSingleReq *) pc; 2366 int error; 2367 __GLXcontext *const cx = 2368 __glXForceCurrent(cl, bswap_CARD32(&req->contextTag), &error); 2369 2370 pc += __GLX_SINGLE_HDR_SIZE; 2371 if (cx != NULL) { 2372 const GLenum pname = (GLenum) bswap_ENUM(pc + 4); 2373 2374 const GLuint compsize = __glGetTexParameteriv_size(pname); 2375 GLint answerBuffer[200]; 2376 GLint *params = 2377 __glXGetAnswerBuffer(cl, compsize * 4, answerBuffer, 2378 sizeof(answerBuffer), 4); 2379 2380 if (params == NULL) 2381 return BadAlloc; 2382 __glXClearErrorOccured(); 2383 2384 glGetTexParameteriv((GLenum) bswap_ENUM(pc + 0), pname, params); 2385 (void) bswap_32_array((uint32_t *) params, compsize); 2386 __glXSendReplySwap(cl->client, params, compsize, 4, GL_FALSE, 0); 2387 error = Success; 2388 } 2389 2390 return error; 2391 } 2392 2393 int 2394 __glXDispSwap_GetTexLevelParameterfv(__GLXclientState * cl, GLbyte * pc) 2395 { 2396 xGLXSingleReq *const req = (xGLXSingleReq *) pc; 2397 int error; 2398 __GLXcontext *const cx = 2399 __glXForceCurrent(cl, bswap_CARD32(&req->contextTag), &error); 2400 2401 pc += __GLX_SINGLE_HDR_SIZE; 2402 if (cx != NULL) { 2403 const GLenum pname = (GLenum) bswap_ENUM(pc + 8); 2404 2405 const GLuint compsize = __glGetTexLevelParameterfv_size(pname); 2406 GLfloat answerBuffer[200]; 2407 GLfloat *params = 2408 __glXGetAnswerBuffer(cl, compsize * 4, answerBuffer, 2409 sizeof(answerBuffer), 4); 2410 2411 if (params == NULL) 2412 return BadAlloc; 2413 __glXClearErrorOccured(); 2414 2415 glGetTexLevelParameterfv((GLenum) bswap_ENUM(pc + 0), 2416 (GLint) bswap_CARD32(pc + 4), pname, params); 2417 (void) bswap_32_array((uint32_t *) params, compsize); 2418 __glXSendReplySwap(cl->client, params, compsize, 4, GL_FALSE, 0); 2419 error = Success; 2420 } 2421 2422 return error; 2423 } 2424 2425 int 2426 __glXDispSwap_GetTexLevelParameteriv(__GLXclientState * cl, GLbyte * pc) 2427 { 2428 xGLXSingleReq *const req = (xGLXSingleReq *) pc; 2429 int error; 2430 __GLXcontext *const cx = 2431 __glXForceCurrent(cl, bswap_CARD32(&req->contextTag), &error); 2432 2433 pc += __GLX_SINGLE_HDR_SIZE; 2434 if (cx != NULL) { 2435 const GLenum pname = (GLenum) bswap_ENUM(pc + 8); 2436 2437 const GLuint compsize = __glGetTexLevelParameteriv_size(pname); 2438 GLint answerBuffer[200]; 2439 GLint *params = 2440 __glXGetAnswerBuffer(cl, compsize * 4, answerBuffer, 2441 sizeof(answerBuffer), 4); 2442 2443 if (params == NULL) 2444 return BadAlloc; 2445 __glXClearErrorOccured(); 2446 2447 glGetTexLevelParameteriv((GLenum) bswap_ENUM(pc + 0), 2448 (GLint) bswap_CARD32(pc + 4), pname, params); 2449 (void) bswap_32_array((uint32_t *) params, compsize); 2450 __glXSendReplySwap(cl->client, params, compsize, 4, GL_FALSE, 0); 2451 error = Success; 2452 } 2453 2454 return error; 2455 } 2456 2457 int 2458 __glXDispSwap_IsEnabled(__GLXclientState * cl, GLbyte * pc) 2459 { 2460 xGLXSingleReq *const req = (xGLXSingleReq *) pc; 2461 int error; 2462 __GLXcontext *const cx = 2463 __glXForceCurrent(cl, bswap_CARD32(&req->contextTag), &error); 2464 2465 pc += __GLX_SINGLE_HDR_SIZE; 2466 if (cx != NULL) { 2467 GLboolean retval; 2468 2469 retval = glIsEnabled((GLenum) bswap_ENUM(pc + 0)); 2470 __glXSendReplySwap(cl->client, dummy_answer, 0, 0, GL_FALSE, retval); 2471 error = Success; 2472 } 2473 2474 return error; 2475 } 2476 2477 int 2478 __glXDispSwap_IsList(__GLXclientState * cl, GLbyte * pc) 2479 { 2480 xGLXSingleReq *const req = (xGLXSingleReq *) pc; 2481 int error; 2482 __GLXcontext *const cx = 2483 __glXForceCurrent(cl, bswap_CARD32(&req->contextTag), &error); 2484 2485 pc += __GLX_SINGLE_HDR_SIZE; 2486 if (cx != NULL) { 2487 GLboolean retval; 2488 2489 retval = glIsList((GLuint) bswap_CARD32(pc + 0)); 2490 __glXSendReplySwap(cl->client, dummy_answer, 0, 0, GL_FALSE, retval); 2491 error = Success; 2492 } 2493 2494 return error; 2495 } 2496 2497 void 2498 __glXDispSwap_DepthRange(GLbyte * pc) 2499 { 2500 #ifdef __GLX_ALIGN64 2501 if ((unsigned long) (pc) & 7) { 2502 (void) memmove(pc - 4, pc, 16); 2503 pc -= 4; 2504 } 2505 #endif 2506 2507 glDepthRange((GLclampd) bswap_FLOAT64(pc + 0), 2508 (GLclampd) bswap_FLOAT64(pc + 8)); 2509 } 2510 2511 void 2512 __glXDispSwap_Frustum(GLbyte * pc) 2513 { 2514 #ifdef __GLX_ALIGN64 2515 if ((unsigned long) (pc) & 7) { 2516 (void) memmove(pc - 4, pc, 48); 2517 pc -= 4; 2518 } 2519 #endif 2520 2521 glFrustum((GLdouble) bswap_FLOAT64(pc + 0), 2522 (GLdouble) bswap_FLOAT64(pc + 8), 2523 (GLdouble) bswap_FLOAT64(pc + 16), 2524 (GLdouble) bswap_FLOAT64(pc + 24), 2525 (GLdouble) bswap_FLOAT64(pc + 32), 2526 (GLdouble) bswap_FLOAT64(pc + 40)); 2527 } 2528 2529 void 2530 __glXDispSwap_LoadIdentity(GLbyte * pc) 2531 { 2532 glLoadIdentity(); 2533 } 2534 2535 void 2536 __glXDispSwap_LoadMatrixf(GLbyte * pc) 2537 { 2538 glLoadMatrixf((const GLfloat *) bswap_32_array((uint32_t *) (pc + 0), 16)); 2539 } 2540 2541 void 2542 __glXDispSwap_LoadMatrixd(GLbyte * pc) 2543 { 2544 #ifdef __GLX_ALIGN64 2545 if ((unsigned long) (pc) & 7) { 2546 (void) memmove(pc - 4, pc, 128); 2547 pc -= 4; 2548 } 2549 #endif 2550 2551 glLoadMatrixd((const GLdouble *) bswap_64_array((uint64_t *) (pc + 0), 16)); 2552 } 2553 2554 void 2555 __glXDispSwap_MatrixMode(GLbyte * pc) 2556 { 2557 glMatrixMode((GLenum) bswap_ENUM(pc + 0)); 2558 } 2559 2560 void 2561 __glXDispSwap_MultMatrixf(GLbyte * pc) 2562 { 2563 glMultMatrixf((const GLfloat *) bswap_32_array((uint32_t *) (pc + 0), 16)); 2564 } 2565 2566 void 2567 __glXDispSwap_MultMatrixd(GLbyte * pc) 2568 { 2569 #ifdef __GLX_ALIGN64 2570 if ((unsigned long) (pc) & 7) { 2571 (void) memmove(pc - 4, pc, 128); 2572 pc -= 4; 2573 } 2574 #endif 2575 2576 glMultMatrixd((const GLdouble *) bswap_64_array((uint64_t *) (pc + 0), 16)); 2577 } 2578 2579 void 2580 __glXDispSwap_Ortho(GLbyte * pc) 2581 { 2582 #ifdef __GLX_ALIGN64 2583 if ((unsigned long) (pc) & 7) { 2584 (void) memmove(pc - 4, pc, 48); 2585 pc -= 4; 2586 } 2587 #endif 2588 2589 glOrtho((GLdouble) bswap_FLOAT64(pc + 0), 2590 (GLdouble) bswap_FLOAT64(pc + 8), 2591 (GLdouble) bswap_FLOAT64(pc + 16), 2592 (GLdouble) bswap_FLOAT64(pc + 24), 2593 (GLdouble) bswap_FLOAT64(pc + 32), 2594 (GLdouble) bswap_FLOAT64(pc + 40)); 2595 } 2596 2597 void 2598 __glXDispSwap_PopMatrix(GLbyte * pc) 2599 { 2600 glPopMatrix(); 2601 } 2602 2603 void 2604 __glXDispSwap_PushMatrix(GLbyte * pc) 2605 { 2606 glPushMatrix(); 2607 } 2608 2609 void 2610 __glXDispSwap_Rotated(GLbyte * pc) 2611 { 2612 #ifdef __GLX_ALIGN64 2613 if ((unsigned long) (pc) & 7) { 2614 (void) memmove(pc - 4, pc, 32); 2615 pc -= 4; 2616 } 2617 #endif 2618 2619 glRotated((GLdouble) bswap_FLOAT64(pc + 0), 2620 (GLdouble) bswap_FLOAT64(pc + 8), 2621 (GLdouble) bswap_FLOAT64(pc + 16), 2622 (GLdouble) bswap_FLOAT64(pc + 24)); 2623 } 2624 2625 void 2626 __glXDispSwap_Rotatef(GLbyte * pc) 2627 { 2628 glRotatef((GLfloat) bswap_FLOAT32(pc + 0), 2629 (GLfloat) bswap_FLOAT32(pc + 4), 2630 (GLfloat) bswap_FLOAT32(pc + 8), 2631 (GLfloat) bswap_FLOAT32(pc + 12)); 2632 } 2633 2634 void 2635 __glXDispSwap_Scaled(GLbyte * pc) 2636 { 2637 #ifdef __GLX_ALIGN64 2638 if ((unsigned long) (pc) & 7) { 2639 (void) memmove(pc - 4, pc, 24); 2640 pc -= 4; 2641 } 2642 #endif 2643 2644 glScaled((GLdouble) bswap_FLOAT64(pc + 0), 2645 (GLdouble) bswap_FLOAT64(pc + 8), 2646 (GLdouble) bswap_FLOAT64(pc + 16)); 2647 } 2648 2649 void 2650 __glXDispSwap_Scalef(GLbyte * pc) 2651 { 2652 glScalef((GLfloat) bswap_FLOAT32(pc + 0), 2653 (GLfloat) bswap_FLOAT32(pc + 4), (GLfloat) bswap_FLOAT32(pc + 8)); 2654 } 2655 2656 void 2657 __glXDispSwap_Translated(GLbyte * pc) 2658 { 2659 #ifdef __GLX_ALIGN64 2660 if ((unsigned long) (pc) & 7) { 2661 (void) memmove(pc - 4, pc, 24); 2662 pc -= 4; 2663 } 2664 #endif 2665 2666 glTranslated((GLdouble) bswap_FLOAT64(pc + 0), 2667 (GLdouble) bswap_FLOAT64(pc + 8), 2668 (GLdouble) bswap_FLOAT64(pc + 16)); 2669 } 2670 2671 void 2672 __glXDispSwap_Translatef(GLbyte * pc) 2673 { 2674 glTranslatef((GLfloat) bswap_FLOAT32(pc + 0), 2675 (GLfloat) bswap_FLOAT32(pc + 4), 2676 (GLfloat) bswap_FLOAT32(pc + 8)); 2677 } 2678 2679 void 2680 __glXDispSwap_Viewport(GLbyte * pc) 2681 { 2682 glViewport((GLint) bswap_CARD32(pc + 0), 2683 (GLint) bswap_CARD32(pc + 4), 2684 (GLsizei) bswap_CARD32(pc + 8), (GLsizei) bswap_CARD32(pc + 12)); 2685 } 2686 2687 void 2688 __glXDispSwap_BindTexture(GLbyte * pc) 2689 { 2690 glBindTexture((GLenum) bswap_ENUM(pc + 0), (GLuint) bswap_CARD32(pc + 4)); 2691 } 2692 2693 void 2694 __glXDispSwap_Indexubv(GLbyte * pc) 2695 { 2696 glIndexubv((const GLubyte *) (pc + 0)); 2697 } 2698 2699 void 2700 __glXDispSwap_PolygonOffset(GLbyte * pc) 2701 { 2702 glPolygonOffset((GLfloat) bswap_FLOAT32(pc + 0), 2703 (GLfloat) bswap_FLOAT32(pc + 4)); 2704 } 2705 2706 int 2707 __glXDispSwap_AreTexturesResident(__GLXclientState * cl, GLbyte * pc) 2708 { 2709 xGLXSingleReq *const req = (xGLXSingleReq *) pc; 2710 int error; 2711 __GLXcontext *const cx = 2712 __glXForceCurrent(cl, bswap_CARD32(&req->contextTag), &error); 2713 2714 pc += __GLX_SINGLE_HDR_SIZE; 2715 if (cx != NULL) { 2716 const GLsizei n = (GLsizei) bswap_CARD32(pc + 0); 2717 2718 GLboolean retval; 2719 GLboolean answerBuffer[200]; 2720 GLboolean *residences = 2721 __glXGetAnswerBuffer(cl, n, answerBuffer, sizeof(answerBuffer), 1); 2722 2723 if (residences == NULL) 2724 return BadAlloc; 2725 retval = 2726 glAreTexturesResident(n, 2727 (const GLuint *) 2728 bswap_32_array((uint32_t *) (pc + 4), 0), 2729 residences); 2730 __glXSendReplySwap(cl->client, residences, n, 1, GL_TRUE, retval); 2731 error = Success; 2732 } 2733 2734 return error; 2735 } 2736 2737 int 2738 __glXDispSwap_AreTexturesResidentEXT(__GLXclientState * cl, GLbyte * pc) 2739 { 2740 xGLXVendorPrivateReq *const req = (xGLXVendorPrivateReq *) pc; 2741 int error; 2742 __GLXcontext *const cx = 2743 __glXForceCurrent(cl, bswap_CARD32(&req->contextTag), &error); 2744 2745 pc += __GLX_VENDPRIV_HDR_SIZE; 2746 if (cx != NULL) { 2747 const GLsizei n = (GLsizei) bswap_CARD32(pc + 0); 2748 2749 GLboolean retval; 2750 GLboolean answerBuffer[200]; 2751 GLboolean *residences = 2752 __glXGetAnswerBuffer(cl, n, answerBuffer, sizeof(answerBuffer), 1); 2753 2754 if (residences == NULL) 2755 return BadAlloc; 2756 retval = 2757 glAreTexturesResident(n, 2758 (const GLuint *) 2759 bswap_32_array((uint32_t *) (pc + 4), 0), 2760 residences); 2761 __glXSendReplySwap(cl->client, residences, n, 1, GL_TRUE, retval); 2762 error = Success; 2763 } 2764 2765 return error; 2766 } 2767 2768 void 2769 __glXDispSwap_CopyTexImage1D(GLbyte * pc) 2770 { 2771 glCopyTexImage1D((GLenum) bswap_ENUM(pc + 0), 2772 (GLint) bswap_CARD32(pc + 4), 2773 (GLenum) bswap_ENUM(pc + 8), 2774 (GLint) bswap_CARD32(pc + 12), 2775 (GLint) bswap_CARD32(pc + 16), 2776 (GLsizei) bswap_CARD32(pc + 20), 2777 (GLint) bswap_CARD32(pc + 24)); 2778 } 2779 2780 void 2781 __glXDispSwap_CopyTexImage2D(GLbyte * pc) 2782 { 2783 glCopyTexImage2D((GLenum) bswap_ENUM(pc + 0), 2784 (GLint) bswap_CARD32(pc + 4), 2785 (GLenum) bswap_ENUM(pc + 8), 2786 (GLint) bswap_CARD32(pc + 12), 2787 (GLint) bswap_CARD32(pc + 16), 2788 (GLsizei) bswap_CARD32(pc + 20), 2789 (GLsizei) bswap_CARD32(pc + 24), 2790 (GLint) bswap_CARD32(pc + 28)); 2791 } 2792 2793 void 2794 __glXDispSwap_CopyTexSubImage1D(GLbyte * pc) 2795 { 2796 glCopyTexSubImage1D((GLenum) bswap_ENUM(pc + 0), 2797 (GLint) bswap_CARD32(pc + 4), 2798 (GLint) bswap_CARD32(pc + 8), 2799 (GLint) bswap_CARD32(pc + 12), 2800 (GLint) bswap_CARD32(pc + 16), 2801 (GLsizei) bswap_CARD32(pc + 20)); 2802 } 2803 2804 void 2805 __glXDispSwap_CopyTexSubImage2D(GLbyte * pc) 2806 { 2807 glCopyTexSubImage2D((GLenum) bswap_ENUM(pc + 0), 2808 (GLint) bswap_CARD32(pc + 4), 2809 (GLint) bswap_CARD32(pc + 8), 2810 (GLint) bswap_CARD32(pc + 12), 2811 (GLint) bswap_CARD32(pc + 16), 2812 (GLint) bswap_CARD32(pc + 20), 2813 (GLsizei) bswap_CARD32(pc + 24), 2814 (GLsizei) bswap_CARD32(pc + 28)); 2815 } 2816 2817 int 2818 __glXDispSwap_DeleteTextures(__GLXclientState * cl, GLbyte * pc) 2819 { 2820 xGLXSingleReq *const req = (xGLXSingleReq *) pc; 2821 int error; 2822 __GLXcontext *const cx = 2823 __glXForceCurrent(cl, bswap_CARD32(&req->contextTag), &error); 2824 2825 pc += __GLX_SINGLE_HDR_SIZE; 2826 if (cx != NULL) { 2827 const GLsizei n = (GLsizei) bswap_CARD32(pc + 0); 2828 2829 glDeleteTextures(n, 2830 (const GLuint *) bswap_32_array((uint32_t *) (pc + 4), 2831 0)); 2832 error = Success; 2833 } 2834 2835 return error; 2836 } 2837 2838 int 2839 __glXDispSwap_DeleteTexturesEXT(__GLXclientState * cl, GLbyte * pc) 2840 { 2841 xGLXVendorPrivateReq *const req = (xGLXVendorPrivateReq *) pc; 2842 int error; 2843 __GLXcontext *const cx = 2844 __glXForceCurrent(cl, bswap_CARD32(&req->contextTag), &error); 2845 2846 pc += __GLX_VENDPRIV_HDR_SIZE; 2847 if (cx != NULL) { 2848 const GLsizei n = (GLsizei) bswap_CARD32(pc + 0); 2849 2850 glDeleteTextures(n, 2851 (const GLuint *) bswap_32_array((uint32_t *) (pc + 4), 2852 0)); 2853 error = Success; 2854 } 2855 2856 return error; 2857 } 2858 2859 int 2860 __glXDispSwap_GenTextures(__GLXclientState * cl, GLbyte * pc) 2861 { 2862 xGLXSingleReq *const req = (xGLXSingleReq *) pc; 2863 int error; 2864 __GLXcontext *const cx = 2865 __glXForceCurrent(cl, bswap_CARD32(&req->contextTag), &error); 2866 2867 pc += __GLX_SINGLE_HDR_SIZE; 2868 if (cx != NULL) { 2869 const GLsizei n = (GLsizei) bswap_CARD32(pc + 0); 2870 2871 GLuint answerBuffer[200]; 2872 GLuint *textures = 2873 __glXGetAnswerBuffer(cl, n * 4, answerBuffer, sizeof(answerBuffer), 2874 4); 2875 2876 if (textures == NULL) 2877 return BadAlloc; 2878 glGenTextures(n, textures); 2879 (void) bswap_32_array((uint32_t *) textures, n); 2880 __glXSendReplySwap(cl->client, textures, n, 4, GL_TRUE, 0); 2881 error = Success; 2882 } 2883 2884 return error; 2885 } 2886 2887 int 2888 __glXDispSwap_GenTexturesEXT(__GLXclientState * cl, GLbyte * pc) 2889 { 2890 xGLXVendorPrivateReq *const req = (xGLXVendorPrivateReq *) pc; 2891 int error; 2892 __GLXcontext *const cx = 2893 __glXForceCurrent(cl, bswap_CARD32(&req->contextTag), &error); 2894 2895 pc += __GLX_VENDPRIV_HDR_SIZE; 2896 if (cx != NULL) { 2897 const GLsizei n = (GLsizei) bswap_CARD32(pc + 0); 2898 2899 GLuint answerBuffer[200]; 2900 GLuint *textures = 2901 __glXGetAnswerBuffer(cl, n * 4, answerBuffer, sizeof(answerBuffer), 2902 4); 2903 2904 if (textures == NULL) 2905 return BadAlloc; 2906 glGenTextures(n, textures); 2907 (void) bswap_32_array((uint32_t *) textures, n); 2908 __glXSendReplySwap(cl->client, textures, n, 4, GL_TRUE, 0); 2909 error = Success; 2910 } 2911 2912 return error; 2913 } 2914 2915 int 2916 __glXDispSwap_IsTexture(__GLXclientState * cl, GLbyte * pc) 2917 { 2918 xGLXSingleReq *const req = (xGLXSingleReq *) pc; 2919 int error; 2920 __GLXcontext *const cx = 2921 __glXForceCurrent(cl, bswap_CARD32(&req->contextTag), &error); 2922 2923 pc += __GLX_SINGLE_HDR_SIZE; 2924 if (cx != NULL) { 2925 GLboolean retval; 2926 2927 retval = glIsTexture((GLuint) bswap_CARD32(pc + 0)); 2928 __glXSendReplySwap(cl->client, dummy_answer, 0, 0, GL_FALSE, retval); 2929 error = Success; 2930 } 2931 2932 return error; 2933 } 2934 2935 int 2936 __glXDispSwap_IsTextureEXT(__GLXclientState * cl, GLbyte * pc) 2937 { 2938 xGLXVendorPrivateReq *const req = (xGLXVendorPrivateReq *) pc; 2939 int error; 2940 __GLXcontext *const cx = 2941 __glXForceCurrent(cl, bswap_CARD32(&req->contextTag), &error); 2942 2943 pc += __GLX_VENDPRIV_HDR_SIZE; 2944 if (cx != NULL) { 2945 GLboolean retval; 2946 2947 retval = glIsTexture((GLuint) bswap_CARD32(pc + 0)); 2948 __glXSendReplySwap(cl->client, dummy_answer, 0, 0, GL_FALSE, retval); 2949 error = Success; 2950 } 2951 2952 return error; 2953 } 2954 2955 void 2956 __glXDispSwap_PrioritizeTextures(GLbyte * pc) 2957 { 2958 const GLsizei n = (GLsizei) bswap_CARD32(pc + 0); 2959 2960 glPrioritizeTextures(n, 2961 (const GLuint *) bswap_32_array((uint32_t *) (pc + 4), 2962 0), 2963 (const GLclampf *) 2964 bswap_32_array((uint32_t *) (pc + 4), 0)); 2965 } 2966 2967 void 2968 __glXDispSwap_TexSubImage1D(GLbyte * pc) 2969 { 2970 const GLvoid *const pixels = (const GLvoid *) ((pc + 56)); 2971 __GLXpixelHeader *const hdr = (__GLXpixelHeader *) (pc); 2972 2973 glPixelStorei(GL_UNPACK_SWAP_BYTES, hdr->swapBytes); 2974 glPixelStorei(GL_UNPACK_LSB_FIRST, hdr->lsbFirst); 2975 glPixelStorei(GL_UNPACK_ROW_LENGTH, (GLint) bswap_CARD32(&hdr->rowLength)); 2976 glPixelStorei(GL_UNPACK_SKIP_ROWS, (GLint) bswap_CARD32(&hdr->skipRows)); 2977 glPixelStorei(GL_UNPACK_SKIP_PIXELS, 2978 (GLint) bswap_CARD32(&hdr->skipPixels)); 2979 glPixelStorei(GL_UNPACK_ALIGNMENT, (GLint) bswap_CARD32(&hdr->alignment)); 2980 2981 glTexSubImage1D((GLenum) bswap_ENUM(pc + 20), 2982 (GLint) bswap_CARD32(pc + 24), 2983 (GLint) bswap_CARD32(pc + 28), 2984 (GLsizei) bswap_CARD32(pc + 36), 2985 (GLenum) bswap_ENUM(pc + 44), 2986 (GLenum) bswap_ENUM(pc + 48), pixels); 2987 } 2988 2989 void 2990 __glXDispSwap_TexSubImage2D(GLbyte * pc) 2991 { 2992 const GLvoid *const pixels = (const GLvoid *) ((pc + 56)); 2993 __GLXpixelHeader *const hdr = (__GLXpixelHeader *) (pc); 2994 2995 glPixelStorei(GL_UNPACK_SWAP_BYTES, hdr->swapBytes); 2996 glPixelStorei(GL_UNPACK_LSB_FIRST, hdr->lsbFirst); 2997 glPixelStorei(GL_UNPACK_ROW_LENGTH, (GLint) bswap_CARD32(&hdr->rowLength)); 2998 glPixelStorei(GL_UNPACK_SKIP_ROWS, (GLint) bswap_CARD32(&hdr->skipRows)); 2999 glPixelStorei(GL_UNPACK_SKIP_PIXELS, 3000 (GLint) bswap_CARD32(&hdr->skipPixels)); 3001 glPixelStorei(GL_UNPACK_ALIGNMENT, (GLint) bswap_CARD32(&hdr->alignment)); 3002 3003 glTexSubImage2D((GLenum) bswap_ENUM(pc + 20), 3004 (GLint) bswap_CARD32(pc + 24), 3005 (GLint) bswap_CARD32(pc + 28), 3006 (GLint) bswap_CARD32(pc + 32), 3007 (GLsizei) bswap_CARD32(pc + 36), 3008 (GLsizei) bswap_CARD32(pc + 40), 3009 (GLenum) bswap_ENUM(pc + 44), 3010 (GLenum) bswap_ENUM(pc + 48), pixels); 3011 } 3012 3013 void 3014 __glXDispSwap_BlendColor(GLbyte * pc) 3015 { 3016 glBlendColor((GLclampf) bswap_FLOAT32(pc + 0), 3017 (GLclampf) bswap_FLOAT32(pc + 4), 3018 (GLclampf) bswap_FLOAT32(pc + 8), 3019 (GLclampf) bswap_FLOAT32(pc + 12)); 3020 } 3021 3022 void 3023 __glXDispSwap_BlendEquation(GLbyte * pc) 3024 { 3025 glBlendEquation((GLenum) bswap_ENUM(pc + 0)); 3026 } 3027 3028 void 3029 __glXDispSwap_ColorTable(GLbyte * pc) 3030 { 3031 const GLvoid *const table = (const GLvoid *) ((pc + 40)); 3032 __GLXpixelHeader *const hdr = (__GLXpixelHeader *) (pc); 3033 3034 glPixelStorei(GL_UNPACK_SWAP_BYTES, hdr->swapBytes); 3035 glPixelStorei(GL_UNPACK_LSB_FIRST, hdr->lsbFirst); 3036 glPixelStorei(GL_UNPACK_ROW_LENGTH, (GLint) bswap_CARD32(&hdr->rowLength)); 3037 glPixelStorei(GL_UNPACK_SKIP_ROWS, (GLint) bswap_CARD32(&hdr->skipRows)); 3038 glPixelStorei(GL_UNPACK_SKIP_PIXELS, 3039 (GLint) bswap_CARD32(&hdr->skipPixels)); 3040 glPixelStorei(GL_UNPACK_ALIGNMENT, (GLint) bswap_CARD32(&hdr->alignment)); 3041 3042 glColorTable((GLenum) bswap_ENUM(pc + 20), 3043 (GLenum) bswap_ENUM(pc + 24), 3044 (GLsizei) bswap_CARD32(pc + 28), 3045 (GLenum) bswap_ENUM(pc + 32), 3046 (GLenum) bswap_ENUM(pc + 36), table); 3047 } 3048 3049 void 3050 __glXDispSwap_ColorTableParameterfv(GLbyte * pc) 3051 { 3052 const GLenum pname = (GLenum) bswap_ENUM(pc + 4); 3053 const GLfloat *params; 3054 3055 params = 3056 (const GLfloat *) bswap_32_array((uint32_t *) (pc + 8), 3057 __glColorTableParameterfv_size(pname)); 3058 3059 glColorTableParameterfv((GLenum) bswap_ENUM(pc + 0), pname, params); 3060 } 3061 3062 void 3063 __glXDispSwap_ColorTableParameteriv(GLbyte * pc) 3064 { 3065 const GLenum pname = (GLenum) bswap_ENUM(pc + 4); 3066 const GLint *params; 3067 3068 params = 3069 (const GLint *) bswap_32_array((uint32_t *) (pc + 8), 3070 __glColorTableParameteriv_size(pname)); 3071 3072 glColorTableParameteriv((GLenum) bswap_ENUM(pc + 0), pname, params); 3073 } 3074 3075 void 3076 __glXDispSwap_CopyColorTable(GLbyte * pc) 3077 { 3078 glCopyColorTable((GLenum) bswap_ENUM(pc + 0), 3079 (GLenum) bswap_ENUM(pc + 4), 3080 (GLint) bswap_CARD32(pc + 8), 3081 (GLint) bswap_CARD32(pc + 12), 3082 (GLsizei) bswap_CARD32(pc + 16)); 3083 } 3084 3085 int 3086 __glXDispSwap_GetColorTableParameterfv(__GLXclientState * cl, GLbyte * pc) 3087 { 3088 xGLXSingleReq *const req = (xGLXSingleReq *) pc; 3089 int error; 3090 __GLXcontext *const cx = 3091 __glXForceCurrent(cl, bswap_CARD32(&req->contextTag), &error); 3092 3093 pc += __GLX_SINGLE_HDR_SIZE; 3094 if (cx != NULL) { 3095 const GLenum pname = (GLenum) bswap_ENUM(pc + 4); 3096 3097 const GLuint compsize = __glGetColorTableParameterfv_size(pname); 3098 GLfloat answerBuffer[200]; 3099 GLfloat *params = 3100 __glXGetAnswerBuffer(cl, compsize * 4, answerBuffer, 3101 sizeof(answerBuffer), 4); 3102 3103 if (params == NULL) 3104 return BadAlloc; 3105 __glXClearErrorOccured(); 3106 3107 glGetColorTableParameterfv((GLenum) bswap_ENUM(pc + 0), pname, params); 3108 (void) bswap_32_array((uint32_t *) params, compsize); 3109 __glXSendReplySwap(cl->client, params, compsize, 4, GL_FALSE, 0); 3110 error = Success; 3111 } 3112 3113 return error; 3114 } 3115 3116 int 3117 __glXDispSwap_GetColorTableParameterfvSGI(__GLXclientState * cl, GLbyte * pc) 3118 { 3119 xGLXVendorPrivateReq *const req = (xGLXVendorPrivateReq *) pc; 3120 int error; 3121 __GLXcontext *const cx = 3122 __glXForceCurrent(cl, bswap_CARD32(&req->contextTag), &error); 3123 3124 pc += __GLX_VENDPRIV_HDR_SIZE; 3125 if (cx != NULL) { 3126 const GLenum pname = (GLenum) bswap_ENUM(pc + 4); 3127 3128 const GLuint compsize = __glGetColorTableParameterfv_size(pname); 3129 GLfloat answerBuffer[200]; 3130 GLfloat *params = 3131 __glXGetAnswerBuffer(cl, compsize * 4, answerBuffer, 3132 sizeof(answerBuffer), 4); 3133 3134 if (params == NULL) 3135 return BadAlloc; 3136 __glXClearErrorOccured(); 3137 3138 glGetColorTableParameterfv((GLenum) bswap_ENUM(pc + 0), pname, params); 3139 (void) bswap_32_array((uint32_t *) params, compsize); 3140 __glXSendReplySwap(cl->client, params, compsize, 4, GL_FALSE, 0); 3141 error = Success; 3142 } 3143 3144 return error; 3145 } 3146 3147 int 3148 __glXDispSwap_GetColorTableParameteriv(__GLXclientState * cl, GLbyte * pc) 3149 { 3150 xGLXSingleReq *const req = (xGLXSingleReq *) pc; 3151 int error; 3152 __GLXcontext *const cx = 3153 __glXForceCurrent(cl, bswap_CARD32(&req->contextTag), &error); 3154 3155 pc += __GLX_SINGLE_HDR_SIZE; 3156 if (cx != NULL) { 3157 const GLenum pname = (GLenum) bswap_ENUM(pc + 4); 3158 3159 const GLuint compsize = __glGetColorTableParameteriv_size(pname); 3160 GLint answerBuffer[200]; 3161 GLint *params = 3162 __glXGetAnswerBuffer(cl, compsize * 4, answerBuffer, 3163 sizeof(answerBuffer), 4); 3164 3165 if (params == NULL) 3166 return BadAlloc; 3167 __glXClearErrorOccured(); 3168 3169 glGetColorTableParameteriv((GLenum) bswap_ENUM(pc + 0), pname, params); 3170 (void) bswap_32_array((uint32_t *) params, compsize); 3171 __glXSendReplySwap(cl->client, params, compsize, 4, GL_FALSE, 0); 3172 error = Success; 3173 } 3174 3175 return error; 3176 } 3177 3178 int 3179 __glXDispSwap_GetColorTableParameterivSGI(__GLXclientState * cl, GLbyte * pc) 3180 { 3181 xGLXVendorPrivateReq *const req = (xGLXVendorPrivateReq *) pc; 3182 int error; 3183 __GLXcontext *const cx = 3184 __glXForceCurrent(cl, bswap_CARD32(&req->contextTag), &error); 3185 3186 pc += __GLX_VENDPRIV_HDR_SIZE; 3187 if (cx != NULL) { 3188 const GLenum pname = (GLenum) bswap_ENUM(pc + 4); 3189 3190 const GLuint compsize = __glGetColorTableParameteriv_size(pname); 3191 GLint answerBuffer[200]; 3192 GLint *params = 3193 __glXGetAnswerBuffer(cl, compsize * 4, answerBuffer, 3194 sizeof(answerBuffer), 4); 3195 3196 if (params == NULL) 3197 return BadAlloc; 3198 __glXClearErrorOccured(); 3199 3200 glGetColorTableParameteriv((GLenum) bswap_ENUM(pc + 0), pname, params); 3201 (void) bswap_32_array((uint32_t *) params, compsize); 3202 __glXSendReplySwap(cl->client, params, compsize, 4, GL_FALSE, 0); 3203 error = Success; 3204 } 3205 3206 return error; 3207 } 3208 3209 void 3210 __glXDispSwap_ColorSubTable(GLbyte * pc) 3211 { 3212 const GLvoid *const data = (const GLvoid *) ((pc + 40)); 3213 __GLXpixelHeader *const hdr = (__GLXpixelHeader *) (pc); 3214 3215 glPixelStorei(GL_UNPACK_SWAP_BYTES, hdr->swapBytes); 3216 glPixelStorei(GL_UNPACK_LSB_FIRST, hdr->lsbFirst); 3217 glPixelStorei(GL_UNPACK_ROW_LENGTH, (GLint) bswap_CARD32(&hdr->rowLength)); 3218 glPixelStorei(GL_UNPACK_SKIP_ROWS, (GLint) bswap_CARD32(&hdr->skipRows)); 3219 glPixelStorei(GL_UNPACK_SKIP_PIXELS, 3220 (GLint) bswap_CARD32(&hdr->skipPixels)); 3221 glPixelStorei(GL_UNPACK_ALIGNMENT, (GLint) bswap_CARD32(&hdr->alignment)); 3222 3223 glColorSubTable((GLenum) bswap_ENUM(pc + 20), 3224 (GLsizei) bswap_CARD32(pc + 24), 3225 (GLsizei) bswap_CARD32(pc + 28), 3226 (GLenum) bswap_ENUM(pc + 32), 3227 (GLenum) bswap_ENUM(pc + 36), data); 3228 } 3229 3230 void 3231 __glXDispSwap_CopyColorSubTable(GLbyte * pc) 3232 { 3233 glCopyColorSubTable((GLenum) bswap_ENUM(pc + 0), 3234 (GLsizei) bswap_CARD32(pc + 4), 3235 (GLint) bswap_CARD32(pc + 8), 3236 (GLint) bswap_CARD32(pc + 12), 3237 (GLsizei) bswap_CARD32(pc + 16)); 3238 } 3239 3240 void 3241 __glXDispSwap_ConvolutionFilter1D(GLbyte * pc) 3242 { 3243 const GLvoid *const image = (const GLvoid *) ((pc + 44)); 3244 __GLXpixelHeader *const hdr = (__GLXpixelHeader *) (pc); 3245 3246 glPixelStorei(GL_UNPACK_SWAP_BYTES, hdr->swapBytes); 3247 glPixelStorei(GL_UNPACK_LSB_FIRST, hdr->lsbFirst); 3248 glPixelStorei(GL_UNPACK_ROW_LENGTH, (GLint) bswap_CARD32(&hdr->rowLength)); 3249 glPixelStorei(GL_UNPACK_SKIP_ROWS, (GLint) bswap_CARD32(&hdr->skipRows)); 3250 glPixelStorei(GL_UNPACK_SKIP_PIXELS, 3251 (GLint) bswap_CARD32(&hdr->skipPixels)); 3252 glPixelStorei(GL_UNPACK_ALIGNMENT, (GLint) bswap_CARD32(&hdr->alignment)); 3253 3254 glConvolutionFilter1D((GLenum) bswap_ENUM(pc + 20), 3255 (GLenum) bswap_ENUM(pc + 24), 3256 (GLsizei) bswap_CARD32(pc + 28), 3257 (GLenum) bswap_ENUM(pc + 36), 3258 (GLenum) bswap_ENUM(pc + 40), image); 3259 } 3260 3261 void 3262 __glXDispSwap_ConvolutionFilter2D(GLbyte * pc) 3263 { 3264 const GLvoid *const image = (const GLvoid *) ((pc + 44)); 3265 __GLXpixelHeader *const hdr = (__GLXpixelHeader *) (pc); 3266 3267 glPixelStorei(GL_UNPACK_SWAP_BYTES, hdr->swapBytes); 3268 glPixelStorei(GL_UNPACK_LSB_FIRST, hdr->lsbFirst); 3269 glPixelStorei(GL_UNPACK_ROW_LENGTH, (GLint) bswap_CARD32(&hdr->rowLength)); 3270 glPixelStorei(GL_UNPACK_SKIP_ROWS, (GLint) bswap_CARD32(&hdr->skipRows)); 3271 glPixelStorei(GL_UNPACK_SKIP_PIXELS, 3272 (GLint) bswap_CARD32(&hdr->skipPixels)); 3273 glPixelStorei(GL_UNPACK_ALIGNMENT, (GLint) bswap_CARD32(&hdr->alignment)); 3274 3275 glConvolutionFilter2D((GLenum) bswap_ENUM(pc + 20), 3276 (GLenum) bswap_ENUM(pc + 24), 3277 (GLsizei) bswap_CARD32(pc + 28), 3278 (GLsizei) bswap_CARD32(pc + 32), 3279 (GLenum) bswap_ENUM(pc + 36), 3280 (GLenum) bswap_ENUM(pc + 40), image); 3281 } 3282 3283 void 3284 __glXDispSwap_ConvolutionParameterf(GLbyte * pc) 3285 { 3286 glConvolutionParameterf((GLenum) bswap_ENUM(pc + 0), 3287 (GLenum) bswap_ENUM(pc + 4), 3288 (GLfloat) bswap_FLOAT32(pc + 8)); 3289 } 3290 3291 void 3292 __glXDispSwap_ConvolutionParameterfv(GLbyte * pc) 3293 { 3294 const GLenum pname = (GLenum) bswap_ENUM(pc + 4); 3295 const GLfloat *params; 3296 3297 params = 3298 (const GLfloat *) bswap_32_array((uint32_t *) (pc + 8), 3299 __glConvolutionParameterfv_size 3300 (pname)); 3301 3302 glConvolutionParameterfv((GLenum) bswap_ENUM(pc + 0), pname, params); 3303 } 3304 3305 void 3306 __glXDispSwap_ConvolutionParameteri(GLbyte * pc) 3307 { 3308 glConvolutionParameteri((GLenum) bswap_ENUM(pc + 0), 3309 (GLenum) bswap_ENUM(pc + 4), 3310 (GLint) bswap_CARD32(pc + 8)); 3311 } 3312 3313 void 3314 __glXDispSwap_ConvolutionParameteriv(GLbyte * pc) 3315 { 3316 const GLenum pname = (GLenum) bswap_ENUM(pc + 4); 3317 const GLint *params; 3318 3319 params = 3320 (const GLint *) bswap_32_array((uint32_t *) (pc + 8), 3321 __glConvolutionParameteriv_size(pname)); 3322 3323 glConvolutionParameteriv((GLenum) bswap_ENUM(pc + 0), pname, params); 3324 } 3325 3326 void 3327 __glXDispSwap_CopyConvolutionFilter1D(GLbyte * pc) 3328 { 3329 glCopyConvolutionFilter1D((GLenum) bswap_ENUM(pc + 0), 3330 (GLenum) bswap_ENUM(pc + 4), 3331 (GLint) bswap_CARD32(pc + 8), 3332 (GLint) bswap_CARD32(pc + 12), 3333 (GLsizei) bswap_CARD32(pc + 16)); 3334 } 3335 3336 void 3337 __glXDispSwap_CopyConvolutionFilter2D(GLbyte * pc) 3338 { 3339 glCopyConvolutionFilter2D((GLenum) bswap_ENUM(pc + 0), 3340 (GLenum) bswap_ENUM(pc + 4), 3341 (GLint) bswap_CARD32(pc + 8), 3342 (GLint) bswap_CARD32(pc + 12), 3343 (GLsizei) bswap_CARD32(pc + 16), 3344 (GLsizei) bswap_CARD32(pc + 20)); 3345 } 3346 3347 int 3348 __glXDispSwap_GetConvolutionParameterfv(__GLXclientState * cl, GLbyte * pc) 3349 { 3350 xGLXSingleReq *const req = (xGLXSingleReq *) pc; 3351 int error; 3352 __GLXcontext *const cx = 3353 __glXForceCurrent(cl, bswap_CARD32(&req->contextTag), &error); 3354 3355 pc += __GLX_SINGLE_HDR_SIZE; 3356 if (cx != NULL) { 3357 const GLenum pname = (GLenum) bswap_ENUM(pc + 4); 3358 3359 const GLuint compsize = __glGetConvolutionParameterfv_size(pname); 3360 GLfloat answerBuffer[200]; 3361 GLfloat *params = 3362 __glXGetAnswerBuffer(cl, compsize * 4, answerBuffer, 3363 sizeof(answerBuffer), 4); 3364 3365 if (params == NULL) 3366 return BadAlloc; 3367 __glXClearErrorOccured(); 3368 3369 glGetConvolutionParameterfv((GLenum) bswap_ENUM(pc + 0), pname, params); 3370 (void) bswap_32_array((uint32_t *) params, compsize); 3371 __glXSendReplySwap(cl->client, params, compsize, 4, GL_FALSE, 0); 3372 error = Success; 3373 } 3374 3375 return error; 3376 } 3377 3378 int 3379 __glXDispSwap_GetConvolutionParameterfvEXT(__GLXclientState * cl, GLbyte * pc) 3380 { 3381 xGLXVendorPrivateReq *const req = (xGLXVendorPrivateReq *) pc; 3382 int error; 3383 __GLXcontext *const cx = 3384 __glXForceCurrent(cl, bswap_CARD32(&req->contextTag), &error); 3385 3386 pc += __GLX_VENDPRIV_HDR_SIZE; 3387 if (cx != NULL) { 3388 const GLenum pname = (GLenum) bswap_ENUM(pc + 4); 3389 3390 const GLuint compsize = __glGetConvolutionParameterfv_size(pname); 3391 GLfloat answerBuffer[200]; 3392 GLfloat *params = 3393 __glXGetAnswerBuffer(cl, compsize * 4, answerBuffer, 3394 sizeof(answerBuffer), 4); 3395 3396 if (params == NULL) 3397 return BadAlloc; 3398 __glXClearErrorOccured(); 3399 3400 glGetConvolutionParameterfv((GLenum) bswap_ENUM(pc + 0), pname, params); 3401 (void) bswap_32_array((uint32_t *) params, compsize); 3402 __glXSendReplySwap(cl->client, params, compsize, 4, GL_FALSE, 0); 3403 error = Success; 3404 } 3405 3406 return error; 3407 } 3408 3409 int 3410 __glXDispSwap_GetConvolutionParameteriv(__GLXclientState * cl, GLbyte * pc) 3411 { 3412 xGLXSingleReq *const req = (xGLXSingleReq *) pc; 3413 int error; 3414 __GLXcontext *const cx = 3415 __glXForceCurrent(cl, bswap_CARD32(&req->contextTag), &error); 3416 3417 pc += __GLX_SINGLE_HDR_SIZE; 3418 if (cx != NULL) { 3419 const GLenum pname = (GLenum) bswap_ENUM(pc + 4); 3420 3421 const GLuint compsize = __glGetConvolutionParameteriv_size(pname); 3422 GLint answerBuffer[200]; 3423 GLint *params = 3424 __glXGetAnswerBuffer(cl, compsize * 4, answerBuffer, 3425 sizeof(answerBuffer), 4); 3426 3427 if (params == NULL) 3428 return BadAlloc; 3429 __glXClearErrorOccured(); 3430 3431 glGetConvolutionParameteriv((GLenum) bswap_ENUM(pc + 0), pname, params); 3432 (void) bswap_32_array((uint32_t *) params, compsize); 3433 __glXSendReplySwap(cl->client, params, compsize, 4, GL_FALSE, 0); 3434 error = Success; 3435 } 3436 3437 return error; 3438 } 3439 3440 int 3441 __glXDispSwap_GetConvolutionParameterivEXT(__GLXclientState * cl, GLbyte * pc) 3442 { 3443 xGLXVendorPrivateReq *const req = (xGLXVendorPrivateReq *) pc; 3444 int error; 3445 __GLXcontext *const cx = 3446 __glXForceCurrent(cl, bswap_CARD32(&req->contextTag), &error); 3447 3448 pc += __GLX_VENDPRIV_HDR_SIZE; 3449 if (cx != NULL) { 3450 const GLenum pname = (GLenum) bswap_ENUM(pc + 4); 3451 3452 const GLuint compsize = __glGetConvolutionParameteriv_size(pname); 3453 GLint answerBuffer[200]; 3454 GLint *params = 3455 __glXGetAnswerBuffer(cl, compsize * 4, answerBuffer, 3456 sizeof(answerBuffer), 4); 3457 3458 if (params == NULL) 3459 return BadAlloc; 3460 __glXClearErrorOccured(); 3461 3462 glGetConvolutionParameteriv((GLenum) bswap_ENUM(pc + 0), pname, params); 3463 (void) bswap_32_array((uint32_t *) params, compsize); 3464 __glXSendReplySwap(cl->client, params, compsize, 4, GL_FALSE, 0); 3465 error = Success; 3466 } 3467 3468 return error; 3469 } 3470 3471 int 3472 __glXDispSwap_GetHistogramParameterfv(__GLXclientState * cl, GLbyte * pc) 3473 { 3474 xGLXSingleReq *const req = (xGLXSingleReq *) pc; 3475 int error; 3476 __GLXcontext *const cx = 3477 __glXForceCurrent(cl, bswap_CARD32(&req->contextTag), &error); 3478 3479 pc += __GLX_SINGLE_HDR_SIZE; 3480 if (cx != NULL) { 3481 const GLenum pname = (GLenum) bswap_ENUM(pc + 4); 3482 3483 const GLuint compsize = __glGetHistogramParameterfv_size(pname); 3484 GLfloat answerBuffer[200]; 3485 GLfloat *params = 3486 __glXGetAnswerBuffer(cl, compsize * 4, answerBuffer, 3487 sizeof(answerBuffer), 4); 3488 3489 if (params == NULL) 3490 return BadAlloc; 3491 __glXClearErrorOccured(); 3492 3493 glGetHistogramParameterfv((GLenum) bswap_ENUM(pc + 0), pname, params); 3494 (void) bswap_32_array((uint32_t *) params, compsize); 3495 __glXSendReplySwap(cl->client, params, compsize, 4, GL_FALSE, 0); 3496 error = Success; 3497 } 3498 3499 return error; 3500 } 3501 3502 int 3503 __glXDispSwap_GetHistogramParameterfvEXT(__GLXclientState * cl, GLbyte * pc) 3504 { 3505 xGLXVendorPrivateReq *const req = (xGLXVendorPrivateReq *) pc; 3506 int error; 3507 __GLXcontext *const cx = 3508 __glXForceCurrent(cl, bswap_CARD32(&req->contextTag), &error); 3509 3510 pc += __GLX_VENDPRIV_HDR_SIZE; 3511 if (cx != NULL) { 3512 const GLenum pname = (GLenum) bswap_ENUM(pc + 4); 3513 3514 const GLuint compsize = __glGetHistogramParameterfv_size(pname); 3515 GLfloat answerBuffer[200]; 3516 GLfloat *params = 3517 __glXGetAnswerBuffer(cl, compsize * 4, answerBuffer, 3518 sizeof(answerBuffer), 4); 3519 3520 if (params == NULL) 3521 return BadAlloc; 3522 __glXClearErrorOccured(); 3523 3524 glGetHistogramParameterfv((GLenum) bswap_ENUM(pc + 0), pname, params); 3525 (void) bswap_32_array((uint32_t *) params, compsize); 3526 __glXSendReplySwap(cl->client, params, compsize, 4, GL_FALSE, 0); 3527 error = Success; 3528 } 3529 3530 return error; 3531 } 3532 3533 int 3534 __glXDispSwap_GetHistogramParameteriv(__GLXclientState * cl, GLbyte * pc) 3535 { 3536 xGLXSingleReq *const req = (xGLXSingleReq *) pc; 3537 int error; 3538 __GLXcontext *const cx = 3539 __glXForceCurrent(cl, bswap_CARD32(&req->contextTag), &error); 3540 3541 pc += __GLX_SINGLE_HDR_SIZE; 3542 if (cx != NULL) { 3543 const GLenum pname = (GLenum) bswap_ENUM(pc + 4); 3544 3545 const GLuint compsize = __glGetHistogramParameteriv_size(pname); 3546 GLint answerBuffer[200]; 3547 GLint *params = 3548 __glXGetAnswerBuffer(cl, compsize * 4, answerBuffer, 3549 sizeof(answerBuffer), 4); 3550 3551 if (params == NULL) 3552 return BadAlloc; 3553 __glXClearErrorOccured(); 3554 3555 glGetHistogramParameteriv((GLenum) bswap_ENUM(pc + 0), pname, params); 3556 (void) bswap_32_array((uint32_t *) params, compsize); 3557 __glXSendReplySwap(cl->client, params, compsize, 4, GL_FALSE, 0); 3558 error = Success; 3559 } 3560 3561 return error; 3562 } 3563 3564 int 3565 __glXDispSwap_GetHistogramParameterivEXT(__GLXclientState * cl, GLbyte * pc) 3566 { 3567 xGLXVendorPrivateReq *const req = (xGLXVendorPrivateReq *) pc; 3568 int error; 3569 __GLXcontext *const cx = 3570 __glXForceCurrent(cl, bswap_CARD32(&req->contextTag), &error); 3571 3572 pc += __GLX_VENDPRIV_HDR_SIZE; 3573 if (cx != NULL) { 3574 const GLenum pname = (GLenum) bswap_ENUM(pc + 4); 3575 3576 const GLuint compsize = __glGetHistogramParameteriv_size(pname); 3577 GLint answerBuffer[200]; 3578 GLint *params = 3579 __glXGetAnswerBuffer(cl, compsize * 4, answerBuffer, 3580 sizeof(answerBuffer), 4); 3581 3582 if (params == NULL) 3583 return BadAlloc; 3584 __glXClearErrorOccured(); 3585 3586 glGetHistogramParameteriv((GLenum) bswap_ENUM(pc + 0), pname, params); 3587 (void) bswap_32_array((uint32_t *) params, compsize); 3588 __glXSendReplySwap(cl->client, params, compsize, 4, GL_FALSE, 0); 3589 error = Success; 3590 } 3591 3592 return error; 3593 } 3594 3595 int 3596 __glXDispSwap_GetMinmaxParameterfv(__GLXclientState * cl, GLbyte * pc) 3597 { 3598 xGLXSingleReq *const req = (xGLXSingleReq *) pc; 3599 int error; 3600 __GLXcontext *const cx = 3601 __glXForceCurrent(cl, bswap_CARD32(&req->contextTag), &error); 3602 3603 pc += __GLX_SINGLE_HDR_SIZE; 3604 if (cx != NULL) { 3605 const GLenum pname = (GLenum) bswap_ENUM(pc + 4); 3606 3607 const GLuint compsize = __glGetMinmaxParameterfv_size(pname); 3608 GLfloat answerBuffer[200]; 3609 GLfloat *params = 3610 __glXGetAnswerBuffer(cl, compsize * 4, answerBuffer, 3611 sizeof(answerBuffer), 4); 3612 3613 if (params == NULL) 3614 return BadAlloc; 3615 __glXClearErrorOccured(); 3616 3617 glGetMinmaxParameterfv((GLenum) bswap_ENUM(pc + 0), pname, params); 3618 (void) bswap_32_array((uint32_t *) params, compsize); 3619 __glXSendReplySwap(cl->client, params, compsize, 4, GL_FALSE, 0); 3620 error = Success; 3621 } 3622 3623 return error; 3624 } 3625 3626 int 3627 __glXDispSwap_GetMinmaxParameterfvEXT(__GLXclientState * cl, GLbyte * pc) 3628 { 3629 xGLXVendorPrivateReq *const req = (xGLXVendorPrivateReq *) pc; 3630 int error; 3631 __GLXcontext *const cx = 3632 __glXForceCurrent(cl, bswap_CARD32(&req->contextTag), &error); 3633 3634 pc += __GLX_VENDPRIV_HDR_SIZE; 3635 if (cx != NULL) { 3636 const GLenum pname = (GLenum) bswap_ENUM(pc + 4); 3637 3638 const GLuint compsize = __glGetMinmaxParameterfv_size(pname); 3639 GLfloat answerBuffer[200]; 3640 GLfloat *params = 3641 __glXGetAnswerBuffer(cl, compsize * 4, answerBuffer, 3642 sizeof(answerBuffer), 4); 3643 3644 if (params == NULL) 3645 return BadAlloc; 3646 __glXClearErrorOccured(); 3647 3648 glGetMinmaxParameterfv((GLenum) bswap_ENUM(pc + 0), pname, params); 3649 (void) bswap_32_array((uint32_t *) params, compsize); 3650 __glXSendReplySwap(cl->client, params, compsize, 4, GL_FALSE, 0); 3651 error = Success; 3652 } 3653 3654 return error; 3655 } 3656 3657 int 3658 __glXDispSwap_GetMinmaxParameteriv(__GLXclientState * cl, GLbyte * pc) 3659 { 3660 xGLXSingleReq *const req = (xGLXSingleReq *) pc; 3661 int error; 3662 __GLXcontext *const cx = 3663 __glXForceCurrent(cl, bswap_CARD32(&req->contextTag), &error); 3664 3665 pc += __GLX_SINGLE_HDR_SIZE; 3666 if (cx != NULL) { 3667 const GLenum pname = (GLenum) bswap_ENUM(pc + 4); 3668 3669 const GLuint compsize = __glGetMinmaxParameteriv_size(pname); 3670 GLint answerBuffer[200]; 3671 GLint *params = 3672 __glXGetAnswerBuffer(cl, compsize * 4, answerBuffer, 3673 sizeof(answerBuffer), 4); 3674 3675 if (params == NULL) 3676 return BadAlloc; 3677 __glXClearErrorOccured(); 3678 3679 glGetMinmaxParameteriv((GLenum) bswap_ENUM(pc + 0), pname, params); 3680 (void) bswap_32_array((uint32_t *) params, compsize); 3681 __glXSendReplySwap(cl->client, params, compsize, 4, GL_FALSE, 0); 3682 error = Success; 3683 } 3684 3685 return error; 3686 } 3687 3688 int 3689 __glXDispSwap_GetMinmaxParameterivEXT(__GLXclientState * cl, GLbyte * pc) 3690 { 3691 xGLXVendorPrivateReq *const req = (xGLXVendorPrivateReq *) pc; 3692 int error; 3693 __GLXcontext *const cx = 3694 __glXForceCurrent(cl, bswap_CARD32(&req->contextTag), &error); 3695 3696 pc += __GLX_VENDPRIV_HDR_SIZE; 3697 if (cx != NULL) { 3698 const GLenum pname = (GLenum) bswap_ENUM(pc + 4); 3699 3700 const GLuint compsize = __glGetMinmaxParameteriv_size(pname); 3701 GLint answerBuffer[200]; 3702 GLint *params = 3703 __glXGetAnswerBuffer(cl, compsize * 4, answerBuffer, 3704 sizeof(answerBuffer), 4); 3705 3706 if (params == NULL) 3707 return BadAlloc; 3708 __glXClearErrorOccured(); 3709 3710 glGetMinmaxParameteriv((GLenum) bswap_ENUM(pc + 0), pname, params); 3711 (void) bswap_32_array((uint32_t *) params, compsize); 3712 __glXSendReplySwap(cl->client, params, compsize, 4, GL_FALSE, 0); 3713 error = Success; 3714 } 3715 3716 return error; 3717 } 3718 3719 void 3720 __glXDispSwap_Histogram(GLbyte * pc) 3721 { 3722 glHistogram((GLenum) bswap_ENUM(pc + 0), 3723 (GLsizei) bswap_CARD32(pc + 4), 3724 (GLenum) bswap_ENUM(pc + 8), *(GLboolean *) (pc + 12)); 3725 } 3726 3727 void 3728 __glXDispSwap_Minmax(GLbyte * pc) 3729 { 3730 glMinmax((GLenum) bswap_ENUM(pc + 0), 3731 (GLenum) bswap_ENUM(pc + 4), *(GLboolean *) (pc + 8)); 3732 } 3733 3734 void 3735 __glXDispSwap_ResetHistogram(GLbyte * pc) 3736 { 3737 glResetHistogram((GLenum) bswap_ENUM(pc + 0)); 3738 } 3739 3740 void 3741 __glXDispSwap_ResetMinmax(GLbyte * pc) 3742 { 3743 glResetMinmax((GLenum) bswap_ENUM(pc + 0)); 3744 } 3745 3746 void 3747 __glXDispSwap_TexImage3D(GLbyte * pc) 3748 { 3749 const CARD32 ptr_is_null = *(CARD32 *) (pc + 76); 3750 const GLvoid *const pixels = 3751 (const GLvoid *) ((ptr_is_null != 0) ? NULL : (pc + 80)); 3752 __GLXpixel3DHeader *const hdr = (__GLXpixel3DHeader *) (pc); 3753 3754 glPixelStorei(GL_UNPACK_SWAP_BYTES, hdr->swapBytes); 3755 glPixelStorei(GL_UNPACK_LSB_FIRST, hdr->lsbFirst); 3756 glPixelStorei(GL_UNPACK_ROW_LENGTH, (GLint) bswap_CARD32(&hdr->rowLength)); 3757 glPixelStorei(GL_UNPACK_IMAGE_HEIGHT, 3758 (GLint) bswap_CARD32(&hdr->imageHeight)); 3759 glPixelStorei(GL_UNPACK_SKIP_ROWS, (GLint) bswap_CARD32(&hdr->skipRows)); 3760 glPixelStorei(GL_UNPACK_SKIP_IMAGES, 3761 (GLint) bswap_CARD32(&hdr->skipImages)); 3762 glPixelStorei(GL_UNPACK_SKIP_PIXELS, 3763 (GLint) bswap_CARD32(&hdr->skipPixels)); 3764 glPixelStorei(GL_UNPACK_ALIGNMENT, (GLint) bswap_CARD32(&hdr->alignment)); 3765 3766 glTexImage3D((GLenum) bswap_ENUM(pc + 36), 3767 (GLint) bswap_CARD32(pc + 40), 3768 (GLint) bswap_CARD32(pc + 44), 3769 (GLsizei) bswap_CARD32(pc + 48), 3770 (GLsizei) bswap_CARD32(pc + 52), 3771 (GLsizei) bswap_CARD32(pc + 56), 3772 (GLint) bswap_CARD32(pc + 64), 3773 (GLenum) bswap_ENUM(pc + 68), 3774 (GLenum) bswap_ENUM(pc + 72), pixels); 3775 } 3776 3777 void 3778 __glXDispSwap_TexSubImage3D(GLbyte * pc) 3779 { 3780 const GLvoid *const pixels = (const GLvoid *) ((pc + 88)); 3781 __GLXpixel3DHeader *const hdr = (__GLXpixel3DHeader *) (pc); 3782 3783 glPixelStorei(GL_UNPACK_SWAP_BYTES, hdr->swapBytes); 3784 glPixelStorei(GL_UNPACK_LSB_FIRST, hdr->lsbFirst); 3785 glPixelStorei(GL_UNPACK_ROW_LENGTH, (GLint) bswap_CARD32(&hdr->rowLength)); 3786 glPixelStorei(GL_UNPACK_IMAGE_HEIGHT, 3787 (GLint) bswap_CARD32(&hdr->imageHeight)); 3788 glPixelStorei(GL_UNPACK_SKIP_ROWS, (GLint) bswap_CARD32(&hdr->skipRows)); 3789 glPixelStorei(GL_UNPACK_SKIP_IMAGES, 3790 (GLint) bswap_CARD32(&hdr->skipImages)); 3791 glPixelStorei(GL_UNPACK_SKIP_PIXELS, 3792 (GLint) bswap_CARD32(&hdr->skipPixels)); 3793 glPixelStorei(GL_UNPACK_ALIGNMENT, (GLint) bswap_CARD32(&hdr->alignment)); 3794 3795 glTexSubImage3D((GLenum) bswap_ENUM(pc + 36), 3796 (GLint) bswap_CARD32(pc + 40), 3797 (GLint) bswap_CARD32(pc + 44), 3798 (GLint) bswap_CARD32(pc + 48), 3799 (GLint) bswap_CARD32(pc + 52), 3800 (GLsizei) bswap_CARD32(pc + 60), 3801 (GLsizei) bswap_CARD32(pc + 64), 3802 (GLsizei) bswap_CARD32(pc + 68), 3803 (GLenum) bswap_ENUM(pc + 76), 3804 (GLenum) bswap_ENUM(pc + 80), pixels); 3805 } 3806 3807 void 3808 __glXDispSwap_CopyTexSubImage3D(GLbyte * pc) 3809 { 3810 glCopyTexSubImage3D((GLenum) bswap_ENUM(pc + 0), 3811 (GLint) bswap_CARD32(pc + 4), 3812 (GLint) bswap_CARD32(pc + 8), 3813 (GLint) bswap_CARD32(pc + 12), 3814 (GLint) bswap_CARD32(pc + 16), 3815 (GLint) bswap_CARD32(pc + 20), 3816 (GLint) bswap_CARD32(pc + 24), 3817 (GLsizei) bswap_CARD32(pc + 28), 3818 (GLsizei) bswap_CARD32(pc + 32)); 3819 } 3820 3821 void 3822 __glXDispSwap_ActiveTexture(GLbyte * pc) 3823 { 3824 glActiveTextureARB((GLenum) bswap_ENUM(pc + 0)); 3825 } 3826 3827 void 3828 __glXDispSwap_MultiTexCoord1dv(GLbyte * pc) 3829 { 3830 #ifdef __GLX_ALIGN64 3831 if ((unsigned long) (pc) & 7) { 3832 (void) memmove(pc - 4, pc, 12); 3833 pc -= 4; 3834 } 3835 #endif 3836 3837 glMultiTexCoord1dvARB((GLenum) bswap_ENUM(pc + 8), 3838 (const GLdouble *) bswap_64_array((uint64_t *) (pc + 0), 3839 1)); 3840 } 3841 3842 void 3843 __glXDispSwap_MultiTexCoord1fvARB(GLbyte * pc) 3844 { 3845 glMultiTexCoord1fvARB((GLenum) bswap_ENUM(pc + 0), 3846 (const GLfloat *) 3847 bswap_32_array((uint32_t *) (pc + 4), 1)); 3848 } 3849 3850 void 3851 __glXDispSwap_MultiTexCoord1iv(GLbyte * pc) 3852 { 3853 glMultiTexCoord1ivARB((GLenum) bswap_ENUM(pc + 0), 3854 (const GLint *) bswap_32_array((uint32_t *) (pc + 4), 3855 1)); 3856 } 3857 3858 void 3859 __glXDispSwap_MultiTexCoord1sv(GLbyte * pc) 3860 { 3861 glMultiTexCoord1svARB((GLenum) bswap_ENUM(pc + 0), 3862 (const GLshort *) bswap_16_array((uint16_t *) (pc + 4), 3863 1)); 3864 } 3865 3866 void 3867 __glXDispSwap_MultiTexCoord2dv(GLbyte * pc) 3868 { 3869 #ifdef __GLX_ALIGN64 3870 if ((unsigned long) (pc) & 7) { 3871 (void) memmove(pc - 4, pc, 20); 3872 pc -= 4; 3873 } 3874 #endif 3875 3876 glMultiTexCoord2dvARB((GLenum) bswap_ENUM(pc + 16), 3877 (const GLdouble *) bswap_64_array((uint64_t *) (pc + 0), 3878 2)); 3879 } 3880 3881 void 3882 __glXDispSwap_MultiTexCoord2fvARB(GLbyte * pc) 3883 { 3884 glMultiTexCoord2fvARB((GLenum) bswap_ENUM(pc + 0), 3885 (const GLfloat *) 3886 bswap_32_array((uint32_t *) (pc + 4), 2)); 3887 } 3888 3889 void 3890 __glXDispSwap_MultiTexCoord2iv(GLbyte * pc) 3891 { 3892 glMultiTexCoord2ivARB((GLenum) bswap_ENUM(pc + 0), 3893 (const GLint *) bswap_32_array((uint32_t *) (pc + 4), 3894 2)); 3895 } 3896 3897 void 3898 __glXDispSwap_MultiTexCoord2sv(GLbyte * pc) 3899 { 3900 glMultiTexCoord2svARB((GLenum) bswap_ENUM(pc + 0), 3901 (const GLshort *) bswap_16_array((uint16_t *) (pc + 4), 3902 2)); 3903 } 3904 3905 void 3906 __glXDispSwap_MultiTexCoord3dv(GLbyte * pc) 3907 { 3908 #ifdef __GLX_ALIGN64 3909 if ((unsigned long) (pc) & 7) { 3910 (void) memmove(pc - 4, pc, 28); 3911 pc -= 4; 3912 } 3913 #endif 3914 3915 glMultiTexCoord3dvARB((GLenum) bswap_ENUM(pc + 24), 3916 (const GLdouble *) bswap_64_array((uint64_t *) (pc + 0), 3917 3)); 3918 } 3919 3920 void 3921 __glXDispSwap_MultiTexCoord3fvARB(GLbyte * pc) 3922 { 3923 glMultiTexCoord3fvARB((GLenum) bswap_ENUM(pc + 0), 3924 (const GLfloat *) 3925 bswap_32_array((uint32_t *) (pc + 4), 3)); 3926 } 3927 3928 void 3929 __glXDispSwap_MultiTexCoord3iv(GLbyte * pc) 3930 { 3931 glMultiTexCoord3ivARB((GLenum) bswap_ENUM(pc + 0), 3932 (const GLint *) bswap_32_array((uint32_t *) (pc + 4), 3933 3)); 3934 } 3935 3936 void 3937 __glXDispSwap_MultiTexCoord3sv(GLbyte * pc) 3938 { 3939 glMultiTexCoord3svARB((GLenum) bswap_ENUM(pc + 0), 3940 (const GLshort *) bswap_16_array((uint16_t *) (pc + 4), 3941 3)); 3942 } 3943 3944 void 3945 __glXDispSwap_MultiTexCoord4dv(GLbyte * pc) 3946 { 3947 #ifdef __GLX_ALIGN64 3948 if ((unsigned long) (pc) & 7) { 3949 (void) memmove(pc - 4, pc, 36); 3950 pc -= 4; 3951 } 3952 #endif 3953 3954 glMultiTexCoord4dvARB((GLenum) bswap_ENUM(pc + 32), 3955 (const GLdouble *) bswap_64_array((uint64_t *) (pc + 0), 3956 4)); 3957 } 3958 3959 void 3960 __glXDispSwap_MultiTexCoord4fvARB(GLbyte * pc) 3961 { 3962 glMultiTexCoord4fvARB((GLenum) bswap_ENUM(pc + 0), 3963 (const GLfloat *) 3964 bswap_32_array((uint32_t *) (pc + 4), 4)); 3965 } 3966 3967 void 3968 __glXDispSwap_MultiTexCoord4iv(GLbyte * pc) 3969 { 3970 glMultiTexCoord4ivARB((GLenum) bswap_ENUM(pc + 0), 3971 (const GLint *) bswap_32_array((uint32_t *) (pc + 4), 3972 4)); 3973 } 3974 3975 void 3976 __glXDispSwap_MultiTexCoord4sv(GLbyte * pc) 3977 { 3978 glMultiTexCoord4svARB((GLenum) bswap_ENUM(pc + 0), 3979 (const GLshort *) bswap_16_array((uint16_t *) (pc + 4), 3980 4)); 3981 } 3982 3983 void 3984 __glXDispSwap_CompressedTexImage1D(GLbyte * pc) 3985 { 3986 PFNGLCOMPRESSEDTEXIMAGE1DPROC CompressedTexImage1D = 3987 __glGetProcAddress("glCompressedTexImage1D"); 3988 const GLsizei imageSize = (GLsizei) bswap_CARD32(pc + 20); 3989 3990 CompressedTexImage1D((GLenum) bswap_ENUM(pc + 0), 3991 (GLint) bswap_CARD32(pc + 4), 3992 (GLenum) bswap_ENUM(pc + 8), 3993 (GLsizei) bswap_CARD32(pc + 12), 3994 (GLint) bswap_CARD32(pc + 16), 3995 imageSize, (const GLvoid *) (pc + 24)); 3996 } 3997 3998 void 3999 __glXDispSwap_CompressedTexImage2D(GLbyte * pc) 4000 { 4001 PFNGLCOMPRESSEDTEXIMAGE2DPROC CompressedTexImage2D = 4002 __glGetProcAddress("glCompressedTexImage2D"); 4003 const GLsizei imageSize = (GLsizei) bswap_CARD32(pc + 24); 4004 4005 CompressedTexImage2D((GLenum) bswap_ENUM(pc + 0), 4006 (GLint) bswap_CARD32(pc + 4), 4007 (GLenum) bswap_ENUM(pc + 8), 4008 (GLsizei) bswap_CARD32(pc + 12), 4009 (GLsizei) bswap_CARD32(pc + 16), 4010 (GLint) bswap_CARD32(pc + 20), 4011 imageSize, (const GLvoid *) (pc + 28)); 4012 } 4013 4014 void 4015 __glXDispSwap_CompressedTexImage3D(GLbyte * pc) 4016 { 4017 PFNGLCOMPRESSEDTEXIMAGE3DPROC CompressedTexImage3D = 4018 __glGetProcAddress("glCompressedTexImage3D"); 4019 const GLsizei imageSize = (GLsizei) bswap_CARD32(pc + 28); 4020 4021 CompressedTexImage3D((GLenum) bswap_ENUM(pc + 0), 4022 (GLint) bswap_CARD32(pc + 4), 4023 (GLenum) bswap_ENUM(pc + 8), 4024 (GLsizei) bswap_CARD32(pc + 12), 4025 (GLsizei) bswap_CARD32(pc + 16), 4026 (GLsizei) bswap_CARD32(pc + 20), 4027 (GLint) bswap_CARD32(pc + 24), 4028 imageSize, (const GLvoid *) (pc + 32)); 4029 } 4030 4031 void 4032 __glXDispSwap_CompressedTexSubImage1D(GLbyte * pc) 4033 { 4034 PFNGLCOMPRESSEDTEXSUBIMAGE1DPROC CompressedTexSubImage1D = 4035 __glGetProcAddress("glCompressedTexSubImage1D"); 4036 const GLsizei imageSize = (GLsizei) bswap_CARD32(pc + 20); 4037 4038 CompressedTexSubImage1D((GLenum) bswap_ENUM(pc + 0), 4039 (GLint) bswap_CARD32(pc + 4), 4040 (GLint) bswap_CARD32(pc + 8), 4041 (GLsizei) bswap_CARD32(pc + 12), 4042 (GLenum) bswap_ENUM(pc + 16), 4043 imageSize, (const GLvoid *) (pc + 24)); 4044 } 4045 4046 void 4047 __glXDispSwap_CompressedTexSubImage2D(GLbyte * pc) 4048 { 4049 PFNGLCOMPRESSEDTEXSUBIMAGE2DPROC CompressedTexSubImage2D = 4050 __glGetProcAddress("glCompressedTexSubImage2D"); 4051 const GLsizei imageSize = (GLsizei) bswap_CARD32(pc + 28); 4052 4053 CompressedTexSubImage2D((GLenum) bswap_ENUM(pc + 0), 4054 (GLint) bswap_CARD32(pc + 4), 4055 (GLint) bswap_CARD32(pc + 8), 4056 (GLint) bswap_CARD32(pc + 12), 4057 (GLsizei) bswap_CARD32(pc + 16), 4058 (GLsizei) bswap_CARD32(pc + 20), 4059 (GLenum) bswap_ENUM(pc + 24), 4060 imageSize, (const GLvoid *) (pc + 32)); 4061 } 4062 4063 void 4064 __glXDispSwap_CompressedTexSubImage3D(GLbyte * pc) 4065 { 4066 PFNGLCOMPRESSEDTEXSUBIMAGE3DPROC CompressedTexSubImage3D = 4067 __glGetProcAddress("glCompressedTexSubImage3D"); 4068 const GLsizei imageSize = (GLsizei) bswap_CARD32(pc + 36); 4069 4070 CompressedTexSubImage3D((GLenum) bswap_ENUM(pc + 0), 4071 (GLint) bswap_CARD32(pc + 4), 4072 (GLint) bswap_CARD32(pc + 8), 4073 (GLint) bswap_CARD32(pc + 12), 4074 (GLint) bswap_CARD32(pc + 16), 4075 (GLsizei) bswap_CARD32(pc + 20), 4076 (GLsizei) bswap_CARD32(pc + 24), 4077 (GLsizei) bswap_CARD32(pc + 28), 4078 (GLenum) bswap_ENUM(pc + 32), 4079 imageSize, (const GLvoid *) (pc + 40)); 4080 } 4081 4082 void 4083 __glXDispSwap_SampleCoverage(GLbyte * pc) 4084 { 4085 PFNGLSAMPLECOVERAGEPROC SampleCoverage = 4086 __glGetProcAddress("glSampleCoverage"); 4087 SampleCoverage((GLclampf) bswap_FLOAT32(pc + 0), *(GLboolean *) (pc + 4)); 4088 } 4089 4090 void 4091 __glXDispSwap_BlendFuncSeparate(GLbyte * pc) 4092 { 4093 PFNGLBLENDFUNCSEPARATEPROC BlendFuncSeparate = 4094 __glGetProcAddress("glBlendFuncSeparate"); 4095 BlendFuncSeparate((GLenum) bswap_ENUM(pc + 0), (GLenum) bswap_ENUM(pc + 4), 4096 (GLenum) bswap_ENUM(pc + 8), 4097 (GLenum) bswap_ENUM(pc + 12)); 4098 } 4099 4100 void 4101 __glXDispSwap_FogCoorddv(GLbyte * pc) 4102 { 4103 PFNGLFOGCOORDDVPROC FogCoorddv = __glGetProcAddress("glFogCoorddv"); 4104 4105 #ifdef __GLX_ALIGN64 4106 if ((unsigned long) (pc) & 7) { 4107 (void) memmove(pc - 4, pc, 8); 4108 pc -= 4; 4109 } 4110 #endif 4111 4112 FogCoorddv((const GLdouble *) bswap_64_array((uint64_t *) (pc + 0), 1)); 4113 } 4114 4115 void 4116 __glXDispSwap_PointParameterf(GLbyte * pc) 4117 { 4118 PFNGLPOINTPARAMETERFPROC PointParameterf = 4119 __glGetProcAddress("glPointParameterf"); 4120 PointParameterf((GLenum) bswap_ENUM(pc + 0), 4121 (GLfloat) bswap_FLOAT32(pc + 4)); 4122 } 4123 4124 void 4125 __glXDispSwap_PointParameterfv(GLbyte * pc) 4126 { 4127 PFNGLPOINTPARAMETERFVPROC PointParameterfv = 4128 __glGetProcAddress("glPointParameterfv"); 4129 const GLenum pname = (GLenum) bswap_ENUM(pc + 0); 4130 const GLfloat *params; 4131 4132 params = 4133 (const GLfloat *) bswap_32_array((uint32_t *) (pc + 4), 4134 __glPointParameterfv_size(pname)); 4135 4136 PointParameterfv(pname, params); 4137 } 4138 4139 void 4140 __glXDispSwap_PointParameteri(GLbyte * pc) 4141 { 4142 PFNGLPOINTPARAMETERIPROC PointParameteri = 4143 __glGetProcAddress("glPointParameteri"); 4144 PointParameteri((GLenum) bswap_ENUM(pc + 0), (GLint) bswap_CARD32(pc + 4)); 4145 } 4146 4147 void 4148 __glXDispSwap_PointParameteriv(GLbyte * pc) 4149 { 4150 PFNGLPOINTPARAMETERIVPROC PointParameteriv = 4151 __glGetProcAddress("glPointParameteriv"); 4152 const GLenum pname = (GLenum) bswap_ENUM(pc + 0); 4153 const GLint *params; 4154 4155 params = 4156 (const GLint *) bswap_32_array((uint32_t *) (pc + 4), 4157 __glPointParameteriv_size(pname)); 4158 4159 PointParameteriv(pname, params); 4160 } 4161 4162 void 4163 __glXDispSwap_SecondaryColor3bv(GLbyte * pc) 4164 { 4165 PFNGLSECONDARYCOLOR3BVPROC SecondaryColor3bv = 4166 __glGetProcAddress("glSecondaryColor3bv"); 4167 SecondaryColor3bv((const GLbyte *) (pc + 0)); 4168 } 4169 4170 void 4171 __glXDispSwap_SecondaryColor3dv(GLbyte * pc) 4172 { 4173 PFNGLSECONDARYCOLOR3DVPROC SecondaryColor3dv = 4174 __glGetProcAddress("glSecondaryColor3dv"); 4175 #ifdef __GLX_ALIGN64 4176 if ((unsigned long) (pc) & 7) { 4177 (void) memmove(pc - 4, pc, 24); 4178 pc -= 4; 4179 } 4180 #endif 4181 4182 SecondaryColor3dv((const GLdouble *) 4183 bswap_64_array((uint64_t *) (pc + 0), 3)); 4184 } 4185 4186 void 4187 __glXDispSwap_SecondaryColor3iv(GLbyte * pc) 4188 { 4189 PFNGLSECONDARYCOLOR3IVPROC SecondaryColor3iv = 4190 __glGetProcAddress("glSecondaryColor3iv"); 4191 SecondaryColor3iv((const GLint *) bswap_32_array((uint32_t *) (pc + 0), 3)); 4192 } 4193 4194 void 4195 __glXDispSwap_SecondaryColor3sv(GLbyte * pc) 4196 { 4197 PFNGLSECONDARYCOLOR3SVPROC SecondaryColor3sv = 4198 __glGetProcAddress("glSecondaryColor3sv"); 4199 SecondaryColor3sv((const GLshort *) 4200 bswap_16_array((uint16_t *) (pc + 0), 3)); 4201 } 4202 4203 void 4204 __glXDispSwap_SecondaryColor3ubv(GLbyte * pc) 4205 { 4206 PFNGLSECONDARYCOLOR3UBVPROC SecondaryColor3ubv = 4207 __glGetProcAddress("glSecondaryColor3ubv"); 4208 SecondaryColor3ubv((const GLubyte *) (pc + 0)); 4209 } 4210 4211 void 4212 __glXDispSwap_SecondaryColor3uiv(GLbyte * pc) 4213 { 4214 PFNGLSECONDARYCOLOR3UIVPROC SecondaryColor3uiv = 4215 __glGetProcAddress("glSecondaryColor3uiv"); 4216 SecondaryColor3uiv((const GLuint *) 4217 bswap_32_array((uint32_t *) (pc + 0), 3)); 4218 } 4219 4220 void 4221 __glXDispSwap_SecondaryColor3usv(GLbyte * pc) 4222 { 4223 PFNGLSECONDARYCOLOR3USVPROC SecondaryColor3usv = 4224 __glGetProcAddress("glSecondaryColor3usv"); 4225 SecondaryColor3usv((const GLushort *) 4226 bswap_16_array((uint16_t *) (pc + 0), 3)); 4227 } 4228 4229 void 4230 __glXDispSwap_WindowPos3fv(GLbyte * pc) 4231 { 4232 PFNGLWINDOWPOS3FVPROC WindowPos3fv = __glGetProcAddress("glWindowPos3fv"); 4233 4234 WindowPos3fv((const GLfloat *) bswap_32_array((uint32_t *) (pc + 0), 3)); 4235 } 4236 4237 void 4238 __glXDispSwap_BeginQuery(GLbyte * pc) 4239 { 4240 PFNGLBEGINQUERYPROC BeginQuery = __glGetProcAddress("glBeginQuery"); 4241 4242 BeginQuery((GLenum) bswap_ENUM(pc + 0), (GLuint) bswap_CARD32(pc + 4)); 4243 } 4244 4245 int 4246 __glXDispSwap_DeleteQueries(__GLXclientState * cl, GLbyte * pc) 4247 { 4248 PFNGLDELETEQUERIESPROC DeleteQueries = 4249 __glGetProcAddress("glDeleteQueries"); 4250 xGLXSingleReq *const req = (xGLXSingleReq *) pc; 4251 int error; 4252 __GLXcontext *const cx = 4253 __glXForceCurrent(cl, bswap_CARD32(&req->contextTag), &error); 4254 4255 pc += __GLX_SINGLE_HDR_SIZE; 4256 if (cx != NULL) { 4257 const GLsizei n = (GLsizei) bswap_CARD32(pc + 0); 4258 4259 DeleteQueries(n, 4260 (const GLuint *) bswap_32_array((uint32_t *) (pc + 4), 4261 0)); 4262 error = Success; 4263 } 4264 4265 return error; 4266 } 4267 4268 void 4269 __glXDispSwap_EndQuery(GLbyte * pc) 4270 { 4271 PFNGLENDQUERYPROC EndQuery = __glGetProcAddress("glEndQuery"); 4272 4273 EndQuery((GLenum) bswap_ENUM(pc + 0)); 4274 } 4275 4276 int 4277 __glXDispSwap_GenQueries(__GLXclientState * cl, GLbyte * pc) 4278 { 4279 PFNGLGENQUERIESPROC GenQueries = __glGetProcAddress("glGenQueries"); 4280 xGLXSingleReq *const req = (xGLXSingleReq *) pc; 4281 int error; 4282 __GLXcontext *const cx = 4283 __glXForceCurrent(cl, bswap_CARD32(&req->contextTag), &error); 4284 4285 pc += __GLX_SINGLE_HDR_SIZE; 4286 if (cx != NULL) { 4287 const GLsizei n = (GLsizei) bswap_CARD32(pc + 0); 4288 4289 GLuint answerBuffer[200]; 4290 GLuint *ids = 4291 __glXGetAnswerBuffer(cl, n * 4, answerBuffer, sizeof(answerBuffer), 4292 4); 4293 if (ids == NULL) 4294 return BadAlloc; 4295 4296 GenQueries(n, ids); 4297 (void) bswap_32_array((uint32_t *) ids, n); 4298 __glXSendReplySwap(cl->client, ids, n, 4, GL_TRUE, 0); 4299 error = Success; 4300 } 4301 4302 return error; 4303 } 4304 4305 int 4306 __glXDispSwap_GetQueryObjectiv(__GLXclientState * cl, GLbyte * pc) 4307 { 4308 PFNGLGETQUERYOBJECTIVPROC GetQueryObjectiv = 4309 __glGetProcAddress("glGetQueryObjectiv"); 4310 xGLXSingleReq *const req = (xGLXSingleReq *) pc; 4311 int error; 4312 __GLXcontext *const cx = 4313 __glXForceCurrent(cl, bswap_CARD32(&req->contextTag), &error); 4314 4315 pc += __GLX_SINGLE_HDR_SIZE; 4316 if (cx != NULL) { 4317 const GLenum pname = (GLenum) bswap_ENUM(pc + 4); 4318 4319 const GLuint compsize = __glGetQueryObjectiv_size(pname); 4320 GLint answerBuffer[200]; 4321 GLint *params = 4322 __glXGetAnswerBuffer(cl, compsize * 4, answerBuffer, 4323 sizeof(answerBuffer), 4); 4324 4325 if (params == NULL) 4326 return BadAlloc; 4327 __glXClearErrorOccured(); 4328 4329 GetQueryObjectiv((GLuint) bswap_CARD32(pc + 0), pname, params); 4330 (void) bswap_32_array((uint32_t *) params, compsize); 4331 __glXSendReplySwap(cl->client, params, compsize, 4, GL_FALSE, 0); 4332 error = Success; 4333 } 4334 4335 return error; 4336 } 4337 4338 int 4339 __glXDispSwap_GetQueryObjectuiv(__GLXclientState * cl, GLbyte * pc) 4340 { 4341 PFNGLGETQUERYOBJECTUIVPROC GetQueryObjectuiv = 4342 __glGetProcAddress("glGetQueryObjectuiv"); 4343 xGLXSingleReq *const req = (xGLXSingleReq *) pc; 4344 int error; 4345 __GLXcontext *const cx = 4346 __glXForceCurrent(cl, bswap_CARD32(&req->contextTag), &error); 4347 4348 pc += __GLX_SINGLE_HDR_SIZE; 4349 if (cx != NULL) { 4350 const GLenum pname = (GLenum) bswap_ENUM(pc + 4); 4351 4352 const GLuint compsize = __glGetQueryObjectuiv_size(pname); 4353 GLuint answerBuffer[200]; 4354 GLuint *params = 4355 __glXGetAnswerBuffer(cl, compsize * 4, answerBuffer, 4356 sizeof(answerBuffer), 4); 4357 4358 if (params == NULL) 4359 return BadAlloc; 4360 __glXClearErrorOccured(); 4361 4362 GetQueryObjectuiv((GLuint) bswap_CARD32(pc + 0), pname, params); 4363 (void) bswap_32_array((uint32_t *) params, compsize); 4364 __glXSendReplySwap(cl->client, params, compsize, 4, GL_FALSE, 0); 4365 error = Success; 4366 } 4367 4368 return error; 4369 } 4370 4371 int 4372 __glXDispSwap_GetQueryiv(__GLXclientState * cl, GLbyte * pc) 4373 { 4374 PFNGLGETQUERYIVPROC GetQueryiv = __glGetProcAddress("glGetQueryiv"); 4375 xGLXSingleReq *const req = (xGLXSingleReq *) pc; 4376 int error; 4377 __GLXcontext *const cx = 4378 __glXForceCurrent(cl, bswap_CARD32(&req->contextTag), &error); 4379 4380 pc += __GLX_SINGLE_HDR_SIZE; 4381 if (cx != NULL) { 4382 const GLenum pname = (GLenum) bswap_ENUM(pc + 4); 4383 4384 const GLuint compsize = __glGetQueryiv_size(pname); 4385 GLint answerBuffer[200]; 4386 GLint *params = 4387 __glXGetAnswerBuffer(cl, compsize * 4, answerBuffer, 4388 sizeof(answerBuffer), 4); 4389 4390 if (params == NULL) 4391 return BadAlloc; 4392 __glXClearErrorOccured(); 4393 4394 GetQueryiv((GLenum) bswap_ENUM(pc + 0), pname, params); 4395 (void) bswap_32_array((uint32_t *) params, compsize); 4396 __glXSendReplySwap(cl->client, params, compsize, 4, GL_FALSE, 0); 4397 error = Success; 4398 } 4399 4400 return error; 4401 } 4402 4403 int 4404 __glXDispSwap_IsQuery(__GLXclientState * cl, GLbyte * pc) 4405 { 4406 PFNGLISQUERYPROC IsQuery = __glGetProcAddress("glIsQuery"); 4407 xGLXSingleReq *const req = (xGLXSingleReq *) pc; 4408 int error; 4409 __GLXcontext *const cx = 4410 __glXForceCurrent(cl, bswap_CARD32(&req->contextTag), &error); 4411 4412 pc += __GLX_SINGLE_HDR_SIZE; 4413 if (cx != NULL) { 4414 GLboolean retval; 4415 4416 retval = IsQuery((GLuint) bswap_CARD32(pc + 0)); 4417 __glXSendReplySwap(cl->client, dummy_answer, 0, 0, GL_FALSE, retval); 4418 error = Success; 4419 } 4420 4421 return error; 4422 } 4423 4424 void 4425 __glXDispSwap_BlendEquationSeparate(GLbyte * pc) 4426 { 4427 PFNGLBLENDEQUATIONSEPARATEPROC BlendEquationSeparate = 4428 __glGetProcAddress("glBlendEquationSeparate"); 4429 BlendEquationSeparate((GLenum) bswap_ENUM(pc + 0), 4430 (GLenum) bswap_ENUM(pc + 4)); 4431 } 4432 4433 void 4434 __glXDispSwap_DrawBuffers(GLbyte * pc) 4435 { 4436 PFNGLDRAWBUFFERSPROC DrawBuffers = __glGetProcAddress("glDrawBuffers"); 4437 const GLsizei n = (GLsizei) bswap_CARD32(pc + 0); 4438 4439 DrawBuffers(n, (const GLenum *) bswap_32_array((uint32_t *) (pc + 4), 0)); 4440 } 4441 4442 void 4443 __glXDispSwap_VertexAttrib1dv(GLbyte * pc) 4444 { 4445 PFNGLVERTEXATTRIB1DVPROC VertexAttrib1dv = 4446 __glGetProcAddress("glVertexAttrib1dv"); 4447 #ifdef __GLX_ALIGN64 4448 if ((unsigned long) (pc) & 7) { 4449 (void) memmove(pc - 4, pc, 12); 4450 pc -= 4; 4451 } 4452 #endif 4453 4454 VertexAttrib1dv((GLuint) bswap_CARD32(pc + 0), 4455 (const GLdouble *) bswap_64_array((uint64_t *) (pc + 4), 4456 1)); 4457 } 4458 4459 void 4460 __glXDispSwap_VertexAttrib1sv(GLbyte * pc) 4461 { 4462 PFNGLVERTEXATTRIB1SVPROC VertexAttrib1sv = 4463 __glGetProcAddress("glVertexAttrib1sv"); 4464 VertexAttrib1sv((GLuint) bswap_CARD32(pc + 0), 4465 (const GLshort *) bswap_16_array((uint16_t *) (pc + 4), 1)); 4466 } 4467 4468 void 4469 __glXDispSwap_VertexAttrib2dv(GLbyte * pc) 4470 { 4471 PFNGLVERTEXATTRIB2DVPROC VertexAttrib2dv = 4472 __glGetProcAddress("glVertexAttrib2dv"); 4473 #ifdef __GLX_ALIGN64 4474 if ((unsigned long) (pc) & 7) { 4475 (void) memmove(pc - 4, pc, 20); 4476 pc -= 4; 4477 } 4478 #endif 4479 4480 VertexAttrib2dv((GLuint) bswap_CARD32(pc + 0), 4481 (const GLdouble *) bswap_64_array((uint64_t *) (pc + 4), 4482 2)); 4483 } 4484 4485 void 4486 __glXDispSwap_VertexAttrib2sv(GLbyte * pc) 4487 { 4488 PFNGLVERTEXATTRIB2SVPROC VertexAttrib2sv = 4489 __glGetProcAddress("glVertexAttrib2sv"); 4490 VertexAttrib2sv((GLuint) bswap_CARD32(pc + 0), 4491 (const GLshort *) bswap_16_array((uint16_t *) (pc + 4), 2)); 4492 } 4493 4494 void 4495 __glXDispSwap_VertexAttrib3dv(GLbyte * pc) 4496 { 4497 PFNGLVERTEXATTRIB3DVPROC VertexAttrib3dv = 4498 __glGetProcAddress("glVertexAttrib3dv"); 4499 #ifdef __GLX_ALIGN64 4500 if ((unsigned long) (pc) & 7) { 4501 (void) memmove(pc - 4, pc, 28); 4502 pc -= 4; 4503 } 4504 #endif 4505 4506 VertexAttrib3dv((GLuint) bswap_CARD32(pc + 0), 4507 (const GLdouble *) bswap_64_array((uint64_t *) (pc + 4), 4508 3)); 4509 } 4510 4511 void 4512 __glXDispSwap_VertexAttrib3sv(GLbyte * pc) 4513 { 4514 PFNGLVERTEXATTRIB3SVPROC VertexAttrib3sv = 4515 __glGetProcAddress("glVertexAttrib3sv"); 4516 VertexAttrib3sv((GLuint) bswap_CARD32(pc + 0), 4517 (const GLshort *) bswap_16_array((uint16_t *) (pc + 4), 3)); 4518 } 4519 4520 void 4521 __glXDispSwap_VertexAttrib4Nbv(GLbyte * pc) 4522 { 4523 PFNGLVERTEXATTRIB4NBVPROC VertexAttrib4Nbv = 4524 __glGetProcAddress("glVertexAttrib4Nbv"); 4525 VertexAttrib4Nbv((GLuint) bswap_CARD32(pc + 0), (const GLbyte *) (pc + 4)); 4526 } 4527 4528 void 4529 __glXDispSwap_VertexAttrib4Niv(GLbyte * pc) 4530 { 4531 PFNGLVERTEXATTRIB4NIVPROC VertexAttrib4Niv = 4532 __glGetProcAddress("glVertexAttrib4Niv"); 4533 VertexAttrib4Niv((GLuint) bswap_CARD32(pc + 0), 4534 (const GLint *) bswap_32_array((uint32_t *) (pc + 4), 4)); 4535 } 4536 4537 void 4538 __glXDispSwap_VertexAttrib4Nsv(GLbyte * pc) 4539 { 4540 PFNGLVERTEXATTRIB4NSVPROC VertexAttrib4Nsv = 4541 __glGetProcAddress("glVertexAttrib4Nsv"); 4542 VertexAttrib4Nsv((GLuint) bswap_CARD32(pc + 0), 4543 (const GLshort *) bswap_16_array((uint16_t *) (pc + 4), 4544 4)); 4545 } 4546 4547 void 4548 __glXDispSwap_VertexAttrib4Nubv(GLbyte * pc) 4549 { 4550 PFNGLVERTEXATTRIB4NUBVPROC VertexAttrib4Nubv = 4551 __glGetProcAddress("glVertexAttrib4Nubv"); 4552 VertexAttrib4Nubv((GLuint) bswap_CARD32(pc + 0), 4553 (const GLubyte *) (pc + 4)); 4554 } 4555 4556 void 4557 __glXDispSwap_VertexAttrib4Nuiv(GLbyte * pc) 4558 { 4559 PFNGLVERTEXATTRIB4NUIVPROC VertexAttrib4Nuiv = 4560 __glGetProcAddress("glVertexAttrib4Nuiv"); 4561 VertexAttrib4Nuiv((GLuint) bswap_CARD32(pc + 0), 4562 (const GLuint *) bswap_32_array((uint32_t *) (pc + 4), 4563 4)); 4564 } 4565 4566 void 4567 __glXDispSwap_VertexAttrib4Nusv(GLbyte * pc) 4568 { 4569 PFNGLVERTEXATTRIB4NUSVPROC VertexAttrib4Nusv = 4570 __glGetProcAddress("glVertexAttrib4Nusv"); 4571 VertexAttrib4Nusv((GLuint) bswap_CARD32(pc + 0), 4572 (const GLushort *) bswap_16_array((uint16_t *) (pc + 4), 4573 4)); 4574 } 4575 4576 void 4577 __glXDispSwap_VertexAttrib4bv(GLbyte * pc) 4578 { 4579 PFNGLVERTEXATTRIB4BVPROC VertexAttrib4bv = 4580 __glGetProcAddress("glVertexAttrib4bv"); 4581 VertexAttrib4bv((GLuint) bswap_CARD32(pc + 0), (const GLbyte *) (pc + 4)); 4582 } 4583 4584 void 4585 __glXDispSwap_VertexAttrib4dv(GLbyte * pc) 4586 { 4587 PFNGLVERTEXATTRIB4DVPROC VertexAttrib4dv = 4588 __glGetProcAddress("glVertexAttrib4dv"); 4589 #ifdef __GLX_ALIGN64 4590 if ((unsigned long) (pc) & 7) { 4591 (void) memmove(pc - 4, pc, 36); 4592 pc -= 4; 4593 } 4594 #endif 4595 4596 VertexAttrib4dv((GLuint) bswap_CARD32(pc + 0), 4597 (const GLdouble *) bswap_64_array((uint64_t *) (pc + 4), 4598 4)); 4599 } 4600 4601 void 4602 __glXDispSwap_VertexAttrib4iv(GLbyte * pc) 4603 { 4604 PFNGLVERTEXATTRIB4IVPROC VertexAttrib4iv = 4605 __glGetProcAddress("glVertexAttrib4iv"); 4606 VertexAttrib4iv((GLuint) bswap_CARD32(pc + 0), 4607 (const GLint *) bswap_32_array((uint32_t *) (pc + 4), 4)); 4608 } 4609 4610 void 4611 __glXDispSwap_VertexAttrib4sv(GLbyte * pc) 4612 { 4613 PFNGLVERTEXATTRIB4SVPROC VertexAttrib4sv = 4614 __glGetProcAddress("glVertexAttrib4sv"); 4615 VertexAttrib4sv((GLuint) bswap_CARD32(pc + 0), 4616 (const GLshort *) bswap_16_array((uint16_t *) (pc + 4), 4)); 4617 } 4618 4619 void 4620 __glXDispSwap_VertexAttrib4ubv(GLbyte * pc) 4621 { 4622 PFNGLVERTEXATTRIB4UBVPROC VertexAttrib4ubv = 4623 __glGetProcAddress("glVertexAttrib4ubv"); 4624 VertexAttrib4ubv((GLuint) bswap_CARD32(pc + 0), (const GLubyte *) (pc + 4)); 4625 } 4626 4627 void 4628 __glXDispSwap_VertexAttrib4uiv(GLbyte * pc) 4629 { 4630 PFNGLVERTEXATTRIB4UIVPROC VertexAttrib4uiv = 4631 __glGetProcAddress("glVertexAttrib4uiv"); 4632 VertexAttrib4uiv((GLuint) bswap_CARD32(pc + 0), 4633 (const GLuint *) bswap_32_array((uint32_t *) (pc + 4), 4)); 4634 } 4635 4636 void 4637 __glXDispSwap_VertexAttrib4usv(GLbyte * pc) 4638 { 4639 PFNGLVERTEXATTRIB4USVPROC VertexAttrib4usv = 4640 __glGetProcAddress("glVertexAttrib4usv"); 4641 VertexAttrib4usv((GLuint) bswap_CARD32(pc + 0), 4642 (const GLushort *) bswap_16_array((uint16_t *) (pc + 4), 4643 4)); 4644 } 4645 4646 void 4647 __glXDispSwap_ClampColor(GLbyte * pc) 4648 { 4649 PFNGLCLAMPCOLORPROC ClampColor = __glGetProcAddress("glClampColor"); 4650 4651 ClampColor((GLenum) bswap_ENUM(pc + 0), (GLenum) bswap_ENUM(pc + 4)); 4652 } 4653 4654 void 4655 __glXDispSwap_BindProgramARB(GLbyte * pc) 4656 { 4657 PFNGLBINDPROGRAMARBPROC BindProgramARB = 4658 __glGetProcAddress("glBindProgramARB"); 4659 BindProgramARB((GLenum) bswap_ENUM(pc + 0), (GLuint) bswap_CARD32(pc + 4)); 4660 } 4661 4662 int 4663 __glXDispSwap_DeleteProgramsARB(__GLXclientState * cl, GLbyte * pc) 4664 { 4665 PFNGLDELETEPROGRAMSARBPROC DeleteProgramsARB = 4666 __glGetProcAddress("glDeleteProgramsARB"); 4667 xGLXVendorPrivateReq *const req = (xGLXVendorPrivateReq *) pc; 4668 int error; 4669 __GLXcontext *const cx = 4670 __glXForceCurrent(cl, bswap_CARD32(&req->contextTag), &error); 4671 4672 pc += __GLX_VENDPRIV_HDR_SIZE; 4673 if (cx != NULL) { 4674 const GLsizei n = (GLsizei) bswap_CARD32(pc + 0); 4675 4676 DeleteProgramsARB(n, 4677 (const GLuint *) bswap_32_array((uint32_t *) (pc + 4), 4678 0)); 4679 error = Success; 4680 } 4681 4682 return error; 4683 } 4684 4685 int 4686 __glXDispSwap_GenProgramsARB(__GLXclientState * cl, GLbyte * pc) 4687 { 4688 PFNGLGENPROGRAMSARBPROC GenProgramsARB = 4689 __glGetProcAddress("glGenProgramsARB"); 4690 xGLXVendorPrivateReq *const req = (xGLXVendorPrivateReq *) pc; 4691 int error; 4692 __GLXcontext *const cx = 4693 __glXForceCurrent(cl, bswap_CARD32(&req->contextTag), &error); 4694 4695 pc += __GLX_VENDPRIV_HDR_SIZE; 4696 if (cx != NULL) { 4697 const GLsizei n = (GLsizei) bswap_CARD32(pc + 0); 4698 4699 GLuint answerBuffer[200]; 4700 GLuint *programs = 4701 __glXGetAnswerBuffer(cl, n * 4, answerBuffer, sizeof(answerBuffer), 4702 4); 4703 if (programs == NULL) 4704 return BadAlloc; 4705 4706 GenProgramsARB(n, programs); 4707 (void) bswap_32_array((uint32_t *) programs, n); 4708 __glXSendReplySwap(cl->client, programs, n, 4, GL_TRUE, 0); 4709 error = Success; 4710 } 4711 4712 return error; 4713 } 4714 4715 int 4716 __glXDispSwap_GetProgramEnvParameterdvARB(__GLXclientState * cl, GLbyte * pc) 4717 { 4718 PFNGLGETPROGRAMENVPARAMETERDVARBPROC GetProgramEnvParameterdvARB = 4719 __glGetProcAddress("glGetProgramEnvParameterdvARB"); 4720 xGLXVendorPrivateReq *const req = (xGLXVendorPrivateReq *) pc; 4721 int error; 4722 __GLXcontext *const cx = 4723 __glXForceCurrent(cl, bswap_CARD32(&req->contextTag), &error); 4724 4725 pc += __GLX_VENDPRIV_HDR_SIZE; 4726 if (cx != NULL) { 4727 GLdouble params[4]; 4728 4729 GetProgramEnvParameterdvARB((GLenum) bswap_ENUM(pc + 0), 4730 (GLuint) bswap_CARD32(pc + 4), params); 4731 (void) bswap_64_array((uint64_t *) params, 4); 4732 __glXSendReplySwap(cl->client, params, 4, 8, GL_FALSE, 0); 4733 error = Success; 4734 } 4735 4736 return error; 4737 } 4738 4739 int 4740 __glXDispSwap_GetProgramEnvParameterfvARB(__GLXclientState * cl, GLbyte * pc) 4741 { 4742 PFNGLGETPROGRAMENVPARAMETERFVARBPROC GetProgramEnvParameterfvARB = 4743 __glGetProcAddress("glGetProgramEnvParameterfvARB"); 4744 xGLXVendorPrivateReq *const req = (xGLXVendorPrivateReq *) pc; 4745 int error; 4746 __GLXcontext *const cx = 4747 __glXForceCurrent(cl, bswap_CARD32(&req->contextTag), &error); 4748 4749 pc += __GLX_VENDPRIV_HDR_SIZE; 4750 if (cx != NULL) { 4751 GLfloat params[4]; 4752 4753 GetProgramEnvParameterfvARB((GLenum) bswap_ENUM(pc + 0), 4754 (GLuint) bswap_CARD32(pc + 4), params); 4755 (void) bswap_32_array((uint32_t *) params, 4); 4756 __glXSendReplySwap(cl->client, params, 4, 4, GL_FALSE, 0); 4757 error = Success; 4758 } 4759 4760 return error; 4761 } 4762 4763 int 4764 __glXDispSwap_GetProgramLocalParameterdvARB(__GLXclientState * cl, GLbyte * pc) 4765 { 4766 PFNGLGETPROGRAMLOCALPARAMETERDVARBPROC GetProgramLocalParameterdvARB = 4767 __glGetProcAddress("glGetProgramLocalParameterdvARB"); 4768 xGLXVendorPrivateReq *const req = (xGLXVendorPrivateReq *) pc; 4769 int error; 4770 __GLXcontext *const cx = 4771 __glXForceCurrent(cl, bswap_CARD32(&req->contextTag), &error); 4772 4773 pc += __GLX_VENDPRIV_HDR_SIZE; 4774 if (cx != NULL) { 4775 GLdouble params[4]; 4776 4777 GetProgramLocalParameterdvARB((GLenum) bswap_ENUM(pc + 0), 4778 (GLuint) bswap_CARD32(pc + 4), params); 4779 (void) bswap_64_array((uint64_t *) params, 4); 4780 __glXSendReplySwap(cl->client, params, 4, 8, GL_FALSE, 0); 4781 error = Success; 4782 } 4783 4784 return error; 4785 } 4786 4787 int 4788 __glXDispSwap_GetProgramLocalParameterfvARB(__GLXclientState * cl, GLbyte * pc) 4789 { 4790 PFNGLGETPROGRAMLOCALPARAMETERFVARBPROC GetProgramLocalParameterfvARB = 4791 __glGetProcAddress("glGetProgramLocalParameterfvARB"); 4792 xGLXVendorPrivateReq *const req = (xGLXVendorPrivateReq *) pc; 4793 int error; 4794 __GLXcontext *const cx = 4795 __glXForceCurrent(cl, bswap_CARD32(&req->contextTag), &error); 4796 4797 pc += __GLX_VENDPRIV_HDR_SIZE; 4798 if (cx != NULL) { 4799 GLfloat params[4]; 4800 4801 GetProgramLocalParameterfvARB((GLenum) bswap_ENUM(pc + 0), 4802 (GLuint) bswap_CARD32(pc + 4), params); 4803 (void) bswap_32_array((uint32_t *) params, 4); 4804 __glXSendReplySwap(cl->client, params, 4, 4, GL_FALSE, 0); 4805 error = Success; 4806 } 4807 4808 return error; 4809 } 4810 4811 int 4812 __glXDispSwap_GetProgramivARB(__GLXclientState * cl, GLbyte * pc) 4813 { 4814 PFNGLGETPROGRAMIVARBPROC GetProgramivARB = 4815 __glGetProcAddress("glGetProgramivARB"); 4816 xGLXVendorPrivateReq *const req = (xGLXVendorPrivateReq *) pc; 4817 int error; 4818 __GLXcontext *const cx = 4819 __glXForceCurrent(cl, bswap_CARD32(&req->contextTag), &error); 4820 4821 pc += __GLX_VENDPRIV_HDR_SIZE; 4822 if (cx != NULL) { 4823 const GLenum pname = (GLenum) bswap_ENUM(pc + 4); 4824 4825 const GLuint compsize = __glGetProgramivARB_size(pname); 4826 GLint answerBuffer[200]; 4827 GLint *params = 4828 __glXGetAnswerBuffer(cl, compsize * 4, answerBuffer, 4829 sizeof(answerBuffer), 4); 4830 4831 if (params == NULL) 4832 return BadAlloc; 4833 __glXClearErrorOccured(); 4834 4835 GetProgramivARB((GLenum) bswap_ENUM(pc + 0), pname, params); 4836 (void) bswap_32_array((uint32_t *) params, compsize); 4837 __glXSendReplySwap(cl->client, params, compsize, 4, GL_FALSE, 0); 4838 error = Success; 4839 } 4840 4841 return error; 4842 } 4843 4844 int 4845 __glXDispSwap_IsProgramARB(__GLXclientState * cl, GLbyte * pc) 4846 { 4847 PFNGLISPROGRAMARBPROC IsProgramARB = __glGetProcAddress("glIsProgramARB"); 4848 xGLXVendorPrivateReq *const req = (xGLXVendorPrivateReq *) pc; 4849 int error; 4850 __GLXcontext *const cx = 4851 __glXForceCurrent(cl, bswap_CARD32(&req->contextTag), &error); 4852 4853 pc += __GLX_VENDPRIV_HDR_SIZE; 4854 if (cx != NULL) { 4855 GLboolean retval; 4856 4857 retval = IsProgramARB((GLuint) bswap_CARD32(pc + 0)); 4858 __glXSendReplySwap(cl->client, dummy_answer, 0, 0, GL_FALSE, retval); 4859 error = Success; 4860 } 4861 4862 return error; 4863 } 4864 4865 void 4866 __glXDispSwap_ProgramEnvParameter4dvARB(GLbyte * pc) 4867 { 4868 PFNGLPROGRAMENVPARAMETER4DVARBPROC ProgramEnvParameter4dvARB = 4869 __glGetProcAddress("glProgramEnvParameter4dvARB"); 4870 #ifdef __GLX_ALIGN64 4871 if ((unsigned long) (pc) & 7) { 4872 (void) memmove(pc - 4, pc, 40); 4873 pc -= 4; 4874 } 4875 #endif 4876 4877 ProgramEnvParameter4dvARB((GLenum) bswap_ENUM(pc + 0), 4878 (GLuint) bswap_CARD32(pc + 4), 4879 (const GLdouble *) 4880 bswap_64_array((uint64_t *) (pc + 8), 4)); 4881 } 4882 4883 void 4884 __glXDispSwap_ProgramEnvParameter4fvARB(GLbyte * pc) 4885 { 4886 PFNGLPROGRAMENVPARAMETER4FVARBPROC ProgramEnvParameter4fvARB = 4887 __glGetProcAddress("glProgramEnvParameter4fvARB"); 4888 ProgramEnvParameter4fvARB((GLenum) bswap_ENUM(pc + 0), 4889 (GLuint) bswap_CARD32(pc + 4), 4890 (const GLfloat *) 4891 bswap_32_array((uint32_t *) (pc + 8), 4)); 4892 } 4893 4894 void 4895 __glXDispSwap_ProgramLocalParameter4dvARB(GLbyte * pc) 4896 { 4897 PFNGLPROGRAMLOCALPARAMETER4DVARBPROC ProgramLocalParameter4dvARB = 4898 __glGetProcAddress("glProgramLocalParameter4dvARB"); 4899 #ifdef __GLX_ALIGN64 4900 if ((unsigned long) (pc) & 7) { 4901 (void) memmove(pc - 4, pc, 40); 4902 pc -= 4; 4903 } 4904 #endif 4905 4906 ProgramLocalParameter4dvARB((GLenum) bswap_ENUM(pc + 0), 4907 (GLuint) bswap_CARD32(pc + 4), 4908 (const GLdouble *) 4909 bswap_64_array((uint64_t *) (pc + 8), 4)); 4910 } 4911 4912 void 4913 __glXDispSwap_ProgramLocalParameter4fvARB(GLbyte * pc) 4914 { 4915 PFNGLPROGRAMLOCALPARAMETER4FVARBPROC ProgramLocalParameter4fvARB = 4916 __glGetProcAddress("glProgramLocalParameter4fvARB"); 4917 ProgramLocalParameter4fvARB((GLenum) bswap_ENUM(pc + 0), 4918 (GLuint) bswap_CARD32(pc + 4), 4919 (const GLfloat *) 4920 bswap_32_array((uint32_t *) (pc + 8), 4)); 4921 } 4922 4923 void 4924 __glXDispSwap_ProgramStringARB(GLbyte * pc) 4925 { 4926 PFNGLPROGRAMSTRINGARBPROC ProgramStringARB = 4927 __glGetProcAddress("glProgramStringARB"); 4928 const GLsizei len = (GLsizei) bswap_CARD32(pc + 8); 4929 4930 ProgramStringARB((GLenum) bswap_ENUM(pc + 0), 4931 (GLenum) bswap_ENUM(pc + 4), 4932 len, (const GLvoid *) (pc + 12)); 4933 } 4934 4935 void 4936 __glXDispSwap_VertexAttrib1fvARB(GLbyte * pc) 4937 { 4938 PFNGLVERTEXATTRIB1FVARBPROC VertexAttrib1fvARB = 4939 __glGetProcAddress("glVertexAttrib1fvARB"); 4940 VertexAttrib1fvARB((GLuint) bswap_CARD32(pc + 0), 4941 (const GLfloat *) bswap_32_array((uint32_t *) (pc + 4), 4942 1)); 4943 } 4944 4945 void 4946 __glXDispSwap_VertexAttrib2fvARB(GLbyte * pc) 4947 { 4948 PFNGLVERTEXATTRIB2FVARBPROC VertexAttrib2fvARB = 4949 __glGetProcAddress("glVertexAttrib2fvARB"); 4950 VertexAttrib2fvARB((GLuint) bswap_CARD32(pc + 0), 4951 (const GLfloat *) bswap_32_array((uint32_t *) (pc + 4), 4952 2)); 4953 } 4954 4955 void 4956 __glXDispSwap_VertexAttrib3fvARB(GLbyte * pc) 4957 { 4958 PFNGLVERTEXATTRIB3FVARBPROC VertexAttrib3fvARB = 4959 __glGetProcAddress("glVertexAttrib3fvARB"); 4960 VertexAttrib3fvARB((GLuint) bswap_CARD32(pc + 0), 4961 (const GLfloat *) bswap_32_array((uint32_t *) (pc + 4), 4962 3)); 4963 } 4964 4965 void 4966 __glXDispSwap_VertexAttrib4fvARB(GLbyte * pc) 4967 { 4968 PFNGLVERTEXATTRIB4FVARBPROC VertexAttrib4fvARB = 4969 __glGetProcAddress("glVertexAttrib4fvARB"); 4970 VertexAttrib4fvARB((GLuint) bswap_CARD32(pc + 0), 4971 (const GLfloat *) bswap_32_array((uint32_t *) (pc + 4), 4972 4)); 4973 } 4974 4975 void 4976 __glXDispSwap_BindFramebuffer(GLbyte * pc) 4977 { 4978 PFNGLBINDFRAMEBUFFERPROC BindFramebuffer = 4979 __glGetProcAddress("glBindFramebuffer"); 4980 BindFramebuffer((GLenum) bswap_ENUM(pc + 0), (GLuint) bswap_CARD32(pc + 4)); 4981 } 4982 4983 void 4984 __glXDispSwap_BindRenderbuffer(GLbyte * pc) 4985 { 4986 PFNGLBINDRENDERBUFFERPROC BindRenderbuffer = 4987 __glGetProcAddress("glBindRenderbuffer"); 4988 BindRenderbuffer((GLenum) bswap_ENUM(pc + 0), 4989 (GLuint) bswap_CARD32(pc + 4)); 4990 } 4991 4992 void 4993 __glXDispSwap_BlitFramebuffer(GLbyte * pc) 4994 { 4995 PFNGLBLITFRAMEBUFFERPROC BlitFramebuffer = 4996 __glGetProcAddress("glBlitFramebuffer"); 4997 BlitFramebuffer((GLint) bswap_CARD32(pc + 0), (GLint) bswap_CARD32(pc + 4), 4998 (GLint) bswap_CARD32(pc + 8), (GLint) bswap_CARD32(pc + 12), 4999 (GLint) bswap_CARD32(pc + 16), 5000 (GLint) bswap_CARD32(pc + 20), 5001 (GLint) bswap_CARD32(pc + 24), 5002 (GLint) bswap_CARD32(pc + 28), 5003 (GLbitfield) bswap_CARD32(pc + 32), 5004 (GLenum) bswap_ENUM(pc + 36)); 5005 } 5006 5007 int 5008 __glXDispSwap_CheckFramebufferStatus(__GLXclientState * cl, GLbyte * pc) 5009 { 5010 PFNGLCHECKFRAMEBUFFERSTATUSPROC CheckFramebufferStatus = 5011 __glGetProcAddress("glCheckFramebufferStatus"); 5012 xGLXVendorPrivateReq *const req = (xGLXVendorPrivateReq *) pc; 5013 int error; 5014 __GLXcontext *const cx = 5015 __glXForceCurrent(cl, bswap_CARD32(&req->contextTag), &error); 5016 5017 pc += __GLX_VENDPRIV_HDR_SIZE; 5018 if (cx != NULL) { 5019 GLenum retval; 5020 5021 retval = CheckFramebufferStatus((GLenum) bswap_ENUM(pc + 0)); 5022 __glXSendReplySwap(cl->client, dummy_answer, 0, 0, GL_FALSE, retval); 5023 error = Success; 5024 } 5025 5026 return error; 5027 } 5028 5029 void 5030 __glXDispSwap_DeleteFramebuffers(GLbyte * pc) 5031 { 5032 PFNGLDELETEFRAMEBUFFERSPROC DeleteFramebuffers = 5033 __glGetProcAddress("glDeleteFramebuffers"); 5034 const GLsizei n = (GLsizei) bswap_CARD32(pc + 0); 5035 5036 DeleteFramebuffers(n, 5037 (const GLuint *) bswap_32_array((uint32_t *) (pc + 4), 5038 0)); 5039 } 5040 5041 void 5042 __glXDispSwap_DeleteRenderbuffers(GLbyte * pc) 5043 { 5044 PFNGLDELETERENDERBUFFERSPROC DeleteRenderbuffers = 5045 __glGetProcAddress("glDeleteRenderbuffers"); 5046 const GLsizei n = (GLsizei) bswap_CARD32(pc + 0); 5047 5048 DeleteRenderbuffers(n, 5049 (const GLuint *) bswap_32_array((uint32_t *) (pc + 4), 5050 0)); 5051 } 5052 5053 void 5054 __glXDispSwap_FramebufferRenderbuffer(GLbyte * pc) 5055 { 5056 PFNGLFRAMEBUFFERRENDERBUFFERPROC FramebufferRenderbuffer = 5057 __glGetProcAddress("glFramebufferRenderbuffer"); 5058 FramebufferRenderbuffer((GLenum) bswap_ENUM(pc + 0), 5059 (GLenum) bswap_ENUM(pc + 4), 5060 (GLenum) bswap_ENUM(pc + 8), 5061 (GLuint) bswap_CARD32(pc + 12)); 5062 } 5063 5064 void 5065 __glXDispSwap_FramebufferTexture1D(GLbyte * pc) 5066 { 5067 PFNGLFRAMEBUFFERTEXTURE1DPROC FramebufferTexture1D = 5068 __glGetProcAddress("glFramebufferTexture1D"); 5069 FramebufferTexture1D((GLenum) bswap_ENUM(pc + 0), 5070 (GLenum) bswap_ENUM(pc + 4), 5071 (GLenum) bswap_ENUM(pc + 8), 5072 (GLuint) bswap_CARD32(pc + 12), 5073 (GLint) bswap_CARD32(pc + 16)); 5074 } 5075 5076 void 5077 __glXDispSwap_FramebufferTexture2D(GLbyte * pc) 5078 { 5079 PFNGLFRAMEBUFFERTEXTURE2DPROC FramebufferTexture2D = 5080 __glGetProcAddress("glFramebufferTexture2D"); 5081 FramebufferTexture2D((GLenum) bswap_ENUM(pc + 0), 5082 (GLenum) bswap_ENUM(pc + 4), 5083 (GLenum) bswap_ENUM(pc + 8), 5084 (GLuint) bswap_CARD32(pc + 12), 5085 (GLint) bswap_CARD32(pc + 16)); 5086 } 5087 5088 void 5089 __glXDispSwap_FramebufferTexture3D(GLbyte * pc) 5090 { 5091 PFNGLFRAMEBUFFERTEXTURE3DPROC FramebufferTexture3D = 5092 __glGetProcAddress("glFramebufferTexture3D"); 5093 FramebufferTexture3D((GLenum) bswap_ENUM(pc + 0), 5094 (GLenum) bswap_ENUM(pc + 4), 5095 (GLenum) bswap_ENUM(pc + 8), 5096 (GLuint) bswap_CARD32(pc + 12), 5097 (GLint) bswap_CARD32(pc + 16), 5098 (GLint) bswap_CARD32(pc + 20)); 5099 } 5100 5101 void 5102 __glXDispSwap_FramebufferTextureLayer(GLbyte * pc) 5103 { 5104 PFNGLFRAMEBUFFERTEXTURELAYERPROC FramebufferTextureLayer = 5105 __glGetProcAddress("glFramebufferTextureLayer"); 5106 FramebufferTextureLayer((GLenum) bswap_ENUM(pc + 0), 5107 (GLenum) bswap_ENUM(pc + 4), 5108 (GLuint) bswap_CARD32(pc + 8), 5109 (GLint) bswap_CARD32(pc + 12), 5110 (GLint) bswap_CARD32(pc + 16)); 5111 } 5112 5113 int 5114 __glXDispSwap_GenFramebuffers(__GLXclientState * cl, GLbyte * pc) 5115 { 5116 PFNGLGENFRAMEBUFFERSPROC GenFramebuffers = 5117 __glGetProcAddress("glGenFramebuffers"); 5118 xGLXVendorPrivateReq *const req = (xGLXVendorPrivateReq *) pc; 5119 int error; 5120 __GLXcontext *const cx = 5121 __glXForceCurrent(cl, bswap_CARD32(&req->contextTag), &error); 5122 5123 pc += __GLX_VENDPRIV_HDR_SIZE; 5124 if (cx != NULL) { 5125 const GLsizei n = (GLsizei) bswap_CARD32(pc + 0); 5126 5127 GLuint answerBuffer[200]; 5128 GLuint *framebuffers = 5129 __glXGetAnswerBuffer(cl, n * 4, answerBuffer, sizeof(answerBuffer), 5130 4); 5131 5132 if (framebuffers == NULL) 5133 return BadAlloc; 5134 5135 GenFramebuffers(n, framebuffers); 5136 (void) bswap_32_array((uint32_t *) framebuffers, n); 5137 __glXSendReplySwap(cl->client, framebuffers, n, 4, GL_TRUE, 0); 5138 error = Success; 5139 } 5140 5141 return error; 5142 } 5143 5144 int 5145 __glXDispSwap_GenRenderbuffers(__GLXclientState * cl, GLbyte * pc) 5146 { 5147 PFNGLGENRENDERBUFFERSPROC GenRenderbuffers = 5148 __glGetProcAddress("glGenRenderbuffers"); 5149 xGLXVendorPrivateReq *const req = (xGLXVendorPrivateReq *) pc; 5150 int error; 5151 __GLXcontext *const cx = 5152 __glXForceCurrent(cl, bswap_CARD32(&req->contextTag), &error); 5153 5154 pc += __GLX_VENDPRIV_HDR_SIZE; 5155 if (cx != NULL) { 5156 const GLsizei n = (GLsizei) bswap_CARD32(pc + 0); 5157 5158 GLuint answerBuffer[200]; 5159 GLuint *renderbuffers = 5160 __glXGetAnswerBuffer(cl, n * 4, answerBuffer, sizeof(answerBuffer), 5161 4); 5162 5163 if (renderbuffers == NULL) 5164 return BadAlloc; 5165 5166 GenRenderbuffers(n, renderbuffers); 5167 (void) bswap_32_array((uint32_t *) renderbuffers, n); 5168 __glXSendReplySwap(cl->client, renderbuffers, n, 4, GL_TRUE, 0); 5169 error = Success; 5170 } 5171 5172 return error; 5173 } 5174 5175 void 5176 __glXDispSwap_GenerateMipmap(GLbyte * pc) 5177 { 5178 PFNGLGENERATEMIPMAPPROC GenerateMipmap = 5179 __glGetProcAddress("glGenerateMipmap"); 5180 GenerateMipmap((GLenum) bswap_ENUM(pc + 0)); 5181 } 5182 5183 int 5184 __glXDispSwap_GetFramebufferAttachmentParameteriv(__GLXclientState * cl, 5185 GLbyte * pc) 5186 { 5187 PFNGLGETFRAMEBUFFERATTACHMENTPARAMETERIVPROC 5188 GetFramebufferAttachmentParameteriv = 5189 __glGetProcAddress("glGetFramebufferAttachmentParameteriv"); 5190 xGLXVendorPrivateReq *const req = (xGLXVendorPrivateReq *) pc; 5191 int error; 5192 __GLXcontext *const cx = 5193 __glXForceCurrent(cl, bswap_CARD32(&req->contextTag), &error); 5194 5195 pc += __GLX_VENDPRIV_HDR_SIZE; 5196 if (cx != NULL) { 5197 GLint params[1]; 5198 5199 GetFramebufferAttachmentParameteriv((GLenum) bswap_ENUM(pc + 0), 5200 (GLenum) bswap_ENUM(pc + 4), 5201 (GLenum) bswap_ENUM(pc + 8), 5202 params); 5203 (void) bswap_32_array((uint32_t *) params, 1); 5204 __glXSendReplySwap(cl->client, params, 1, 4, GL_FALSE, 0); 5205 error = Success; 5206 } 5207 5208 return error; 5209 } 5210 5211 int 5212 __glXDispSwap_GetRenderbufferParameteriv(__GLXclientState * cl, GLbyte * pc) 5213 { 5214 PFNGLGETRENDERBUFFERPARAMETERIVPROC GetRenderbufferParameteriv = 5215 __glGetProcAddress("glGetRenderbufferParameteriv"); 5216 xGLXVendorPrivateReq *const req = (xGLXVendorPrivateReq *) pc; 5217 int error; 5218 __GLXcontext *const cx = 5219 __glXForceCurrent(cl, bswap_CARD32(&req->contextTag), &error); 5220 5221 pc += __GLX_VENDPRIV_HDR_SIZE; 5222 if (cx != NULL) { 5223 GLint params[1]; 5224 5225 GetRenderbufferParameteriv((GLenum) bswap_ENUM(pc + 0), 5226 (GLenum) bswap_ENUM(pc + 4), params); 5227 (void) bswap_32_array((uint32_t *) params, 1); 5228 __glXSendReplySwap(cl->client, params, 1, 4, GL_FALSE, 0); 5229 error = Success; 5230 } 5231 5232 return error; 5233 } 5234 5235 int 5236 __glXDispSwap_IsFramebuffer(__GLXclientState * cl, GLbyte * pc) 5237 { 5238 PFNGLISFRAMEBUFFERPROC IsFramebuffer = 5239 __glGetProcAddress("glIsFramebuffer"); 5240 xGLXVendorPrivateReq *const req = (xGLXVendorPrivateReq *) pc; 5241 int error; 5242 __GLXcontext *const cx = 5243 __glXForceCurrent(cl, bswap_CARD32(&req->contextTag), &error); 5244 5245 pc += __GLX_VENDPRIV_HDR_SIZE; 5246 if (cx != NULL) { 5247 GLboolean retval; 5248 5249 retval = IsFramebuffer((GLuint) bswap_CARD32(pc + 0)); 5250 __glXSendReplySwap(cl->client, dummy_answer, 0, 0, GL_FALSE, retval); 5251 error = Success; 5252 } 5253 5254 return error; 5255 } 5256 5257 int 5258 __glXDispSwap_IsRenderbuffer(__GLXclientState * cl, GLbyte * pc) 5259 { 5260 PFNGLISRENDERBUFFERPROC IsRenderbuffer = 5261 __glGetProcAddress("glIsRenderbuffer"); 5262 xGLXVendorPrivateReq *const req = (xGLXVendorPrivateReq *) pc; 5263 int error; 5264 __GLXcontext *const cx = 5265 __glXForceCurrent(cl, bswap_CARD32(&req->contextTag), &error); 5266 5267 pc += __GLX_VENDPRIV_HDR_SIZE; 5268 if (cx != NULL) { 5269 GLboolean retval; 5270 5271 retval = IsRenderbuffer((GLuint) bswap_CARD32(pc + 0)); 5272 __glXSendReplySwap(cl->client, dummy_answer, 0, 0, GL_FALSE, retval); 5273 error = Success; 5274 } 5275 5276 return error; 5277 } 5278 5279 void 5280 __glXDispSwap_RenderbufferStorage(GLbyte * pc) 5281 { 5282 PFNGLRENDERBUFFERSTORAGEPROC RenderbufferStorage = 5283 __glGetProcAddress("glRenderbufferStorage"); 5284 RenderbufferStorage((GLenum) bswap_ENUM(pc + 0), 5285 (GLenum) bswap_ENUM(pc + 4), 5286 (GLsizei) bswap_CARD32(pc + 8), 5287 (GLsizei) bswap_CARD32(pc + 12)); 5288 } 5289 5290 void 5291 __glXDispSwap_RenderbufferStorageMultisample(GLbyte * pc) 5292 { 5293 PFNGLRENDERBUFFERSTORAGEMULTISAMPLEPROC RenderbufferStorageMultisample = 5294 __glGetProcAddress("glRenderbufferStorageMultisample"); 5295 RenderbufferStorageMultisample((GLenum) bswap_ENUM(pc + 0), 5296 (GLsizei) bswap_CARD32(pc + 4), 5297 (GLenum) bswap_ENUM(pc + 8), 5298 (GLsizei) bswap_CARD32(pc + 12), 5299 (GLsizei) bswap_CARD32(pc + 16)); 5300 } 5301 5302 void 5303 __glXDispSwap_SecondaryColor3fvEXT(GLbyte * pc) 5304 { 5305 PFNGLSECONDARYCOLOR3FVEXTPROC SecondaryColor3fvEXT = 5306 __glGetProcAddress("glSecondaryColor3fvEXT"); 5307 SecondaryColor3fvEXT((const GLfloat *) 5308 bswap_32_array((uint32_t *) (pc + 0), 3)); 5309 } 5310 5311 void 5312 __glXDispSwap_FogCoordfvEXT(GLbyte * pc) 5313 { 5314 PFNGLFOGCOORDFVEXTPROC FogCoordfvEXT = 5315 __glGetProcAddress("glFogCoordfvEXT"); 5316 FogCoordfvEXT((const GLfloat *) bswap_32_array((uint32_t *) (pc + 0), 1)); 5317 } 5318 5319 void 5320 __glXDispSwap_VertexAttrib1dvNV(GLbyte * pc) 5321 { 5322 PFNGLVERTEXATTRIB1DVNVPROC VertexAttrib1dvNV = 5323 __glGetProcAddress("glVertexAttrib1dvNV"); 5324 #ifdef __GLX_ALIGN64 5325 if ((unsigned long) (pc) & 7) { 5326 (void) memmove(pc - 4, pc, 12); 5327 pc -= 4; 5328 } 5329 #endif 5330 5331 VertexAttrib1dvNV((GLuint) bswap_CARD32(pc + 0), 5332 (const GLdouble *) bswap_64_array((uint64_t *) (pc + 4), 5333 1)); 5334 } 5335 5336 void 5337 __glXDispSwap_VertexAttrib1fvNV(GLbyte * pc) 5338 { 5339 PFNGLVERTEXATTRIB1FVNVPROC VertexAttrib1fvNV = 5340 __glGetProcAddress("glVertexAttrib1fvNV"); 5341 VertexAttrib1fvNV((GLuint) bswap_CARD32(pc + 0), 5342 (const GLfloat *) bswap_32_array((uint32_t *) (pc + 4), 5343 1)); 5344 } 5345 5346 void 5347 __glXDispSwap_VertexAttrib1svNV(GLbyte * pc) 5348 { 5349 PFNGLVERTEXATTRIB1SVNVPROC VertexAttrib1svNV = 5350 __glGetProcAddress("glVertexAttrib1svNV"); 5351 VertexAttrib1svNV((GLuint) bswap_CARD32(pc + 0), 5352 (const GLshort *) bswap_16_array((uint16_t *) (pc + 4), 5353 1)); 5354 } 5355 5356 void 5357 __glXDispSwap_VertexAttrib2dvNV(GLbyte * pc) 5358 { 5359 PFNGLVERTEXATTRIB2DVNVPROC VertexAttrib2dvNV = 5360 __glGetProcAddress("glVertexAttrib2dvNV"); 5361 #ifdef __GLX_ALIGN64 5362 if ((unsigned long) (pc) & 7) { 5363 (void) memmove(pc - 4, pc, 20); 5364 pc -= 4; 5365 } 5366 #endif 5367 5368 VertexAttrib2dvNV((GLuint) bswap_CARD32(pc + 0), 5369 (const GLdouble *) bswap_64_array((uint64_t *) (pc + 4), 5370 2)); 5371 } 5372 5373 void 5374 __glXDispSwap_VertexAttrib2fvNV(GLbyte * pc) 5375 { 5376 PFNGLVERTEXATTRIB2FVNVPROC VertexAttrib2fvNV = 5377 __glGetProcAddress("glVertexAttrib2fvNV"); 5378 VertexAttrib2fvNV((GLuint) bswap_CARD32(pc + 0), 5379 (const GLfloat *) bswap_32_array((uint32_t *) (pc + 4), 5380 2)); 5381 } 5382 5383 void 5384 __glXDispSwap_VertexAttrib2svNV(GLbyte * pc) 5385 { 5386 PFNGLVERTEXATTRIB2SVNVPROC VertexAttrib2svNV = 5387 __glGetProcAddress("glVertexAttrib2svNV"); 5388 VertexAttrib2svNV((GLuint) bswap_CARD32(pc + 0), 5389 (const GLshort *) bswap_16_array((uint16_t *) (pc + 4), 5390 2)); 5391 } 5392 5393 void 5394 __glXDispSwap_VertexAttrib3dvNV(GLbyte * pc) 5395 { 5396 PFNGLVERTEXATTRIB3DVNVPROC VertexAttrib3dvNV = 5397 __glGetProcAddress("glVertexAttrib3dvNV"); 5398 #ifdef __GLX_ALIGN64 5399 if ((unsigned long) (pc) & 7) { 5400 (void) memmove(pc - 4, pc, 28); 5401 pc -= 4; 5402 } 5403 #endif 5404 5405 VertexAttrib3dvNV((GLuint) bswap_CARD32(pc + 0), 5406 (const GLdouble *) bswap_64_array((uint64_t *) (pc + 4), 5407 3)); 5408 } 5409 5410 void 5411 __glXDispSwap_VertexAttrib3fvNV(GLbyte * pc) 5412 { 5413 PFNGLVERTEXATTRIB3FVNVPROC VertexAttrib3fvNV = 5414 __glGetProcAddress("glVertexAttrib3fvNV"); 5415 VertexAttrib3fvNV((GLuint) bswap_CARD32(pc + 0), 5416 (const GLfloat *) bswap_32_array((uint32_t *) (pc + 4), 5417 3)); 5418 } 5419 5420 void 5421 __glXDispSwap_VertexAttrib3svNV(GLbyte * pc) 5422 { 5423 PFNGLVERTEXATTRIB3SVNVPROC VertexAttrib3svNV = 5424 __glGetProcAddress("glVertexAttrib3svNV"); 5425 VertexAttrib3svNV((GLuint) bswap_CARD32(pc + 0), 5426 (const GLshort *) bswap_16_array((uint16_t *) (pc + 4), 5427 3)); 5428 } 5429 5430 void 5431 __glXDispSwap_VertexAttrib4dvNV(GLbyte * pc) 5432 { 5433 PFNGLVERTEXATTRIB4DVNVPROC VertexAttrib4dvNV = 5434 __glGetProcAddress("glVertexAttrib4dvNV"); 5435 #ifdef __GLX_ALIGN64 5436 if ((unsigned long) (pc) & 7) { 5437 (void) memmove(pc - 4, pc, 36); 5438 pc -= 4; 5439 } 5440 #endif 5441 5442 VertexAttrib4dvNV((GLuint) bswap_CARD32(pc + 0), 5443 (const GLdouble *) bswap_64_array((uint64_t *) (pc + 4), 5444 4)); 5445 } 5446 5447 void 5448 __glXDispSwap_VertexAttrib4fvNV(GLbyte * pc) 5449 { 5450 PFNGLVERTEXATTRIB4FVNVPROC VertexAttrib4fvNV = 5451 __glGetProcAddress("glVertexAttrib4fvNV"); 5452 VertexAttrib4fvNV((GLuint) bswap_CARD32(pc + 0), 5453 (const GLfloat *) bswap_32_array((uint32_t *) (pc + 4), 5454 4)); 5455 } 5456 5457 void 5458 __glXDispSwap_VertexAttrib4svNV(GLbyte * pc) 5459 { 5460 PFNGLVERTEXATTRIB4SVNVPROC VertexAttrib4svNV = 5461 __glGetProcAddress("glVertexAttrib4svNV"); 5462 VertexAttrib4svNV((GLuint) bswap_CARD32(pc + 0), 5463 (const GLshort *) bswap_16_array((uint16_t *) (pc + 4), 5464 4)); 5465 } 5466 5467 void 5468 __glXDispSwap_VertexAttrib4ubvNV(GLbyte * pc) 5469 { 5470 PFNGLVERTEXATTRIB4UBVNVPROC VertexAttrib4ubvNV = 5471 __glGetProcAddress("glVertexAttrib4ubvNV"); 5472 VertexAttrib4ubvNV((GLuint) bswap_CARD32(pc + 0), 5473 (const GLubyte *) (pc + 4)); 5474 } 5475 5476 void 5477 __glXDispSwap_VertexAttribs1dvNV(GLbyte * pc) 5478 { 5479 PFNGLVERTEXATTRIBS1DVNVPROC VertexAttribs1dvNV = 5480 __glGetProcAddress("glVertexAttribs1dvNV"); 5481 const GLsizei n = (GLsizei) bswap_CARD32(pc + 4); 5482 5483 #ifdef __GLX_ALIGN64 5484 const GLuint cmdlen = 12 + __GLX_PAD((n * 8)) - 4; 5485 5486 if ((unsigned long) (pc) & 7) { 5487 (void) memmove(pc - 4, pc, cmdlen); 5488 pc -= 4; 5489 } 5490 #endif 5491 5492 VertexAttribs1dvNV((GLuint) bswap_CARD32(pc + 0), 5493 n, 5494 (const GLdouble *) bswap_64_array((uint64_t *) (pc + 8), 5495 0)); 5496 } 5497 5498 void 5499 __glXDispSwap_VertexAttribs1fvNV(GLbyte * pc) 5500 { 5501 PFNGLVERTEXATTRIBS1FVNVPROC VertexAttribs1fvNV = 5502 __glGetProcAddress("glVertexAttribs1fvNV"); 5503 const GLsizei n = (GLsizei) bswap_CARD32(pc + 4); 5504 5505 VertexAttribs1fvNV((GLuint) bswap_CARD32(pc + 0), 5506 n, 5507 (const GLfloat *) bswap_32_array((uint32_t *) (pc + 8), 5508 0)); 5509 } 5510 5511 void 5512 __glXDispSwap_VertexAttribs1svNV(GLbyte * pc) 5513 { 5514 PFNGLVERTEXATTRIBS1SVNVPROC VertexAttribs1svNV = 5515 __glGetProcAddress("glVertexAttribs1svNV"); 5516 const GLsizei n = (GLsizei) bswap_CARD32(pc + 4); 5517 5518 VertexAttribs1svNV((GLuint) bswap_CARD32(pc + 0), 5519 n, 5520 (const GLshort *) bswap_16_array((uint16_t *) (pc + 8), 5521 0)); 5522 } 5523 5524 void 5525 __glXDispSwap_VertexAttribs2dvNV(GLbyte * pc) 5526 { 5527 PFNGLVERTEXATTRIBS2DVNVPROC VertexAttribs2dvNV = 5528 __glGetProcAddress("glVertexAttribs2dvNV"); 5529 const GLsizei n = (GLsizei) bswap_CARD32(pc + 4); 5530 5531 #ifdef __GLX_ALIGN64 5532 const GLuint cmdlen = 12 + __GLX_PAD((n * 16)) - 4; 5533 5534 if ((unsigned long) (pc) & 7) { 5535 (void) memmove(pc - 4, pc, cmdlen); 5536 pc -= 4; 5537 } 5538 #endif 5539 5540 VertexAttribs2dvNV((GLuint) bswap_CARD32(pc + 0), 5541 n, 5542 (const GLdouble *) bswap_64_array((uint64_t *) (pc + 8), 5543 0)); 5544 } 5545 5546 void 5547 __glXDispSwap_VertexAttribs2fvNV(GLbyte * pc) 5548 { 5549 PFNGLVERTEXATTRIBS2FVNVPROC VertexAttribs2fvNV = 5550 __glGetProcAddress("glVertexAttribs2fvNV"); 5551 const GLsizei n = (GLsizei) bswap_CARD32(pc + 4); 5552 5553 VertexAttribs2fvNV((GLuint) bswap_CARD32(pc + 0), 5554 n, 5555 (const GLfloat *) bswap_32_array((uint32_t *) (pc + 8), 5556 0)); 5557 } 5558 5559 void 5560 __glXDispSwap_VertexAttribs2svNV(GLbyte * pc) 5561 { 5562 PFNGLVERTEXATTRIBS2SVNVPROC VertexAttribs2svNV = 5563 __glGetProcAddress("glVertexAttribs2svNV"); 5564 const GLsizei n = (GLsizei) bswap_CARD32(pc + 4); 5565 5566 VertexAttribs2svNV((GLuint) bswap_CARD32(pc + 0), 5567 n, 5568 (const GLshort *) bswap_16_array((uint16_t *) (pc + 8), 5569 0)); 5570 } 5571 5572 void 5573 __glXDispSwap_VertexAttribs3dvNV(GLbyte * pc) 5574 { 5575 PFNGLVERTEXATTRIBS3DVNVPROC VertexAttribs3dvNV = 5576 __glGetProcAddress("glVertexAttribs3dvNV"); 5577 const GLsizei n = (GLsizei) bswap_CARD32(pc + 4); 5578 5579 #ifdef __GLX_ALIGN64 5580 const GLuint cmdlen = 12 + __GLX_PAD((n * 24)) - 4; 5581 5582 if ((unsigned long) (pc) & 7) { 5583 (void) memmove(pc - 4, pc, cmdlen); 5584 pc -= 4; 5585 } 5586 #endif 5587 5588 VertexAttribs3dvNV((GLuint) bswap_CARD32(pc + 0), 5589 n, 5590 (const GLdouble *) bswap_64_array((uint64_t *) (pc + 8), 5591 0)); 5592 } 5593 5594 void 5595 __glXDispSwap_VertexAttribs3fvNV(GLbyte * pc) 5596 { 5597 PFNGLVERTEXATTRIBS3FVNVPROC VertexAttribs3fvNV = 5598 __glGetProcAddress("glVertexAttribs3fvNV"); 5599 const GLsizei n = (GLsizei) bswap_CARD32(pc + 4); 5600 5601 VertexAttribs3fvNV((GLuint) bswap_CARD32(pc + 0), 5602 n, 5603 (const GLfloat *) bswap_32_array((uint32_t *) (pc + 8), 5604 0)); 5605 } 5606 5607 void 5608 __glXDispSwap_VertexAttribs3svNV(GLbyte * pc) 5609 { 5610 PFNGLVERTEXATTRIBS3SVNVPROC VertexAttribs3svNV = 5611 __glGetProcAddress("glVertexAttribs3svNV"); 5612 const GLsizei n = (GLsizei) bswap_CARD32(pc + 4); 5613 5614 VertexAttribs3svNV((GLuint) bswap_CARD32(pc + 0), 5615 n, 5616 (const GLshort *) bswap_16_array((uint16_t *) (pc + 8), 5617 0)); 5618 } 5619 5620 void 5621 __glXDispSwap_VertexAttribs4dvNV(GLbyte * pc) 5622 { 5623 PFNGLVERTEXATTRIBS4DVNVPROC VertexAttribs4dvNV = 5624 __glGetProcAddress("glVertexAttribs4dvNV"); 5625 const GLsizei n = (GLsizei) bswap_CARD32(pc + 4); 5626 5627 #ifdef __GLX_ALIGN64 5628 const GLuint cmdlen = 12 + __GLX_PAD((n * 32)) - 4; 5629 5630 if ((unsigned long) (pc) & 7) { 5631 (void) memmove(pc - 4, pc, cmdlen); 5632 pc -= 4; 5633 } 5634 #endif 5635 5636 VertexAttribs4dvNV((GLuint) bswap_CARD32(pc + 0), 5637 n, 5638 (const GLdouble *) bswap_64_array((uint64_t *) (pc + 8), 5639 0)); 5640 } 5641 5642 void 5643 __glXDispSwap_VertexAttribs4fvNV(GLbyte * pc) 5644 { 5645 PFNGLVERTEXATTRIBS4FVNVPROC VertexAttribs4fvNV = 5646 __glGetProcAddress("glVertexAttribs4fvNV"); 5647 const GLsizei n = (GLsizei) bswap_CARD32(pc + 4); 5648 5649 VertexAttribs4fvNV((GLuint) bswap_CARD32(pc + 0), 5650 n, 5651 (const GLfloat *) bswap_32_array((uint32_t *) (pc + 8), 5652 0)); 5653 } 5654 5655 void 5656 __glXDispSwap_VertexAttribs4svNV(GLbyte * pc) 5657 { 5658 PFNGLVERTEXATTRIBS4SVNVPROC VertexAttribs4svNV = 5659 __glGetProcAddress("glVertexAttribs4svNV"); 5660 const GLsizei n = (GLsizei) bswap_CARD32(pc + 4); 5661 5662 VertexAttribs4svNV((GLuint) bswap_CARD32(pc + 0), 5663 n, 5664 (const GLshort *) bswap_16_array((uint16_t *) (pc + 8), 5665 0)); 5666 } 5667 5668 void 5669 __glXDispSwap_VertexAttribs4ubvNV(GLbyte * pc) 5670 { 5671 PFNGLVERTEXATTRIBS4UBVNVPROC VertexAttribs4ubvNV = 5672 __glGetProcAddress("glVertexAttribs4ubvNV"); 5673 const GLsizei n = (GLsizei) bswap_CARD32(pc + 4); 5674 5675 VertexAttribs4ubvNV((GLuint) bswap_CARD32(pc + 0), 5676 n, (const GLubyte *) (pc + 8)); 5677 } 5678 5679 void 5680 __glXDispSwap_ActiveStencilFaceEXT(GLbyte * pc) 5681 { 5682 PFNGLACTIVESTENCILFACEEXTPROC ActiveStencilFaceEXT = 5683 __glGetProcAddress("glActiveStencilFaceEXT"); 5684 ActiveStencilFaceEXT((GLenum) bswap_ENUM(pc + 0)); 5685 }