1/* DO NOT EDIT - This file generated automatically by glX_proto_send.py (from Mesa) script */ 2 3/* 4 * (C) Copyright IBM Corporation 2004, 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 29#include <GL/gl.h> 30#include "indirect.h" 31#include "glxclient.h" 32#include "indirect_size.h" 33#include "glapi.h" 34#include <GL/glxproto.h> 35#include <X11/Xlib-xcb.h> 36#include <xcb/xcb.h> 37#include <xcb/glx.h> 38#include <limits.h> 39 40# if defined(__i386__) && defined(__GNUC__) && !defined(__CYGWIN__) && !defined(__MINGW32__) 41# define FASTCALL __attribute__((fastcall)) 42# else 43# define FASTCALL 44# endif 45# if defined(__GNUC__) 46# define NOINLINE __attribute__((noinline)) 47# else 48# define NOINLINE 49# endif 50 51static _X_INLINE int safe_add(int a, int b) 52{ 53 if (a < 0 || b < 0) return -1; 54 if (INT_MAX - a < b) return -1; 55 return a + b; 56} 57static _X_INLINE int safe_mul(int a, int b) 58{ 59 if (a < 0 || b < 0) return -1; 60 if (a == 0 || b == 0) return 0; 61 if (a > INT_MAX / b) return -1; 62 return a * b; 63} 64static _X_INLINE int safe_pad(int a) 65{ 66 int ret; 67 if (a < 0) return -1; 68 if ((ret = safe_add(a, 3)) < 0) return -1; 69 return ret & (GLuint)~3; 70} 71 72#ifndef __GNUC__ 73# define __builtin_expect(x, y) x 74#endif 75 76/* If the size and opcode values are known at compile-time, this will, on 77 * x86 at least, emit them with a single instruction. 78 */ 79#define emit_header(dest, op, size) \ 80 do { union { short s[2]; int i; } temp; \ 81 temp.s[0] = (size); temp.s[1] = (op); \ 82 *((int *)(dest)) = temp.i; } while(0) 83 84NOINLINE CARD32 85__glXReadReply( Display *dpy, size_t size, void * dest, GLboolean reply_is_always_array ) 86{ 87 xGLXSingleReply reply; 88 89 (void) _XReply(dpy, (xReply *) & reply, 0, False); 90 if (size != 0) { 91 if ((reply.length > 0) || reply_is_always_array) { 92 const GLint bytes = (reply_is_always_array) 93 ? (4 * reply.length) : (reply.size * size); 94 const GLint extra = 4 - (bytes & 3); 95 96 _XRead(dpy, dest, bytes); 97 if ( extra < 4 ) { 98 _XEatData(dpy, extra); 99 } 100 } 101 else { 102 (void) memcpy( dest, &(reply.pad3), size); 103 } 104 } 105 106 return reply.retval; 107} 108 109NOINLINE void 110__glXReadPixelReply( Display *dpy, struct glx_context * gc, unsigned max_dim, 111 GLint width, GLint height, GLint depth, GLenum format, GLenum type, 112 void * dest, GLboolean dimensions_in_reply ) 113{ 114 xGLXSingleReply reply; 115 GLint size; 116 117 (void) _XReply(dpy, (xReply *) & reply, 0, False); 118 119 if ( dimensions_in_reply ) { 120 width = reply.pad3; 121 height = reply.pad4; 122 depth = reply.pad5; 123 124 if ((height == 0) || (max_dim < 2)) { height = 1; } 125 if ((depth == 0) || (max_dim < 3)) { depth = 1; } 126 } 127 128 size = reply.length * 4; 129 if (size != 0) { 130 void * buf = malloc( size ); 131 132 if ( buf == NULL ) { 133 _XEatData(dpy, size); 134 __glXSetError(gc, GL_OUT_OF_MEMORY); 135 } 136 else { 137 const GLint extra = 4 - (size & 3); 138 139 _XRead(dpy, buf, size); 140 if ( extra < 4 ) { 141 _XEatData(dpy, extra); 142 } 143 144 __glEmptyImage(gc, 3, width, height, depth, format, type, 145 buf, dest); 146 free(buf); 147 } 148 } 149} 150 151#define X_GLXSingle 0 152 153NOINLINE FASTCALL GLubyte * 154__glXSetupSingleRequest( struct glx_context * gc, GLint sop, GLint cmdlen ) 155{ 156 xGLXSingleReq * req; 157 Display * const dpy = gc->currentDpy; 158 159 (void) __glXFlushRenderBuffer(gc, gc->pc); 160 LockDisplay(dpy); 161 GetReqExtra(GLXSingle, cmdlen, req); 162 req->reqType = gc->majorOpcode; 163 req->contextTag = gc->currentContextTag; 164 req->glxCode = sop; 165 return (GLubyte *)(req) + sz_xGLXSingleReq; 166} 167 168NOINLINE FASTCALL GLubyte * 169__glXSetupVendorRequest( struct glx_context * gc, GLint code, GLint vop, GLint cmdlen ) 170{ 171 xGLXVendorPrivateReq * req; 172 Display * const dpy = gc->currentDpy; 173 174 (void) __glXFlushRenderBuffer(gc, gc->pc); 175 LockDisplay(dpy); 176 GetReqExtra(GLXVendorPrivate, cmdlen, req); 177 req->reqType = gc->majorOpcode; 178 req->glxCode = code; 179 req->vendorCode = vop; 180 req->contextTag = gc->currentContextTag; 181 return (GLubyte *)(req) + sz_xGLXVendorPrivateReq; 182} 183 184const GLuint __glXDefaultPixelStore[9] = { 0, 0, 0, 0, 0, 0, 0, 0, 1 }; 185 186#define zero (__glXDefaultPixelStore+0) 187#define one (__glXDefaultPixelStore+8) 188#define default_pixel_store_1D (__glXDefaultPixelStore+4) 189#define default_pixel_store_1D_size 20 190#define default_pixel_store_2D (__glXDefaultPixelStore+4) 191#define default_pixel_store_2D_size 20 192#define default_pixel_store_3D (__glXDefaultPixelStore+0) 193#define default_pixel_store_3D_size 36 194#define default_pixel_store_4D (__glXDefaultPixelStore+0) 195#define default_pixel_store_4D_size 36 196 197static FASTCALL NOINLINE void 198generic_3_byte( GLint rop, const void * ptr ) 199{ 200 struct glx_context * const gc = __glXGetCurrentContext(); 201 const GLuint cmdlen = 8; 202 203 emit_header(gc->pc, rop, cmdlen); 204 (void) memcpy((void *)(gc->pc + 4), ptr, 4); 205 gc->pc += cmdlen; 206 if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); } 207} 208 209static FASTCALL NOINLINE void 210generic_4_byte( GLint rop, const void * ptr ) 211{ 212 struct glx_context * const gc = __glXGetCurrentContext(); 213 const GLuint cmdlen = 8; 214 215 emit_header(gc->pc, rop, cmdlen); 216 (void) memcpy((void *)(gc->pc + 4), ptr, 4); 217 gc->pc += cmdlen; 218 if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); } 219} 220 221static FASTCALL NOINLINE void 222generic_6_byte( GLint rop, const void * ptr ) 223{ 224 struct glx_context * const gc = __glXGetCurrentContext(); 225 const GLuint cmdlen = 12; 226 227 emit_header(gc->pc, rop, cmdlen); 228 (void) memcpy((void *)(gc->pc + 4), ptr, 8); 229 gc->pc += cmdlen; 230 if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); } 231} 232 233static FASTCALL NOINLINE void 234generic_8_byte( GLint rop, const void * ptr ) 235{ 236 struct glx_context * const gc = __glXGetCurrentContext(); 237 const GLuint cmdlen = 12; 238 239 emit_header(gc->pc, rop, cmdlen); 240 (void) memcpy((void *)(gc->pc + 4), ptr, 8); 241 gc->pc += cmdlen; 242 if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); } 243} 244 245static FASTCALL NOINLINE void 246generic_12_byte( GLint rop, const void * ptr ) 247{ 248 struct glx_context * const gc = __glXGetCurrentContext(); 249 const GLuint cmdlen = 16; 250 251 emit_header(gc->pc, rop, cmdlen); 252 (void) memcpy((void *)(gc->pc + 4), ptr, 12); 253 gc->pc += cmdlen; 254 if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); } 255} 256 257static FASTCALL NOINLINE void 258generic_16_byte( GLint rop, const void * ptr ) 259{ 260 struct glx_context * const gc = __glXGetCurrentContext(); 261 const GLuint cmdlen = 20; 262 263 emit_header(gc->pc, rop, cmdlen); 264 (void) memcpy((void *)(gc->pc + 4), ptr, 16); 265 gc->pc += cmdlen; 266 if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); } 267} 268 269static FASTCALL NOINLINE void 270generic_24_byte( GLint rop, const void * ptr ) 271{ 272 struct glx_context * const gc = __glXGetCurrentContext(); 273 const GLuint cmdlen = 28; 274 275 emit_header(gc->pc, rop, cmdlen); 276 (void) memcpy((void *)(gc->pc + 4), ptr, 24); 277 gc->pc += cmdlen; 278 if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); } 279} 280 281static FASTCALL NOINLINE void 282generic_32_byte( GLint rop, const void * ptr ) 283{ 284 struct glx_context * const gc = __glXGetCurrentContext(); 285 const GLuint cmdlen = 36; 286 287 emit_header(gc->pc, rop, cmdlen); 288 (void) memcpy((void *)(gc->pc + 4), ptr, 32); 289 gc->pc += cmdlen; 290 if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); } 291} 292 293#define X_GLsop_NewList 101 294void __indirect_glNewList(GLuint list, GLenum mode) 295{ 296 struct glx_context * const gc = __glXGetCurrentContext(); 297 Display * const dpy = gc->currentDpy; 298#ifndef USE_XCB 299 const GLuint cmdlen = 8; 300#endif 301 if (__builtin_expect(dpy != NULL, 1)) { 302#ifdef USE_XCB 303 xcb_connection_t *c = XGetXCBConnection(dpy); 304 (void) __glXFlushRenderBuffer(gc, gc->pc); 305 xcb_glx_new_list(c, gc->currentContextTag, list, mode); 306#else 307 GLubyte const * pc = __glXSetupSingleRequest(gc, X_GLsop_NewList, cmdlen); 308(void) memcpy((void *)(pc + 0), (void *)(&list), 1 * sizeof(GLuint)); 309(void) memcpy((void *)(pc + 4), (void *)(&mode), 1 * sizeof(GLenum)); 310 UnlockDisplay(dpy); SyncHandle(); 311#endif /* USE_XCB */ 312 } 313 return; 314} 315 316#define X_GLsop_EndList 102 317void __indirect_glEndList(void) 318{ 319 struct glx_context * const gc = __glXGetCurrentContext(); 320 Display * const dpy = gc->currentDpy; 321#ifndef USE_XCB 322 const GLuint cmdlen = 0; 323#endif 324 if (__builtin_expect(dpy != NULL, 1)) { 325#ifdef USE_XCB 326 xcb_connection_t *c = XGetXCBConnection(dpy); 327 (void) __glXFlushRenderBuffer(gc, gc->pc); 328 xcb_glx_end_list(c, gc->currentContextTag); 329#else 330 (void) __glXSetupSingleRequest(gc, X_GLsop_EndList, cmdlen); 331 UnlockDisplay(dpy); SyncHandle(); 332#endif /* USE_XCB */ 333 } 334 return; 335} 336 337#define X_GLrop_CallList 1 338void __indirect_glCallList(GLuint list) 339{ 340 struct glx_context * const gc = __glXGetCurrentContext(); 341 const GLuint cmdlen = 8; 342emit_header(gc->pc, X_GLrop_CallList, cmdlen); 343(void) memcpy((void *)(gc->pc + 4), (void *)(&list), 1 * sizeof(GLuint)); 344gc->pc += cmdlen; 345if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); } 346} 347 348#define X_GLrop_CallLists 2 349void __indirect_glCallLists(GLsizei n, GLenum type, const GLvoid * lists) 350{ 351 struct glx_context * const gc = __glXGetCurrentContext(); 352 const GLuint compsize = __glCallLists_size(type); 353 const GLuint cmdlen = 12 + safe_pad(safe_mul(compsize, n)); 354 if (0 + safe_pad(safe_mul(compsize, n)) < 0) { 355 __glXSetError(gc, GL_INVALID_VALUE); 356 return; 357 } 358 if (n < 0) { 359 __glXSetError(gc, GL_INVALID_VALUE); 360 return; 361 } 362 if (__builtin_expect((n >= 0) && (gc->currentDpy != NULL), 1)) { 363if (cmdlen <= gc->maxSmallRenderCommandSize) { 364 if ( (gc->pc + cmdlen) > gc->bufEnd ) { 365 (void) __glXFlushRenderBuffer(gc, gc->pc); 366 } 367emit_header(gc->pc, X_GLrop_CallLists, cmdlen); 368(void) memcpy((void *)(gc->pc + 4), (void *)(&n), 1 * sizeof(GLsizei)); 369(void) memcpy((void *)(gc->pc + 8), (void *)(&type), 1 * sizeof(GLenum)); 370(void) memcpy((void *)(gc->pc + 12), (void *)(lists), safe_mul(compsize, n)); 371gc->pc += cmdlen; 372if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); } 373} 374else { 375const GLint op = X_GLrop_CallLists; 376const GLuint cmdlenLarge = cmdlen + 4; 377GLubyte * const pc = __glXFlushRenderBuffer(gc, gc->pc); 378(void) memcpy((void *)(pc + 0), (void *)(&cmdlenLarge), 4); 379(void) memcpy((void *)(pc + 4), (void *)(&op), 4); 380(void) memcpy((void *)(pc + 8), (void *)(&n), 1 * sizeof(GLsizei)); 381(void) memcpy((void *)(pc + 12), (void *)(&type), 1 * sizeof(GLenum)); 382 __glXSendLargeCommand(gc, pc, 16, lists, safe_mul(compsize, n)); 383} 384 } 385} 386 387#define X_GLsop_DeleteLists 103 388void __indirect_glDeleteLists(GLuint list, GLsizei range) 389{ 390 struct glx_context * const gc = __glXGetCurrentContext(); 391 Display * const dpy = gc->currentDpy; 392#ifndef USE_XCB 393 const GLuint cmdlen = 8; 394#endif 395 if (__builtin_expect(dpy != NULL, 1)) { 396#ifdef USE_XCB 397 xcb_connection_t *c = XGetXCBConnection(dpy); 398 (void) __glXFlushRenderBuffer(gc, gc->pc); 399 xcb_glx_delete_lists(c, gc->currentContextTag, list, range); 400#else 401 GLubyte const * pc = __glXSetupSingleRequest(gc, X_GLsop_DeleteLists, cmdlen); 402(void) memcpy((void *)(pc + 0), (void *)(&list), 1 * sizeof(GLuint)); 403(void) memcpy((void *)(pc + 4), (void *)(&range), 1 * sizeof(GLsizei)); 404 UnlockDisplay(dpy); SyncHandle(); 405#endif /* USE_XCB */ 406 } 407 return; 408} 409 410#define X_GLsop_GenLists 104 411GLuint __indirect_glGenLists(GLsizei range) 412{ 413 struct glx_context * const gc = __glXGetCurrentContext(); 414 Display * const dpy = gc->currentDpy; 415 GLuint retval = (GLuint) 0; 416#ifndef USE_XCB 417 const GLuint cmdlen = 4; 418#endif 419 if (__builtin_expect(dpy != NULL, 1)) { 420#ifdef USE_XCB 421 xcb_connection_t *c = XGetXCBConnection(dpy); 422 (void) __glXFlushRenderBuffer(gc, gc->pc); 423 xcb_glx_gen_lists_reply_t *reply = xcb_glx_gen_lists_reply(c, xcb_glx_gen_lists(c, gc->currentContextTag, range), NULL); 424 retval = reply->ret_val; 425 free(reply); 426#else 427 GLubyte const * pc = __glXSetupSingleRequest(gc, X_GLsop_GenLists, cmdlen); 428(void) memcpy((void *)(pc + 0), (void *)(&range), 1 * sizeof(GLsizei)); 429 retval = (GLuint) __glXReadReply(dpy, 0, NULL, GL_FALSE); 430 UnlockDisplay(dpy); SyncHandle(); 431#endif /* USE_XCB */ 432 } 433 return retval; 434} 435 436#define X_GLrop_ListBase 3 437void __indirect_glListBase(GLuint base) 438{ 439 struct glx_context * const gc = __glXGetCurrentContext(); 440 const GLuint cmdlen = 8; 441emit_header(gc->pc, X_GLrop_ListBase, cmdlen); 442(void) memcpy((void *)(gc->pc + 4), (void *)(&base), 1 * sizeof(GLuint)); 443gc->pc += cmdlen; 444if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); } 445} 446 447#define X_GLrop_Begin 4 448void __indirect_glBegin(GLenum mode) 449{ 450 struct glx_context * const gc = __glXGetCurrentContext(); 451 const GLuint cmdlen = 8; 452emit_header(gc->pc, X_GLrop_Begin, cmdlen); 453(void) memcpy((void *)(gc->pc + 4), (void *)(&mode), 1 * sizeof(GLenum)); 454gc->pc += cmdlen; 455if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); } 456} 457 458#define X_GLrop_Bitmap 5 459void __indirect_glBitmap(GLsizei width, GLsizei height, GLfloat xorig, GLfloat yorig, GLfloat xmove, GLfloat ymove, const GLubyte * bitmap) 460{ 461 struct glx_context * const gc = __glXGetCurrentContext(); 462 const GLuint compsize = (bitmap != NULL) ? __glImageSize(width, height, 1, GL_COLOR_INDEX, GL_BITMAP, 0) : 0; 463 const GLuint cmdlen = 48 + safe_pad(compsize); 464 if (0 + safe_pad(compsize) < 0) { 465 __glXSetError(gc, GL_INVALID_VALUE); 466 return; 467 } 468 if (__builtin_expect(gc->currentDpy != NULL, 1)) { 469if (cmdlen <= gc->maxSmallRenderCommandSize) { 470 if ( (gc->pc + cmdlen) > gc->bufEnd ) { 471 (void) __glXFlushRenderBuffer(gc, gc->pc); 472 } 473emit_header(gc->pc, X_GLrop_Bitmap, cmdlen); 474(void) memcpy((void *)(gc->pc + 24), (void *)(&width), 1 * sizeof(GLsizei)); 475(void) memcpy((void *)(gc->pc + 28), (void *)(&height), 1 * sizeof(GLsizei)); 476(void) memcpy((void *)(gc->pc + 32), (void *)(&xorig), 1 * sizeof(GLfloat)); 477(void) memcpy((void *)(gc->pc + 36), (void *)(&yorig), 1 * sizeof(GLfloat)); 478(void) memcpy((void *)(gc->pc + 40), (void *)(&xmove), 1 * sizeof(GLfloat)); 479(void) memcpy((void *)(gc->pc + 44), (void *)(&ymove), 1 * sizeof(GLfloat)); 480if (compsize > 0) { 481 __glFillImage(gc, 2, width, height, 1, GL_COLOR_INDEX, GL_BITMAP, bitmap, gc->pc + 48, gc->pc + 4); 482} else { 483 (void) memcpy( gc->pc + 4, default_pixel_store_2D, default_pixel_store_2D_size ); 484} 485gc->pc += cmdlen; 486if (gc->pc > gc->limit) { (void) __glXFlushRenderBuffer(gc, gc->pc); } 487} 488else { 489const GLint op = X_GLrop_Bitmap; 490const GLuint cmdlenLarge = cmdlen + 4; 491GLubyte * const pc = __glXFlushRenderBuffer(gc, gc->pc); 492(void) memcpy((void *)(pc + 0), (void *)(&cmdlenLarge), 4); 493(void) memcpy((void *)(pc + 4), (void *)(&op), 4); 494(void) memcpy((void *)(pc + 28), (void *)(&width), 1 * sizeof(GLsizei)); 495(void) memcpy((void *)(pc + 32), (void *)(&height), 1 * sizeof(GLsizei)); 496(void) memcpy((void *)(pc + 36), (void *)(&xorig), 1 * sizeof(GLfloat)); 497(void) memcpy((void *)(pc + 40), (void *)(&yorig), 1 * sizeof(GLfloat)); 498(void) memcpy((void *)(pc + 44), (void *)(&xmove), 1 * sizeof(GLfloat)); 499(void) memcpy((void *)(pc + 48), (void *)(&ymove), 1 * sizeof(GLfloat)); 500__glXSendLargeImage(gc, compsize, 2, width, height, 1, GL_COLOR_INDEX, GL_BITMAP, bitmap, pc + 52, pc + 8); 501} 502 } 503} 504 505#define X_GLrop_Color3bv 6 506void __indirect_glColor3b(GLbyte red, GLbyte green, GLbyte blue) 507{ 508 struct glx_context * const gc = __glXGetCurrentContext(); 509 const GLuint cmdlen = 8; 510emit_header(gc->pc, X_GLrop_Color3bv, cmdlen); 511(void) memcpy((void *)(gc->pc + 4), (void *)(&red), 1 * sizeof(GLbyte)); 512(void) memcpy((void *)(gc->pc + 5), (void *)(&green), 1 * sizeof(GLbyte)); 513(void) memcpy((void *)(gc->pc + 6), (void *)(&blue), 1 * sizeof(GLbyte)); 514gc->pc += cmdlen; 515if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); } 516} 517 518#define X_GLrop_Color3bv 6 519void __indirect_glColor3bv(const GLbyte * v) 520{ 521 generic_3_byte( X_GLrop_Color3bv, v ); 522} 523 524#define X_GLrop_Color3dv 7 525void __indirect_glColor3d(GLdouble red, GLdouble green, GLdouble blue) 526{ 527 struct glx_context * const gc = __glXGetCurrentContext(); 528 const GLuint cmdlen = 28; 529emit_header(gc->pc, X_GLrop_Color3dv, cmdlen); 530(void) memcpy((void *)(gc->pc + 4), (void *)(&red), 1 * sizeof(GLdouble)); 531(void) memcpy((void *)(gc->pc + 12), (void *)(&green), 1 * sizeof(GLdouble)); 532(void) memcpy((void *)(gc->pc + 20), (void *)(&blue), 1 * sizeof(GLdouble)); 533gc->pc += cmdlen; 534if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); } 535} 536 537#define X_GLrop_Color3dv 7 538void __indirect_glColor3dv(const GLdouble * v) 539{ 540 generic_24_byte( X_GLrop_Color3dv, v ); 541} 542 543#define X_GLrop_Color3fv 8 544void __indirect_glColor3f(GLfloat red, GLfloat green, GLfloat blue) 545{ 546 struct glx_context * const gc = __glXGetCurrentContext(); 547 const GLuint cmdlen = 16; 548emit_header(gc->pc, X_GLrop_Color3fv, cmdlen); 549(void) memcpy((void *)(gc->pc + 4), (void *)(&red), 1 * sizeof(GLfloat)); 550(void) memcpy((void *)(gc->pc + 8), (void *)(&green), 1 * sizeof(GLfloat)); 551(void) memcpy((void *)(gc->pc + 12), (void *)(&blue), 1 * sizeof(GLfloat)); 552gc->pc += cmdlen; 553if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); } 554} 555 556#define X_GLrop_Color3fv 8 557void __indirect_glColor3fv(const GLfloat * v) 558{ 559 generic_12_byte( X_GLrop_Color3fv, v ); 560} 561 562#define X_GLrop_Color3iv 9 563void __indirect_glColor3i(GLint red, GLint green, GLint blue) 564{ 565 struct glx_context * const gc = __glXGetCurrentContext(); 566 const GLuint cmdlen = 16; 567emit_header(gc->pc, X_GLrop_Color3iv, cmdlen); 568(void) memcpy((void *)(gc->pc + 4), (void *)(&red), 1 * sizeof(GLint)); 569(void) memcpy((void *)(gc->pc + 8), (void *)(&green), 1 * sizeof(GLint)); 570(void) memcpy((void *)(gc->pc + 12), (void *)(&blue), 1 * sizeof(GLint)); 571gc->pc += cmdlen; 572if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); } 573} 574 575#define X_GLrop_Color3iv 9 576void __indirect_glColor3iv(const GLint * v) 577{ 578 generic_12_byte( X_GLrop_Color3iv, v ); 579} 580 581#define X_GLrop_Color3sv 10 582void __indirect_glColor3s(GLshort red, GLshort green, GLshort blue) 583{ 584 struct glx_context * const gc = __glXGetCurrentContext(); 585 const GLuint cmdlen = 12; 586emit_header(gc->pc, X_GLrop_Color3sv, cmdlen); 587(void) memcpy((void *)(gc->pc + 4), (void *)(&red), 1 * sizeof(GLshort)); 588(void) memcpy((void *)(gc->pc + 6), (void *)(&green), 1 * sizeof(GLshort)); 589(void) memcpy((void *)(gc->pc + 8), (void *)(&blue), 1 * sizeof(GLshort)); 590gc->pc += cmdlen; 591if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); } 592} 593 594#define X_GLrop_Color3sv 10 595void __indirect_glColor3sv(const GLshort * v) 596{ 597 generic_6_byte( X_GLrop_Color3sv, v ); 598} 599 600#define X_GLrop_Color3ubv 11 601void __indirect_glColor3ub(GLubyte red, GLubyte green, GLubyte blue) 602{ 603 struct glx_context * const gc = __glXGetCurrentContext(); 604 const GLuint cmdlen = 8; 605emit_header(gc->pc, X_GLrop_Color3ubv, cmdlen); 606(void) memcpy((void *)(gc->pc + 4), (void *)(&red), 1 * sizeof(GLubyte)); 607(void) memcpy((void *)(gc->pc + 5), (void *)(&green), 1 * sizeof(GLubyte)); 608(void) memcpy((void *)(gc->pc + 6), (void *)(&blue), 1 * sizeof(GLubyte)); 609gc->pc += cmdlen; 610if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); } 611} 612 613#define X_GLrop_Color3ubv 11 614void __indirect_glColor3ubv(const GLubyte * v) 615{ 616 generic_3_byte( X_GLrop_Color3ubv, v ); 617} 618 619#define X_GLrop_Color3uiv 12 620void __indirect_glColor3ui(GLuint red, GLuint green, GLuint blue) 621{ 622 struct glx_context * const gc = __glXGetCurrentContext(); 623 const GLuint cmdlen = 16; 624emit_header(gc->pc, X_GLrop_Color3uiv, cmdlen); 625(void) memcpy((void *)(gc->pc + 4), (void *)(&red), 1 * sizeof(GLuint)); 626(void) memcpy((void *)(gc->pc + 8), (void *)(&green), 1 * sizeof(GLuint)); 627(void) memcpy((void *)(gc->pc + 12), (void *)(&blue), 1 * sizeof(GLuint)); 628gc->pc += cmdlen; 629if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); } 630} 631 632#define X_GLrop_Color3uiv 12 633void __indirect_glColor3uiv(const GLuint * v) 634{ 635 generic_12_byte( X_GLrop_Color3uiv, v ); 636} 637 638#define X_GLrop_Color3usv 13 639void __indirect_glColor3us(GLushort red, GLushort green, GLushort blue) 640{ 641 struct glx_context * const gc = __glXGetCurrentContext(); 642 const GLuint cmdlen = 12; 643emit_header(gc->pc, X_GLrop_Color3usv, cmdlen); 644(void) memcpy((void *)(gc->pc + 4), (void *)(&red), 1 * sizeof(GLushort)); 645(void) memcpy((void *)(gc->pc + 6), (void *)(&green), 1 * sizeof(GLushort)); 646(void) memcpy((void *)(gc->pc + 8), (void *)(&blue), 1 * sizeof(GLushort)); 647gc->pc += cmdlen; 648if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); } 649} 650 651#define X_GLrop_Color3usv 13 652void __indirect_glColor3usv(const GLushort * v) 653{ 654 generic_6_byte( X_GLrop_Color3usv, v ); 655} 656 657#define X_GLrop_Color4bv 14 658void __indirect_glColor4b(GLbyte red, GLbyte green, GLbyte blue, GLbyte alpha) 659{ 660 struct glx_context * const gc = __glXGetCurrentContext(); 661 const GLuint cmdlen = 8; 662emit_header(gc->pc, X_GLrop_Color4bv, cmdlen); 663(void) memcpy((void *)(gc->pc + 4), (void *)(&red), 1 * sizeof(GLbyte)); 664(void) memcpy((void *)(gc->pc + 5), (void *)(&green), 1 * sizeof(GLbyte)); 665(void) memcpy((void *)(gc->pc + 6), (void *)(&blue), 1 * sizeof(GLbyte)); 666(void) memcpy((void *)(gc->pc + 7), (void *)(&alpha), 1 * sizeof(GLbyte)); 667gc->pc += cmdlen; 668if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); } 669} 670 671#define X_GLrop_Color4bv 14 672void __indirect_glColor4bv(const GLbyte * v) 673{ 674 generic_4_byte( X_GLrop_Color4bv, v ); 675} 676 677#define X_GLrop_Color4dv 15 678void __indirect_glColor4d(GLdouble red, GLdouble green, GLdouble blue, GLdouble alpha) 679{ 680 struct glx_context * const gc = __glXGetCurrentContext(); 681 const GLuint cmdlen = 36; 682emit_header(gc->pc, X_GLrop_Color4dv, cmdlen); 683(void) memcpy((void *)(gc->pc + 4), (void *)(&red), 1 * sizeof(GLdouble)); 684(void) memcpy((void *)(gc->pc + 12), (void *)(&green), 1 * sizeof(GLdouble)); 685(void) memcpy((void *)(gc->pc + 20), (void *)(&blue), 1 * sizeof(GLdouble)); 686(void) memcpy((void *)(gc->pc + 28), (void *)(&alpha), 1 * sizeof(GLdouble)); 687gc->pc += cmdlen; 688if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); } 689} 690 691#define X_GLrop_Color4dv 15 692void __indirect_glColor4dv(const GLdouble * v) 693{ 694 generic_32_byte( X_GLrop_Color4dv, v ); 695} 696 697#define X_GLrop_Color4fv 16 698void __indirect_glColor4f(GLfloat red, GLfloat green, GLfloat blue, GLfloat alpha) 699{ 700 struct glx_context * const gc = __glXGetCurrentContext(); 701 const GLuint cmdlen = 20; 702emit_header(gc->pc, X_GLrop_Color4fv, cmdlen); 703(void) memcpy((void *)(gc->pc + 4), (void *)(&red), 1 * sizeof(GLfloat)); 704(void) memcpy((void *)(gc->pc + 8), (void *)(&green), 1 * sizeof(GLfloat)); 705(void) memcpy((void *)(gc->pc + 12), (void *)(&blue), 1 * sizeof(GLfloat)); 706(void) memcpy((void *)(gc->pc + 16), (void *)(&alpha), 1 * sizeof(GLfloat)); 707gc->pc += cmdlen; 708if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); } 709} 710 711#define X_GLrop_Color4fv 16 712void __indirect_glColor4fv(const GLfloat * v) 713{ 714 generic_16_byte( X_GLrop_Color4fv, v ); 715} 716 717#define X_GLrop_Color4iv 17 718void __indirect_glColor4i(GLint red, GLint green, GLint blue, GLint alpha) 719{ 720 struct glx_context * const gc = __glXGetCurrentContext(); 721 const GLuint cmdlen = 20; 722emit_header(gc->pc, X_GLrop_Color4iv, cmdlen); 723(void) memcpy((void *)(gc->pc + 4), (void *)(&red), 1 * sizeof(GLint)); 724(void) memcpy((void *)(gc->pc + 8), (void *)(&green), 1 * sizeof(GLint)); 725(void) memcpy((void *)(gc->pc + 12), (void *)(&blue), 1 * sizeof(GLint)); 726(void) memcpy((void *)(gc->pc + 16), (void *)(&alpha), 1 * sizeof(GLint)); 727gc->pc += cmdlen; 728if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); } 729} 730 731#define X_GLrop_Color4iv 17 732void __indirect_glColor4iv(const GLint * v) 733{ 734 generic_16_byte( X_GLrop_Color4iv, v ); 735} 736 737#define X_GLrop_Color4sv 18 738void __indirect_glColor4s(GLshort red, GLshort green, GLshort blue, GLshort alpha) 739{ 740 struct glx_context * const gc = __glXGetCurrentContext(); 741 const GLuint cmdlen = 12; 742emit_header(gc->pc, X_GLrop_Color4sv, cmdlen); 743(void) memcpy((void *)(gc->pc + 4), (void *)(&red), 1 * sizeof(GLshort)); 744(void) memcpy((void *)(gc->pc + 6), (void *)(&green), 1 * sizeof(GLshort)); 745(void) memcpy((void *)(gc->pc + 8), (void *)(&blue), 1 * sizeof(GLshort)); 746(void) memcpy((void *)(gc->pc + 10), (void *)(&alpha), 1 * sizeof(GLshort)); 747gc->pc += cmdlen; 748if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); } 749} 750 751#define X_GLrop_Color4sv 18 752void __indirect_glColor4sv(const GLshort * v) 753{ 754 generic_8_byte( X_GLrop_Color4sv, v ); 755} 756 757#define X_GLrop_Color4ubv 19 758void __indirect_glColor4ub(GLubyte red, GLubyte green, GLubyte blue, GLubyte alpha) 759{ 760 struct glx_context * const gc = __glXGetCurrentContext(); 761 const GLuint cmdlen = 8; 762emit_header(gc->pc, X_GLrop_Color4ubv, cmdlen); 763(void) memcpy((void *)(gc->pc + 4), (void *)(&red), 1 * sizeof(GLubyte)); 764(void) memcpy((void *)(gc->pc + 5), (void *)(&green), 1 * sizeof(GLubyte)); 765(void) memcpy((void *)(gc->pc + 6), (void *)(&blue), 1 * sizeof(GLubyte)); 766(void) memcpy((void *)(gc->pc + 7), (void *)(&alpha), 1 * sizeof(GLubyte)); 767gc->pc += cmdlen; 768if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); } 769} 770 771#define X_GLrop_Color4ubv 19 772void __indirect_glColor4ubv(const GLubyte * v) 773{ 774 generic_4_byte( X_GLrop_Color4ubv, v ); 775} 776 777#define X_GLrop_Color4uiv 20 778void __indirect_glColor4ui(GLuint red, GLuint green, GLuint blue, GLuint alpha) 779{ 780 struct glx_context * const gc = __glXGetCurrentContext(); 781 const GLuint cmdlen = 20; 782emit_header(gc->pc, X_GLrop_Color4uiv, cmdlen); 783(void) memcpy((void *)(gc->pc + 4), (void *)(&red), 1 * sizeof(GLuint)); 784(void) memcpy((void *)(gc->pc + 8), (void *)(&green), 1 * sizeof(GLuint)); 785(void) memcpy((void *)(gc->pc + 12), (void *)(&blue), 1 * sizeof(GLuint)); 786(void) memcpy((void *)(gc->pc + 16), (void *)(&alpha), 1 * sizeof(GLuint)); 787gc->pc += cmdlen; 788if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); } 789} 790 791#define X_GLrop_Color4uiv 20 792void __indirect_glColor4uiv(const GLuint * v) 793{ 794 generic_16_byte( X_GLrop_Color4uiv, v ); 795} 796 797#define X_GLrop_Color4usv 21 798void __indirect_glColor4us(GLushort red, GLushort green, GLushort blue, GLushort alpha) 799{ 800 struct glx_context * const gc = __glXGetCurrentContext(); 801 const GLuint cmdlen = 12; 802emit_header(gc->pc, X_GLrop_Color4usv, cmdlen); 803(void) memcpy((void *)(gc->pc + 4), (void *)(&red), 1 * sizeof(GLushort)); 804(void) memcpy((void *)(gc->pc + 6), (void *)(&green), 1 * sizeof(GLushort)); 805(void) memcpy((void *)(gc->pc + 8), (void *)(&blue), 1 * sizeof(GLushort)); 806(void) memcpy((void *)(gc->pc + 10), (void *)(&alpha), 1 * sizeof(GLushort)); 807gc->pc += cmdlen; 808if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); } 809} 810 811#define X_GLrop_Color4usv 21 812void __indirect_glColor4usv(const GLushort * v) 813{ 814 generic_8_byte( X_GLrop_Color4usv, v ); 815} 816 817#define X_GLrop_EdgeFlagv 22 818void __indirect_glEdgeFlag(GLboolean flag) 819{ 820 struct glx_context * const gc = __glXGetCurrentContext(); 821 const GLuint cmdlen = 8; 822emit_header(gc->pc, X_GLrop_EdgeFlagv, cmdlen); 823(void) memcpy((void *)(gc->pc + 4), (void *)(&flag), 1 * sizeof(GLboolean)); 824gc->pc += cmdlen; 825if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); } 826} 827 828#define X_GLrop_EdgeFlagv 22 829void __indirect_glEdgeFlagv(const GLboolean * flag) 830{ 831 struct glx_context * const gc = __glXGetCurrentContext(); 832 const GLuint cmdlen = 8; 833emit_header(gc->pc, X_GLrop_EdgeFlagv, cmdlen); 834(void) memcpy((void *)(gc->pc + 4), (void *)(flag), 1 * sizeof(GLboolean)); 835gc->pc += cmdlen; 836if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); } 837} 838 839#define X_GLrop_End 23 840void __indirect_glEnd(void) 841{ 842 struct glx_context * const gc = __glXGetCurrentContext(); 843 const GLuint cmdlen = 4; 844emit_header(gc->pc, X_GLrop_End, cmdlen); 845gc->pc += cmdlen; 846if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); } 847} 848 849#define X_GLrop_Indexdv 24 850void __indirect_glIndexd(GLdouble c) 851{ 852 struct glx_context * const gc = __glXGetCurrentContext(); 853 const GLuint cmdlen = 12; 854emit_header(gc->pc, X_GLrop_Indexdv, cmdlen); 855(void) memcpy((void *)(gc->pc + 4), (void *)(&c), 1 * sizeof(GLdouble)); 856gc->pc += cmdlen; 857if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); } 858} 859 860#define X_GLrop_Indexdv 24 861void __indirect_glIndexdv(const GLdouble * c) 862{ 863 generic_8_byte( X_GLrop_Indexdv, c ); 864} 865 866#define X_GLrop_Indexfv 25 867void __indirect_glIndexf(GLfloat c) 868{ 869 struct glx_context * const gc = __glXGetCurrentContext(); 870 const GLuint cmdlen = 8; 871emit_header(gc->pc, X_GLrop_Indexfv, cmdlen); 872(void) memcpy((void *)(gc->pc + 4), (void *)(&c), 1 * sizeof(GLfloat)); 873gc->pc += cmdlen; 874if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); } 875} 876 877#define X_GLrop_Indexfv 25 878void __indirect_glIndexfv(const GLfloat * c) 879{ 880 generic_4_byte( X_GLrop_Indexfv, c ); 881} 882 883#define X_GLrop_Indexiv 26 884void __indirect_glIndexi(GLint c) 885{ 886 struct glx_context * const gc = __glXGetCurrentContext(); 887 const GLuint cmdlen = 8; 888emit_header(gc->pc, X_GLrop_Indexiv, cmdlen); 889(void) memcpy((void *)(gc->pc + 4), (void *)(&c), 1 * sizeof(GLint)); 890gc->pc += cmdlen; 891if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); } 892} 893 894#define X_GLrop_Indexiv 26 895void __indirect_glIndexiv(const GLint * c) 896{ 897 generic_4_byte( X_GLrop_Indexiv, c ); 898} 899 900#define X_GLrop_Indexsv 27 901void __indirect_glIndexs(GLshort c) 902{ 903 struct glx_context * const gc = __glXGetCurrentContext(); 904 const GLuint cmdlen = 8; 905emit_header(gc->pc, X_GLrop_Indexsv, cmdlen); 906(void) memcpy((void *)(gc->pc + 4), (void *)(&c), 1 * sizeof(GLshort)); 907gc->pc += cmdlen; 908if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); } 909} 910 911#define X_GLrop_Indexsv 27 912void __indirect_glIndexsv(const GLshort * c) 913{ 914 struct glx_context * const gc = __glXGetCurrentContext(); 915 const GLuint cmdlen = 8; 916emit_header(gc->pc, X_GLrop_Indexsv, cmdlen); 917(void) memcpy((void *)(gc->pc + 4), (void *)(c), 1 * sizeof(GLshort)); 918gc->pc += cmdlen; 919if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); } 920} 921 922#define X_GLrop_Normal3bv 28 923void __indirect_glNormal3b(GLbyte nx, GLbyte ny, GLbyte nz) 924{ 925 struct glx_context * const gc = __glXGetCurrentContext(); 926 const GLuint cmdlen = 8; 927emit_header(gc->pc, X_GLrop_Normal3bv, cmdlen); 928(void) memcpy((void *)(gc->pc + 4), (void *)(&nx), 1 * sizeof(GLbyte)); 929(void) memcpy((void *)(gc->pc + 5), (void *)(&ny), 1 * sizeof(GLbyte)); 930(void) memcpy((void *)(gc->pc + 6), (void *)(&nz), 1 * sizeof(GLbyte)); 931gc->pc += cmdlen; 932if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); } 933} 934 935#define X_GLrop_Normal3bv 28 936void __indirect_glNormal3bv(const GLbyte * v) 937{ 938 generic_3_byte( X_GLrop_Normal3bv, v ); 939} 940 941#define X_GLrop_Normal3dv 29 942void __indirect_glNormal3d(GLdouble nx, GLdouble ny, GLdouble nz) 943{ 944 struct glx_context * const gc = __glXGetCurrentContext(); 945 const GLuint cmdlen = 28; 946emit_header(gc->pc, X_GLrop_Normal3dv, cmdlen); 947(void) memcpy((void *)(gc->pc + 4), (void *)(&nx), 1 * sizeof(GLdouble)); 948(void) memcpy((void *)(gc->pc + 12), (void *)(&ny), 1 * sizeof(GLdouble)); 949(void) memcpy((void *)(gc->pc + 20), (void *)(&nz), 1 * sizeof(GLdouble)); 950gc->pc += cmdlen; 951if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); } 952} 953 954#define X_GLrop_Normal3dv 29 955void __indirect_glNormal3dv(const GLdouble * v) 956{ 957 generic_24_byte( X_GLrop_Normal3dv, v ); 958} 959 960#define X_GLrop_Normal3fv 30 961void __indirect_glNormal3f(GLfloat nx, GLfloat ny, GLfloat nz) 962{ 963 struct glx_context * const gc = __glXGetCurrentContext(); 964 const GLuint cmdlen = 16; 965emit_header(gc->pc, X_GLrop_Normal3fv, cmdlen); 966(void) memcpy((void *)(gc->pc + 4), (void *)(&nx), 1 * sizeof(GLfloat)); 967(void) memcpy((void *)(gc->pc + 8), (void *)(&ny), 1 * sizeof(GLfloat)); 968(void) memcpy((void *)(gc->pc + 12), (void *)(&nz), 1 * sizeof(GLfloat)); 969gc->pc += cmdlen; 970if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); } 971} 972 973#define X_GLrop_Normal3fv 30 974void __indirect_glNormal3fv(const GLfloat * v) 975{ 976 generic_12_byte( X_GLrop_Normal3fv, v ); 977} 978 979#define X_GLrop_Normal3iv 31 980void __indirect_glNormal3i(GLint nx, GLint ny, GLint nz) 981{ 982 struct glx_context * const gc = __glXGetCurrentContext(); 983 const GLuint cmdlen = 16; 984emit_header(gc->pc, X_GLrop_Normal3iv, cmdlen); 985(void) memcpy((void *)(gc->pc + 4), (void *)(&nx), 1 * sizeof(GLint)); 986(void) memcpy((void *)(gc->pc + 8), (void *)(&ny), 1 * sizeof(GLint)); 987(void) memcpy((void *)(gc->pc + 12), (void *)(&nz), 1 * sizeof(GLint)); 988gc->pc += cmdlen; 989if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); } 990} 991 992#define X_GLrop_Normal3iv 31 993void __indirect_glNormal3iv(const GLint * v) 994{ 995 generic_12_byte( X_GLrop_Normal3iv, v ); 996} 997 998#define X_GLrop_Normal3sv 32 999void __indirect_glNormal3s(GLshort nx, GLshort ny, GLshort nz) 1000{ 1001 struct glx_context * const gc = __glXGetCurrentContext(); 1002 const GLuint cmdlen = 12; 1003emit_header(gc->pc, X_GLrop_Normal3sv, cmdlen); 1004(void) memcpy((void *)(gc->pc + 4), (void *)(&nx), 1 * sizeof(GLshort)); 1005(void) memcpy((void *)(gc->pc + 6), (void *)(&ny), 1 * sizeof(GLshort)); 1006(void) memcpy((void *)(gc->pc + 8), (void *)(&nz), 1 * sizeof(GLshort)); 1007gc->pc += cmdlen; 1008if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); } 1009} 1010 1011#define X_GLrop_Normal3sv 32 1012void __indirect_glNormal3sv(const GLshort * v) 1013{ 1014 generic_6_byte( X_GLrop_Normal3sv, v ); 1015} 1016 1017#define X_GLrop_RasterPos2dv 33 1018void __indirect_glRasterPos2d(GLdouble x, GLdouble y) 1019{ 1020 struct glx_context * const gc = __glXGetCurrentContext(); 1021 const GLuint cmdlen = 20; 1022emit_header(gc->pc, X_GLrop_RasterPos2dv, cmdlen); 1023(void) memcpy((void *)(gc->pc + 4), (void *)(&x), 1 * sizeof(GLdouble)); 1024(void) memcpy((void *)(gc->pc + 12), (void *)(&y), 1 * sizeof(GLdouble)); 1025gc->pc += cmdlen; 1026if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); } 1027} 1028 1029#define X_GLrop_RasterPos2dv 33 1030void __indirect_glRasterPos2dv(const GLdouble * v) 1031{ 1032 generic_16_byte( X_GLrop_RasterPos2dv, v ); 1033} 1034 1035#define X_GLrop_RasterPos2fv 34 1036void __indirect_glRasterPos2f(GLfloat x, GLfloat y) 1037{ 1038 struct glx_context * const gc = __glXGetCurrentContext(); 1039 const GLuint cmdlen = 12; 1040emit_header(gc->pc, X_GLrop_RasterPos2fv, cmdlen); 1041(void) memcpy((void *)(gc->pc + 4), (void *)(&x), 1 * sizeof(GLfloat)); 1042(void) memcpy((void *)(gc->pc + 8), (void *)(&y), 1 * sizeof(GLfloat)); 1043gc->pc += cmdlen; 1044if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); } 1045} 1046 1047#define X_GLrop_RasterPos2fv 34 1048void __indirect_glRasterPos2fv(const GLfloat * v) 1049{ 1050 generic_8_byte( X_GLrop_RasterPos2fv, v ); 1051} 1052 1053#define X_GLrop_RasterPos2iv 35 1054void __indirect_glRasterPos2i(GLint x, GLint y) 1055{ 1056 struct glx_context * const gc = __glXGetCurrentContext(); 1057 const GLuint cmdlen = 12; 1058emit_header(gc->pc, X_GLrop_RasterPos2iv, cmdlen); 1059(void) memcpy((void *)(gc->pc + 4), (void *)(&x), 1 * sizeof(GLint)); 1060(void) memcpy((void *)(gc->pc + 8), (void *)(&y), 1 * sizeof(GLint)); 1061gc->pc += cmdlen; 1062if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); } 1063} 1064 1065#define X_GLrop_RasterPos2iv 35 1066void __indirect_glRasterPos2iv(const GLint * v) 1067{ 1068 generic_8_byte( X_GLrop_RasterPos2iv, v ); 1069} 1070 1071#define X_GLrop_RasterPos2sv 36 1072void __indirect_glRasterPos2s(GLshort x, GLshort y) 1073{ 1074 struct glx_context * const gc = __glXGetCurrentContext(); 1075 const GLuint cmdlen = 8; 1076emit_header(gc->pc, X_GLrop_RasterPos2sv, cmdlen); 1077(void) memcpy((void *)(gc->pc + 4), (void *)(&x), 1 * sizeof(GLshort)); 1078(void) memcpy((void *)(gc->pc + 6), (void *)(&y), 1 * sizeof(GLshort)); 1079gc->pc += cmdlen; 1080if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); } 1081} 1082 1083#define X_GLrop_RasterPos2sv 36 1084void __indirect_glRasterPos2sv(const GLshort * v) 1085{ 1086 generic_4_byte( X_GLrop_RasterPos2sv, v ); 1087} 1088 1089#define X_GLrop_RasterPos3dv 37 1090void __indirect_glRasterPos3d(GLdouble x, GLdouble y, GLdouble z) 1091{ 1092 struct glx_context * const gc = __glXGetCurrentContext(); 1093 const GLuint cmdlen = 28; 1094emit_header(gc->pc, X_GLrop_RasterPos3dv, cmdlen); 1095(void) memcpy((void *)(gc->pc + 4), (void *)(&x), 1 * sizeof(GLdouble)); 1096(void) memcpy((void *)(gc->pc + 12), (void *)(&y), 1 * sizeof(GLdouble)); 1097(void) memcpy((void *)(gc->pc + 20), (void *)(&z), 1 * sizeof(GLdouble)); 1098gc->pc += cmdlen; 1099if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); } 1100} 1101 1102#define X_GLrop_RasterPos3dv 37 1103void __indirect_glRasterPos3dv(const GLdouble * v) 1104{ 1105 generic_24_byte( X_GLrop_RasterPos3dv, v ); 1106} 1107 1108#define X_GLrop_RasterPos3fv 38 1109void __indirect_glRasterPos3f(GLfloat x, GLfloat y, GLfloat z) 1110{ 1111 struct glx_context * const gc = __glXGetCurrentContext(); 1112 const GLuint cmdlen = 16; 1113emit_header(gc->pc, X_GLrop_RasterPos3fv, cmdlen); 1114(void) memcpy((void *)(gc->pc + 4), (void *)(&x), 1 * sizeof(GLfloat)); 1115(void) memcpy((void *)(gc->pc + 8), (void *)(&y), 1 * sizeof(GLfloat)); 1116(void) memcpy((void *)(gc->pc + 12), (void *)(&z), 1 * sizeof(GLfloat)); 1117gc->pc += cmdlen; 1118if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); } 1119} 1120 1121#define X_GLrop_RasterPos3fv 38 1122void __indirect_glRasterPos3fv(const GLfloat * v) 1123{ 1124 generic_12_byte( X_GLrop_RasterPos3fv, v ); 1125} 1126 1127#define X_GLrop_RasterPos3iv 39 1128void __indirect_glRasterPos3i(GLint x, GLint y, GLint z) 1129{ 1130 struct glx_context * const gc = __glXGetCurrentContext(); 1131 const GLuint cmdlen = 16; 1132emit_header(gc->pc, X_GLrop_RasterPos3iv, cmdlen); 1133(void) memcpy((void *)(gc->pc + 4), (void *)(&x), 1 * sizeof(GLint)); 1134(void) memcpy((void *)(gc->pc + 8), (void *)(&y), 1 * sizeof(GLint)); 1135(void) memcpy((void *)(gc->pc + 12), (void *)(&z), 1 * sizeof(GLint)); 1136gc->pc += cmdlen; 1137if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); } 1138} 1139 1140#define X_GLrop_RasterPos3iv 39 1141void __indirect_glRasterPos3iv(const GLint * v) 1142{ 1143 generic_12_byte( X_GLrop_RasterPos3iv, v ); 1144} 1145 1146#define X_GLrop_RasterPos3sv 40 1147void __indirect_glRasterPos3s(GLshort x, GLshort y, GLshort z) 1148{ 1149 struct glx_context * const gc = __glXGetCurrentContext(); 1150 const GLuint cmdlen = 12; 1151emit_header(gc->pc, X_GLrop_RasterPos3sv, cmdlen); 1152(void) memcpy((void *)(gc->pc + 4), (void *)(&x), 1 * sizeof(GLshort)); 1153(void) memcpy((void *)(gc->pc + 6), (void *)(&y), 1 * sizeof(GLshort)); 1154(void) memcpy((void *)(gc->pc + 8), (void *)(&z), 1 * sizeof(GLshort)); 1155gc->pc += cmdlen; 1156if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); } 1157} 1158 1159#define X_GLrop_RasterPos3sv 40 1160void __indirect_glRasterPos3sv(const GLshort * v) 1161{ 1162 generic_6_byte( X_GLrop_RasterPos3sv, v ); 1163} 1164 1165#define X_GLrop_RasterPos4dv 41 1166void __indirect_glRasterPos4d(GLdouble x, GLdouble y, GLdouble z, GLdouble w) 1167{ 1168 struct glx_context * const gc = __glXGetCurrentContext(); 1169 const GLuint cmdlen = 36; 1170emit_header(gc->pc, X_GLrop_RasterPos4dv, cmdlen); 1171(void) memcpy((void *)(gc->pc + 4), (void *)(&x), 1 * sizeof(GLdouble)); 1172(void) memcpy((void *)(gc->pc + 12), (void *)(&y), 1 * sizeof(GLdouble)); 1173(void) memcpy((void *)(gc->pc + 20), (void *)(&z), 1 * sizeof(GLdouble)); 1174(void) memcpy((void *)(gc->pc + 28), (void *)(&w), 1 * sizeof(GLdouble)); 1175gc->pc += cmdlen; 1176if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); } 1177} 1178 1179#define X_GLrop_RasterPos4dv 41 1180void __indirect_glRasterPos4dv(const GLdouble * v) 1181{ 1182 generic_32_byte( X_GLrop_RasterPos4dv, v ); 1183} 1184 1185#define X_GLrop_RasterPos4fv 42 1186void __indirect_glRasterPos4f(GLfloat x, GLfloat y, GLfloat z, GLfloat w) 1187{ 1188 struct glx_context * const gc = __glXGetCurrentContext(); 1189 const GLuint cmdlen = 20; 1190emit_header(gc->pc, X_GLrop_RasterPos4fv, cmdlen); 1191(void) memcpy((void *)(gc->pc + 4), (void *)(&x), 1 * sizeof(GLfloat)); 1192(void) memcpy((void *)(gc->pc + 8), (void *)(&y), 1 * sizeof(GLfloat)); 1193(void) memcpy((void *)(gc->pc + 12), (void *)(&z), 1 * sizeof(GLfloat)); 1194(void) memcpy((void *)(gc->pc + 16), (void *)(&w), 1 * sizeof(GLfloat)); 1195gc->pc += cmdlen; 1196if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); } 1197} 1198 1199#define X_GLrop_RasterPos4fv 42 1200void __indirect_glRasterPos4fv(const GLfloat * v) 1201{ 1202 generic_16_byte( X_GLrop_RasterPos4fv, v ); 1203} 1204 1205#define X_GLrop_RasterPos4iv 43 1206void __indirect_glRasterPos4i(GLint x, GLint y, GLint z, GLint w) 1207{ 1208 struct glx_context * const gc = __glXGetCurrentContext(); 1209 const GLuint cmdlen = 20; 1210emit_header(gc->pc, X_GLrop_RasterPos4iv, cmdlen); 1211(void) memcpy((void *)(gc->pc + 4), (void *)(&x), 1 * sizeof(GLint)); 1212(void) memcpy((void *)(gc->pc + 8), (void *)(&y), 1 * sizeof(GLint)); 1213(void) memcpy((void *)(gc->pc + 12), (void *)(&z), 1 * sizeof(GLint)); 1214(void) memcpy((void *)(gc->pc + 16), (void *)(&w), 1 * sizeof(GLint)); 1215gc->pc += cmdlen; 1216if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); } 1217} 1218 1219#define X_GLrop_RasterPos4iv 43 1220void __indirect_glRasterPos4iv(const GLint * v) 1221{ 1222 generic_16_byte( X_GLrop_RasterPos4iv, v ); 1223} 1224 1225#define X_GLrop_RasterPos4sv 44 1226void __indirect_glRasterPos4s(GLshort x, GLshort y, GLshort z, GLshort w) 1227{ 1228 struct glx_context * const gc = __glXGetCurrentContext(); 1229 const GLuint cmdlen = 12; 1230emit_header(gc->pc, X_GLrop_RasterPos4sv, cmdlen); 1231(void) memcpy((void *)(gc->pc + 4), (void *)(&x), 1 * sizeof(GLshort)); 1232(void) memcpy((void *)(gc->pc + 6), (void *)(&y), 1 * sizeof(GLshort)); 1233(void) memcpy((void *)(gc->pc + 8), (void *)(&z), 1 * sizeof(GLshort)); 1234(void) memcpy((void *)(gc->pc + 10), (void *)(&w), 1 * sizeof(GLshort)); 1235gc->pc += cmdlen; 1236if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); } 1237} 1238 1239#define X_GLrop_RasterPos4sv 44 1240void __indirect_glRasterPos4sv(const GLshort * v) 1241{ 1242 generic_8_byte( X_GLrop_RasterPos4sv, v ); 1243} 1244 1245#define X_GLrop_Rectdv 45 1246void __indirect_glRectd(GLdouble x1, GLdouble y1, GLdouble x2, GLdouble y2) 1247{ 1248 struct glx_context * const gc = __glXGetCurrentContext(); 1249 const GLuint cmdlen = 36; 1250emit_header(gc->pc, X_GLrop_Rectdv, cmdlen); 1251(void) memcpy((void *)(gc->pc + 4), (void *)(&x1), 1 * sizeof(GLdouble)); 1252(void) memcpy((void *)(gc->pc + 12), (void *)(&y1), 1 * sizeof(GLdouble)); 1253(void) memcpy((void *)(gc->pc + 20), (void *)(&x2), 1 * sizeof(GLdouble)); 1254(void) memcpy((void *)(gc->pc + 28), (void *)(&y2), 1 * sizeof(GLdouble)); 1255gc->pc += cmdlen; 1256if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); } 1257} 1258 1259#define X_GLrop_Rectdv 45 1260void __indirect_glRectdv(const GLdouble * v1, const GLdouble * v2) 1261{ 1262 struct glx_context * const gc = __glXGetCurrentContext(); 1263 const GLuint cmdlen = 36; 1264emit_header(gc->pc, X_GLrop_Rectdv, cmdlen); 1265(void) memcpy((void *)(gc->pc + 4), (void *)(v1), 2 * sizeof(GLdouble)); 1266(void) memcpy((void *)(gc->pc + 20), (void *)(v2), 2 * sizeof(GLdouble)); 1267gc->pc += cmdlen; 1268if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); } 1269} 1270 1271#define X_GLrop_Rectfv 46 1272void __indirect_glRectf(GLfloat x1, GLfloat y1, GLfloat x2, GLfloat y2) 1273{ 1274 struct glx_context * const gc = __glXGetCurrentContext(); 1275 const GLuint cmdlen = 20; 1276emit_header(gc->pc, X_GLrop_Rectfv, cmdlen); 1277(void) memcpy((void *)(gc->pc + 4), (void *)(&x1), 1 * sizeof(GLfloat)); 1278(void) memcpy((void *)(gc->pc + 8), (void *)(&y1), 1 * sizeof(GLfloat)); 1279(void) memcpy((void *)(gc->pc + 12), (void *)(&x2), 1 * sizeof(GLfloat)); 1280(void) memcpy((void *)(gc->pc + 16), (void *)(&y2), 1 * sizeof(GLfloat)); 1281gc->pc += cmdlen; 1282if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); } 1283} 1284 1285#define X_GLrop_Rectfv 46 1286void __indirect_glRectfv(const GLfloat * v1, const GLfloat * v2) 1287{ 1288 struct glx_context * const gc = __glXGetCurrentContext(); 1289 const GLuint cmdlen = 20; 1290emit_header(gc->pc, X_GLrop_Rectfv, cmdlen); 1291(void) memcpy((void *)(gc->pc + 4), (void *)(v1), 2 * sizeof(GLfloat)); 1292(void) memcpy((void *)(gc->pc + 12), (void *)(v2), 2 * sizeof(GLfloat)); 1293gc->pc += cmdlen; 1294if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); } 1295} 1296 1297#define X_GLrop_Rectiv 47 1298void __indirect_glRecti(GLint x1, GLint y1, GLint x2, GLint y2) 1299{ 1300 struct glx_context * const gc = __glXGetCurrentContext(); 1301 const GLuint cmdlen = 20; 1302emit_header(gc->pc, X_GLrop_Rectiv, cmdlen); 1303(void) memcpy((void *)(gc->pc + 4), (void *)(&x1), 1 * sizeof(GLint)); 1304(void) memcpy((void *)(gc->pc + 8), (void *)(&y1), 1 * sizeof(GLint)); 1305(void) memcpy((void *)(gc->pc + 12), (void *)(&x2), 1 * sizeof(GLint)); 1306(void) memcpy((void *)(gc->pc + 16), (void *)(&y2), 1 * sizeof(GLint)); 1307gc->pc += cmdlen; 1308if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); } 1309} 1310 1311#define X_GLrop_Rectiv 47 1312void __indirect_glRectiv(const GLint * v1, const GLint * v2) 1313{ 1314 struct glx_context * const gc = __glXGetCurrentContext(); 1315 const GLuint cmdlen = 20; 1316emit_header(gc->pc, X_GLrop_Rectiv, cmdlen); 1317(void) memcpy((void *)(gc->pc + 4), (void *)(v1), 2 * sizeof(GLint)); 1318(void) memcpy((void *)(gc->pc + 12), (void *)(v2), 2 * sizeof(GLint)); 1319gc->pc += cmdlen; 1320if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); } 1321} 1322 1323#define X_GLrop_Rectsv 48 1324void __indirect_glRects(GLshort x1, GLshort y1, GLshort x2, GLshort y2) 1325{ 1326 struct glx_context * const gc = __glXGetCurrentContext(); 1327 const GLuint cmdlen = 12; 1328emit_header(gc->pc, X_GLrop_Rectsv, cmdlen); 1329(void) memcpy((void *)(gc->pc + 4), (void *)(&x1), 1 * sizeof(GLshort)); 1330(void) memcpy((void *)(gc->pc + 6), (void *)(&y1), 1 * sizeof(GLshort)); 1331(void) memcpy((void *)(gc->pc + 8), (void *)(&x2), 1 * sizeof(GLshort)); 1332(void) memcpy((void *)(gc->pc + 10), (void *)(&y2), 1 * sizeof(GLshort)); 1333gc->pc += cmdlen; 1334if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); } 1335} 1336 1337#define X_GLrop_Rectsv 48 1338void __indirect_glRectsv(const GLshort * v1, const GLshort * v2) 1339{ 1340 struct glx_context * const gc = __glXGetCurrentContext(); 1341 const GLuint cmdlen = 12; 1342emit_header(gc->pc, X_GLrop_Rectsv, cmdlen); 1343(void) memcpy((void *)(gc->pc + 4), (void *)(v1), 2 * sizeof(GLshort)); 1344(void) memcpy((void *)(gc->pc + 8), (void *)(v2), 2 * sizeof(GLshort)); 1345gc->pc += cmdlen; 1346if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); } 1347} 1348 1349#define X_GLrop_TexCoord1dv 49 1350void __indirect_glTexCoord1d(GLdouble s) 1351{ 1352 struct glx_context * const gc = __glXGetCurrentContext(); 1353 const GLuint cmdlen = 12; 1354emit_header(gc->pc, X_GLrop_TexCoord1dv, cmdlen); 1355(void) memcpy((void *)(gc->pc + 4), (void *)(&s), 1 * sizeof(GLdouble)); 1356gc->pc += cmdlen; 1357if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); } 1358} 1359 1360#define X_GLrop_TexCoord1dv 49 1361void __indirect_glTexCoord1dv(const GLdouble * v) 1362{ 1363 generic_8_byte( X_GLrop_TexCoord1dv, v ); 1364} 1365 1366#define X_GLrop_TexCoord1fv 50 1367void __indirect_glTexCoord1f(GLfloat s) 1368{ 1369 struct glx_context * const gc = __glXGetCurrentContext(); 1370 const GLuint cmdlen = 8; 1371emit_header(gc->pc, X_GLrop_TexCoord1fv, cmdlen); 1372(void) memcpy((void *)(gc->pc + 4), (void *)(&s), 1 * sizeof(GLfloat)); 1373gc->pc += cmdlen; 1374if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); } 1375} 1376 1377#define X_GLrop_TexCoord1fv 50 1378void __indirect_glTexCoord1fv(const GLfloat * v) 1379{ 1380 generic_4_byte( X_GLrop_TexCoord1fv, v ); 1381} 1382 1383#define X_GLrop_TexCoord1iv 51 1384void __indirect_glTexCoord1i(GLint s) 1385{ 1386 struct glx_context * const gc = __glXGetCurrentContext(); 1387 const GLuint cmdlen = 8; 1388emit_header(gc->pc, X_GLrop_TexCoord1iv, cmdlen); 1389(void) memcpy((void *)(gc->pc + 4), (void *)(&s), 1 * sizeof(GLint)); 1390gc->pc += cmdlen; 1391if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); } 1392} 1393 1394#define X_GLrop_TexCoord1iv 51 1395void __indirect_glTexCoord1iv(const GLint * v) 1396{ 1397 generic_4_byte( X_GLrop_TexCoord1iv, v ); 1398} 1399 1400#define X_GLrop_TexCoord1sv 52 1401void __indirect_glTexCoord1s(GLshort s) 1402{ 1403 struct glx_context * const gc = __glXGetCurrentContext(); 1404 const GLuint cmdlen = 8; 1405emit_header(gc->pc, X_GLrop_TexCoord1sv, cmdlen); 1406(void) memcpy((void *)(gc->pc + 4), (void *)(&s), 1 * sizeof(GLshort)); 1407gc->pc += cmdlen; 1408if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); } 1409} 1410 1411#define X_GLrop_TexCoord1sv 52 1412void __indirect_glTexCoord1sv(const GLshort * v) 1413{ 1414 struct glx_context * const gc = __glXGetCurrentContext(); 1415 const GLuint cmdlen = 8; 1416emit_header(gc->pc, X_GLrop_TexCoord1sv, cmdlen); 1417(void) memcpy((void *)(gc->pc + 4), (void *)(v), 1 * sizeof(GLshort)); 1418gc->pc += cmdlen; 1419if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); } 1420} 1421 1422#define X_GLrop_TexCoord2dv 53 1423void __indirect_glTexCoord2d(GLdouble s, GLdouble t) 1424{ 1425 struct glx_context * const gc = __glXGetCurrentContext(); 1426 const GLuint cmdlen = 20; 1427emit_header(gc->pc, X_GLrop_TexCoord2dv, cmdlen); 1428(void) memcpy((void *)(gc->pc + 4), (void *)(&s), 1 * sizeof(GLdouble)); 1429(void) memcpy((void *)(gc->pc + 12), (void *)(&t), 1 * sizeof(GLdouble)); 1430gc->pc += cmdlen; 1431if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); } 1432} 1433 1434#define X_GLrop_TexCoord2dv 53 1435void __indirect_glTexCoord2dv(const GLdouble * v) 1436{ 1437 generic_16_byte( X_GLrop_TexCoord2dv, v ); 1438} 1439 1440#define X_GLrop_TexCoord2fv 54 1441void __indirect_glTexCoord2f(GLfloat s, GLfloat t) 1442{ 1443 struct glx_context * const gc = __glXGetCurrentContext(); 1444 const GLuint cmdlen = 12; 1445emit_header(gc->pc, X_GLrop_TexCoord2fv, cmdlen); 1446(void) memcpy((void *)(gc->pc + 4), (void *)(&s), 1 * sizeof(GLfloat)); 1447(void) memcpy((void *)(gc->pc + 8), (void *)(&t), 1 * sizeof(GLfloat)); 1448gc->pc += cmdlen; 1449if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); } 1450} 1451 1452#define X_GLrop_TexCoord2fv 54 1453void __indirect_glTexCoord2fv(const GLfloat * v) 1454{ 1455 generic_8_byte( X_GLrop_TexCoord2fv, v ); 1456} 1457 1458#define X_GLrop_TexCoord2iv 55 1459void __indirect_glTexCoord2i(GLint s, GLint t) 1460{ 1461 struct glx_context * const gc = __glXGetCurrentContext(); 1462 const GLuint cmdlen = 12; 1463emit_header(gc->pc, X_GLrop_TexCoord2iv, cmdlen); 1464(void) memcpy((void *)(gc->pc + 4), (void *)(&s), 1 * sizeof(GLint)); 1465(void) memcpy((void *)(gc->pc + 8), (void *)(&t), 1 * sizeof(GLint)); 1466gc->pc += cmdlen; 1467if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); } 1468} 1469 1470#define X_GLrop_TexCoord2iv 55 1471void __indirect_glTexCoord2iv(const GLint * v) 1472{ 1473 generic_8_byte( X_GLrop_TexCoord2iv, v ); 1474} 1475 1476#define X_GLrop_TexCoord2sv 56 1477void __indirect_glTexCoord2s(GLshort s, GLshort t) 1478{ 1479 struct glx_context * const gc = __glXGetCurrentContext(); 1480 const GLuint cmdlen = 8; 1481emit_header(gc->pc, X_GLrop_TexCoord2sv, cmdlen); 1482(void) memcpy((void *)(gc->pc + 4), (void *)(&s), 1 * sizeof(GLshort)); 1483(void) memcpy((void *)(gc->pc + 6), (void *)(&t), 1 * sizeof(GLshort)); 1484gc->pc += cmdlen; 1485if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); } 1486} 1487 1488#define X_GLrop_TexCoord2sv 56 1489void __indirect_glTexCoord2sv(const GLshort * v) 1490{ 1491 generic_4_byte( X_GLrop_TexCoord2sv, v ); 1492} 1493 1494#define X_GLrop_TexCoord3dv 57 1495void __indirect_glTexCoord3d(GLdouble s, GLdouble t, GLdouble r) 1496{ 1497 struct glx_context * const gc = __glXGetCurrentContext(); 1498 const GLuint cmdlen = 28; 1499emit_header(gc->pc, X_GLrop_TexCoord3dv, cmdlen); 1500(void) memcpy((void *)(gc->pc + 4), (void *)(&s), 1 * sizeof(GLdouble)); 1501(void) memcpy((void *)(gc->pc + 12), (void *)(&t), 1 * sizeof(GLdouble)); 1502(void) memcpy((void *)(gc->pc + 20), (void *)(&r), 1 * sizeof(GLdouble)); 1503gc->pc += cmdlen; 1504if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); } 1505} 1506 1507#define X_GLrop_TexCoord3dv 57 1508void __indirect_glTexCoord3dv(const GLdouble * v) 1509{ 1510 generic_24_byte( X_GLrop_TexCoord3dv, v ); 1511} 1512 1513#define X_GLrop_TexCoord3fv 58 1514void __indirect_glTexCoord3f(GLfloat s, GLfloat t, GLfloat r) 1515{ 1516 struct glx_context * const gc = __glXGetCurrentContext(); 1517 const GLuint cmdlen = 16; 1518emit_header(gc->pc, X_GLrop_TexCoord3fv, cmdlen); 1519(void) memcpy((void *)(gc->pc + 4), (void *)(&s), 1 * sizeof(GLfloat)); 1520(void) memcpy((void *)(gc->pc + 8), (void *)(&t), 1 * sizeof(GLfloat)); 1521(void) memcpy((void *)(gc->pc + 12), (void *)(&r), 1 * sizeof(GLfloat)); 1522gc->pc += cmdlen; 1523if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); } 1524} 1525 1526#define X_GLrop_TexCoord3fv 58 1527void __indirect_glTexCoord3fv(const GLfloat * v) 1528{ 1529 generic_12_byte( X_GLrop_TexCoord3fv, v ); 1530} 1531 1532#define X_GLrop_TexCoord3iv 59 1533void __indirect_glTexCoord3i(GLint s, GLint t, GLint r) 1534{ 1535 struct glx_context * const gc = __glXGetCurrentContext(); 1536 const GLuint cmdlen = 16; 1537emit_header(gc->pc, X_GLrop_TexCoord3iv, cmdlen); 1538(void) memcpy((void *)(gc->pc + 4), (void *)(&s), 1 * sizeof(GLint)); 1539(void) memcpy((void *)(gc->pc + 8), (void *)(&t), 1 * sizeof(GLint)); 1540(void) memcpy((void *)(gc->pc + 12), (void *)(&r), 1 * sizeof(GLint)); 1541gc->pc += cmdlen; 1542if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); } 1543} 1544 1545#define X_GLrop_TexCoord3iv 59 1546void __indirect_glTexCoord3iv(const GLint * v) 1547{ 1548 generic_12_byte( X_GLrop_TexCoord3iv, v ); 1549} 1550 1551#define X_GLrop_TexCoord3sv 60 1552void __indirect_glTexCoord3s(GLshort s, GLshort t, GLshort r) 1553{ 1554 struct glx_context * const gc = __glXGetCurrentContext(); 1555 const GLuint cmdlen = 12; 1556emit_header(gc->pc, X_GLrop_TexCoord3sv, cmdlen); 1557(void) memcpy((void *)(gc->pc + 4), (void *)(&s), 1 * sizeof(GLshort)); 1558(void) memcpy((void *)(gc->pc + 6), (void *)(&t), 1 * sizeof(GLshort)); 1559(void) memcpy((void *)(gc->pc + 8), (void *)(&r), 1 * sizeof(GLshort)); 1560gc->pc += cmdlen; 1561if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); } 1562} 1563 1564#define X_GLrop_TexCoord3sv 60 1565void __indirect_glTexCoord3sv(const GLshort * v) 1566{ 1567 generic_6_byte( X_GLrop_TexCoord3sv, v ); 1568} 1569 1570#define X_GLrop_TexCoord4dv 61 1571void __indirect_glTexCoord4d(GLdouble s, GLdouble t, GLdouble r, GLdouble q) 1572{ 1573 struct glx_context * const gc = __glXGetCurrentContext(); 1574 const GLuint cmdlen = 36; 1575emit_header(gc->pc, X_GLrop_TexCoord4dv, cmdlen); 1576(void) memcpy((void *)(gc->pc + 4), (void *)(&s), 1 * sizeof(GLdouble)); 1577(void) memcpy((void *)(gc->pc + 12), (void *)(&t), 1 * sizeof(GLdouble)); 1578(void) memcpy((void *)(gc->pc + 20), (void *)(&r), 1 * sizeof(GLdouble)); 1579(void) memcpy((void *)(gc->pc + 28), (void *)(&q), 1 * sizeof(GLdouble)); 1580gc->pc += cmdlen; 1581if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); } 1582} 1583 1584#define X_GLrop_TexCoord4dv 61 1585void __indirect_glTexCoord4dv(const GLdouble * v) 1586{ 1587 generic_32_byte( X_GLrop_TexCoord4dv, v ); 1588} 1589 1590#define X_GLrop_TexCoord4fv 62 1591void __indirect_glTexCoord4f(GLfloat s, GLfloat t, GLfloat r, GLfloat q) 1592{ 1593 struct glx_context * const gc = __glXGetCurrentContext(); 1594 const GLuint cmdlen = 20; 1595emit_header(gc->pc, X_GLrop_TexCoord4fv, cmdlen); 1596(void) memcpy((void *)(gc->pc + 4), (void *)(&s), 1 * sizeof(GLfloat)); 1597(void) memcpy((void *)(gc->pc + 8), (void *)(&t), 1 * sizeof(GLfloat)); 1598(void) memcpy((void *)(gc->pc + 12), (void *)(&r), 1 * sizeof(GLfloat)); 1599(void) memcpy((void *)(gc->pc + 16), (void *)(&q), 1 * sizeof(GLfloat)); 1600gc->pc += cmdlen; 1601if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); } 1602} 1603 1604#define X_GLrop_TexCoord4fv 62 1605void __indirect_glTexCoord4fv(const GLfloat * v) 1606{ 1607 generic_16_byte( X_GLrop_TexCoord4fv, v ); 1608} 1609 1610#define X_GLrop_TexCoord4iv 63 1611void __indirect_glTexCoord4i(GLint s, GLint t, GLint r, GLint q) 1612{ 1613 struct glx_context * const gc = __glXGetCurrentContext(); 1614 const GLuint cmdlen = 20; 1615emit_header(gc->pc, X_GLrop_TexCoord4iv, cmdlen); 1616(void) memcpy((void *)(gc->pc + 4), (void *)(&s), 1 * sizeof(GLint)); 1617(void) memcpy((void *)(gc->pc + 8), (void *)(&t), 1 * sizeof(GLint)); 1618(void) memcpy((void *)(gc->pc + 12), (void *)(&r), 1 * sizeof(GLint)); 1619(void) memcpy((void *)(gc->pc + 16), (void *)(&q), 1 * sizeof(GLint)); 1620gc->pc += cmdlen; 1621if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); } 1622} 1623 1624#define X_GLrop_TexCoord4iv 63 1625void __indirect_glTexCoord4iv(const GLint * v) 1626{ 1627 generic_16_byte( X_GLrop_TexCoord4iv, v ); 1628} 1629 1630#define X_GLrop_TexCoord4sv 64 1631void __indirect_glTexCoord4s(GLshort s, GLshort t, GLshort r, GLshort q) 1632{ 1633 struct glx_context * const gc = __glXGetCurrentContext(); 1634 const GLuint cmdlen = 12; 1635emit_header(gc->pc, X_GLrop_TexCoord4sv, cmdlen); 1636(void) memcpy((void *)(gc->pc + 4), (void *)(&s), 1 * sizeof(GLshort)); 1637(void) memcpy((void *)(gc->pc + 6), (void *)(&t), 1 * sizeof(GLshort)); 1638(void) memcpy((void *)(gc->pc + 8), (void *)(&r), 1 * sizeof(GLshort)); 1639(void) memcpy((void *)(gc->pc + 10), (void *)(&q), 1 * sizeof(GLshort)); 1640gc->pc += cmdlen; 1641if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); } 1642} 1643 1644#define X_GLrop_TexCoord4sv 64 1645void __indirect_glTexCoord4sv(const GLshort * v) 1646{ 1647 generic_8_byte( X_GLrop_TexCoord4sv, v ); 1648} 1649 1650#define X_GLrop_Vertex2dv 65 1651void __indirect_glVertex2d(GLdouble x, GLdouble y) 1652{ 1653 struct glx_context * const gc = __glXGetCurrentContext(); 1654 const GLuint cmdlen = 20; 1655emit_header(gc->pc, X_GLrop_Vertex2dv, cmdlen); 1656(void) memcpy((void *)(gc->pc + 4), (void *)(&x), 1 * sizeof(GLdouble)); 1657(void) memcpy((void *)(gc->pc + 12), (void *)(&y), 1 * sizeof(GLdouble)); 1658gc->pc += cmdlen; 1659if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); } 1660} 1661 1662#define X_GLrop_Vertex2dv 65 1663void __indirect_glVertex2dv(const GLdouble * v) 1664{ 1665 generic_16_byte( X_GLrop_Vertex2dv, v ); 1666} 1667 1668#define X_GLrop_Vertex2fv 66 1669void __indirect_glVertex2f(GLfloat x, GLfloat y) 1670{ 1671 struct glx_context * const gc = __glXGetCurrentContext(); 1672 const GLuint cmdlen = 12; 1673emit_header(gc->pc, X_GLrop_Vertex2fv, cmdlen); 1674(void) memcpy((void *)(gc->pc + 4), (void *)(&x), 1 * sizeof(GLfloat)); 1675(void) memcpy((void *)(gc->pc + 8), (void *)(&y), 1 * sizeof(GLfloat)); 1676gc->pc += cmdlen; 1677if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); } 1678} 1679 1680#define X_GLrop_Vertex2fv 66 1681void __indirect_glVertex2fv(const GLfloat * v) 1682{ 1683 generic_8_byte( X_GLrop_Vertex2fv, v ); 1684} 1685 1686#define X_GLrop_Vertex2iv 67 1687void __indirect_glVertex2i(GLint x, GLint y) 1688{ 1689 struct glx_context * const gc = __glXGetCurrentContext(); 1690 const GLuint cmdlen = 12; 1691emit_header(gc->pc, X_GLrop_Vertex2iv, cmdlen); 1692(void) memcpy((void *)(gc->pc + 4), (void *)(&x), 1 * sizeof(GLint)); 1693(void) memcpy((void *)(gc->pc + 8), (void *)(&y), 1 * sizeof(GLint)); 1694gc->pc += cmdlen; 1695if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); } 1696} 1697 1698#define X_GLrop_Vertex2iv 67 1699void __indirect_glVertex2iv(const GLint * v) 1700{ 1701 generic_8_byte( X_GLrop_Vertex2iv, v ); 1702} 1703 1704#define X_GLrop_Vertex2sv 68 1705void __indirect_glVertex2s(GLshort x, GLshort y) 1706{ 1707 struct glx_context * const gc = __glXGetCurrentContext(); 1708 const GLuint cmdlen = 8; 1709emit_header(gc->pc, X_GLrop_Vertex2sv, cmdlen); 1710(void) memcpy((void *)(gc->pc + 4), (void *)(&x), 1 * sizeof(GLshort)); 1711(void) memcpy((void *)(gc->pc + 6), (void *)(&y), 1 * sizeof(GLshort)); 1712gc->pc += cmdlen; 1713if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); } 1714} 1715 1716#define X_GLrop_Vertex2sv 68 1717void __indirect_glVertex2sv(const GLshort * v) 1718{ 1719 generic_4_byte( X_GLrop_Vertex2sv, v ); 1720} 1721 1722#define X_GLrop_Vertex3dv 69 1723void __indirect_glVertex3d(GLdouble x, GLdouble y, GLdouble z) 1724{ 1725 struct glx_context * const gc = __glXGetCurrentContext(); 1726 const GLuint cmdlen = 28; 1727emit_header(gc->pc, X_GLrop_Vertex3dv, cmdlen); 1728(void) memcpy((void *)(gc->pc + 4), (void *)(&x), 1 * sizeof(GLdouble)); 1729(void) memcpy((void *)(gc->pc + 12), (void *)(&y), 1 * sizeof(GLdouble)); 1730(void) memcpy((void *)(gc->pc + 20), (void *)(&z), 1 * sizeof(GLdouble)); 1731gc->pc += cmdlen; 1732if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); } 1733} 1734 1735#define X_GLrop_Vertex3dv 69 1736void __indirect_glVertex3dv(const GLdouble * v) 1737{ 1738 generic_24_byte( X_GLrop_Vertex3dv, v ); 1739} 1740 1741#define X_GLrop_Vertex3fv 70 1742void __indirect_glVertex3f(GLfloat x, GLfloat y, GLfloat z) 1743{ 1744 struct glx_context * const gc = __glXGetCurrentContext(); 1745 const GLuint cmdlen = 16; 1746emit_header(gc->pc, X_GLrop_Vertex3fv, cmdlen); 1747(void) memcpy((void *)(gc->pc + 4), (void *)(&x), 1 * sizeof(GLfloat)); 1748(void) memcpy((void *)(gc->pc + 8), (void *)(&y), 1 * sizeof(GLfloat)); 1749(void) memcpy((void *)(gc->pc + 12), (void *)(&z), 1 * sizeof(GLfloat)); 1750gc->pc += cmdlen; 1751if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); } 1752} 1753 1754#define X_GLrop_Vertex3fv 70 1755void __indirect_glVertex3fv(const GLfloat * v) 1756{ 1757 generic_12_byte( X_GLrop_Vertex3fv, v ); 1758} 1759 1760#define X_GLrop_Vertex3iv 71 1761void __indirect_glVertex3i(GLint x, GLint y, GLint z) 1762{ 1763 struct glx_context * const gc = __glXGetCurrentContext(); 1764 const GLuint cmdlen = 16; 1765emit_header(gc->pc, X_GLrop_Vertex3iv, cmdlen); 1766(void) memcpy((void *)(gc->pc + 4), (void *)(&x), 1 * sizeof(GLint)); 1767(void) memcpy((void *)(gc->pc + 8), (void *)(&y), 1 * sizeof(GLint)); 1768(void) memcpy((void *)(gc->pc + 12), (void *)(&z), 1 * sizeof(GLint)); 1769gc->pc += cmdlen; 1770if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); } 1771} 1772 1773#define X_GLrop_Vertex3iv 71 1774void __indirect_glVertex3iv(const GLint * v) 1775{ 1776 generic_12_byte( X_GLrop_Vertex3iv, v ); 1777} 1778 1779#define X_GLrop_Vertex3sv 72 1780void __indirect_glVertex3s(GLshort x, GLshort y, GLshort z) 1781{ 1782 struct glx_context * const gc = __glXGetCurrentContext(); 1783 const GLuint cmdlen = 12; 1784emit_header(gc->pc, X_GLrop_Vertex3sv, cmdlen); 1785(void) memcpy((void *)(gc->pc + 4), (void *)(&x), 1 * sizeof(GLshort)); 1786(void) memcpy((void *)(gc->pc + 6), (void *)(&y), 1 * sizeof(GLshort)); 1787(void) memcpy((void *)(gc->pc + 8), (void *)(&z), 1 * sizeof(GLshort)); 1788gc->pc += cmdlen; 1789if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); } 1790} 1791 1792#define X_GLrop_Vertex3sv 72 1793void __indirect_glVertex3sv(const GLshort * v) 1794{ 1795 generic_6_byte( X_GLrop_Vertex3sv, v ); 1796} 1797 1798#define X_GLrop_Vertex4dv 73 1799void __indirect_glVertex4d(GLdouble x, GLdouble y, GLdouble z, GLdouble w) 1800{ 1801 struct glx_context * const gc = __glXGetCurrentContext(); 1802 const GLuint cmdlen = 36; 1803emit_header(gc->pc, X_GLrop_Vertex4dv, cmdlen); 1804(void) memcpy((void *)(gc->pc + 4), (void *)(&x), 1 * sizeof(GLdouble)); 1805(void) memcpy((void *)(gc->pc + 12), (void *)(&y), 1 * sizeof(GLdouble)); 1806(void) memcpy((void *)(gc->pc + 20), (void *)(&z), 1 * sizeof(GLdouble)); 1807(void) memcpy((void *)(gc->pc + 28), (void *)(&w), 1 * sizeof(GLdouble)); 1808gc->pc += cmdlen; 1809if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); } 1810} 1811 1812#define X_GLrop_Vertex4dv 73 1813void __indirect_glVertex4dv(const GLdouble * v) 1814{ 1815 generic_32_byte( X_GLrop_Vertex4dv, v ); 1816} 1817 1818#define X_GLrop_Vertex4fv 74 1819void __indirect_glVertex4f(GLfloat x, GLfloat y, GLfloat z, GLfloat w) 1820{ 1821 struct glx_context * const gc = __glXGetCurrentContext(); 1822 const GLuint cmdlen = 20; 1823emit_header(gc->pc, X_GLrop_Vertex4fv, cmdlen); 1824(void) memcpy((void *)(gc->pc + 4), (void *)(&x), 1 * sizeof(GLfloat)); 1825(void) memcpy((void *)(gc->pc + 8), (void *)(&y), 1 * sizeof(GLfloat)); 1826(void) memcpy((void *)(gc->pc + 12), (void *)(&z), 1 * sizeof(GLfloat)); 1827(void) memcpy((void *)(gc->pc + 16), (void *)(&w), 1 * sizeof(GLfloat)); 1828gc->pc += cmdlen; 1829if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); } 1830} 1831 1832#define X_GLrop_Vertex4fv 74 1833void __indirect_glVertex4fv(const GLfloat * v) 1834{ 1835 generic_16_byte( X_GLrop_Vertex4fv, v ); 1836} 1837 1838#define X_GLrop_Vertex4iv 75 1839void __indirect_glVertex4i(GLint x, GLint y, GLint z, GLint w) 1840{ 1841 struct glx_context * const gc = __glXGetCurrentContext(); 1842 const GLuint cmdlen = 20; 1843emit_header(gc->pc, X_GLrop_Vertex4iv, cmdlen); 1844(void) memcpy((void *)(gc->pc + 4), (void *)(&x), 1 * sizeof(GLint)); 1845(void) memcpy((void *)(gc->pc + 8), (void *)(&y), 1 * sizeof(GLint)); 1846(void) memcpy((void *)(gc->pc + 12), (void *)(&z), 1 * sizeof(GLint)); 1847(void) memcpy((void *)(gc->pc + 16), (void *)(&w), 1 * sizeof(GLint)); 1848gc->pc += cmdlen; 1849if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); } 1850} 1851 1852#define X_GLrop_Vertex4iv 75 1853void __indirect_glVertex4iv(const GLint * v) 1854{ 1855 generic_16_byte( X_GLrop_Vertex4iv, v ); 1856} 1857 1858#define X_GLrop_Vertex4sv 76 1859void __indirect_glVertex4s(GLshort x, GLshort y, GLshort z, GLshort w) 1860{ 1861 struct glx_context * const gc = __glXGetCurrentContext(); 1862 const GLuint cmdlen = 12; 1863emit_header(gc->pc, X_GLrop_Vertex4sv, cmdlen); 1864(void) memcpy((void *)(gc->pc + 4), (void *)(&x), 1 * sizeof(GLshort)); 1865(void) memcpy((void *)(gc->pc + 6), (void *)(&y), 1 * sizeof(GLshort)); 1866(void) memcpy((void *)(gc->pc + 8), (void *)(&z), 1 * sizeof(GLshort)); 1867(void) memcpy((void *)(gc->pc + 10), (void *)(&w), 1 * sizeof(GLshort)); 1868gc->pc += cmdlen; 1869if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); } 1870} 1871 1872#define X_GLrop_Vertex4sv 76 1873void __indirect_glVertex4sv(const GLshort * v) 1874{ 1875 generic_8_byte( X_GLrop_Vertex4sv, v ); 1876} 1877 1878#define X_GLrop_ClipPlane 77 1879void __indirect_glClipPlane(GLenum plane, const GLdouble * equation) 1880{ 1881 struct glx_context * const gc = __glXGetCurrentContext(); 1882 const GLuint cmdlen = 40; 1883emit_header(gc->pc, X_GLrop_ClipPlane, cmdlen); 1884(void) memcpy((void *)(gc->pc + 4), (void *)(equation), 4 * sizeof(GLdouble)); 1885(void) memcpy((void *)(gc->pc + 36), (void *)(&plane), 1 * sizeof(GLenum)); 1886gc->pc += cmdlen; 1887if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); } 1888} 1889 1890#define X_GLrop_ColorMaterial 78 1891void __indirect_glColorMaterial(GLenum face, GLenum mode) 1892{ 1893 struct glx_context * const gc = __glXGetCurrentContext(); 1894 const GLuint cmdlen = 12; 1895emit_header(gc->pc, X_GLrop_ColorMaterial, cmdlen); 1896(void) memcpy((void *)(gc->pc + 4), (void *)(&face), 1 * sizeof(GLenum)); 1897(void) memcpy((void *)(gc->pc + 8), (void *)(&mode), 1 * sizeof(GLenum)); 1898gc->pc += cmdlen; 1899if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); } 1900} 1901 1902#define X_GLrop_CullFace 79 1903void __indirect_glCullFace(GLenum mode) 1904{ 1905 struct glx_context * const gc = __glXGetCurrentContext(); 1906 const GLuint cmdlen = 8; 1907emit_header(gc->pc, X_GLrop_CullFace, cmdlen); 1908(void) memcpy((void *)(gc->pc + 4), (void *)(&mode), 1 * sizeof(GLenum)); 1909gc->pc += cmdlen; 1910if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); } 1911} 1912 1913#define X_GLrop_Fogf 80 1914void __indirect_glFogf(GLenum pname, GLfloat param) 1915{ 1916 struct glx_context * const gc = __glXGetCurrentContext(); 1917 const GLuint cmdlen = 12; 1918emit_header(gc->pc, X_GLrop_Fogf, cmdlen); 1919(void) memcpy((void *)(gc->pc + 4), (void *)(&pname), 1 * sizeof(GLenum)); 1920(void) memcpy((void *)(gc->pc + 8), (void *)(¶m), 1 * sizeof(GLfloat)); 1921gc->pc += cmdlen; 1922if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); } 1923} 1924 1925#define X_GLrop_Fogfv 81 1926void __indirect_glFogfv(GLenum pname, const GLfloat * params) 1927{ 1928 struct glx_context * const gc = __glXGetCurrentContext(); 1929 const GLuint compsize = __glFogfv_size(pname); 1930 const GLuint cmdlen = 8 + safe_pad(safe_mul(compsize, 1 * sizeof(GLfloat))); 1931 if (0 + safe_pad(safe_mul(compsize, 1 * sizeof(GLfloat))) < 0) { 1932 __glXSetError(gc, GL_INVALID_VALUE); 1933 return; 1934 } 1935emit_header(gc->pc, X_GLrop_Fogfv, cmdlen); 1936(void) memcpy((void *)(gc->pc + 4), (void *)(&pname), 1 * sizeof(GLenum)); 1937(void) memcpy((void *)(gc->pc + 8), (void *)(params), safe_mul(compsize, 1 * sizeof(GLfloat))); 1938gc->pc += cmdlen; 1939if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); } 1940} 1941 1942#define X_GLrop_Fogi 82 1943void __indirect_glFogi(GLenum pname, GLint param) 1944{ 1945 struct glx_context * const gc = __glXGetCurrentContext(); 1946 const GLuint cmdlen = 12; 1947emit_header(gc->pc, X_GLrop_Fogi, cmdlen); 1948(void) memcpy((void *)(gc->pc + 4), (void *)(&pname), 1 * sizeof(GLenum)); 1949(void) memcpy((void *)(gc->pc + 8), (void *)(¶m), 1 * sizeof(GLint)); 1950gc->pc += cmdlen; 1951if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); } 1952} 1953 1954#define X_GLrop_Fogiv 83 1955void __indirect_glFogiv(GLenum pname, const GLint * params) 1956{ 1957 struct glx_context * const gc = __glXGetCurrentContext(); 1958 const GLuint compsize = __glFogiv_size(pname); 1959 const GLuint cmdlen = 8 + safe_pad(safe_mul(compsize, 1 * sizeof(GLint))); 1960 if (0 + safe_pad(safe_mul(compsize, 1 * sizeof(GLint))) < 0) { 1961 __glXSetError(gc, GL_INVALID_VALUE); 1962 return; 1963 } 1964emit_header(gc->pc, X_GLrop_Fogiv, cmdlen); 1965(void) memcpy((void *)(gc->pc + 4), (void *)(&pname), 1 * sizeof(GLenum)); 1966(void) memcpy((void *)(gc->pc + 8), (void *)(params), safe_mul(compsize, 1 * sizeof(GLint))); 1967gc->pc += cmdlen; 1968if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); } 1969} 1970 1971#define X_GLrop_FrontFace 84 1972void __indirect_glFrontFace(GLenum mode) 1973{ 1974 struct glx_context * const gc = __glXGetCurrentContext(); 1975 const GLuint cmdlen = 8; 1976emit_header(gc->pc, X_GLrop_FrontFace, cmdlen); 1977(void) memcpy((void *)(gc->pc + 4), (void *)(&mode), 1 * sizeof(GLenum)); 1978gc->pc += cmdlen; 1979if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); } 1980} 1981 1982#define X_GLrop_Hint 85 1983void __indirect_glHint(GLenum target, GLenum mode) 1984{ 1985 struct glx_context * const gc = __glXGetCurrentContext(); 1986 const GLuint cmdlen = 12; 1987emit_header(gc->pc, X_GLrop_Hint, cmdlen); 1988(void) memcpy((void *)(gc->pc + 4), (void *)(&target), 1 * sizeof(GLenum)); 1989(void) memcpy((void *)(gc->pc + 8), (void *)(&mode), 1 * sizeof(GLenum)); 1990gc->pc += cmdlen; 1991if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); } 1992} 1993 1994#define X_GLrop_Lightf 86 1995void __indirect_glLightf(GLenum light, GLenum pname, GLfloat param) 1996{ 1997 struct glx_context * const gc = __glXGetCurrentContext(); 1998 const GLuint cmdlen = 16; 1999emit_header(gc->pc, X_GLrop_Lightf, cmdlen); 2000(void) memcpy((void *)(gc->pc + 4), (void *)(&light), 1 * sizeof(GLenum)); 2001(void) memcpy((void *)(gc->pc + 8), (void *)(&pname), 1 * sizeof(GLenum)); 2002(void) memcpy((void *)(gc->pc + 12), (void *)(¶m), 1 * sizeof(GLfloat)); 2003gc->pc += cmdlen; 2004if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); } 2005} 2006 2007#define X_GLrop_Lightfv 87 2008void __indirect_glLightfv(GLenum light, GLenum pname, const GLfloat * params) 2009{ 2010 struct glx_context * const gc = __glXGetCurrentContext(); 2011 const GLuint compsize = __glLightfv_size(pname); 2012 const GLuint cmdlen = 12 + safe_pad(safe_mul(compsize, 1 * sizeof(GLfloat))); 2013 if (0 + safe_pad(safe_mul(compsize, 1 * sizeof(GLfloat))) < 0) { 2014 __glXSetError(gc, GL_INVALID_VALUE); 2015 return; 2016 } 2017emit_header(gc->pc, X_GLrop_Lightfv, cmdlen); 2018(void) memcpy((void *)(gc->pc + 4), (void *)(&light), 1 * sizeof(GLenum)); 2019(void) memcpy((void *)(gc->pc + 8), (void *)(&pname), 1 * sizeof(GLenum)); 2020(void) memcpy((void *)(gc->pc + 12), (void *)(params), safe_mul(compsize, 1 * sizeof(GLfloat))); 2021gc->pc += cmdlen; 2022if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); } 2023} 2024 2025#define X_GLrop_Lighti 88 2026void __indirect_glLighti(GLenum light, GLenum pname, GLint param) 2027{ 2028 struct glx_context * const gc = __glXGetCurrentContext(); 2029 const GLuint cmdlen = 16; 2030emit_header(gc->pc, X_GLrop_Lighti, cmdlen); 2031(void) memcpy((void *)(gc->pc + 4), (void *)(&light), 1 * sizeof(GLenum)); 2032(void) memcpy((void *)(gc->pc + 8), (void *)(&pname), 1 * sizeof(GLenum)); 2033(void) memcpy((void *)(gc->pc + 12), (void *)(¶m), 1 * sizeof(GLint)); 2034gc->pc += cmdlen; 2035if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); } 2036} 2037 2038#define X_GLrop_Lightiv 89 2039void __indirect_glLightiv(GLenum light, GLenum pname, const GLint * params) 2040{ 2041 struct glx_context * const gc = __glXGetCurrentContext(); 2042 const GLuint compsize = __glLightiv_size(pname); 2043 const GLuint cmdlen = 12 + safe_pad(safe_mul(compsize, 1 * sizeof(GLint))); 2044 if (0 + safe_pad(safe_mul(compsize, 1 * sizeof(GLint))) < 0) { 2045 __glXSetError(gc, GL_INVALID_VALUE); 2046 return; 2047 } 2048emit_header(gc->pc, X_GLrop_Lightiv, cmdlen); 2049(void) memcpy((void *)(gc->pc + 4), (void *)(&light), 1 * sizeof(GLenum)); 2050(void) memcpy((void *)(gc->pc + 8), (void *)(&pname), 1 * sizeof(GLenum)); 2051(void) memcpy((void *)(gc->pc + 12), (void *)(params), safe_mul(compsize, 1 * sizeof(GLint))); 2052gc->pc += cmdlen; 2053if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); } 2054} 2055 2056#define X_GLrop_LightModelf 90 2057void __indirect_glLightModelf(GLenum pname, GLfloat param) 2058{ 2059 struct glx_context * const gc = __glXGetCurrentContext(); 2060 const GLuint cmdlen = 12; 2061emit_header(gc->pc, X_GLrop_LightModelf, cmdlen); 2062(void) memcpy((void *)(gc->pc + 4), (void *)(&pname), 1 * sizeof(GLenum)); 2063(void) memcpy((void *)(gc->pc + 8), (void *)(¶m), 1 * sizeof(GLfloat)); 2064gc->pc += cmdlen; 2065if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); } 2066} 2067 2068#define X_GLrop_LightModelfv 91 2069void __indirect_glLightModelfv(GLenum pname, const GLfloat * params) 2070{ 2071 struct glx_context * const gc = __glXGetCurrentContext(); 2072 const GLuint compsize = __glLightModelfv_size(pname); 2073 const GLuint cmdlen = 8 + safe_pad(safe_mul(compsize, 1 * sizeof(GLfloat))); 2074 if (0 + safe_pad(safe_mul(compsize, 1 * sizeof(GLfloat))) < 0) { 2075 __glXSetError(gc, GL_INVALID_VALUE); 2076 return; 2077 } 2078emit_header(gc->pc, X_GLrop_LightModelfv, cmdlen); 2079(void) memcpy((void *)(gc->pc + 4), (void *)(&pname), 1 * sizeof(GLenum)); 2080(void) memcpy((void *)(gc->pc + 8), (void *)(params), safe_mul(compsize, 1 * sizeof(GLfloat))); 2081gc->pc += cmdlen; 2082if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); } 2083} 2084 2085#define X_GLrop_LightModeli 92 2086void __indirect_glLightModeli(GLenum pname, GLint param) 2087{ 2088 struct glx_context * const gc = __glXGetCurrentContext(); 2089 const GLuint cmdlen = 12; 2090emit_header(gc->pc, X_GLrop_LightModeli, cmdlen); 2091(void) memcpy((void *)(gc->pc + 4), (void *)(&pname), 1 * sizeof(GLenum)); 2092(void) memcpy((void *)(gc->pc + 8), (void *)(¶m), 1 * sizeof(GLint)); 2093gc->pc += cmdlen; 2094if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); } 2095} 2096 2097#define X_GLrop_LightModeliv 93 2098void __indirect_glLightModeliv(GLenum pname, const GLint * params) 2099{ 2100 struct glx_context * const gc = __glXGetCurrentContext(); 2101 const GLuint compsize = __glLightModeliv_size(pname); 2102 const GLuint cmdlen = 8 + safe_pad(safe_mul(compsize, 1 * sizeof(GLint))); 2103 if (0 + safe_pad(safe_mul(compsize, 1 * sizeof(GLint))) < 0) { 2104 __glXSetError(gc, GL_INVALID_VALUE); 2105 return; 2106 } 2107emit_header(gc->pc, X_GLrop_LightModeliv, cmdlen); 2108(void) memcpy((void *)(gc->pc + 4), (void *)(&pname), 1 * sizeof(GLenum)); 2109(void) memcpy((void *)(gc->pc + 8), (void *)(params), safe_mul(compsize, 1 * sizeof(GLint))); 2110gc->pc += cmdlen; 2111if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); } 2112} 2113 2114#define X_GLrop_LineStipple 94 2115void __indirect_glLineStipple(GLint factor, GLushort pattern) 2116{ 2117 struct glx_context * const gc = __glXGetCurrentContext(); 2118 const GLuint cmdlen = 12; 2119emit_header(gc->pc, X_GLrop_LineStipple, cmdlen); 2120(void) memcpy((void *)(gc->pc + 4), (void *)(&factor), 1 * sizeof(GLint)); 2121(void) memcpy((void *)(gc->pc + 8), (void *)(&pattern), 1 * sizeof(GLushort)); 2122gc->pc += cmdlen; 2123if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); } 2124} 2125 2126#define X_GLrop_LineWidth 95 2127void __indirect_glLineWidth(GLfloat width) 2128{ 2129 struct glx_context * const gc = __glXGetCurrentContext(); 2130 const GLuint cmdlen = 8; 2131emit_header(gc->pc, X_GLrop_LineWidth, cmdlen); 2132(void) memcpy((void *)(gc->pc + 4), (void *)(&width), 1 * sizeof(GLfloat)); 2133gc->pc += cmdlen; 2134if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); } 2135} 2136 2137#define X_GLrop_Materialf 96 2138void __indirect_glMaterialf(GLenum face, GLenum pname, GLfloat param) 2139{ 2140 struct glx_context * const gc = __glXGetCurrentContext(); 2141 const GLuint cmdlen = 16; 2142emit_header(gc->pc, X_GLrop_Materialf, cmdlen); 2143(void) memcpy((void *)(gc->pc + 4), (void *)(&face), 1 * sizeof(GLenum)); 2144(void) memcpy((void *)(gc->pc + 8), (void *)(&pname), 1 * sizeof(GLenum)); 2145(void) memcpy((void *)(gc->pc + 12), (void *)(¶m), 1 * sizeof(GLfloat)); 2146gc->pc += cmdlen; 2147if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); } 2148} 2149 2150#define X_GLrop_Materialfv 97 2151void __indirect_glMaterialfv(GLenum face, GLenum pname, const GLfloat * params) 2152{ 2153 struct glx_context * const gc = __glXGetCurrentContext(); 2154 const GLuint compsize = __glMaterialfv_size(pname); 2155 const GLuint cmdlen = 12 + safe_pad(safe_mul(compsize, 1 * sizeof(GLfloat))); 2156 if (0 + safe_pad(safe_mul(compsize, 1 * sizeof(GLfloat))) < 0) { 2157 __glXSetError(gc, GL_INVALID_VALUE); 2158 return; 2159 } 2160emit_header(gc->pc, X_GLrop_Materialfv, cmdlen); 2161(void) memcpy((void *)(gc->pc + 4), (void *)(&face), 1 * sizeof(GLenum)); 2162(void) memcpy((void *)(gc->pc + 8), (void *)(&pname), 1 * sizeof(GLenum)); 2163(void) memcpy((void *)(gc->pc + 12), (void *)(params), safe_mul(compsize, 1 * sizeof(GLfloat))); 2164gc->pc += cmdlen; 2165if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); } 2166} 2167 2168#define X_GLrop_Materiali 98 2169void __indirect_glMateriali(GLenum face, GLenum pname, GLint param) 2170{ 2171 struct glx_context * const gc = __glXGetCurrentContext(); 2172 const GLuint cmdlen = 16; 2173emit_header(gc->pc, X_GLrop_Materiali, cmdlen); 2174(void) memcpy((void *)(gc->pc + 4), (void *)(&face), 1 * sizeof(GLenum)); 2175(void) memcpy((void *)(gc->pc + 8), (void *)(&pname), 1 * sizeof(GLenum)); 2176(void) memcpy((void *)(gc->pc + 12), (void *)(¶m), 1 * sizeof(GLint)); 2177gc->pc += cmdlen; 2178if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); } 2179} 2180 2181#define X_GLrop_Materialiv 99 2182void __indirect_glMaterialiv(GLenum face, GLenum pname, const GLint * params) 2183{ 2184 struct glx_context * const gc = __glXGetCurrentContext(); 2185 const GLuint compsize = __glMaterialiv_size(pname); 2186 const GLuint cmdlen = 12 + safe_pad(safe_mul(compsize, 1 * sizeof(GLint))); 2187 if (0 + safe_pad(safe_mul(compsize, 1 * sizeof(GLint))) < 0) { 2188 __glXSetError(gc, GL_INVALID_VALUE); 2189 return; 2190 } 2191emit_header(gc->pc, X_GLrop_Materialiv, cmdlen); 2192(void) memcpy((void *)(gc->pc + 4), (void *)(&face), 1 * sizeof(GLenum)); 2193(void) memcpy((void *)(gc->pc + 8), (void *)(&pname), 1 * sizeof(GLenum)); 2194(void) memcpy((void *)(gc->pc + 12), (void *)(params), safe_mul(compsize, 1 * sizeof(GLint))); 2195gc->pc += cmdlen; 2196if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); } 2197} 2198 2199#define X_GLrop_PointSize 100 2200void __indirect_glPointSize(GLfloat size) 2201{ 2202 struct glx_context * const gc = __glXGetCurrentContext(); 2203 const GLuint cmdlen = 8; 2204emit_header(gc->pc, X_GLrop_PointSize, cmdlen); 2205(void) memcpy((void *)(gc->pc + 4), (void *)(&size), 1 * sizeof(GLfloat)); 2206gc->pc += cmdlen; 2207if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); } 2208} 2209 2210#define X_GLrop_PolygonMode 101 2211void __indirect_glPolygonMode(GLenum face, GLenum mode) 2212{ 2213 struct glx_context * const gc = __glXGetCurrentContext(); 2214 const GLuint cmdlen = 12; 2215emit_header(gc->pc, X_GLrop_PolygonMode, cmdlen); 2216(void) memcpy((void *)(gc->pc + 4), (void *)(&face), 1 * sizeof(GLenum)); 2217(void) memcpy((void *)(gc->pc + 8), (void *)(&mode), 1 * sizeof(GLenum)); 2218gc->pc += cmdlen; 2219if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); } 2220} 2221 2222#define X_GLrop_PolygonStipple 102 2223void __indirect_glPolygonStipple(const GLubyte * mask) 2224{ 2225 struct glx_context * const gc = __glXGetCurrentContext(); 2226 const GLuint compsize = (mask != NULL) ? __glImageSize(32, 32, 1, GL_COLOR_INDEX, GL_BITMAP, 0) : 0; 2227 const GLuint cmdlen = 24 + safe_pad(compsize); 2228 if (0 + safe_pad(compsize) < 0) { 2229 __glXSetError(gc, GL_INVALID_VALUE); 2230 return; 2231 } 2232emit_header(gc->pc, X_GLrop_PolygonStipple, cmdlen); 2233if (compsize > 0) { 2234 __glFillImage(gc, 2, 32, 32, 1, GL_COLOR_INDEX, GL_BITMAP, mask, gc->pc + 24, gc->pc + 4); 2235} else { 2236 (void) memcpy( gc->pc + 4, default_pixel_store_2D, default_pixel_store_2D_size ); 2237} 2238gc->pc += cmdlen; 2239if (gc->pc > gc->limit) { (void) __glXFlushRenderBuffer(gc, gc->pc); } 2240} 2241 2242#define X_GLrop_Scissor 103 2243void __indirect_glScissor(GLint x, GLint y, GLsizei width, GLsizei height) 2244{ 2245 struct glx_context * const gc = __glXGetCurrentContext(); 2246 const GLuint cmdlen = 20; 2247emit_header(gc->pc, X_GLrop_Scissor, cmdlen); 2248(void) memcpy((void *)(gc->pc + 4), (void *)(&x), 1 * sizeof(GLint)); 2249(void) memcpy((void *)(gc->pc + 8), (void *)(&y), 1 * sizeof(GLint)); 2250(void) memcpy((void *)(gc->pc + 12), (void *)(&width), 1 * sizeof(GLsizei)); 2251(void) memcpy((void *)(gc->pc + 16), (void *)(&height), 1 * sizeof(GLsizei)); 2252gc->pc += cmdlen; 2253if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); } 2254} 2255 2256#define X_GLrop_ShadeModel 104 2257void __indirect_glShadeModel(GLenum mode) 2258{ 2259 struct glx_context * const gc = __glXGetCurrentContext(); 2260 const GLuint cmdlen = 8; 2261emit_header(gc->pc, X_GLrop_ShadeModel, cmdlen); 2262(void) memcpy((void *)(gc->pc + 4), (void *)(&mode), 1 * sizeof(GLenum)); 2263gc->pc += cmdlen; 2264if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); } 2265} 2266 2267#define X_GLrop_TexParameterf 105 2268void __indirect_glTexParameterf(GLenum target, GLenum pname, GLfloat param) 2269{ 2270 struct glx_context * const gc = __glXGetCurrentContext(); 2271 const GLuint cmdlen = 16; 2272emit_header(gc->pc, X_GLrop_TexParameterf, cmdlen); 2273(void) memcpy((void *)(gc->pc + 4), (void *)(&target), 1 * sizeof(GLenum)); 2274(void) memcpy((void *)(gc->pc + 8), (void *)(&pname), 1 * sizeof(GLenum)); 2275(void) memcpy((void *)(gc->pc + 12), (void *)(¶m), 1 * sizeof(GLfloat)); 2276gc->pc += cmdlen; 2277if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); } 2278} 2279 2280#define X_GLrop_TexParameterfv 106 2281void __indirect_glTexParameterfv(GLenum target, GLenum pname, const GLfloat * params) 2282{ 2283 struct glx_context * const gc = __glXGetCurrentContext(); 2284 const GLuint compsize = __glTexParameterfv_size(pname); 2285 const GLuint cmdlen = 12 + safe_pad(safe_mul(compsize, 1 * sizeof(GLfloat))); 2286 if (0 + safe_pad(safe_mul(compsize, 1 * sizeof(GLfloat))) < 0) { 2287 __glXSetError(gc, GL_INVALID_VALUE); 2288 return; 2289 } 2290emit_header(gc->pc, X_GLrop_TexParameterfv, cmdlen); 2291(void) memcpy((void *)(gc->pc + 4), (void *)(&target), 1 * sizeof(GLenum)); 2292(void) memcpy((void *)(gc->pc + 8), (void *)(&pname), 1 * sizeof(GLenum)); 2293(void) memcpy((void *)(gc->pc + 12), (void *)(params), safe_mul(compsize, 1 * sizeof(GLfloat))); 2294gc->pc += cmdlen; 2295if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); } 2296} 2297 2298#define X_GLrop_TexParameteri 107 2299void __indirect_glTexParameteri(GLenum target, GLenum pname, GLint param) 2300{ 2301 struct glx_context * const gc = __glXGetCurrentContext(); 2302 const GLuint cmdlen = 16; 2303emit_header(gc->pc, X_GLrop_TexParameteri, cmdlen); 2304(void) memcpy((void *)(gc->pc + 4), (void *)(&target), 1 * sizeof(GLenum)); 2305(void) memcpy((void *)(gc->pc + 8), (void *)(&pname), 1 * sizeof(GLenum)); 2306(void) memcpy((void *)(gc->pc + 12), (void *)(¶m), 1 * sizeof(GLint)); 2307gc->pc += cmdlen; 2308if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); } 2309} 2310 2311#define X_GLrop_TexParameteriv 108 2312void __indirect_glTexParameteriv(GLenum target, GLenum pname, const GLint * params) 2313{ 2314 struct glx_context * const gc = __glXGetCurrentContext(); 2315 const GLuint compsize = __glTexParameteriv_size(pname); 2316 const GLuint cmdlen = 12 + safe_pad(safe_mul(compsize, 1 * sizeof(GLint))); 2317 if (0 + safe_pad(safe_mul(compsize, 1 * sizeof(GLint))) < 0) { 2318 __glXSetError(gc, GL_INVALID_VALUE); 2319 return; 2320 } 2321emit_header(gc->pc, X_GLrop_TexParameteriv, cmdlen); 2322(void) memcpy((void *)(gc->pc + 4), (void *)(&target), 1 * sizeof(GLenum)); 2323(void) memcpy((void *)(gc->pc + 8), (void *)(&pname), 1 * sizeof(GLenum)); 2324(void) memcpy((void *)(gc->pc + 12), (void *)(params), safe_mul(compsize, 1 * sizeof(GLint))); 2325gc->pc += cmdlen; 2326if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); } 2327} 2328 2329static void 2330__glx_TexImage_1D2D( unsigned opcode, unsigned dim, GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLint border, GLenum format, GLenum type, const GLvoid * pixels ) 2331{ 2332 struct glx_context * const gc = __glXGetCurrentContext(); 2333 const GLuint compsize = __glImageSize(width, height, 1, format, type, target); 2334 const GLuint cmdlen = 56 + safe_pad(compsize); 2335 if (0 + safe_pad(compsize) < 0) { 2336 __glXSetError(gc, GL_INVALID_VALUE); 2337 return; 2338 } 2339 if (__builtin_expect(gc->currentDpy != NULL, 1)) { 2340if (cmdlen <= gc->maxSmallRenderCommandSize) { 2341 if ( (gc->pc + cmdlen) > gc->bufEnd ) { 2342 (void) __glXFlushRenderBuffer(gc, gc->pc); 2343 } 2344emit_header(gc->pc, opcode, cmdlen); 2345(void) memcpy((void *)(gc->pc + 24), (void *)(&target), 1 * sizeof(GLenum)); 2346(void) memcpy((void *)(gc->pc + 28), (void *)(&level), 1 * sizeof(GLint)); 2347(void) memcpy((void *)(gc->pc + 32), (void *)(&internalformat), 1 * sizeof(GLint)); 2348(void) memcpy((void *)(gc->pc + 36), (void *)(&width), 1 * sizeof(GLsizei)); 2349(void) memcpy((void *)(gc->pc + 40), (void *)(&height), 1 * sizeof(GLsizei)); 2350(void) memcpy((void *)(gc->pc + 44), (void *)(&border), 1 * sizeof(GLint)); 2351(void) memcpy((void *)(gc->pc + 48), (void *)(&format), 1 * sizeof(GLenum)); 2352(void) memcpy((void *)(gc->pc + 52), (void *)(&type), 1 * sizeof(GLenum)); 2353if ((compsize > 0) && (pixels != NULL)) { 2354 __glFillImage(gc, dim, width, height, 1, format, type, pixels, gc->pc + 56, gc->pc + 4); 2355} else { 2356 (void) memcpy( gc->pc + 4, default_pixel_store_2D, default_pixel_store_2D_size ); 2357} 2358gc->pc += cmdlen; 2359if (gc->pc > gc->limit) { (void) __glXFlushRenderBuffer(gc, gc->pc); } 2360} 2361else { 2362const GLint op = opcode; 2363const GLuint cmdlenLarge = cmdlen + 4; 2364GLubyte * const pc = __glXFlushRenderBuffer(gc, gc->pc); 2365(void) memcpy((void *)(pc + 0), (void *)(&cmdlenLarge), 4); 2366(void) memcpy((void *)(pc + 4), (void *)(&op), 4); 2367(void) memcpy((void *)(pc + 28), (void *)(&target), 1 * sizeof(GLenum)); 2368(void) memcpy((void *)(pc + 32), (void *)(&level), 1 * sizeof(GLint)); 2369(void) memcpy((void *)(pc + 36), (void *)(&internalformat), 1 * sizeof(GLint)); 2370(void) memcpy((void *)(pc + 40), (void *)(&width), 1 * sizeof(GLsizei)); 2371(void) memcpy((void *)(pc + 44), (void *)(&height), 1 * sizeof(GLsizei)); 2372(void) memcpy((void *)(pc + 48), (void *)(&border), 1 * sizeof(GLint)); 2373(void) memcpy((void *)(pc + 52), (void *)(&format), 1 * sizeof(GLenum)); 2374(void) memcpy((void *)(pc + 56), (void *)(&type), 1 * sizeof(GLenum)); 2375__glXSendLargeImage(gc, compsize, dim, width, height, 1, format, type, pixels, pc + 60, pc + 8); 2376} 2377 } 2378} 2379 2380#define X_GLrop_TexImage1D 109 2381void __indirect_glTexImage1D(GLenum target, GLint level, GLint internalformat, GLsizei width, GLint border, GLenum format, GLenum type, const GLvoid * pixels) 2382{ 2383 __glx_TexImage_1D2D(X_GLrop_TexImage1D, 1, target, level, internalformat, width, 1, border, format, type, pixels ); 2384} 2385 2386#define X_GLrop_TexImage2D 110 2387void __indirect_glTexImage2D(GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLint border, GLenum format, GLenum type, const GLvoid * pixels) 2388{ 2389 __glx_TexImage_1D2D(X_GLrop_TexImage2D, 2, target, level, internalformat, width, height, border, format, type, pixels ); 2390} 2391 2392#define X_GLrop_TexEnvf 111 2393void __indirect_glTexEnvf(GLenum target, GLenum pname, GLfloat param) 2394{ 2395 struct glx_context * const gc = __glXGetCurrentContext(); 2396 const GLuint cmdlen = 16; 2397emit_header(gc->pc, X_GLrop_TexEnvf, cmdlen); 2398(void) memcpy((void *)(gc->pc + 4), (void *)(&target), 1 * sizeof(GLenum)); 2399(void) memcpy((void *)(gc->pc + 8), (void *)(&pname), 1 * sizeof(GLenum)); 2400(void) memcpy((void *)(gc->pc + 12), (void *)(¶m), 1 * sizeof(GLfloat)); 2401gc->pc += cmdlen; 2402if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); } 2403} 2404 2405#define X_GLrop_TexEnvfv 112 2406void __indirect_glTexEnvfv(GLenum target, GLenum pname, const GLfloat * params) 2407{ 2408 struct glx_context * const gc = __glXGetCurrentContext(); 2409 const GLuint compsize = __glTexEnvfv_size(pname); 2410 const GLuint cmdlen = 12 + safe_pad(safe_mul(compsize, 1 * sizeof(GLfloat))); 2411 if (0 + safe_pad(safe_mul(compsize, 1 * sizeof(GLfloat))) < 0) { 2412 __glXSetError(gc, GL_INVALID_VALUE); 2413 return; 2414 } 2415emit_header(gc->pc, X_GLrop_TexEnvfv, cmdlen); 2416(void) memcpy((void *)(gc->pc + 4), (void *)(&target), 1 * sizeof(GLenum)); 2417(void) memcpy((void *)(gc->pc + 8), (void *)(&pname), 1 * sizeof(GLenum)); 2418(void) memcpy((void *)(gc->pc + 12), (void *)(params), safe_mul(compsize, 1 * sizeof(GLfloat))); 2419gc->pc += cmdlen; 2420if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); } 2421} 2422 2423#define X_GLrop_TexEnvi 113 2424void __indirect_glTexEnvi(GLenum target, GLenum pname, GLint param) 2425{ 2426 struct glx_context * const gc = __glXGetCurrentContext(); 2427 const GLuint cmdlen = 16; 2428emit_header(gc->pc, X_GLrop_TexEnvi, cmdlen); 2429(void) memcpy((void *)(gc->pc + 4), (void *)(&target), 1 * sizeof(GLenum)); 2430(void) memcpy((void *)(gc->pc + 8), (void *)(&pname), 1 * sizeof(GLenum)); 2431(void) memcpy((void *)(gc->pc + 12), (void *)(¶m), 1 * sizeof(GLint)); 2432gc->pc += cmdlen; 2433if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); } 2434} 2435 2436#define X_GLrop_TexEnviv 114 2437void __indirect_glTexEnviv(GLenum target, GLenum pname, const GLint * params) 2438{ 2439 struct glx_context * const gc = __glXGetCurrentContext(); 2440 const GLuint compsize = __glTexEnviv_size(pname); 2441 const GLuint cmdlen = 12 + safe_pad(safe_mul(compsize, 1 * sizeof(GLint))); 2442 if (0 + safe_pad(safe_mul(compsize, 1 * sizeof(GLint))) < 0) { 2443 __glXSetError(gc, GL_INVALID_VALUE); 2444 return; 2445 } 2446emit_header(gc->pc, X_GLrop_TexEnviv, cmdlen); 2447(void) memcpy((void *)(gc->pc + 4), (void *)(&target), 1 * sizeof(GLenum)); 2448(void) memcpy((void *)(gc->pc + 8), (void *)(&pname), 1 * sizeof(GLenum)); 2449(void) memcpy((void *)(gc->pc + 12), (void *)(params), safe_mul(compsize, 1 * sizeof(GLint))); 2450gc->pc += cmdlen; 2451if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); } 2452} 2453 2454#define X_GLrop_TexGend 115 2455void __indirect_glTexGend(GLenum coord, GLenum pname, GLdouble param) 2456{ 2457 struct glx_context * const gc = __glXGetCurrentContext(); 2458 const GLuint cmdlen = 20; 2459emit_header(gc->pc, X_GLrop_TexGend, cmdlen); 2460(void) memcpy((void *)(gc->pc + 4), (void *)(¶m), 1 * sizeof(GLdouble)); 2461(void) memcpy((void *)(gc->pc + 12), (void *)(&coord), 1 * sizeof(GLenum)); 2462(void) memcpy((void *)(gc->pc + 16), (void *)(&pname), 1 * sizeof(GLenum)); 2463gc->pc += cmdlen; 2464if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); } 2465} 2466 2467#define X_GLrop_TexGendv 116 2468void __indirect_glTexGendv(GLenum coord, GLenum pname, const GLdouble * params) 2469{ 2470 struct glx_context * const gc = __glXGetCurrentContext(); 2471 const GLuint compsize = __glTexGendv_size(pname); 2472 const GLuint cmdlen = 12 + safe_pad(safe_mul(compsize, 1 * sizeof(GLdouble))); 2473 if (0 + safe_pad(safe_mul(compsize, 1 * sizeof(GLdouble))) < 0) { 2474 __glXSetError(gc, GL_INVALID_VALUE); 2475 return; 2476 } 2477emit_header(gc->pc, X_GLrop_TexGendv, cmdlen); 2478(void) memcpy((void *)(gc->pc + 4), (void *)(&coord), 1 * sizeof(GLenum)); 2479(void) memcpy((void *)(gc->pc + 8), (void *)(&pname), 1 * sizeof(GLenum)); 2480(void) memcpy((void *)(gc->pc + 12), (void *)(params), safe_mul(compsize, 1 * sizeof(GLdouble))); 2481gc->pc += cmdlen; 2482if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); } 2483} 2484 2485#define X_GLrop_TexGenf 117 2486void __indirect_glTexGenf(GLenum coord, GLenum pname, GLfloat param) 2487{ 2488 struct glx_context * const gc = __glXGetCurrentContext(); 2489 const GLuint cmdlen = 16; 2490emit_header(gc->pc, X_GLrop_TexGenf, cmdlen); 2491(void) memcpy((void *)(gc->pc + 4), (void *)(&coord), 1 * sizeof(GLenum)); 2492(void) memcpy((void *)(gc->pc + 8), (void *)(&pname), 1 * sizeof(GLenum)); 2493(void) memcpy((void *)(gc->pc + 12), (void *)(¶m), 1 * sizeof(GLfloat)); 2494gc->pc += cmdlen; 2495if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); } 2496} 2497 2498#define X_GLrop_TexGenfv 118 2499void __indirect_glTexGenfv(GLenum coord, GLenum pname, const GLfloat * params) 2500{ 2501 struct glx_context * const gc = __glXGetCurrentContext(); 2502 const GLuint compsize = __glTexGenfv_size(pname); 2503 const GLuint cmdlen = 12 + safe_pad(safe_mul(compsize, 1 * sizeof(GLfloat))); 2504 if (0 + safe_pad(safe_mul(compsize, 1 * sizeof(GLfloat))) < 0) { 2505 __glXSetError(gc, GL_INVALID_VALUE); 2506 return; 2507 } 2508emit_header(gc->pc, X_GLrop_TexGenfv, cmdlen); 2509(void) memcpy((void *)(gc->pc + 4), (void *)(&coord), 1 * sizeof(GLenum)); 2510(void) memcpy((void *)(gc->pc + 8), (void *)(&pname), 1 * sizeof(GLenum)); 2511(void) memcpy((void *)(gc->pc + 12), (void *)(params), safe_mul(compsize, 1 * sizeof(GLfloat))); 2512gc->pc += cmdlen; 2513if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); } 2514} 2515 2516#define X_GLrop_TexGeni 119 2517void __indirect_glTexGeni(GLenum coord, GLenum pname, GLint param) 2518{ 2519 struct glx_context * const gc = __glXGetCurrentContext(); 2520 const GLuint cmdlen = 16; 2521emit_header(gc->pc, X_GLrop_TexGeni, cmdlen); 2522(void) memcpy((void *)(gc->pc + 4), (void *)(&coord), 1 * sizeof(GLenum)); 2523(void) memcpy((void *)(gc->pc + 8), (void *)(&pname), 1 * sizeof(GLenum)); 2524(void) memcpy((void *)(gc->pc + 12), (void *)(¶m), 1 * sizeof(GLint)); 2525gc->pc += cmdlen; 2526if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); } 2527} 2528 2529#define X_GLrop_TexGeniv 120 2530void __indirect_glTexGeniv(GLenum coord, GLenum pname, const GLint * params) 2531{ 2532 struct glx_context * const gc = __glXGetCurrentContext(); 2533 const GLuint compsize = __glTexGeniv_size(pname); 2534 const GLuint cmdlen = 12 + safe_pad(safe_mul(compsize, 1 * sizeof(GLint))); 2535 if (0 + safe_pad(safe_mul(compsize, 1 * sizeof(GLint))) < 0) { 2536 __glXSetError(gc, GL_INVALID_VALUE); 2537 return; 2538 } 2539emit_header(gc->pc, X_GLrop_TexGeniv, cmdlen); 2540(void) memcpy((void *)(gc->pc + 4), (void *)(&coord), 1 * sizeof(GLenum)); 2541(void) memcpy((void *)(gc->pc + 8), (void *)(&pname), 1 * sizeof(GLenum)); 2542(void) memcpy((void *)(gc->pc + 12), (void *)(params), safe_mul(compsize, 1 * sizeof(GLint))); 2543gc->pc += cmdlen; 2544if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); } 2545} 2546 2547#define X_GLrop_InitNames 121 2548void __indirect_glInitNames(void) 2549{ 2550 struct glx_context * const gc = __glXGetCurrentContext(); 2551 const GLuint cmdlen = 4; 2552emit_header(gc->pc, X_GLrop_InitNames, cmdlen); 2553gc->pc += cmdlen; 2554if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); } 2555} 2556 2557#define X_GLrop_LoadName 122 2558void __indirect_glLoadName(GLuint name) 2559{ 2560 struct glx_context * const gc = __glXGetCurrentContext(); 2561 const GLuint cmdlen = 8; 2562emit_header(gc->pc, X_GLrop_LoadName, cmdlen); 2563(void) memcpy((void *)(gc->pc + 4), (void *)(&name), 1 * sizeof(GLuint)); 2564gc->pc += cmdlen; 2565if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); } 2566} 2567 2568#define X_GLrop_PassThrough 123 2569void __indirect_glPassThrough(GLfloat token) 2570{ 2571 struct glx_context * const gc = __glXGetCurrentContext(); 2572 const GLuint cmdlen = 8; 2573emit_header(gc->pc, X_GLrop_PassThrough, cmdlen); 2574(void) memcpy((void *)(gc->pc + 4), (void *)(&token), 1 * sizeof(GLfloat)); 2575gc->pc += cmdlen; 2576if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); } 2577} 2578 2579#define X_GLrop_PopName 124 2580void __indirect_glPopName(void) 2581{ 2582 struct glx_context * const gc = __glXGetCurrentContext(); 2583 const GLuint cmdlen = 4; 2584emit_header(gc->pc, X_GLrop_PopName, cmdlen); 2585gc->pc += cmdlen; 2586if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); } 2587} 2588 2589#define X_GLrop_PushName 125 2590void __indirect_glPushName(GLuint name) 2591{ 2592 struct glx_context * const gc = __glXGetCurrentContext(); 2593 const GLuint cmdlen = 8; 2594emit_header(gc->pc, X_GLrop_PushName, cmdlen); 2595(void) memcpy((void *)(gc->pc + 4), (void *)(&name), 1 * sizeof(GLuint)); 2596gc->pc += cmdlen; 2597if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); } 2598} 2599 2600#define X_GLrop_DrawBuffer 126 2601void __indirect_glDrawBuffer(GLenum mode) 2602{ 2603 struct glx_context * const gc = __glXGetCurrentContext(); 2604 const GLuint cmdlen = 8; 2605emit_header(gc->pc, X_GLrop_DrawBuffer, cmdlen); 2606(void) memcpy((void *)(gc->pc + 4), (void *)(&mode), 1 * sizeof(GLenum)); 2607gc->pc += cmdlen; 2608if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); } 2609} 2610 2611#define X_GLrop_Clear 127 2612void __indirect_glClear(GLbitfield mask) 2613{ 2614 struct glx_context * const gc = __glXGetCurrentContext(); 2615 const GLuint cmdlen = 8; 2616emit_header(gc->pc, X_GLrop_Clear, cmdlen); 2617(void) memcpy((void *)(gc->pc + 4), (void *)(&mask), 1 * sizeof(GLbitfield)); 2618gc->pc += cmdlen; 2619if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); } 2620} 2621 2622#define X_GLrop_ClearAccum 128 2623void __indirect_glClearAccum(GLfloat red, GLfloat green, GLfloat blue, GLfloat alpha) 2624{ 2625 struct glx_context * const gc = __glXGetCurrentContext(); 2626 const GLuint cmdlen = 20; 2627emit_header(gc->pc, X_GLrop_ClearAccum, cmdlen); 2628(void) memcpy((void *)(gc->pc + 4), (void *)(&red), 1 * sizeof(GLfloat)); 2629(void) memcpy((void *)(gc->pc + 8), (void *)(&green), 1 * sizeof(GLfloat)); 2630(void) memcpy((void *)(gc->pc + 12), (void *)(&blue), 1 * sizeof(GLfloat)); 2631(void) memcpy((void *)(gc->pc + 16), (void *)(&alpha), 1 * sizeof(GLfloat)); 2632gc->pc += cmdlen; 2633if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); } 2634} 2635 2636#define X_GLrop_ClearIndex 129 2637void __indirect_glClearIndex(GLfloat c) 2638{ 2639 struct glx_context * const gc = __glXGetCurrentContext(); 2640 const GLuint cmdlen = 8; 2641emit_header(gc->pc, X_GLrop_ClearIndex, cmdlen); 2642(void) memcpy((void *)(gc->pc + 4), (void *)(&c), 1 * sizeof(GLfloat)); 2643gc->pc += cmdlen; 2644if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); } 2645} 2646 2647#define X_GLrop_ClearColor 130 2648void __indirect_glClearColor(GLclampf red, GLclampf green, GLclampf blue, GLclampf alpha) 2649{ 2650 struct glx_context * const gc = __glXGetCurrentContext(); 2651 const GLuint cmdlen = 20; 2652emit_header(gc->pc, X_GLrop_ClearColor, cmdlen); 2653(void) memcpy((void *)(gc->pc + 4), (void *)(&red), 1 * sizeof(GLclampf)); 2654(void) memcpy((void *)(gc->pc + 8), (void *)(&green), 1 * sizeof(GLclampf)); 2655(void) memcpy((void *)(gc->pc + 12), (void *)(&blue), 1 * sizeof(GLclampf)); 2656(void) memcpy((void *)(gc->pc + 16), (void *)(&alpha), 1 * sizeof(GLclampf)); 2657gc->pc += cmdlen; 2658if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); } 2659} 2660 2661#define X_GLrop_ClearStencil 131 2662void __indirect_glClearStencil(GLint s) 2663{ 2664 struct glx_context * const gc = __glXGetCurrentContext(); 2665 const GLuint cmdlen = 8; 2666emit_header(gc->pc, X_GLrop_ClearStencil, cmdlen); 2667(void) memcpy((void *)(gc->pc + 4), (void *)(&s), 1 * sizeof(GLint)); 2668gc->pc += cmdlen; 2669if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); } 2670} 2671 2672#define X_GLrop_ClearDepth 132 2673void __indirect_glClearDepth(GLclampd depth) 2674{ 2675 struct glx_context * const gc = __glXGetCurrentContext(); 2676 const GLuint cmdlen = 12; 2677emit_header(gc->pc, X_GLrop_ClearDepth, cmdlen); 2678(void) memcpy((void *)(gc->pc + 4), (void *)(&depth), 1 * sizeof(GLclampd)); 2679gc->pc += cmdlen; 2680if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); } 2681} 2682 2683#define X_GLrop_StencilMask 133 2684void __indirect_glStencilMask(GLuint mask) 2685{ 2686 struct glx_context * const gc = __glXGetCurrentContext(); 2687 const GLuint cmdlen = 8; 2688emit_header(gc->pc, X_GLrop_StencilMask, cmdlen); 2689(void) memcpy((void *)(gc->pc + 4), (void *)(&mask), 1 * sizeof(GLuint)); 2690gc->pc += cmdlen; 2691if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); } 2692} 2693 2694#define X_GLrop_ColorMask 134 2695void __indirect_glColorMask(GLboolean red, GLboolean green, GLboolean blue, GLboolean alpha) 2696{ 2697 struct glx_context * const gc = __glXGetCurrentContext(); 2698 const GLuint cmdlen = 8; 2699emit_header(gc->pc, X_GLrop_ColorMask, cmdlen); 2700(void) memcpy((void *)(gc->pc + 4), (void *)(&red), 1 * sizeof(GLboolean)); 2701(void) memcpy((void *)(gc->pc + 5), (void *)(&green), 1 * sizeof(GLboolean)); 2702(void) memcpy((void *)(gc->pc + 6), (void *)(&blue), 1 * sizeof(GLboolean)); 2703(void) memcpy((void *)(gc->pc + 7), (void *)(&alpha), 1 * sizeof(GLboolean)); 2704gc->pc += cmdlen; 2705if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); } 2706} 2707 2708#define X_GLrop_DepthMask 135 2709void __indirect_glDepthMask(GLboolean flag) 2710{ 2711 struct glx_context * const gc = __glXGetCurrentContext(); 2712 const GLuint cmdlen = 8; 2713emit_header(gc->pc, X_GLrop_DepthMask, cmdlen); 2714(void) memcpy((void *)(gc->pc + 4), (void *)(&flag), 1 * sizeof(GLboolean)); 2715gc->pc += cmdlen; 2716if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); } 2717} 2718 2719#define X_GLrop_IndexMask 136 2720void __indirect_glIndexMask(GLuint mask) 2721{ 2722 struct glx_context * const gc = __glXGetCurrentContext(); 2723 const GLuint cmdlen = 8; 2724emit_header(gc->pc, X_GLrop_IndexMask, cmdlen); 2725(void) memcpy((void *)(gc->pc + 4), (void *)(&mask), 1 * sizeof(GLuint)); 2726gc->pc += cmdlen; 2727if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); } 2728} 2729 2730#define X_GLrop_Accum 137 2731void __indirect_glAccum(GLenum op, GLfloat value) 2732{ 2733 struct glx_context * const gc = __glXGetCurrentContext(); 2734 const GLuint cmdlen = 12; 2735emit_header(gc->pc, X_GLrop_Accum, cmdlen); 2736(void) memcpy((void *)(gc->pc + 4), (void *)(&op), 1 * sizeof(GLenum)); 2737(void) memcpy((void *)(gc->pc + 8), (void *)(&value), 1 * sizeof(GLfloat)); 2738gc->pc += cmdlen; 2739if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); } 2740} 2741 2742#define X_GLrop_PopAttrib 141 2743void __indirect_glPopAttrib(void) 2744{ 2745 struct glx_context * const gc = __glXGetCurrentContext(); 2746 const GLuint cmdlen = 4; 2747emit_header(gc->pc, X_GLrop_PopAttrib, cmdlen); 2748gc->pc += cmdlen; 2749if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); } 2750} 2751 2752#define X_GLrop_PushAttrib 142 2753void __indirect_glPushAttrib(GLbitfield mask) 2754{ 2755 struct glx_context * const gc = __glXGetCurrentContext(); 2756 const GLuint cmdlen = 8; 2757emit_header(gc->pc, X_GLrop_PushAttrib, cmdlen); 2758(void) memcpy((void *)(gc->pc + 4), (void *)(&mask), 1 * sizeof(GLbitfield)); 2759gc->pc += cmdlen; 2760if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); } 2761} 2762 2763#define X_GLrop_MapGrid1d 147 2764void __indirect_glMapGrid1d(GLint un, GLdouble u1, GLdouble u2) 2765{ 2766 struct glx_context * const gc = __glXGetCurrentContext(); 2767 const GLuint cmdlen = 24; 2768emit_header(gc->pc, X_GLrop_MapGrid1d, cmdlen); 2769(void) memcpy((void *)(gc->pc + 4), (void *)(&u1), 1 * sizeof(GLdouble)); 2770(void) memcpy((void *)(gc->pc + 12), (void *)(&u2), 1 * sizeof(GLdouble)); 2771(void) memcpy((void *)(gc->pc + 20), (void *)(&un), 1 * sizeof(GLint)); 2772gc->pc += cmdlen; 2773if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); } 2774} 2775 2776#define X_GLrop_MapGrid1f 148 2777void __indirect_glMapGrid1f(GLint un, GLfloat u1, GLfloat u2) 2778{ 2779 struct glx_context * const gc = __glXGetCurrentContext(); 2780 const GLuint cmdlen = 16; 2781emit_header(gc->pc, X_GLrop_MapGrid1f, cmdlen); 2782(void) memcpy((void *)(gc->pc + 4), (void *)(&un), 1 * sizeof(GLint)); 2783(void) memcpy((void *)(gc->pc + 8), (void *)(&u1), 1 * sizeof(GLfloat)); 2784(void) memcpy((void *)(gc->pc + 12), (void *)(&u2), 1 * sizeof(GLfloat)); 2785gc->pc += cmdlen; 2786if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); } 2787} 2788 2789#define X_GLrop_MapGrid2d 149 2790void __indirect_glMapGrid2d(GLint un, GLdouble u1, GLdouble u2, GLint vn, GLdouble v1, GLdouble v2) 2791{ 2792 struct glx_context * const gc = __glXGetCurrentContext(); 2793 const GLuint cmdlen = 44; 2794emit_header(gc->pc, X_GLrop_MapGrid2d, cmdlen); 2795(void) memcpy((void *)(gc->pc + 4), (void *)(&u1), 1 * sizeof(GLdouble)); 2796(void) memcpy((void *)(gc->pc + 12), (void *)(&u2), 1 * sizeof(GLdouble)); 2797(void) memcpy((void *)(gc->pc + 20), (void *)(&v1), 1 * sizeof(GLdouble)); 2798(void) memcpy((void *)(gc->pc + 28), (void *)(&v2), 1 * sizeof(GLdouble)); 2799(void) memcpy((void *)(gc->pc + 36), (void *)(&un), 1 * sizeof(GLint)); 2800(void) memcpy((void *)(gc->pc + 40), (void *)(&vn), 1 * sizeof(GLint)); 2801gc->pc += cmdlen; 2802if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); } 2803} 2804 2805#define X_GLrop_MapGrid2f 150 2806void __indirect_glMapGrid2f(GLint un, GLfloat u1, GLfloat u2, GLint vn, GLfloat v1, GLfloat v2) 2807{ 2808 struct glx_context * const gc = __glXGetCurrentContext(); 2809 const GLuint cmdlen = 28; 2810emit_header(gc->pc, X_GLrop_MapGrid2f, cmdlen); 2811(void) memcpy((void *)(gc->pc + 4), (void *)(&un), 1 * sizeof(GLint)); 2812(void) memcpy((void *)(gc->pc + 8), (void *)(&u1), 1 * sizeof(GLfloat)); 2813(void) memcpy((void *)(gc->pc + 12), (void *)(&u2), 1 * sizeof(GLfloat)); 2814(void) memcpy((void *)(gc->pc + 16), (void *)(&vn), 1 * sizeof(GLint)); 2815(void) memcpy((void *)(gc->pc + 20), (void *)(&v1), 1 * sizeof(GLfloat)); 2816(void) memcpy((void *)(gc->pc + 24), (void *)(&v2), 1 * sizeof(GLfloat)); 2817gc->pc += cmdlen; 2818if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); } 2819} 2820 2821#define X_GLrop_EvalCoord1dv 151 2822void __indirect_glEvalCoord1d(GLdouble u) 2823{ 2824 struct glx_context * const gc = __glXGetCurrentContext(); 2825 const GLuint cmdlen = 12; 2826emit_header(gc->pc, X_GLrop_EvalCoord1dv, cmdlen); 2827(void) memcpy((void *)(gc->pc + 4), (void *)(&u), 1 * sizeof(GLdouble)); 2828gc->pc += cmdlen; 2829if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); } 2830} 2831 2832#define X_GLrop_EvalCoord1dv 151 2833void __indirect_glEvalCoord1dv(const GLdouble * u) 2834{ 2835 generic_8_byte( X_GLrop_EvalCoord1dv, u ); 2836} 2837 2838#define X_GLrop_EvalCoord1fv 152 2839void __indirect_glEvalCoord1f(GLfloat u) 2840{ 2841 struct glx_context * const gc = __glXGetCurrentContext(); 2842 const GLuint cmdlen = 8; 2843emit_header(gc->pc, X_GLrop_EvalCoord1fv, cmdlen); 2844(void) memcpy((void *)(gc->pc + 4), (void *)(&u), 1 * sizeof(GLfloat)); 2845gc->pc += cmdlen; 2846if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); } 2847} 2848 2849#define X_GLrop_EvalCoord1fv 152 2850void __indirect_glEvalCoord1fv(const GLfloat * u) 2851{ 2852 generic_4_byte( X_GLrop_EvalCoord1fv, u ); 2853} 2854 2855#define X_GLrop_EvalCoord2dv 153 2856void __indirect_glEvalCoord2d(GLdouble u, GLdouble v) 2857{ 2858 struct glx_context * const gc = __glXGetCurrentContext(); 2859 const GLuint cmdlen = 20; 2860emit_header(gc->pc, X_GLrop_EvalCoord2dv, cmdlen); 2861(void) memcpy((void *)(gc->pc + 4), (void *)(&u), 1 * sizeof(GLdouble)); 2862(void) memcpy((void *)(gc->pc + 12), (void *)(&v), 1 * sizeof(GLdouble)); 2863gc->pc += cmdlen; 2864if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); } 2865} 2866 2867#define X_GLrop_EvalCoord2dv 153 2868void __indirect_glEvalCoord2dv(const GLdouble * u) 2869{ 2870 generic_16_byte( X_GLrop_EvalCoord2dv, u ); 2871} 2872 2873#define X_GLrop_EvalCoord2fv 154 2874void __indirect_glEvalCoord2f(GLfloat u, GLfloat v) 2875{ 2876 struct glx_context * const gc = __glXGetCurrentContext(); 2877 const GLuint cmdlen = 12; 2878emit_header(gc->pc, X_GLrop_EvalCoord2fv, cmdlen); 2879(void) memcpy((void *)(gc->pc + 4), (void *)(&u), 1 * sizeof(GLfloat)); 2880(void) memcpy((void *)(gc->pc + 8), (void *)(&v), 1 * sizeof(GLfloat)); 2881gc->pc += cmdlen; 2882if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); } 2883} 2884 2885#define X_GLrop_EvalCoord2fv 154 2886void __indirect_glEvalCoord2fv(const GLfloat * u) 2887{ 2888 generic_8_byte( X_GLrop_EvalCoord2fv, u ); 2889} 2890 2891#define X_GLrop_EvalMesh1 155 2892void __indirect_glEvalMesh1(GLenum mode, GLint i1, GLint i2) 2893{ 2894 struct glx_context * const gc = __glXGetCurrentContext(); 2895 const GLuint cmdlen = 16; 2896emit_header(gc->pc, X_GLrop_EvalMesh1, cmdlen); 2897(void) memcpy((void *)(gc->pc + 4), (void *)(&mode), 1 * sizeof(GLenum)); 2898(void) memcpy((void *)(gc->pc + 8), (void *)(&i1), 1 * sizeof(GLint)); 2899(void) memcpy((void *)(gc->pc + 12), (void *)(&i2), 1 * sizeof(GLint)); 2900gc->pc += cmdlen; 2901if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); } 2902} 2903 2904#define X_GLrop_EvalPoint1 156 2905void __indirect_glEvalPoint1(GLint i) 2906{ 2907 struct glx_context * const gc = __glXGetCurrentContext(); 2908 const GLuint cmdlen = 8; 2909emit_header(gc->pc, X_GLrop_EvalPoint1, cmdlen); 2910(void) memcpy((void *)(gc->pc + 4), (void *)(&i), 1 * sizeof(GLint)); 2911gc->pc += cmdlen; 2912if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); } 2913} 2914 2915#define X_GLrop_EvalMesh2 157 2916void __indirect_glEvalMesh2(GLenum mode, GLint i1, GLint i2, GLint j1, GLint j2) 2917{ 2918 struct glx_context * const gc = __glXGetCurrentContext(); 2919 const GLuint cmdlen = 24; 2920emit_header(gc->pc, X_GLrop_EvalMesh2, cmdlen); 2921(void) memcpy((void *)(gc->pc + 4), (void *)(&mode), 1 * sizeof(GLenum)); 2922(void) memcpy((void *)(gc->pc + 8), (void *)(&i1), 1 * sizeof(GLint)); 2923(void) memcpy((void *)(gc->pc + 12), (void *)(&i2), 1 * sizeof(GLint)); 2924(void) memcpy((void *)(gc->pc + 16), (void *)(&j1), 1 * sizeof(GLint)); 2925(void) memcpy((void *)(gc->pc + 20), (void *)(&j2), 1 * sizeof(GLint)); 2926gc->pc += cmdlen; 2927if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); } 2928} 2929 2930#define X_GLrop_EvalPoint2 158 2931void __indirect_glEvalPoint2(GLint i, GLint j) 2932{ 2933 struct glx_context * const gc = __glXGetCurrentContext(); 2934 const GLuint cmdlen = 12; 2935emit_header(gc->pc, X_GLrop_EvalPoint2, cmdlen); 2936(void) memcpy((void *)(gc->pc + 4), (void *)(&i), 1 * sizeof(GLint)); 2937(void) memcpy((void *)(gc->pc + 8), (void *)(&j), 1 * sizeof(GLint)); 2938gc->pc += cmdlen; 2939if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); } 2940} 2941 2942#define X_GLrop_AlphaFunc 159 2943void __indirect_glAlphaFunc(GLenum func, GLclampf ref) 2944{ 2945 struct glx_context * const gc = __glXGetCurrentContext(); 2946 const GLuint cmdlen = 12; 2947emit_header(gc->pc, X_GLrop_AlphaFunc, cmdlen); 2948(void) memcpy((void *)(gc->pc + 4), (void *)(&func), 1 * sizeof(GLenum)); 2949(void) memcpy((void *)(gc->pc + 8), (void *)(&ref), 1 * sizeof(GLclampf)); 2950gc->pc += cmdlen; 2951if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); } 2952} 2953 2954#define X_GLrop_BlendFunc 160 2955void __indirect_glBlendFunc(GLenum sfactor, GLenum dfactor) 2956{ 2957 struct glx_context * const gc = __glXGetCurrentContext(); 2958 const GLuint cmdlen = 12; 2959emit_header(gc->pc, X_GLrop_BlendFunc, cmdlen); 2960(void) memcpy((void *)(gc->pc + 4), (void *)(&sfactor), 1 * sizeof(GLenum)); 2961(void) memcpy((void *)(gc->pc + 8), (void *)(&dfactor), 1 * sizeof(GLenum)); 2962gc->pc += cmdlen; 2963if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); } 2964} 2965 2966#define X_GLrop_LogicOp 161 2967void __indirect_glLogicOp(GLenum opcode) 2968{ 2969 struct glx_context * const gc = __glXGetCurrentContext(); 2970 const GLuint cmdlen = 8; 2971emit_header(gc->pc, X_GLrop_LogicOp, cmdlen); 2972(void) memcpy((void *)(gc->pc + 4), (void *)(&opcode), 1 * sizeof(GLenum)); 2973gc->pc += cmdlen; 2974if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); } 2975} 2976 2977#define X_GLrop_StencilFunc 162 2978void __indirect_glStencilFunc(GLenum func, GLint ref, GLuint mask) 2979{ 2980 struct glx_context * const gc = __glXGetCurrentContext(); 2981 const GLuint cmdlen = 16; 2982emit_header(gc->pc, X_GLrop_StencilFunc, cmdlen); 2983(void) memcpy((void *)(gc->pc + 4), (void *)(&func), 1 * sizeof(GLenum)); 2984(void) memcpy((void *)(gc->pc + 8), (void *)(&ref), 1 * sizeof(GLint)); 2985(void) memcpy((void *)(gc->pc + 12), (void *)(&mask), 1 * sizeof(GLuint)); 2986gc->pc += cmdlen; 2987if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); } 2988} 2989 2990#define X_GLrop_StencilOp 163 2991void __indirect_glStencilOp(GLenum fail, GLenum zfail, GLenum zpass) 2992{ 2993 struct glx_context * const gc = __glXGetCurrentContext(); 2994 const GLuint cmdlen = 16; 2995emit_header(gc->pc, X_GLrop_StencilOp, cmdlen); 2996(void) memcpy((void *)(gc->pc + 4), (void *)(&fail), 1 * sizeof(GLenum)); 2997(void) memcpy((void *)(gc->pc + 8), (void *)(&zfail), 1 * sizeof(GLenum)); 2998(void) memcpy((void *)(gc->pc + 12), (void *)(&zpass), 1 * sizeof(GLenum)); 2999gc->pc += cmdlen; 3000if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); } 3001} 3002 3003#define X_GLrop_DepthFunc 164 3004void __indirect_glDepthFunc(GLenum func) 3005{ 3006 struct glx_context * const gc = __glXGetCurrentContext(); 3007 const GLuint cmdlen = 8; 3008emit_header(gc->pc, X_GLrop_DepthFunc, cmdlen); 3009(void) memcpy((void *)(gc->pc + 4), (void *)(&func), 1 * sizeof(GLenum)); 3010gc->pc += cmdlen; 3011if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); } 3012} 3013 3014#define X_GLrop_PixelZoom 165 3015void __indirect_glPixelZoom(GLfloat xfactor, GLfloat yfactor) 3016{ 3017 struct glx_context * const gc = __glXGetCurrentContext(); 3018 const GLuint cmdlen = 12; 3019emit_header(gc->pc, X_GLrop_PixelZoom, cmdlen); 3020(void) memcpy((void *)(gc->pc + 4), (void *)(&xfactor), 1 * sizeof(GLfloat)); 3021(void) memcpy((void *)(gc->pc + 8), (void *)(&yfactor), 1 * sizeof(GLfloat)); 3022gc->pc += cmdlen; 3023if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); } 3024} 3025 3026#define X_GLrop_PixelTransferf 166 3027void __indirect_glPixelTransferf(GLenum pname, GLfloat param) 3028{ 3029 struct glx_context * const gc = __glXGetCurrentContext(); 3030 const GLuint cmdlen = 12; 3031emit_header(gc->pc, X_GLrop_PixelTransferf, cmdlen); 3032(void) memcpy((void *)(gc->pc + 4), (void *)(&pname), 1 * sizeof(GLenum)); 3033(void) memcpy((void *)(gc->pc + 8), (void *)(¶m), 1 * sizeof(GLfloat)); 3034gc->pc += cmdlen; 3035if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); } 3036} 3037 3038#define X_GLrop_PixelTransferi 167 3039void __indirect_glPixelTransferi(GLenum pname, GLint param) 3040{ 3041 struct glx_context * const gc = __glXGetCurrentContext(); 3042 const GLuint cmdlen = 12; 3043emit_header(gc->pc, X_GLrop_PixelTransferi, cmdlen); 3044(void) memcpy((void *)(gc->pc + 4), (void *)(&pname), 1 * sizeof(GLenum)); 3045(void) memcpy((void *)(gc->pc + 8), (void *)(¶m), 1 * sizeof(GLint)); 3046gc->pc += cmdlen; 3047if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); } 3048} 3049 3050#define X_GLrop_PixelMapfv 168 3051void __indirect_glPixelMapfv(GLenum map, GLsizei mapsize, const GLfloat * values) 3052{ 3053 struct glx_context * const gc = __glXGetCurrentContext(); 3054 const GLuint cmdlen = 12 + safe_pad(safe_mul(mapsize, 1 * sizeof(GLfloat))); 3055 if (0 + safe_pad(safe_mul(mapsize, 1 * sizeof(GLfloat))) < 0) { 3056 __glXSetError(gc, GL_INVALID_VALUE); 3057 return; 3058 } 3059 if (mapsize < 0) { 3060 __glXSetError(gc, GL_INVALID_VALUE); 3061 return; 3062 } 3063 if (__builtin_expect((mapsize >= 0) && (gc->currentDpy != NULL), 1)) { 3064if (cmdlen <= gc->maxSmallRenderCommandSize) { 3065 if ( (gc->pc + cmdlen) > gc->bufEnd ) { 3066 (void) __glXFlushRenderBuffer(gc, gc->pc); 3067 } 3068emit_header(gc->pc, X_GLrop_PixelMapfv, cmdlen); 3069(void) memcpy((void *)(gc->pc + 4), (void *)(&map), 1 * sizeof(GLenum)); 3070(void) memcpy((void *)(gc->pc + 8), (void *)(&mapsize), 1 * sizeof(GLsizei)); 3071(void) memcpy((void *)(gc->pc + 12), (void *)(values), safe_mul(mapsize, 1 * sizeof(GLfloat))); 3072gc->pc += cmdlen; 3073if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); } 3074} 3075else { 3076const GLint op = X_GLrop_PixelMapfv; 3077const GLuint cmdlenLarge = cmdlen + 4; 3078GLubyte * const pc = __glXFlushRenderBuffer(gc, gc->pc); 3079(void) memcpy((void *)(pc + 0), (void *)(&cmdlenLarge), 4); 3080(void) memcpy((void *)(pc + 4), (void *)(&op), 4); 3081(void) memcpy((void *)(pc + 8), (void *)(&map), 1 * sizeof(GLenum)); 3082(void) memcpy((void *)(pc + 12), (void *)(&mapsize), 1 * sizeof(GLsizei)); 3083 __glXSendLargeCommand(gc, pc, 16, values, safe_mul(mapsize, 1 * sizeof(GLfloat))); 3084} 3085 } 3086} 3087 3088#define X_GLrop_PixelMapuiv 169 3089void __indirect_glPixelMapuiv(GLenum map, GLsizei mapsize, const GLuint * values) 3090{ 3091 struct glx_context * const gc = __glXGetCurrentContext(); 3092 const GLuint cmdlen = 12 + safe_pad(safe_mul(mapsize, 1 * sizeof(GLuint))); 3093 if (0 + safe_pad(safe_mul(mapsize, 1 * sizeof(GLuint))) < 0) { 3094 __glXSetError(gc, GL_INVALID_VALUE); 3095 return; 3096 } 3097 if (mapsize < 0) { 3098 __glXSetError(gc, GL_INVALID_VALUE); 3099 return; 3100 } 3101 if (__builtin_expect((mapsize >= 0) && (gc->currentDpy != NULL), 1)) { 3102if (cmdlen <= gc->maxSmallRenderCommandSize) { 3103 if ( (gc->pc + cmdlen) > gc->bufEnd ) { 3104 (void) __glXFlushRenderBuffer(gc, gc->pc); 3105 } 3106emit_header(gc->pc, X_GLrop_PixelMapuiv, cmdlen); 3107(void) memcpy((void *)(gc->pc + 4), (void *)(&map), 1 * sizeof(GLenum)); 3108(void) memcpy((void *)(gc->pc + 8), (void *)(&mapsize), 1 * sizeof(GLsizei)); 3109(void) memcpy((void *)(gc->pc + 12), (void *)(values), safe_mul(mapsize, 1 * sizeof(GLuint))); 3110gc->pc += cmdlen; 3111if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); } 3112} 3113else { 3114const GLint op = X_GLrop_PixelMapuiv; 3115const GLuint cmdlenLarge = cmdlen + 4; 3116GLubyte * const pc = __glXFlushRenderBuffer(gc, gc->pc); 3117(void) memcpy((void *)(pc + 0), (void *)(&cmdlenLarge), 4); 3118(void) memcpy((void *)(pc + 4), (void *)(&op), 4); 3119(void) memcpy((void *)(pc + 8), (void *)(&map), 1 * sizeof(GLenum)); 3120(void) memcpy((void *)(pc + 12), (void *)(&mapsize), 1 * sizeof(GLsizei)); 3121 __glXSendLargeCommand(gc, pc, 16, values, safe_mul(mapsize, 1 * sizeof(GLuint))); 3122} 3123 } 3124} 3125 3126#define X_GLrop_PixelMapusv 170 3127void __indirect_glPixelMapusv(GLenum map, GLsizei mapsize, const GLushort * values) 3128{ 3129 struct glx_context * const gc = __glXGetCurrentContext(); 3130 const GLuint cmdlen = 12 + safe_pad(safe_mul(mapsize, 1 * sizeof(GLushort))); 3131 if (0 + safe_pad(safe_mul(mapsize, 1 * sizeof(GLushort))) < 0) { 3132 __glXSetError(gc, GL_INVALID_VALUE); 3133 return; 3134 } 3135 if (mapsize < 0) { 3136 __glXSetError(gc, GL_INVALID_VALUE); 3137 return; 3138 } 3139 if (__builtin_expect((mapsize >= 0) && (gc->currentDpy != NULL), 1)) { 3140if (cmdlen <= gc->maxSmallRenderCommandSize) { 3141 if ( (gc->pc + cmdlen) > gc->bufEnd ) { 3142 (void) __glXFlushRenderBuffer(gc, gc->pc); 3143 } 3144emit_header(gc->pc, X_GLrop_PixelMapusv, cmdlen); 3145(void) memcpy((void *)(gc->pc + 4), (void *)(&map), 1 * sizeof(GLenum)); 3146(void) memcpy((void *)(gc->pc + 8), (void *)(&mapsize), 1 * sizeof(GLsizei)); 3147(void) memcpy((void *)(gc->pc + 12), (void *)(values), safe_mul(mapsize, 1 * sizeof(GLushort))); 3148gc->pc += cmdlen; 3149if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); } 3150} 3151else { 3152const GLint op = X_GLrop_PixelMapusv; 3153const GLuint cmdlenLarge = cmdlen + 4; 3154GLubyte * const pc = __glXFlushRenderBuffer(gc, gc->pc); 3155(void) memcpy((void *)(pc + 0), (void *)(&cmdlenLarge), 4); 3156(void) memcpy((void *)(pc + 4), (void *)(&op), 4); 3157(void) memcpy((void *)(pc + 8), (void *)(&map), 1 * sizeof(GLenum)); 3158(void) memcpy((void *)(pc + 12), (void *)(&mapsize), 1 * sizeof(GLsizei)); 3159 __glXSendLargeCommand(gc, pc, 16, values, safe_mul(mapsize, 1 * sizeof(GLushort))); 3160} 3161 } 3162} 3163 3164#define X_GLrop_ReadBuffer 171 3165void __indirect_glReadBuffer(GLenum mode) 3166{ 3167 struct glx_context * const gc = __glXGetCurrentContext(); 3168 const GLuint cmdlen = 8; 3169emit_header(gc->pc, X_GLrop_ReadBuffer, cmdlen); 3170(void) memcpy((void *)(gc->pc + 4), (void *)(&mode), 1 * sizeof(GLenum)); 3171gc->pc += cmdlen; 3172if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); } 3173} 3174 3175#define X_GLrop_CopyPixels 172 3176void __indirect_glCopyPixels(GLint x, GLint y, GLsizei width, GLsizei height, GLenum type) 3177{ 3178 struct glx_context * const gc = __glXGetCurrentContext(); 3179 const GLuint cmdlen = 24; 3180emit_header(gc->pc, X_GLrop_CopyPixels, cmdlen); 3181(void) memcpy((void *)(gc->pc + 4), (void *)(&x), 1 * sizeof(GLint)); 3182(void) memcpy((void *)(gc->pc + 8), (void *)(&y), 1 * sizeof(GLint)); 3183(void) memcpy((void *)(gc->pc + 12), (void *)(&width), 1 * sizeof(GLsizei)); 3184(void) memcpy((void *)(gc->pc + 16), (void *)(&height), 1 * sizeof(GLsizei)); 3185(void) memcpy((void *)(gc->pc + 20), (void *)(&type), 1 * sizeof(GLenum)); 3186gc->pc += cmdlen; 3187if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); } 3188} 3189 3190#define X_GLsop_ReadPixels 111 3191void __indirect_glReadPixels(GLint x, GLint y, GLsizei width, GLsizei height, GLenum format, GLenum type, GLvoid * pixels) 3192{ 3193 struct glx_context * const gc = __glXGetCurrentContext(); 3194 const __GLXattribute * const state = gc->client_state_private; 3195 Display * const dpy = gc->currentDpy; 3196#ifndef USE_XCB 3197 const GLuint cmdlen = 28; 3198#endif 3199 if (__builtin_expect(dpy != NULL, 1)) { 3200#ifdef USE_XCB 3201 xcb_connection_t *c = XGetXCBConnection(dpy); 3202 (void) __glXFlushRenderBuffer(gc, gc->pc); 3203 xcb_glx_read_pixels_reply_t *reply = xcb_glx_read_pixels_reply(c, xcb_glx_read_pixels(c, gc->currentContextTag, x, y, width, height, format, type, state->storePack.swapEndian, 0), NULL); 3204 __glEmptyImage(gc, 3, width, height, 1, format, type, xcb_glx_read_pixels_data(reply), pixels); 3205 free(reply); 3206#else 3207 GLubyte const * pc = __glXSetupSingleRequest(gc, X_GLsop_ReadPixels, cmdlen); 3208(void) memcpy((void *)(pc + 0), (void *)(&x), 1 * sizeof(GLint)); 3209(void) memcpy((void *)(pc + 4), (void *)(&y), 1 * sizeof(GLint)); 3210(void) memcpy((void *)(pc + 8), (void *)(&width), 1 * sizeof(GLsizei)); 3211(void) memcpy((void *)(pc + 12), (void *)(&height), 1 * sizeof(GLsizei)); 3212(void) memcpy((void *)(pc + 16), (void *)(&format), 1 * sizeof(GLenum)); 3213(void) memcpy((void *)(pc + 20), (void *)(&type), 1 * sizeof(GLenum)); 3214 *(int32_t *)(pc + 24) = 0; 3215 * (int8_t *)(pc + 24) = state->storePack.swapEndian; 3216 __glXReadPixelReply(dpy, gc, 2, width, height, 1, format, type, pixels, GL_FALSE); 3217 UnlockDisplay(dpy); SyncHandle(); 3218#endif /* USE_XCB */ 3219 } 3220 return; 3221} 3222 3223#define X_GLrop_DrawPixels 173 3224void __indirect_glDrawPixels(GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid * pixels) 3225{ 3226 struct glx_context * const gc = __glXGetCurrentContext(); 3227 const GLuint compsize = (pixels != NULL) ? __glImageSize(width, height, 1, format, type, 0) : 0; 3228 const GLuint cmdlen = 40 + safe_pad(compsize); 3229 if (0 + safe_pad(compsize) < 0) { 3230 __glXSetError(gc, GL_INVALID_VALUE); 3231 return; 3232 } 3233 if (__builtin_expect(gc->currentDpy != NULL, 1)) { 3234if (cmdlen <= gc->maxSmallRenderCommandSize) { 3235 if ( (gc->pc + cmdlen) > gc->bufEnd ) { 3236 (void) __glXFlushRenderBuffer(gc, gc->pc); 3237 } 3238emit_header(gc->pc, X_GLrop_DrawPixels, cmdlen); 3239(void) memcpy((void *)(gc->pc + 24), (void *)(&width), 1 * sizeof(GLsizei)); 3240(void) memcpy((void *)(gc->pc + 28), (void *)(&height), 1 * sizeof(GLsizei)); 3241(void) memcpy((void *)(gc->pc + 32), (void *)(&format), 1 * sizeof(GLenum)); 3242(void) memcpy((void *)(gc->pc + 36), (void *)(&type), 1 * sizeof(GLenum)); 3243if (compsize > 0) { 3244 __glFillImage(gc, 2, width, height, 1, format, type, pixels, gc->pc + 40, gc->pc + 4); 3245} else { 3246 (void) memcpy( gc->pc + 4, default_pixel_store_2D, default_pixel_store_2D_size ); 3247} 3248gc->pc += cmdlen; 3249if (gc->pc > gc->limit) { (void) __glXFlushRenderBuffer(gc, gc->pc); } 3250} 3251else { 3252const GLint op = X_GLrop_DrawPixels; 3253const GLuint cmdlenLarge = cmdlen + 4; 3254GLubyte * const pc = __glXFlushRenderBuffer(gc, gc->pc); 3255(void) memcpy((void *)(pc + 0), (void *)(&cmdlenLarge), 4); 3256(void) memcpy((void *)(pc + 4), (void *)(&op), 4); 3257(void) memcpy((void *)(pc + 28), (void *)(&width), 1 * sizeof(GLsizei)); 3258(void) memcpy((void *)(pc + 32), (void *)(&height), 1 * sizeof(GLsizei)); 3259(void) memcpy((void *)(pc + 36), (void *)(&format), 1 * sizeof(GLenum)); 3260(void) memcpy((void *)(pc + 40), (void *)(&type), 1 * sizeof(GLenum)); 3261__glXSendLargeImage(gc, compsize, 2, width, height, 1, format, type, pixels, pc + 44, pc + 8); 3262} 3263 } 3264} 3265 3266#define X_GLsop_GetClipPlane 113 3267void __indirect_glGetClipPlane(GLenum plane, GLdouble * equation) 3268{ 3269 struct glx_context * const gc = __glXGetCurrentContext(); 3270 Display * const dpy = gc->currentDpy; 3271#ifndef USE_XCB 3272 const GLuint cmdlen = 4; 3273#endif 3274 if (__builtin_expect(dpy != NULL, 1)) { 3275#ifdef USE_XCB 3276 xcb_connection_t *c = XGetXCBConnection(dpy); 3277 (void) __glXFlushRenderBuffer(gc, gc->pc); 3278 xcb_glx_get_clip_plane_reply_t *reply = xcb_glx_get_clip_plane_reply(c, xcb_glx_get_clip_plane(c, gc->currentContextTag, plane), NULL); 3279 (void)memcpy(equation, xcb_glx_get_clip_plane_data(reply), xcb_glx_get_clip_plane_data_length(reply) * sizeof(GLdouble)); 3280 free(reply); 3281#else 3282 GLubyte const * pc = __glXSetupSingleRequest(gc, X_GLsop_GetClipPlane, cmdlen); 3283(void) memcpy((void *)(pc + 0), (void *)(&plane), 1 * sizeof(GLenum)); 3284 (void) __glXReadReply(dpy, 8, equation, GL_TRUE); 3285 UnlockDisplay(dpy); SyncHandle(); 3286#endif /* USE_XCB */ 3287 } 3288 return; 3289} 3290 3291#define X_GLsop_GetLightfv 118 3292void __indirect_glGetLightfv(GLenum light, GLenum pname, GLfloat * params) 3293{ 3294 struct glx_context * const gc = __glXGetCurrentContext(); 3295 Display * const dpy = gc->currentDpy; 3296#ifndef USE_XCB 3297 const GLuint cmdlen = 8; 3298#endif 3299 if (__builtin_expect(dpy != NULL, 1)) { 3300#ifdef USE_XCB 3301 xcb_connection_t *c = XGetXCBConnection(dpy); 3302 (void) __glXFlushRenderBuffer(gc, gc->pc); 3303 xcb_glx_get_lightfv_reply_t *reply = xcb_glx_get_lightfv_reply(c, xcb_glx_get_lightfv(c, gc->currentContextTag, light, pname), NULL); 3304 /* the XXX_data_length() xcb function name is misleading, it returns the number */ 3305 /* of elements, not the length of the data part. A single element is embedded. */ 3306 if (xcb_glx_get_lightfv_data_length(reply) == 1) 3307 (void)memcpy(params, &reply->datum, sizeof(reply->datum)); 3308 else 3309 (void)memcpy(params, xcb_glx_get_lightfv_data(reply), xcb_glx_get_lightfv_data_length(reply) * sizeof(GLfloat)); 3310 free(reply); 3311#else 3312 GLubyte const * pc = __glXSetupSingleRequest(gc, X_GLsop_GetLightfv, cmdlen); 3313(void) memcpy((void *)(pc + 0), (void *)(&light), 1 * sizeof(GLenum)); 3314(void) memcpy((void *)(pc + 4), (void *)(&pname), 1 * sizeof(GLenum)); 3315 (void) __glXReadReply(dpy, 4, params, GL_FALSE); 3316 UnlockDisplay(dpy); SyncHandle(); 3317#endif /* USE_XCB */ 3318 } 3319 return; 3320} 3321 3322#define X_GLsop_GetLightiv 119 3323void __indirect_glGetLightiv(GLenum light, GLenum pname, GLint * params) 3324{ 3325 struct glx_context * const gc = __glXGetCurrentContext(); 3326 Display * const dpy = gc->currentDpy; 3327#ifndef USE_XCB 3328 const GLuint cmdlen = 8; 3329#endif 3330 if (__builtin_expect(dpy != NULL, 1)) { 3331#ifdef USE_XCB 3332 xcb_connection_t *c = XGetXCBConnection(dpy); 3333 (void) __glXFlushRenderBuffer(gc, gc->pc); 3334 xcb_glx_get_lightiv_reply_t *reply = xcb_glx_get_lightiv_reply(c, xcb_glx_get_lightiv(c, gc->currentContextTag, light, pname), NULL); 3335 /* the XXX_data_length() xcb function name is misleading, it returns the number */ 3336 /* of elements, not the length of the data part. A single element is embedded. */ 3337 if (xcb_glx_get_lightiv_data_length(reply) == 1) 3338 (void)memcpy(params, &reply->datum, sizeof(reply->datum)); 3339 else 3340 (void)memcpy(params, xcb_glx_get_lightiv_data(reply), xcb_glx_get_lightiv_data_length(reply) * sizeof(GLint)); 3341 free(reply); 3342#else 3343 GLubyte const * pc = __glXSetupSingleRequest(gc, X_GLsop_GetLightiv, cmdlen); 3344(void) memcpy((void *)(pc + 0), (void *)(&light), 1 * sizeof(GLenum)); 3345(void) memcpy((void *)(pc + 4), (void *)(&pname), 1 * sizeof(GLenum)); 3346 (void) __glXReadReply(dpy, 4, params, GL_FALSE); 3347 UnlockDisplay(dpy); SyncHandle(); 3348#endif /* USE_XCB */ 3349 } 3350 return; 3351} 3352 3353#define X_GLsop_GetMapdv 120 3354void __indirect_glGetMapdv(GLenum target, GLenum query, GLdouble * v) 3355{ 3356 struct glx_context * const gc = __glXGetCurrentContext(); 3357 Display * const dpy = gc->currentDpy; 3358#ifndef USE_XCB 3359 const GLuint cmdlen = 8; 3360#endif 3361 if (__builtin_expect(dpy != NULL, 1)) { 3362#ifdef USE_XCB 3363 xcb_connection_t *c = XGetXCBConnection(dpy); 3364 (void) __glXFlushRenderBuffer(gc, gc->pc); 3365 xcb_glx_get_mapdv_reply_t *reply = xcb_glx_get_mapdv_reply(c, xcb_glx_get_mapdv(c, gc->currentContextTag, target, query), NULL); 3366 /* the XXX_data_length() xcb function name is misleading, it returns the number */ 3367 /* of elements, not the length of the data part. A single element is embedded. */ 3368 if (xcb_glx_get_mapdv_data_length(reply) == 1) 3369 (void)memcpy(v, &reply->datum, sizeof(reply->datum)); 3370 else 3371 (void)memcpy(v, xcb_glx_get_mapdv_data(reply), xcb_glx_get_mapdv_data_length(reply) * sizeof(GLdouble)); 3372 free(reply); 3373#else 3374 GLubyte const * pc = __glXSetupSingleRequest(gc, X_GLsop_GetMapdv, cmdlen); 3375(void) memcpy((void *)(pc + 0), (void *)(&target), 1 * sizeof(GLenum)); 3376(void) memcpy((void *)(pc + 4), (void *)(&query), 1 * sizeof(GLenum)); 3377 (void) __glXReadReply(dpy, 8, v, GL_FALSE); 3378 UnlockDisplay(dpy); SyncHandle(); 3379#endif /* USE_XCB */ 3380 } 3381 return; 3382} 3383 3384#define X_GLsop_GetMapfv 121 3385void __indirect_glGetMapfv(GLenum target, GLenum query, GLfloat * v) 3386{ 3387 struct glx_context * const gc = __glXGetCurrentContext(); 3388 Display * const dpy = gc->currentDpy; 3389#ifndef USE_XCB 3390 const GLuint cmdlen = 8; 3391#endif 3392 if (__builtin_expect(dpy != NULL, 1)) { 3393#ifdef USE_XCB 3394 xcb_connection_t *c = XGetXCBConnection(dpy); 3395 (void) __glXFlushRenderBuffer(gc, gc->pc); 3396 xcb_glx_get_mapfv_reply_t *reply = xcb_glx_get_mapfv_reply(c, xcb_glx_get_mapfv(c, gc->currentContextTag, target, query), NULL); 3397 /* the XXX_data_length() xcb function name is misleading, it returns the number */ 3398 /* of elements, not the length of the data part. A single element is embedded. */ 3399 if (xcb_glx_get_mapfv_data_length(reply) == 1) 3400 (void)memcpy(v, &reply->datum, sizeof(reply->datum)); 3401 else 3402 (void)memcpy(v, xcb_glx_get_mapfv_data(reply), xcb_glx_get_mapfv_data_length(reply) * sizeof(GLfloat)); 3403 free(reply); 3404#else 3405 GLubyte const * pc = __glXSetupSingleRequest(gc, X_GLsop_GetMapfv, cmdlen); 3406(void) memcpy((void *)(pc + 0), (void *)(&target), 1 * sizeof(GLenum)); 3407(void) memcpy((void *)(pc + 4), (void *)(&query), 1 * sizeof(GLenum)); 3408 (void) __glXReadReply(dpy, 4, v, GL_FALSE); 3409 UnlockDisplay(dpy); SyncHandle(); 3410#endif /* USE_XCB */ 3411 } 3412 return; 3413} 3414 3415#define X_GLsop_GetMapiv 122 3416void __indirect_glGetMapiv(GLenum target, GLenum query, GLint * v) 3417{ 3418 struct glx_context * const gc = __glXGetCurrentContext(); 3419 Display * const dpy = gc->currentDpy; 3420#ifndef USE_XCB 3421 const GLuint cmdlen = 8; 3422#endif 3423 if (__builtin_expect(dpy != NULL, 1)) { 3424#ifdef USE_XCB 3425 xcb_connection_t *c = XGetXCBConnection(dpy); 3426 (void) __glXFlushRenderBuffer(gc, gc->pc); 3427 xcb_glx_get_mapiv_reply_t *reply = xcb_glx_get_mapiv_reply(c, xcb_glx_get_mapiv(c, gc->currentContextTag, target, query), NULL); 3428 /* the XXX_data_length() xcb function name is misleading, it returns the number */ 3429 /* of elements, not the length of the data part. A single element is embedded. */ 3430 if (xcb_glx_get_mapiv_data_length(reply) == 1) 3431 (void)memcpy(v, &reply->datum, sizeof(reply->datum)); 3432 else 3433 (void)memcpy(v, xcb_glx_get_mapiv_data(reply), xcb_glx_get_mapiv_data_length(reply) * sizeof(GLint)); 3434 free(reply); 3435#else 3436 GLubyte const * pc = __glXSetupSingleRequest(gc, X_GLsop_GetMapiv, cmdlen); 3437(void) memcpy((void *)(pc + 0), (void *)(&target), 1 * sizeof(GLenum)); 3438(void) memcpy((void *)(pc + 4), (void *)(&query), 1 * sizeof(GLenum)); 3439 (void) __glXReadReply(dpy, 4, v, GL_FALSE); 3440 UnlockDisplay(dpy); SyncHandle(); 3441#endif /* USE_XCB */ 3442 } 3443 return; 3444} 3445 3446#define X_GLsop_GetMaterialfv 123 3447void __indirect_glGetMaterialfv(GLenum face, GLenum pname, GLfloat * params) 3448{ 3449 struct glx_context * const gc = __glXGetCurrentContext(); 3450 Display * const dpy = gc->currentDpy; 3451#ifndef USE_XCB 3452 const GLuint cmdlen = 8; 3453#endif 3454 if (__builtin_expect(dpy != NULL, 1)) { 3455#ifdef USE_XCB 3456 xcb_connection_t *c = XGetXCBConnection(dpy); 3457 (void) __glXFlushRenderBuffer(gc, gc->pc); 3458 xcb_glx_get_materialfv_reply_t *reply = xcb_glx_get_materialfv_reply(c, xcb_glx_get_materialfv(c, gc->currentContextTag, face, pname), NULL); 3459 /* the XXX_data_length() xcb function name is misleading, it returns the number */ 3460 /* of elements, not the length of the data part. A single element is embedded. */ 3461 if (xcb_glx_get_materialfv_data_length(reply) == 1) 3462 (void)memcpy(params, &reply->datum, sizeof(reply->datum)); 3463 else 3464 (void)memcpy(params, xcb_glx_get_materialfv_data(reply), xcb_glx_get_materialfv_data_length(reply) * sizeof(GLfloat)); 3465 free(reply); 3466#else 3467 GLubyte const * pc = __glXSetupSingleRequest(gc, X_GLsop_GetMaterialfv, cmdlen); 3468(void) memcpy((void *)(pc + 0), (void *)(&face), 1 * sizeof(GLenum)); 3469(void) memcpy((void *)(pc + 4), (void *)(&pname), 1 * sizeof(GLenum)); 3470 (void) __glXReadReply(dpy, 4, params, GL_FALSE); 3471 UnlockDisplay(dpy); SyncHandle(); 3472#endif /* USE_XCB */ 3473 } 3474 return; 3475} 3476 3477#define X_GLsop_GetMaterialiv 124 3478void __indirect_glGetMaterialiv(GLenum face, GLenum pname, GLint * params) 3479{ 3480 struct glx_context * const gc = __glXGetCurrentContext(); 3481 Display * const dpy = gc->currentDpy; 3482#ifndef USE_XCB 3483 const GLuint cmdlen = 8; 3484#endif 3485 if (__builtin_expect(dpy != NULL, 1)) { 3486#ifdef USE_XCB 3487 xcb_connection_t *c = XGetXCBConnection(dpy); 3488 (void) __glXFlushRenderBuffer(gc, gc->pc); 3489 xcb_glx_get_materialiv_reply_t *reply = xcb_glx_get_materialiv_reply(c, xcb_glx_get_materialiv(c, gc->currentContextTag, face, pname), NULL); 3490 /* the XXX_data_length() xcb function name is misleading, it returns the number */ 3491 /* of elements, not the length of the data part. A single element is embedded. */ 3492 if (xcb_glx_get_materialiv_data_length(reply) == 1) 3493 (void)memcpy(params, &reply->datum, sizeof(reply->datum)); 3494 else 3495 (void)memcpy(params, xcb_glx_get_materialiv_data(reply), xcb_glx_get_materialiv_data_length(reply) * sizeof(GLint)); 3496 free(reply); 3497#else 3498 GLubyte const * pc = __glXSetupSingleRequest(gc, X_GLsop_GetMaterialiv, cmdlen); 3499(void) memcpy((void *)(pc + 0), (void *)(&face), 1 * sizeof(GLenum)); 3500(void) memcpy((void *)(pc + 4), (void *)(&pname), 1 * sizeof(GLenum)); 3501 (void) __glXReadReply(dpy, 4, params, GL_FALSE); 3502 UnlockDisplay(dpy); SyncHandle(); 3503#endif /* USE_XCB */ 3504 } 3505 return; 3506} 3507 3508#define X_GLsop_GetPixelMapfv 125 3509void __indirect_glGetPixelMapfv(GLenum map, GLfloat * values) 3510{ 3511 struct glx_context * const gc = __glXGetCurrentContext(); 3512 Display * const dpy = gc->currentDpy; 3513#ifndef USE_XCB 3514 const GLuint cmdlen = 4; 3515#endif 3516 if (__builtin_expect(dpy != NULL, 1)) { 3517#ifdef USE_XCB 3518 xcb_connection_t *c = XGetXCBConnection(dpy); 3519 (void) __glXFlushRenderBuffer(gc, gc->pc); 3520 xcb_glx_get_pixel_mapfv_reply_t *reply = xcb_glx_get_pixel_mapfv_reply(c, xcb_glx_get_pixel_mapfv(c, gc->currentContextTag, map), NULL); 3521 /* the XXX_data_length() xcb function name is misleading, it returns the number */ 3522 /* of elements, not the length of the data part. A single element is embedded. */ 3523 if (xcb_glx_get_pixel_mapfv_data_length(reply) == 1) 3524 (void)memcpy(values, &reply->datum, sizeof(reply->datum)); 3525 else 3526 (void)memcpy(values, xcb_glx_get_pixel_mapfv_data(reply), xcb_glx_get_pixel_mapfv_data_length(reply) * sizeof(GLfloat)); 3527 free(reply); 3528#else 3529 GLubyte const * pc = __glXSetupSingleRequest(gc, X_GLsop_GetPixelMapfv, cmdlen); 3530(void) memcpy((void *)(pc + 0), (void *)(&map), 1 * sizeof(GLenum)); 3531 (void) __glXReadReply(dpy, 4, values, GL_FALSE); 3532 UnlockDisplay(dpy); SyncHandle(); 3533#endif /* USE_XCB */ 3534 } 3535 return; 3536} 3537 3538#define X_GLsop_GetPixelMapuiv 126 3539void __indirect_glGetPixelMapuiv(GLenum map, GLuint * values) 3540{ 3541 struct glx_context * const gc = __glXGetCurrentContext(); 3542 Display * const dpy = gc->currentDpy; 3543#ifndef USE_XCB 3544 const GLuint cmdlen = 4; 3545#endif 3546 if (__builtin_expect(dpy != NULL, 1)) { 3547#ifdef USE_XCB 3548 xcb_connection_t *c = XGetXCBConnection(dpy); 3549 (void) __glXFlushRenderBuffer(gc, gc->pc); 3550 xcb_glx_get_pixel_mapuiv_reply_t *reply = xcb_glx_get_pixel_mapuiv_reply(c, xcb_glx_get_pixel_mapuiv(c, gc->currentContextTag, map), NULL); 3551 /* the XXX_data_length() xcb function name is misleading, it returns the number */ 3552 /* of elements, not the length of the data part. A single element is embedded. */ 3553 if (xcb_glx_get_pixel_mapuiv_data_length(reply) == 1) 3554 (void)memcpy(values, &reply->datum, sizeof(reply->datum)); 3555 else 3556 (void)memcpy(values, xcb_glx_get_pixel_mapuiv_data(reply), xcb_glx_get_pixel_mapuiv_data_length(reply) * sizeof(GLuint)); 3557 free(reply); 3558#else 3559 GLubyte const * pc = __glXSetupSingleRequest(gc, X_GLsop_GetPixelMapuiv, cmdlen); 3560(void) memcpy((void *)(pc + 0), (void *)(&map), 1 * sizeof(GLenum)); 3561 (void) __glXReadReply(dpy, 4, values, GL_FALSE); 3562 UnlockDisplay(dpy); SyncHandle(); 3563#endif /* USE_XCB */ 3564 } 3565 return; 3566} 3567 3568#define X_GLsop_GetPixelMapusv 127 3569void __indirect_glGetPixelMapusv(GLenum map, GLushort * values) 3570{ 3571 struct glx_context * const gc = __glXGetCurrentContext(); 3572 Display * const dpy = gc->currentDpy; 3573#ifndef USE_XCB 3574 const GLuint cmdlen = 4; 3575#endif 3576 if (__builtin_expect(dpy != NULL, 1)) { 3577#ifdef USE_XCB 3578 xcb_connection_t *c = XGetXCBConnection(dpy); 3579 (void) __glXFlushRenderBuffer(gc, gc->pc); 3580 xcb_glx_get_pixel_mapusv_reply_t *reply = xcb_glx_get_pixel_mapusv_reply(c, xcb_glx_get_pixel_mapusv(c, gc->currentContextTag, map), NULL); 3581 /* the XXX_data_length() xcb function name is misleading, it returns the number */ 3582 /* of elements, not the length of the data part. A single element is embedded. */ 3583 if (xcb_glx_get_pixel_mapusv_data_length(reply) == 1) 3584 (void)memcpy(values, &reply->datum, sizeof(reply->datum)); 3585 else 3586 (void)memcpy(values, xcb_glx_get_pixel_mapusv_data(reply), xcb_glx_get_pixel_mapusv_data_length(reply) * sizeof(GLushort)); 3587 free(reply); 3588#else 3589 GLubyte const * pc = __glXSetupSingleRequest(gc, X_GLsop_GetPixelMapusv, cmdlen); 3590(void) memcpy((void *)(pc + 0), (void *)(&map), 1 * sizeof(GLenum)); 3591 (void) __glXReadReply(dpy, 2, values, GL_FALSE); 3592 UnlockDisplay(dpy); SyncHandle(); 3593#endif /* USE_XCB */ 3594 } 3595 return; 3596} 3597 3598#define X_GLsop_GetPolygonStipple 128 3599void __indirect_glGetPolygonStipple(GLubyte * mask) 3600{ 3601 struct glx_context * const gc = __glXGetCurrentContext(); 3602 Display * const dpy = gc->currentDpy; 3603#ifndef USE_XCB 3604 const GLuint cmdlen = 4; 3605#endif 3606 if (__builtin_expect(dpy != NULL, 1)) { 3607#ifdef USE_XCB 3608 xcb_connection_t *c = XGetXCBConnection(dpy); 3609 (void) __glXFlushRenderBuffer(gc, gc->pc); 3610 xcb_glx_get_polygon_stipple_reply_t *reply = xcb_glx_get_polygon_stipple_reply(c, xcb_glx_get_polygon_stipple(c, gc->currentContextTag, 0), NULL); 3611 __glEmptyImage(gc, 3, 32, 32, 1, GL_COLOR_INDEX, GL_BITMAP, xcb_glx_get_polygon_stipple_data(reply), mask); 3612 free(reply); 3613#else 3614 GLubyte const * pc = __glXSetupSingleRequest(gc, X_GLsop_GetPolygonStipple, cmdlen); 3615 *(int32_t *)(pc + 0) = 0; 3616 __glXReadPixelReply(dpy, gc, 2, 32, 32, 1, GL_COLOR_INDEX, GL_BITMAP, mask, GL_FALSE); 3617 UnlockDisplay(dpy); SyncHandle(); 3618#endif /* USE_XCB */ 3619 } 3620 return; 3621} 3622 3623#define X_GLsop_GetTexEnvfv 130 3624void __indirect_glGetTexEnvfv(GLenum target, GLenum pname, GLfloat * params) 3625{ 3626 struct glx_context * const gc = __glXGetCurrentContext(); 3627 Display * const dpy = gc->currentDpy; 3628#ifndef USE_XCB 3629 const GLuint cmdlen = 8; 3630#endif 3631 if (__builtin_expect(dpy != NULL, 1)) { 3632#ifdef USE_XCB 3633 xcb_connection_t *c = XGetXCBConnection(dpy); 3634 (void) __glXFlushRenderBuffer(gc, gc->pc); 3635 xcb_glx_get_tex_envfv_reply_t *reply = xcb_glx_get_tex_envfv_reply(c, xcb_glx_get_tex_envfv(c, gc->currentContextTag, target, pname), NULL); 3636 /* the XXX_data_length() xcb function name is misleading, it returns the number */ 3637 /* of elements, not the length of the data part. A single element is embedded. */ 3638 if (xcb_glx_get_tex_envfv_data_length(reply) == 1) 3639 (void)memcpy(params, &reply->datum, sizeof(reply->datum)); 3640 else 3641 (void)memcpy(params, xcb_glx_get_tex_envfv_data(reply), xcb_glx_get_tex_envfv_data_length(reply) * sizeof(GLfloat)); 3642 free(reply); 3643#else 3644 GLubyte const * pc = __glXSetupSingleRequest(gc, X_GLsop_GetTexEnvfv, cmdlen); 3645(void) memcpy((void *)(pc + 0), (void *)(&target), 1 * sizeof(GLenum)); 3646(void) memcpy((void *)(pc + 4), (void *)(&pname), 1 * sizeof(GLenum)); 3647 (void) __glXReadReply(dpy, 4, params, GL_FALSE); 3648 UnlockDisplay(dpy); SyncHandle(); 3649#endif /* USE_XCB */ 3650 } 3651 return; 3652} 3653 3654#define X_GLsop_GetTexEnviv 131 3655void __indirect_glGetTexEnviv(GLenum target, GLenum pname, GLint * params) 3656{ 3657 struct glx_context * const gc = __glXGetCurrentContext(); 3658 Display * const dpy = gc->currentDpy; 3659#ifndef USE_XCB 3660 const GLuint cmdlen = 8; 3661#endif 3662 if (__builtin_expect(dpy != NULL, 1)) { 3663#ifdef USE_XCB 3664 xcb_connection_t *c = XGetXCBConnection(dpy); 3665 (void) __glXFlushRenderBuffer(gc, gc->pc); 3666 xcb_glx_get_tex_enviv_reply_t *reply = xcb_glx_get_tex_enviv_reply(c, xcb_glx_get_tex_enviv(c, gc->currentContextTag, target, pname), NULL); 3667 /* the XXX_data_length() xcb function name is misleading, it returns the number */ 3668 /* of elements, not the length of the data part. A single element is embedded. */ 3669 if (xcb_glx_get_tex_enviv_data_length(reply) == 1) 3670 (void)memcpy(params, &reply->datum, sizeof(reply->datum)); 3671 else 3672 (void)memcpy(params, xcb_glx_get_tex_enviv_data(reply), xcb_glx_get_tex_enviv_data_length(reply) * sizeof(GLint)); 3673 free(reply); 3674#else 3675 GLubyte const * pc = __glXSetupSingleRequest(gc, X_GLsop_GetTexEnviv, cmdlen); 3676(void) memcpy((void *)(pc + 0), (void *)(&target), 1 * sizeof(GLenum)); 3677(void) memcpy((void *)(pc + 4), (void *)(&pname), 1 * sizeof(GLenum)); 3678 (void) __glXReadReply(dpy, 4, params, GL_FALSE); 3679 UnlockDisplay(dpy); SyncHandle(); 3680#endif /* USE_XCB */ 3681 } 3682 return; 3683} 3684 3685#define X_GLsop_GetTexGendv 132 3686void __indirect_glGetTexGendv(GLenum coord, GLenum pname, GLdouble * params) 3687{ 3688 struct glx_context * const gc = __glXGetCurrentContext(); 3689 Display * const dpy = gc->currentDpy; 3690#ifndef USE_XCB 3691 const GLuint cmdlen = 8; 3692#endif 3693 if (__builtin_expect(dpy != NULL, 1)) { 3694#ifdef USE_XCB 3695 xcb_connection_t *c = XGetXCBConnection(dpy); 3696 (void) __glXFlushRenderBuffer(gc, gc->pc); 3697 xcb_glx_get_tex_gendv_reply_t *reply = xcb_glx_get_tex_gendv_reply(c, xcb_glx_get_tex_gendv(c, gc->currentContextTag, coord, pname), NULL); 3698 /* the XXX_data_length() xcb function name is misleading, it returns the number */ 3699 /* of elements, not the length of the data part. A single element is embedded. */ 3700 if (xcb_glx_get_tex_gendv_data_length(reply) == 1) 3701 (void)memcpy(params, &reply->datum, sizeof(reply->datum)); 3702 else 3703 (void)memcpy(params, xcb_glx_get_tex_gendv_data(reply), xcb_glx_get_tex_gendv_data_length(reply) * sizeof(GLdouble)); 3704 free(reply); 3705#else 3706 GLubyte const * pc = __glXSetupSingleRequest(gc, X_GLsop_GetTexGendv, cmdlen); 3707(void) memcpy((void *)(pc + 0), (void *)(&coord), 1 * sizeof(GLenum)); 3708(void) memcpy((void *)(pc + 4), (void *)(&pname), 1 * sizeof(GLenum)); 3709 (void) __glXReadReply(dpy, 8, params, GL_FALSE); 3710 UnlockDisplay(dpy); SyncHandle(); 3711#endif /* USE_XCB */ 3712 } 3713 return; 3714} 3715 3716#define X_GLsop_GetTexGenfv 133 3717void __indirect_glGetTexGenfv(GLenum coord, GLenum pname, GLfloat * params) 3718{ 3719 struct glx_context * const gc = __glXGetCurrentContext(); 3720 Display * const dpy = gc->currentDpy; 3721#ifndef USE_XCB 3722 const GLuint cmdlen = 8; 3723#endif 3724 if (__builtin_expect(dpy != NULL, 1)) { 3725#ifdef USE_XCB 3726 xcb_connection_t *c = XGetXCBConnection(dpy); 3727 (void) __glXFlushRenderBuffer(gc, gc->pc); 3728 xcb_glx_get_tex_genfv_reply_t *reply = xcb_glx_get_tex_genfv_reply(c, xcb_glx_get_tex_genfv(c, gc->currentContextTag, coord, pname), NULL); 3729 /* the XXX_data_length() xcb function name is misleading, it returns the number */ 3730 /* of elements, not the length of the data part. A single element is embedded. */ 3731 if (xcb_glx_get_tex_genfv_data_length(reply) == 1) 3732 (void)memcpy(params, &reply->datum, sizeof(reply->datum)); 3733 else 3734 (void)memcpy(params, xcb_glx_get_tex_genfv_data(reply), xcb_glx_get_tex_genfv_data_length(reply) * sizeof(GLfloat)); 3735 free(reply); 3736#else 3737 GLubyte const * pc = __glXSetupSingleRequest(gc, X_GLsop_GetTexGenfv, cmdlen); 3738(void) memcpy((void *)(pc + 0), (void *)(&coord), 1 * sizeof(GLenum)); 3739(void) memcpy((void *)(pc + 4), (void *)(&pname), 1 * sizeof(GLenum)); 3740 (void) __glXReadReply(dpy, 4, params, GL_FALSE); 3741 UnlockDisplay(dpy); SyncHandle(); 3742#endif /* USE_XCB */ 3743 } 3744 return; 3745} 3746 3747#define X_GLsop_GetTexGeniv 134 3748void __indirect_glGetTexGeniv(GLenum coord, GLenum pname, GLint * params) 3749{ 3750 struct glx_context * const gc = __glXGetCurrentContext(); 3751 Display * const dpy = gc->currentDpy; 3752#ifndef USE_XCB 3753 const GLuint cmdlen = 8; 3754#endif 3755 if (__builtin_expect(dpy != NULL, 1)) { 3756#ifdef USE_XCB 3757 xcb_connection_t *c = XGetXCBConnection(dpy); 3758 (void) __glXFlushRenderBuffer(gc, gc->pc); 3759 xcb_glx_get_tex_geniv_reply_t *reply = xcb_glx_get_tex_geniv_reply(c, xcb_glx_get_tex_geniv(c, gc->currentContextTag, coord, pname), NULL); 3760 /* the XXX_data_length() xcb function name is misleading, it returns the number */ 3761 /* of elements, not the length of the data part. A single element is embedded. */ 3762 if (xcb_glx_get_tex_geniv_data_length(reply) == 1) 3763 (void)memcpy(params, &reply->datum, sizeof(reply->datum)); 3764 else 3765 (void)memcpy(params, xcb_glx_get_tex_geniv_data(reply), xcb_glx_get_tex_geniv_data_length(reply) * sizeof(GLint)); 3766 free(reply); 3767#else 3768 GLubyte const * pc = __glXSetupSingleRequest(gc, X_GLsop_GetTexGeniv, cmdlen); 3769(void) memcpy((void *)(pc + 0), (void *)(&coord), 1 * sizeof(GLenum)); 3770(void) memcpy((void *)(pc + 4), (void *)(&pname), 1 * sizeof(GLenum)); 3771 (void) __glXReadReply(dpy, 4, params, GL_FALSE); 3772 UnlockDisplay(dpy); SyncHandle(); 3773#endif /* USE_XCB */ 3774 } 3775 return; 3776} 3777 3778#define X_GLsop_GetTexImage 135 3779void __indirect_glGetTexImage(GLenum target, GLint level, GLenum format, GLenum type, GLvoid * pixels) 3780{ 3781 struct glx_context * const gc = __glXGetCurrentContext(); 3782 const __GLXattribute * const state = gc->client_state_private; 3783 Display * const dpy = gc->currentDpy; 3784#ifndef USE_XCB 3785 const GLuint cmdlen = 20; 3786#endif 3787 if (__builtin_expect(dpy != NULL, 1)) { 3788#ifdef USE_XCB 3789 xcb_connection_t *c = XGetXCBConnection(dpy); 3790 (void) __glXFlushRenderBuffer(gc, gc->pc); 3791 xcb_glx_get_tex_image_reply_t *reply = xcb_glx_get_tex_image_reply(c, xcb_glx_get_tex_image(c, gc->currentContextTag, target, level, format, type, state->storePack.swapEndian), NULL); 3792 if (reply->height == 0) { reply->height = 1; } 3793 if (reply->depth == 0) { reply->depth = 1; } 3794 __glEmptyImage(gc, 3, reply->width, reply->height, reply->depth, format, type, xcb_glx_get_tex_image_data(reply), pixels); 3795 free(reply); 3796#else 3797 GLubyte const * pc = __glXSetupSingleRequest(gc, X_GLsop_GetTexImage, cmdlen); 3798(void) memcpy((void *)(pc + 0), (void *)(&target), 1 * sizeof(GLenum)); 3799(void) memcpy((void *)(pc + 4), (void *)(&level), 1 * sizeof(GLint)); 3800(void) memcpy((void *)(pc + 8), (void *)(&format), 1 * sizeof(GLenum)); 3801(void) memcpy((void *)(pc + 12), (void *)(&type), 1 * sizeof(GLenum)); 3802 *(int32_t *)(pc + 16) = 0; 3803 * (int8_t *)(pc + 16) = state->storePack.swapEndian; 3804 __glXReadPixelReply(dpy, gc, 3, 0, 0, 0, format, type, pixels, GL_TRUE); 3805 UnlockDisplay(dpy); SyncHandle(); 3806#endif /* USE_XCB */ 3807 } 3808 return; 3809} 3810 3811#define X_GLsop_GetTexParameterfv 136 3812void __indirect_glGetTexParameterfv(GLenum target, GLenum pname, GLfloat * params) 3813{ 3814 struct glx_context * const gc = __glXGetCurrentContext(); 3815 Display * const dpy = gc->currentDpy; 3816#ifndef USE_XCB 3817 const GLuint cmdlen = 8; 3818#endif 3819 if (__builtin_expect(dpy != NULL, 1)) { 3820#ifdef USE_XCB 3821 xcb_connection_t *c = XGetXCBConnection(dpy); 3822 (void) __glXFlushRenderBuffer(gc, gc->pc); 3823 xcb_glx_get_tex_parameterfv_reply_t *reply = xcb_glx_get_tex_parameterfv_reply(c, xcb_glx_get_tex_parameterfv(c, gc->currentContextTag, target, pname), NULL); 3824 /* the XXX_data_length() xcb function name is misleading, it returns the number */ 3825 /* of elements, not the length of the data part. A single element is embedded. */ 3826 if (xcb_glx_get_tex_parameterfv_data_length(reply) == 1) 3827 (void)memcpy(params, &reply->datum, sizeof(reply->datum)); 3828 else 3829 (void)memcpy(params, xcb_glx_get_tex_parameterfv_data(reply), xcb_glx_get_tex_parameterfv_data_length(reply) * sizeof(GLfloat)); 3830 free(reply); 3831#else 3832 GLubyte const * pc = __glXSetupSingleRequest(gc, X_GLsop_GetTexParameterfv, cmdlen); 3833(void) memcpy((void *)(pc + 0), (void *)(&target), 1 * sizeof(GLenum)); 3834(void) memcpy((void *)(pc + 4), (void *)(&pname), 1 * sizeof(GLenum)); 3835 (void) __glXReadReply(dpy, 4, params, GL_FALSE); 3836 UnlockDisplay(dpy); SyncHandle(); 3837#endif /* USE_XCB */ 3838 } 3839 return; 3840} 3841 3842#define X_GLsop_GetTexParameteriv 137 3843void __indirect_glGetTexParameteriv(GLenum target, GLenum pname, GLint * params) 3844{ 3845 struct glx_context * const gc = __glXGetCurrentContext(); 3846 Display * const dpy = gc->currentDpy; 3847#ifndef USE_XCB 3848 const GLuint cmdlen = 8; 3849#endif 3850 if (__builtin_expect(dpy != NULL, 1)) { 3851#ifdef USE_XCB 3852 xcb_connection_t *c = XGetXCBConnection(dpy); 3853 (void) __glXFlushRenderBuffer(gc, gc->pc); 3854 xcb_glx_get_tex_parameteriv_reply_t *reply = xcb_glx_get_tex_parameteriv_reply(c, xcb_glx_get_tex_parameteriv(c, gc->currentContextTag, target, pname), NULL); 3855 /* the XXX_data_length() xcb function name is misleading, it returns the number */ 3856 /* of elements, not the length of the data part. A single element is embedded. */ 3857 if (xcb_glx_get_tex_parameteriv_data_length(reply) == 1) 3858 (void)memcpy(params, &reply->datum, sizeof(reply->datum)); 3859 else 3860 (void)memcpy(params, xcb_glx_get_tex_parameteriv_data(reply), xcb_glx_get_tex_parameteriv_data_length(reply) * sizeof(GLint)); 3861 free(reply); 3862#else 3863 GLubyte const * pc = __glXSetupSingleRequest(gc, X_GLsop_GetTexParameteriv, cmdlen); 3864(void) memcpy((void *)(pc + 0), (void *)(&target), 1 * sizeof(GLenum)); 3865(void) memcpy((void *)(pc + 4), (void *)(&pname), 1 * sizeof(GLenum)); 3866 (void) __glXReadReply(dpy, 4, params, GL_FALSE); 3867 UnlockDisplay(dpy); SyncHandle(); 3868#endif /* USE_XCB */ 3869 } 3870 return; 3871} 3872 3873#define X_GLsop_GetTexLevelParameterfv 138 3874void __indirect_glGetTexLevelParameterfv(GLenum target, GLint level, GLenum pname, GLfloat * params) 3875{ 3876 struct glx_context * const gc = __glXGetCurrentContext(); 3877 Display * const dpy = gc->currentDpy; 3878#ifndef USE_XCB 3879 const GLuint cmdlen = 12; 3880#endif 3881 if (__builtin_expect(dpy != NULL, 1)) { 3882#ifdef USE_XCB 3883 xcb_connection_t *c = XGetXCBConnection(dpy); 3884 (void) __glXFlushRenderBuffer(gc, gc->pc); 3885 xcb_glx_get_tex_level_parameterfv_reply_t *reply = xcb_glx_get_tex_level_parameterfv_reply(c, xcb_glx_get_tex_level_parameterfv(c, gc->currentContextTag, target, level, pname), NULL); 3886 /* the XXX_data_length() xcb function name is misleading, it returns the number */ 3887 /* of elements, not the length of the data part. A single element is embedded. */ 3888 if (xcb_glx_get_tex_level_parameterfv_data_length(reply) == 1) 3889 (void)memcpy(params, &reply->datum, sizeof(reply->datum)); 3890 else 3891 (void)memcpy(params, xcb_glx_get_tex_level_parameterfv_data(reply), xcb_glx_get_tex_level_parameterfv_data_length(reply) * sizeof(GLfloat)); 3892 free(reply); 3893#else 3894 GLubyte const * pc = __glXSetupSingleRequest(gc, X_GLsop_GetTexLevelParameterfv, cmdlen); 3895(void) memcpy((void *)(pc + 0), (void *)(&target), 1 * sizeof(GLenum)); 3896(void) memcpy((void *)(pc + 4), (void *)(&level), 1 * sizeof(GLint)); 3897(void) memcpy((void *)(pc + 8), (void *)(&pname), 1 * sizeof(GLenum)); 3898 (void) __glXReadReply(dpy, 4, params, GL_FALSE); 3899 UnlockDisplay(dpy); SyncHandle(); 3900#endif /* USE_XCB */ 3901 } 3902 return; 3903} 3904 3905#define X_GLsop_GetTexLevelParameteriv 139 3906void __indirect_glGetTexLevelParameteriv(GLenum target, GLint level, GLenum pname, GLint * params) 3907{ 3908 struct glx_context * const gc = __glXGetCurrentContext(); 3909 Display * const dpy = gc->currentDpy; 3910#ifndef USE_XCB 3911 const GLuint cmdlen = 12; 3912#endif 3913 if (__builtin_expect(dpy != NULL, 1)) { 3914#ifdef USE_XCB 3915 xcb_connection_t *c = XGetXCBConnection(dpy); 3916 (void) __glXFlushRenderBuffer(gc, gc->pc); 3917 xcb_glx_get_tex_level_parameteriv_reply_t *reply = xcb_glx_get_tex_level_parameteriv_reply(c, xcb_glx_get_tex_level_parameteriv(c, gc->currentContextTag, target, level, pname), NULL); 3918 /* the XXX_data_length() xcb function name is misleading, it returns the number */ 3919 /* of elements, not the length of the data part. A single element is embedded. */ 3920 if (xcb_glx_get_tex_level_parameteriv_data_length(reply) == 1) 3921 (void)memcpy(params, &reply->datum, sizeof(reply->datum)); 3922 else 3923 (void)memcpy(params, xcb_glx_get_tex_level_parameteriv_data(reply), xcb_glx_get_tex_level_parameteriv_data_length(reply) * sizeof(GLint)); 3924 free(reply); 3925#else 3926 GLubyte const * pc = __glXSetupSingleRequest(gc, X_GLsop_GetTexLevelParameteriv, cmdlen); 3927(void) memcpy((void *)(pc + 0), (void *)(&target), 1 * sizeof(GLenum)); 3928(void) memcpy((void *)(pc + 4), (void *)(&level), 1 * sizeof(GLint)); 3929(void) memcpy((void *)(pc + 8), (void *)(&pname), 1 * sizeof(GLenum)); 3930 (void) __glXReadReply(dpy, 4, params, GL_FALSE); 3931 UnlockDisplay(dpy); SyncHandle(); 3932#endif /* USE_XCB */ 3933 } 3934 return; 3935} 3936 3937#define X_GLsop_IsList 141 3938GLboolean __indirect_glIsList(GLuint list) 3939{ 3940 struct glx_context * const gc = __glXGetCurrentContext(); 3941 Display * const dpy = gc->currentDpy; 3942 GLboolean retval = (GLboolean) 0; 3943#ifndef USE_XCB 3944 const GLuint cmdlen = 4; 3945#endif 3946 if (__builtin_expect(dpy != NULL, 1)) { 3947#ifdef USE_XCB 3948 xcb_connection_t *c = XGetXCBConnection(dpy); 3949 (void) __glXFlushRenderBuffer(gc, gc->pc); 3950 xcb_glx_is_list_reply_t *reply = xcb_glx_is_list_reply(c, xcb_glx_is_list(c, gc->currentContextTag, list), NULL); 3951 retval = reply->ret_val; 3952 free(reply); 3953#else 3954 GLubyte const * pc = __glXSetupSingleRequest(gc, X_GLsop_IsList, cmdlen); 3955(void) memcpy((void *)(pc + 0), (void *)(&list), 1 * sizeof(GLuint)); 3956 retval = (GLboolean) __glXReadReply(dpy, 0, NULL, GL_FALSE); 3957 UnlockDisplay(dpy); SyncHandle(); 3958#endif /* USE_XCB */ 3959 } 3960 return retval; 3961} 3962 3963#define X_GLrop_DepthRange 174 3964void __indirect_glDepthRange(GLclampd zNear, GLclampd zFar) 3965{ 3966 struct glx_context * const gc = __glXGetCurrentContext(); 3967 const GLuint cmdlen = 20; 3968emit_header(gc->pc, X_GLrop_DepthRange, cmdlen); 3969(void) memcpy((void *)(gc->pc + 4), (void *)(&zNear), 1 * sizeof(GLclampd)); 3970(void) memcpy((void *)(gc->pc + 12), (void *)(&zFar), 1 * sizeof(GLclampd)); 3971gc->pc += cmdlen; 3972if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); } 3973} 3974 3975#define X_GLrop_Frustum 175 3976void __indirect_glFrustum(GLdouble left, GLdouble right, GLdouble bottom, GLdouble top, GLdouble zNear, GLdouble zFar) 3977{ 3978 struct glx_context * const gc = __glXGetCurrentContext(); 3979 const GLuint cmdlen = 52; 3980emit_header(gc->pc, X_GLrop_Frustum, cmdlen); 3981(void) memcpy((void *)(gc->pc + 4), (void *)(&left), 1 * sizeof(GLdouble)); 3982(void) memcpy((void *)(gc->pc + 12), (void *)(&right), 1 * sizeof(GLdouble)); 3983(void) memcpy((void *)(gc->pc + 20), (void *)(&bottom), 1 * sizeof(GLdouble)); 3984(void) memcpy((void *)(gc->pc + 28), (void *)(&top), 1 * sizeof(GLdouble)); 3985(void) memcpy((void *)(gc->pc + 36), (void *)(&zNear), 1 * sizeof(GLdouble)); 3986(void) memcpy((void *)(gc->pc + 44), (void *)(&zFar), 1 * sizeof(GLdouble)); 3987gc->pc += cmdlen; 3988if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); } 3989} 3990 3991#define X_GLrop_LoadIdentity 176 3992void __indirect_glLoadIdentity(void) 3993{ 3994 struct glx_context * const gc = __glXGetCurrentContext(); 3995 const GLuint cmdlen = 4; 3996emit_header(gc->pc, X_GLrop_LoadIdentity, cmdlen); 3997gc->pc += cmdlen; 3998if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); } 3999} 4000 4001#define X_GLrop_LoadMatrixf 177 4002void __indirect_glLoadMatrixf(const GLfloat * m) 4003{ 4004 struct glx_context * const gc = __glXGetCurrentContext(); 4005 const GLuint cmdlen = 68; 4006emit_header(gc->pc, X_GLrop_LoadMatrixf, cmdlen); 4007(void) memcpy((void *)(gc->pc + 4), (void *)(m), 16 * sizeof(GLfloat)); 4008gc->pc += cmdlen; 4009if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); } 4010} 4011 4012#define X_GLrop_LoadMatrixd 178 4013void __indirect_glLoadMatrixd(const GLdouble * m) 4014{ 4015 struct glx_context * const gc = __glXGetCurrentContext(); 4016 const GLuint cmdlen = 132; 4017emit_header(gc->pc, X_GLrop_LoadMatrixd, cmdlen); 4018(void) memcpy((void *)(gc->pc + 4), (void *)(m), 16 * sizeof(GLdouble)); 4019gc->pc += cmdlen; 4020if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); } 4021} 4022 4023#define X_GLrop_MatrixMode 179 4024void __indirect_glMatrixMode(GLenum mode) 4025{ 4026 struct glx_context * const gc = __glXGetCurrentContext(); 4027 const GLuint cmdlen = 8; 4028emit_header(gc->pc, X_GLrop_MatrixMode, cmdlen); 4029(void) memcpy((void *)(gc->pc + 4), (void *)(&mode), 1 * sizeof(GLenum)); 4030gc->pc += cmdlen; 4031if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); } 4032} 4033 4034#define X_GLrop_MultMatrixf 180 4035void __indirect_glMultMatrixf(const GLfloat * m) 4036{ 4037 struct glx_context * const gc = __glXGetCurrentContext(); 4038 const GLuint cmdlen = 68; 4039emit_header(gc->pc, X_GLrop_MultMatrixf, cmdlen); 4040(void) memcpy((void *)(gc->pc + 4), (void *)(m), 16 * sizeof(GLfloat)); 4041gc->pc += cmdlen; 4042if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); } 4043} 4044 4045#define X_GLrop_MultMatrixd 181 4046void __indirect_glMultMatrixd(const GLdouble * m) 4047{ 4048 struct glx_context * const gc = __glXGetCurrentContext(); 4049 const GLuint cmdlen = 132; 4050emit_header(gc->pc, X_GLrop_MultMatrixd, cmdlen); 4051(void) memcpy((void *)(gc->pc + 4), (void *)(m), 16 * sizeof(GLdouble)); 4052gc->pc += cmdlen; 4053if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); } 4054} 4055 4056#define X_GLrop_Ortho 182 4057void __indirect_glOrtho(GLdouble left, GLdouble right, GLdouble bottom, GLdouble top, GLdouble zNear, GLdouble zFar) 4058{ 4059 struct glx_context * const gc = __glXGetCurrentContext(); 4060 const GLuint cmdlen = 52; 4061emit_header(gc->pc, X_GLrop_Ortho, cmdlen); 4062(void) memcpy((void *)(gc->pc + 4), (void *)(&left), 1 * sizeof(GLdouble)); 4063(void) memcpy((void *)(gc->pc + 12), (void *)(&right), 1 * sizeof(GLdouble)); 4064(void) memcpy((void *)(gc->pc + 20), (void *)(&bottom), 1 * sizeof(GLdouble)); 4065(void) memcpy((void *)(gc->pc + 28), (void *)(&top), 1 * sizeof(GLdouble)); 4066(void) memcpy((void *)(gc->pc + 36), (void *)(&zNear), 1 * sizeof(GLdouble)); 4067(void) memcpy((void *)(gc->pc + 44), (void *)(&zFar), 1 * sizeof(GLdouble)); 4068gc->pc += cmdlen; 4069if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); } 4070} 4071 4072#define X_GLrop_PopMatrix 183 4073void __indirect_glPopMatrix(void) 4074{ 4075 struct glx_context * const gc = __glXGetCurrentContext(); 4076 const GLuint cmdlen = 4; 4077emit_header(gc->pc, X_GLrop_PopMatrix, cmdlen); 4078gc->pc += cmdlen; 4079if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); } 4080} 4081 4082#define X_GLrop_PushMatrix 184 4083void __indirect_glPushMatrix(void) 4084{ 4085 struct glx_context * const gc = __glXGetCurrentContext(); 4086 const GLuint cmdlen = 4; 4087emit_header(gc->pc, X_GLrop_PushMatrix, cmdlen); 4088gc->pc += cmdlen; 4089if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); } 4090} 4091 4092#define X_GLrop_Rotated 185 4093void __indirect_glRotated(GLdouble angle, GLdouble x, GLdouble y, GLdouble z) 4094{ 4095 struct glx_context * const gc = __glXGetCurrentContext(); 4096 const GLuint cmdlen = 36; 4097emit_header(gc->pc, X_GLrop_Rotated, cmdlen); 4098(void) memcpy((void *)(gc->pc + 4), (void *)(&angle), 1 * sizeof(GLdouble)); 4099(void) memcpy((void *)(gc->pc + 12), (void *)(&x), 1 * sizeof(GLdouble)); 4100(void) memcpy((void *)(gc->pc + 20), (void *)(&y), 1 * sizeof(GLdouble)); 4101(void) memcpy((void *)(gc->pc + 28), (void *)(&z), 1 * sizeof(GLdouble)); 4102gc->pc += cmdlen; 4103if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); } 4104} 4105 4106#define X_GLrop_Rotatef 186 4107void __indirect_glRotatef(GLfloat angle, GLfloat x, GLfloat y, GLfloat z) 4108{ 4109 struct glx_context * const gc = __glXGetCurrentContext(); 4110 const GLuint cmdlen = 20; 4111emit_header(gc->pc, X_GLrop_Rotatef, cmdlen); 4112(void) memcpy((void *)(gc->pc + 4), (void *)(&angle), 1 * sizeof(GLfloat)); 4113(void) memcpy((void *)(gc->pc + 8), (void *)(&x), 1 * sizeof(GLfloat)); 4114(void) memcpy((void *)(gc->pc + 12), (void *)(&y), 1 * sizeof(GLfloat)); 4115(void) memcpy((void *)(gc->pc + 16), (void *)(&z), 1 * sizeof(GLfloat)); 4116gc->pc += cmdlen; 4117if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); } 4118} 4119 4120#define X_GLrop_Scaled 187 4121void __indirect_glScaled(GLdouble x, GLdouble y, GLdouble z) 4122{ 4123 struct glx_context * const gc = __glXGetCurrentContext(); 4124 const GLuint cmdlen = 28; 4125emit_header(gc->pc, X_GLrop_Scaled, cmdlen); 4126(void) memcpy((void *)(gc->pc + 4), (void *)(&x), 1 * sizeof(GLdouble)); 4127(void) memcpy((void *)(gc->pc + 12), (void *)(&y), 1 * sizeof(GLdouble)); 4128(void) memcpy((void *)(gc->pc + 20), (void *)(&z), 1 * sizeof(GLdouble)); 4129gc->pc += cmdlen; 4130if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); } 4131} 4132 4133#define X_GLrop_Scalef 188 4134void __indirect_glScalef(GLfloat x, GLfloat y, GLfloat z) 4135{ 4136 struct glx_context * const gc = __glXGetCurrentContext(); 4137 const GLuint cmdlen = 16; 4138emit_header(gc->pc, X_GLrop_Scalef, cmdlen); 4139(void) memcpy((void *)(gc->pc + 4), (void *)(&x), 1 * sizeof(GLfloat)); 4140(void) memcpy((void *)(gc->pc + 8), (void *)(&y), 1 * sizeof(GLfloat)); 4141(void) memcpy((void *)(gc->pc + 12), (void *)(&z), 1 * sizeof(GLfloat)); 4142gc->pc += cmdlen; 4143if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); } 4144} 4145 4146#define X_GLrop_Translated 189 4147void __indirect_glTranslated(GLdouble x, GLdouble y, GLdouble z) 4148{ 4149 struct glx_context * const gc = __glXGetCurrentContext(); 4150 const GLuint cmdlen = 28; 4151emit_header(gc->pc, X_GLrop_Translated, cmdlen); 4152(void) memcpy((void *)(gc->pc + 4), (void *)(&x), 1 * sizeof(GLdouble)); 4153(void) memcpy((void *)(gc->pc + 12), (void *)(&y), 1 * sizeof(GLdouble)); 4154(void) memcpy((void *)(gc->pc + 20), (void *)(&z), 1 * sizeof(GLdouble)); 4155gc->pc += cmdlen; 4156if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); } 4157} 4158 4159#define X_GLrop_Translatef 190 4160void __indirect_glTranslatef(GLfloat x, GLfloat y, GLfloat z) 4161{ 4162 struct glx_context * const gc = __glXGetCurrentContext(); 4163 const GLuint cmdlen = 16; 4164emit_header(gc->pc, X_GLrop_Translatef, cmdlen); 4165(void) memcpy((void *)(gc->pc + 4), (void *)(&x), 1 * sizeof(GLfloat)); 4166(void) memcpy((void *)(gc->pc + 8), (void *)(&y), 1 * sizeof(GLfloat)); 4167(void) memcpy((void *)(gc->pc + 12), (void *)(&z), 1 * sizeof(GLfloat)); 4168gc->pc += cmdlen; 4169if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); } 4170} 4171 4172#define X_GLrop_Viewport 191 4173void __indirect_glViewport(GLint x, GLint y, GLsizei width, GLsizei height) 4174{ 4175 struct glx_context * const gc = __glXGetCurrentContext(); 4176 const GLuint cmdlen = 20; 4177emit_header(gc->pc, X_GLrop_Viewport, cmdlen); 4178(void) memcpy((void *)(gc->pc + 4), (void *)(&x), 1 * sizeof(GLint)); 4179(void) memcpy((void *)(gc->pc + 8), (void *)(&y), 1 * sizeof(GLint)); 4180(void) memcpy((void *)(gc->pc + 12), (void *)(&width), 1 * sizeof(GLsizei)); 4181(void) memcpy((void *)(gc->pc + 16), (void *)(&height), 1 * sizeof(GLsizei)); 4182gc->pc += cmdlen; 4183if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); } 4184} 4185 4186#define X_GLrop_BindTexture 4117 4187void __indirect_glBindTexture(GLenum target, GLuint texture) 4188{ 4189 struct glx_context * const gc = __glXGetCurrentContext(); 4190 const GLuint cmdlen = 12; 4191emit_header(gc->pc, X_GLrop_BindTexture, cmdlen); 4192(void) memcpy((void *)(gc->pc + 4), (void *)(&target), 1 * sizeof(GLenum)); 4193(void) memcpy((void *)(gc->pc + 8), (void *)(&texture), 1 * sizeof(GLuint)); 4194gc->pc += cmdlen; 4195if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); } 4196} 4197 4198#define X_GLrop_Indexubv 194 4199void __indirect_glIndexub(GLubyte c) 4200{ 4201 struct glx_context * const gc = __glXGetCurrentContext(); 4202 const GLuint cmdlen = 8; 4203emit_header(gc->pc, X_GLrop_Indexubv, cmdlen); 4204(void) memcpy((void *)(gc->pc + 4), (void *)(&c), 1 * sizeof(GLubyte)); 4205gc->pc += cmdlen; 4206if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); } 4207} 4208 4209#define X_GLrop_Indexubv 194 4210void __indirect_glIndexubv(const GLubyte * c) 4211{ 4212 struct glx_context * const gc = __glXGetCurrentContext(); 4213 const GLuint cmdlen = 8; 4214emit_header(gc->pc, X_GLrop_Indexubv, cmdlen); 4215(void) memcpy((void *)(gc->pc + 4), (void *)(c), 1 * sizeof(GLubyte)); 4216gc->pc += cmdlen; 4217if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); } 4218} 4219 4220#define X_GLrop_PolygonOffset 192 4221void __indirect_glPolygonOffset(GLfloat factor, GLfloat units) 4222{ 4223 struct glx_context * const gc = __glXGetCurrentContext(); 4224 const GLuint cmdlen = 12; 4225emit_header(gc->pc, X_GLrop_PolygonOffset, cmdlen); 4226(void) memcpy((void *)(gc->pc + 4), (void *)(&factor), 1 * sizeof(GLfloat)); 4227(void) memcpy((void *)(gc->pc + 8), (void *)(&units), 1 * sizeof(GLfloat)); 4228gc->pc += cmdlen; 4229if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); } 4230} 4231 4232#define X_GLrop_CopyTexImage1D 4119 4233void __indirect_glCopyTexImage1D(GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLint border) 4234{ 4235 struct glx_context * const gc = __glXGetCurrentContext(); 4236 const GLuint cmdlen = 32; 4237emit_header(gc->pc, X_GLrop_CopyTexImage1D, cmdlen); 4238(void) memcpy((void *)(gc->pc + 4), (void *)(&target), 1 * sizeof(GLenum)); 4239(void) memcpy((void *)(gc->pc + 8), (void *)(&level), 1 * sizeof(GLint)); 4240(void) memcpy((void *)(gc->pc + 12), (void *)(&internalformat), 1 * sizeof(GLenum)); 4241(void) memcpy((void *)(gc->pc + 16), (void *)(&x), 1 * sizeof(GLint)); 4242(void) memcpy((void *)(gc->pc + 20), (void *)(&y), 1 * sizeof(GLint)); 4243(void) memcpy((void *)(gc->pc + 24), (void *)(&width), 1 * sizeof(GLsizei)); 4244(void) memcpy((void *)(gc->pc + 28), (void *)(&border), 1 * sizeof(GLint)); 4245gc->pc += cmdlen; 4246if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); } 4247} 4248 4249#define X_GLrop_CopyTexImage2D 4120 4250void __indirect_glCopyTexImage2D(GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLsizei height, GLint border) 4251{ 4252 struct glx_context * const gc = __glXGetCurrentContext(); 4253 const GLuint cmdlen = 36; 4254emit_header(gc->pc, X_GLrop_CopyTexImage2D, cmdlen); 4255(void) memcpy((void *)(gc->pc + 4), (void *)(&target), 1 * sizeof(GLenum)); 4256(void) memcpy((void *)(gc->pc + 8), (void *)(&level), 1 * sizeof(GLint)); 4257(void) memcpy((void *)(gc->pc + 12), (void *)(&internalformat), 1 * sizeof(GLenum)); 4258(void) memcpy((void *)(gc->pc + 16), (void *)(&x), 1 * sizeof(GLint)); 4259(void) memcpy((void *)(gc->pc + 20), (void *)(&y), 1 * sizeof(GLint)); 4260(void) memcpy((void *)(gc->pc + 24), (void *)(&width), 1 * sizeof(GLsizei)); 4261(void) memcpy((void *)(gc->pc + 28), (void *)(&height), 1 * sizeof(GLsizei)); 4262(void) memcpy((void *)(gc->pc + 32), (void *)(&border), 1 * sizeof(GLint)); 4263gc->pc += cmdlen; 4264if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); } 4265} 4266 4267#define X_GLrop_CopyTexSubImage1D 4121 4268void __indirect_glCopyTexSubImage1D(GLenum target, GLint level, GLint xoffset, GLint x, GLint y, GLsizei width) 4269{ 4270 struct glx_context * const gc = __glXGetCurrentContext(); 4271 const GLuint cmdlen = 28; 4272emit_header(gc->pc, X_GLrop_CopyTexSubImage1D, cmdlen); 4273(void) memcpy((void *)(gc->pc + 4), (void *)(&target), 1 * sizeof(GLenum)); 4274(void) memcpy((void *)(gc->pc + 8), (void *)(&level), 1 * sizeof(GLint)); 4275(void) memcpy((void *)(gc->pc + 12), (void *)(&xoffset), 1 * sizeof(GLint)); 4276(void) memcpy((void *)(gc->pc + 16), (void *)(&x), 1 * sizeof(GLint)); 4277(void) memcpy((void *)(gc->pc + 20), (void *)(&y), 1 * sizeof(GLint)); 4278(void) memcpy((void *)(gc->pc + 24), (void *)(&width), 1 * sizeof(GLsizei)); 4279gc->pc += cmdlen; 4280if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); } 4281} 4282 4283#define X_GLrop_CopyTexSubImage2D 4122 4284void __indirect_glCopyTexSubImage2D(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint x, GLint y, GLsizei width, GLsizei height) 4285{ 4286 struct glx_context * const gc = __glXGetCurrentContext(); 4287 const GLuint cmdlen = 36; 4288emit_header(gc->pc, X_GLrop_CopyTexSubImage2D, cmdlen); 4289(void) memcpy((void *)(gc->pc + 4), (void *)(&target), 1 * sizeof(GLenum)); 4290(void) memcpy((void *)(gc->pc + 8), (void *)(&level), 1 * sizeof(GLint)); 4291(void) memcpy((void *)(gc->pc + 12), (void *)(&xoffset), 1 * sizeof(GLint)); 4292(void) memcpy((void *)(gc->pc + 16), (void *)(&yoffset), 1 * sizeof(GLint)); 4293(void) memcpy((void *)(gc->pc + 20), (void *)(&x), 1 * sizeof(GLint)); 4294(void) memcpy((void *)(gc->pc + 24), (void *)(&y), 1 * sizeof(GLint)); 4295(void) memcpy((void *)(gc->pc + 28), (void *)(&width), 1 * sizeof(GLsizei)); 4296(void) memcpy((void *)(gc->pc + 32), (void *)(&height), 1 * sizeof(GLsizei)); 4297gc->pc += cmdlen; 4298if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); } 4299} 4300 4301#define X_GLsop_DeleteTextures 144 4302void __indirect_glDeleteTextures(GLsizei n, const GLuint * textures) 4303{ 4304 struct glx_context * const gc = __glXGetCurrentContext(); 4305 Display * const dpy = gc->currentDpy; 4306#ifndef USE_XCB 4307 const GLuint cmdlen = 4 + safe_pad(safe_mul(n, 1 * sizeof(GLuint))); 4308#endif 4309 if (0 + safe_pad(safe_mul(n, 1 * sizeof(GLuint))) < 0) { 4310 __glXSetError(gc, GL_INVALID_VALUE); 4311 return; 4312 } 4313 if (n < 0) { 4314 __glXSetError(gc, GL_INVALID_VALUE); 4315 return; 4316 } 4317 if (__builtin_expect((n >= 0) && (dpy != NULL), 1)) { 4318#ifdef USE_XCB 4319 xcb_connection_t *c = XGetXCBConnection(dpy); 4320 (void) __glXFlushRenderBuffer(gc, gc->pc); 4321 xcb_glx_delete_textures(c, gc->currentContextTag, n, textures); 4322#else 4323 GLubyte const * pc = __glXSetupSingleRequest(gc, X_GLsop_DeleteTextures, cmdlen); 4324(void) memcpy((void *)(pc + 0), (void *)(&n), 1 * sizeof(GLsizei)); 4325(void) memcpy((void *)(pc + 4), (void *)(textures), safe_mul(n, 1 * sizeof(GLuint))); 4326 UnlockDisplay(dpy); SyncHandle(); 4327#endif /* USE_XCB */ 4328 } 4329 return; 4330} 4331 4332#define X_GLvop_DeleteTexturesEXT 12 4333void glDeleteTexturesEXT(GLsizei n, const GLuint * textures) 4334{ 4335#if defined(GLX_DIRECT_RENDERING) && !defined(GLX_USE_APPLEGL) 4336 if (((struct glx_context *)__glXGetCurrentContext())->isDirect) { 4337 const _glapi_proc *const disp_table = (_glapi_proc *)GET_DISPATCH(); 4338 PFNGLDELETETEXTURESEXTPROC p = 4339 (PFNGLDELETETEXTURESEXTPROC) disp_table[327]; 4340 p(n, textures); 4341 } else 4342#endif 4343 { 4344 struct glx_context * const gc = __glXGetCurrentContext(); 4345 Display * const dpy = gc->currentDpy; 4346 const GLuint cmdlen = 4 + safe_pad(safe_mul(n, 1 * sizeof(GLuint))); 4347 if (0 + safe_pad(safe_mul(n, 1 * sizeof(GLuint))) < 0) { 4348 __glXSetError(gc, GL_INVALID_VALUE); 4349 return; 4350 } 4351 if (n < 0) { 4352 __glXSetError(gc, GL_INVALID_VALUE); 4353 return; 4354 } 4355 if (__builtin_expect((n >= 0) && (dpy != NULL), 1)) { 4356 GLubyte const * pc = __glXSetupVendorRequest(gc, X_GLXVendorPrivate, X_GLvop_DeleteTexturesEXT, cmdlen); 4357(void) memcpy((void *)(pc + 0), (void *)(&n), 1 * sizeof(GLsizei)); 4358(void) memcpy((void *)(pc + 4), (void *)(textures), safe_mul(n, 1 * sizeof(GLuint))); 4359 UnlockDisplay(dpy); SyncHandle(); 4360 } 4361 return; 4362} 4363} 4364 4365#define X_GLsop_GenTextures 145 4366void __indirect_glGenTextures(GLsizei n, GLuint * textures) 4367{ 4368 struct glx_context * const gc = __glXGetCurrentContext(); 4369 Display * const dpy = gc->currentDpy; 4370#ifndef USE_XCB 4371 const GLuint cmdlen = 4; 4372#endif 4373 if (n < 0) { 4374 __glXSetError(gc, GL_INVALID_VALUE); 4375 return; 4376 } 4377 if (__builtin_expect((n >= 0) && (dpy != NULL), 1)) { 4378#ifdef USE_XCB 4379 xcb_connection_t *c = XGetXCBConnection(dpy); 4380 (void) __glXFlushRenderBuffer(gc, gc->pc); 4381 xcb_glx_gen_textures_reply_t *reply = xcb_glx_gen_textures_reply(c, xcb_glx_gen_textures(c, gc->currentContextTag, n), NULL); 4382 (void)memcpy(textures, xcb_glx_gen_textures_data(reply), xcb_glx_gen_textures_data_length(reply) * sizeof(GLuint)); 4383 free(reply); 4384#else 4385 GLubyte const * pc = __glXSetupSingleRequest(gc, X_GLsop_GenTextures, cmdlen); 4386(void) memcpy((void *)(pc + 0), (void *)(&n), 1 * sizeof(GLsizei)); 4387 (void) __glXReadReply(dpy, 4, textures, GL_TRUE); 4388 UnlockDisplay(dpy); SyncHandle(); 4389#endif /* USE_XCB */ 4390 } 4391 return; 4392} 4393 4394#define X_GLvop_GenTexturesEXT 13 4395void glGenTexturesEXT(GLsizei n, GLuint * textures) 4396{ 4397#if defined(GLX_DIRECT_RENDERING) && !defined(GLX_USE_APPLEGL) 4398 if (((struct glx_context *)__glXGetCurrentContext())->isDirect) { 4399 const _glapi_proc *const disp_table = (_glapi_proc *)GET_DISPATCH(); 4400 PFNGLGENTEXTURESEXTPROC p = 4401 (PFNGLGENTEXTURESEXTPROC) disp_table[328]; 4402 p(n, textures); 4403 } else 4404#endif 4405 { 4406 struct glx_context * const gc = __glXGetCurrentContext(); 4407 Display * const dpy = gc->currentDpy; 4408 const GLuint cmdlen = 4; 4409 if (n < 0) { 4410 __glXSetError(gc, GL_INVALID_VALUE); 4411 return; 4412 } 4413 if (__builtin_expect((n >= 0) && (dpy != NULL), 1)) { 4414 GLubyte const * pc = __glXSetupVendorRequest(gc, X_GLXVendorPrivateWithReply, X_GLvop_GenTexturesEXT, cmdlen); 4415(void) memcpy((void *)(pc + 0), (void *)(&n), 1 * sizeof(GLsizei)); 4416 (void) __glXReadReply(dpy, 4, textures, GL_TRUE); 4417 UnlockDisplay(dpy); SyncHandle(); 4418 } 4419 return; 4420} 4421} 4422 4423#define X_GLsop_IsTexture 146 4424GLboolean __indirect_glIsTexture(GLuint texture) 4425{ 4426 struct glx_context * const gc = __glXGetCurrentContext(); 4427 Display * const dpy = gc->currentDpy; 4428 GLboolean retval = (GLboolean) 0; 4429#ifndef USE_XCB 4430 const GLuint cmdlen = 4; 4431#endif 4432 if (__builtin_expect(dpy != NULL, 1)) { 4433#ifdef USE_XCB 4434 xcb_connection_t *c = XGetXCBConnection(dpy); 4435 (void) __glXFlushRenderBuffer(gc, gc->pc); 4436 xcb_glx_is_texture_reply_t *reply = xcb_glx_is_texture_reply(c, xcb_glx_is_texture(c, gc->currentContextTag, texture), NULL); 4437 retval = reply->ret_val; 4438 free(reply); 4439#else 4440 GLubyte const * pc = __glXSetupSingleRequest(gc, X_GLsop_IsTexture, cmdlen); 4441(void) memcpy((void *)(pc + 0), (void *)(&texture), 1 * sizeof(GLuint)); 4442 retval = (GLboolean) __glXReadReply(dpy, 0, NULL, GL_FALSE); 4443 UnlockDisplay(dpy); SyncHandle(); 4444#endif /* USE_XCB */ 4445 } 4446 return retval; 4447} 4448 4449#define X_GLvop_IsTextureEXT 14 4450GLboolean glIsTextureEXT(GLuint texture) 4451{ 4452#if defined(GLX_DIRECT_RENDERING) && !defined(GLX_USE_APPLEGL) 4453 if (((struct glx_context *)__glXGetCurrentContext())->isDirect) { 4454 const _glapi_proc *const disp_table = (_glapi_proc *)GET_DISPATCH(); 4455 PFNGLISTEXTUREEXTPROC p = 4456 (PFNGLISTEXTUREEXTPROC) disp_table[330]; 4457 return p(texture); 4458 } else 4459#endif 4460 { 4461 struct glx_context * const gc = __glXGetCurrentContext(); 4462 Display * const dpy = gc->currentDpy; 4463 GLboolean retval = (GLboolean) 0; 4464 const GLuint cmdlen = 4; 4465 if (__builtin_expect(dpy != NULL, 1)) { 4466 GLubyte const * pc = __glXSetupVendorRequest(gc, X_GLXVendorPrivateWithReply, X_GLvop_IsTextureEXT, cmdlen); 4467(void) memcpy((void *)(pc + 0), (void *)(&texture), 1 * sizeof(GLuint)); 4468 retval = (GLboolean) __glXReadReply(dpy, 0, NULL, GL_FALSE); 4469 UnlockDisplay(dpy); SyncHandle(); 4470 } 4471 return retval; 4472} 4473} 4474 4475#define X_GLrop_PrioritizeTextures 4118 4476void __indirect_glPrioritizeTextures(GLsizei n, const GLuint * textures, const GLclampf * priorities) 4477{ 4478 struct glx_context * const gc = __glXGetCurrentContext(); 4479 const GLuint cmdlen = 8 + safe_pad(safe_mul(n, 1 * sizeof(GLuint))) + safe_pad(safe_mul(n, 1 * sizeof(GLclampf))); 4480 if (0 + safe_pad(safe_mul(n, 1 * sizeof(GLuint))) + safe_pad(safe_mul(n, 1 * sizeof(GLclampf))) < 0) { 4481 __glXSetError(gc, GL_INVALID_VALUE); 4482 return; 4483 } 4484 if (n < 0) { 4485 __glXSetError(gc, GL_INVALID_VALUE); 4486 return; 4487 } 4488 if (__builtin_expect(n >= 0, 1)) { 4489emit_header(gc->pc, X_GLrop_PrioritizeTextures, cmdlen); 4490(void) memcpy((void *)(gc->pc + 4), (void *)(&n), 1 * sizeof(GLsizei)); 4491(void) memcpy((void *)(gc->pc + 8), (void *)(textures), safe_mul(n, 1 * sizeof(GLuint))); 4492(void) memcpy((void *)(gc->pc + 8 + safe_mul(n, 1 * sizeof(GLuint))), (void *)(priorities), safe_mul(n, 1 * sizeof(GLclampf))); 4493gc->pc += cmdlen; 4494if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); } 4495 } 4496} 4497 4498static void 4499__glx_TexSubImage_1D2D( unsigned opcode, unsigned dim, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid * pixels ) 4500{ 4501 struct glx_context * const gc = __glXGetCurrentContext(); 4502 const GLuint compsize = (pixels != NULL) ? __glImageSize(width, height, 1, format, type, target) : 0; 4503 const GLuint cmdlen = 60 + safe_pad(compsize); 4504 if (0 + safe_pad(compsize) < 0) { 4505 __glXSetError(gc, GL_INVALID_VALUE); 4506 return; 4507 } 4508 if (__builtin_expect(gc->currentDpy != NULL, 1)) { 4509if (cmdlen <= gc->maxSmallRenderCommandSize) { 4510 if ( (gc->pc + cmdlen) > gc->bufEnd ) { 4511 (void) __glXFlushRenderBuffer(gc, gc->pc); 4512 } 4513emit_header(gc->pc, opcode, cmdlen); 4514(void) memcpy((void *)(gc->pc + 24), (void *)(&target), 1 * sizeof(GLenum)); 4515(void) memcpy((void *)(gc->pc + 28), (void *)(&level), 1 * sizeof(GLint)); 4516(void) memcpy((void *)(gc->pc + 32), (void *)(&xoffset), 1 * sizeof(GLint)); 4517(void) memcpy((void *)(gc->pc + 36), (void *)(&yoffset), 1 * sizeof(GLint)); 4518(void) memcpy((void *)(gc->pc + 40), (void *)(&width), 1 * sizeof(GLsizei)); 4519(void) memcpy((void *)(gc->pc + 44), (void *)(&height), 1 * sizeof(GLsizei)); 4520(void) memcpy((void *)(gc->pc + 48), (void *)(&format), 1 * sizeof(GLenum)); 4521(void) memcpy((void *)(gc->pc + 52), (void *)(&type), 1 * sizeof(GLenum)); 4522(void) memset((void *)(gc->pc + 56), 0, 1 * sizeof(GLuint)); 4523if (compsize > 0) { 4524 __glFillImage(gc, dim, width, height, 1, format, type, pixels, gc->pc + 60, gc->pc + 4); 4525} else { 4526 (void) memcpy( gc->pc + 4, default_pixel_store_2D, default_pixel_store_2D_size ); 4527} 4528gc->pc += cmdlen; 4529if (gc->pc > gc->limit) { (void) __glXFlushRenderBuffer(gc, gc->pc); } 4530} 4531else { 4532const GLint op = opcode; 4533const GLuint cmdlenLarge = cmdlen + 4; 4534GLubyte * const pc = __glXFlushRenderBuffer(gc, gc->pc); 4535(void) memcpy((void *)(pc + 0), (void *)(&cmdlenLarge), 4); 4536(void) memcpy((void *)(pc + 4), (void *)(&op), 4); 4537(void) memcpy((void *)(pc + 28), (void *)(&target), 1 * sizeof(GLenum)); 4538(void) memcpy((void *)(pc + 32), (void *)(&level), 1 * sizeof(GLint)); 4539(void) memcpy((void *)(pc + 36), (void *)(&xoffset), 1 * sizeof(GLint)); 4540(void) memcpy((void *)(pc + 40), (void *)(&yoffset), 1 * sizeof(GLint)); 4541(void) memcpy((void *)(pc + 44), (void *)(&width), 1 * sizeof(GLsizei)); 4542(void) memcpy((void *)(pc + 48), (void *)(&height), 1 * sizeof(GLsizei)); 4543(void) memcpy((void *)(pc + 52), (void *)(&format), 1 * sizeof(GLenum)); 4544(void) memcpy((void *)(pc + 56), (void *)(&type), 1 * sizeof(GLenum)); 4545(void) memset((void *)(pc + 60), 0, 1 * sizeof(GLuint)); 4546__glXSendLargeImage(gc, compsize, dim, width, height, 1, format, type, pixels, pc + 64, pc + 8); 4547} 4548 } 4549} 4550 4551#define X_GLrop_TexSubImage1D 4099 4552void __indirect_glTexSubImage1D(GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, GLenum type, const GLvoid * pixels) 4553{ 4554 __glx_TexSubImage_1D2D(X_GLrop_TexSubImage1D, 1, target, level, xoffset, 1, width, 1, format, type, pixels ); 4555} 4556 4557#define X_GLrop_TexSubImage2D 4100 4558void __indirect_glTexSubImage2D(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid * pixels) 4559{ 4560 __glx_TexSubImage_1D2D(X_GLrop_TexSubImage2D, 2, target, level, xoffset, yoffset, width, height, format, type, pixels ); 4561} 4562 4563#define X_GLrop_BlendColor 4096 4564void __indirect_glBlendColor(GLclampf red, GLclampf green, GLclampf blue, GLclampf alpha) 4565{ 4566 struct glx_context * const gc = __glXGetCurrentContext(); 4567 const GLuint cmdlen = 20; 4568emit_header(gc->pc, X_GLrop_BlendColor, cmdlen); 4569(void) memcpy((void *)(gc->pc + 4), (void *)(&red), 1 * sizeof(GLclampf)); 4570(void) memcpy((void *)(gc->pc + 8), (void *)(&green), 1 * sizeof(GLclampf)); 4571(void) memcpy((void *)(gc->pc + 12), (void *)(&blue), 1 * sizeof(GLclampf)); 4572(void) memcpy((void *)(gc->pc + 16), (void *)(&alpha), 1 * sizeof(GLclampf)); 4573gc->pc += cmdlen; 4574if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); } 4575} 4576 4577#define X_GLrop_BlendEquation 4097 4578void __indirect_glBlendEquation(GLenum mode) 4579{ 4580 struct glx_context * const gc = __glXGetCurrentContext(); 4581 const GLuint cmdlen = 8; 4582emit_header(gc->pc, X_GLrop_BlendEquation, cmdlen); 4583(void) memcpy((void *)(gc->pc + 4), (void *)(&mode), 1 * sizeof(GLenum)); 4584gc->pc += cmdlen; 4585if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); } 4586} 4587 4588#define X_GLrop_ColorTable 2053 4589void __indirect_glColorTable(GLenum target, GLenum internalformat, GLsizei width, GLenum format, GLenum type, const GLvoid * table) 4590{ 4591 struct glx_context * const gc = __glXGetCurrentContext(); 4592 const GLuint compsize = (table != NULL) ? __glImageSize(width, 1, 1, format, type, target) : 0; 4593 const GLuint cmdlen = 44 + safe_pad(compsize); 4594 if (0 + safe_pad(compsize) < 0) { 4595 __glXSetError(gc, GL_INVALID_VALUE); 4596 return; 4597 } 4598 if (__builtin_expect(gc->currentDpy != NULL, 1)) { 4599if (cmdlen <= gc->maxSmallRenderCommandSize) { 4600 if ( (gc->pc + cmdlen) > gc->bufEnd ) { 4601 (void) __glXFlushRenderBuffer(gc, gc->pc); 4602 } 4603emit_header(gc->pc, X_GLrop_ColorTable, cmdlen); 4604(void) memcpy((void *)(gc->pc + 24), (void *)(&target), 1 * sizeof(GLenum)); 4605(void) memcpy((void *)(gc->pc + 28), (void *)(&internalformat), 1 * sizeof(GLenum)); 4606(void) memcpy((void *)(gc->pc + 32), (void *)(&width), 1 * sizeof(GLsizei)); 4607(void) memcpy((void *)(gc->pc + 36), (void *)(&format), 1 * sizeof(GLenum)); 4608(void) memcpy((void *)(gc->pc + 40), (void *)(&type), 1 * sizeof(GLenum)); 4609if (compsize > 0) { 4610 __glFillImage(gc, 1, width, 1, 1, format, type, table, gc->pc + 44, gc->pc + 4); 4611} else { 4612 (void) memcpy( gc->pc + 4, default_pixel_store_1D, default_pixel_store_1D_size ); 4613} 4614gc->pc += cmdlen; 4615if (gc->pc > gc->limit) { (void) __glXFlushRenderBuffer(gc, gc->pc); } 4616} 4617else { 4618const GLint op = X_GLrop_ColorTable; 4619const GLuint cmdlenLarge = cmdlen + 4; 4620GLubyte * const pc = __glXFlushRenderBuffer(gc, gc->pc); 4621(void) memcpy((void *)(pc + 0), (void *)(&cmdlenLarge), 4); 4622(void) memcpy((void *)(pc + 4), (void *)(&op), 4); 4623(void) memcpy((void *)(pc + 28), (void *)(&target), 1 * sizeof(GLenum)); 4624(void) memcpy((void *)(pc + 32), (void *)(&internalformat), 1 * sizeof(GLenum)); 4625(void) memcpy((void *)(pc + 36), (void *)(&width), 1 * sizeof(GLsizei)); 4626(void) memcpy((void *)(pc + 40), (void *)(&format), 1 * sizeof(GLenum)); 4627(void) memcpy((void *)(pc + 44), (void *)(&type), 1 * sizeof(GLenum)); 4628__glXSendLargeImage(gc, compsize, 1, width, 1, 1, format, type, table, pc + 48, pc + 8); 4629} 4630 } 4631} 4632 4633#define X_GLrop_ColorTableParameterfv 2054 4634void __indirect_glColorTableParameterfv(GLenum target, GLenum pname, const GLfloat * params) 4635{ 4636 struct glx_context * const gc = __glXGetCurrentContext(); 4637 const GLuint compsize = __glColorTableParameterfv_size(pname); 4638 const GLuint cmdlen = 12 + safe_pad(safe_mul(compsize, 1 * sizeof(GLfloat))); 4639 if (0 + safe_pad(safe_mul(compsize, 1 * sizeof(GLfloat))) < 0) { 4640 __glXSetError(gc, GL_INVALID_VALUE); 4641 return; 4642 } 4643emit_header(gc->pc, X_GLrop_ColorTableParameterfv, cmdlen); 4644(void) memcpy((void *)(gc->pc + 4), (void *)(&target), 1 * sizeof(GLenum)); 4645(void) memcpy((void *)(gc->pc + 8), (void *)(&pname), 1 * sizeof(GLenum)); 4646(void) memcpy((void *)(gc->pc + 12), (void *)(params), safe_mul(compsize, 1 * sizeof(GLfloat))); 4647gc->pc += cmdlen; 4648if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); } 4649} 4650 4651#define X_GLrop_ColorTableParameteriv 2055 4652void __indirect_glColorTableParameteriv(GLenum target, GLenum pname, const GLint * params) 4653{ 4654 struct glx_context * const gc = __glXGetCurrentContext(); 4655 const GLuint compsize = __glColorTableParameteriv_size(pname); 4656 const GLuint cmdlen = 12 + safe_pad(safe_mul(compsize, 1 * sizeof(GLint))); 4657 if (0 + safe_pad(safe_mul(compsize, 1 * sizeof(GLint))) < 0) { 4658 __glXSetError(gc, GL_INVALID_VALUE); 4659 return; 4660 } 4661emit_header(gc->pc, X_GLrop_ColorTableParameteriv, cmdlen); 4662(void) memcpy((void *)(gc->pc + 4), (void *)(&target), 1 * sizeof(GLenum)); 4663(void) memcpy((void *)(gc->pc + 8), (void *)(&pname), 1 * sizeof(GLenum)); 4664(void) memcpy((void *)(gc->pc + 12), (void *)(params), safe_mul(compsize, 1 * sizeof(GLint))); 4665gc->pc += cmdlen; 4666if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); } 4667} 4668 4669#define X_GLrop_CopyColorTable 2056 4670void __indirect_glCopyColorTable(GLenum target, GLenum internalformat, GLint x, GLint y, GLsizei width) 4671{ 4672 struct glx_context * const gc = __glXGetCurrentContext(); 4673 const GLuint cmdlen = 24; 4674emit_header(gc->pc, X_GLrop_CopyColorTable, cmdlen); 4675(void) memcpy((void *)(gc->pc + 4), (void *)(&target), 1 * sizeof(GLenum)); 4676(void) memcpy((void *)(gc->pc + 8), (void *)(&internalformat), 1 * sizeof(GLenum)); 4677(void) memcpy((void *)(gc->pc + 12), (void *)(&x), 1 * sizeof(GLint)); 4678(void) memcpy((void *)(gc->pc + 16), (void *)(&y), 1 * sizeof(GLint)); 4679(void) memcpy((void *)(gc->pc + 20), (void *)(&width), 1 * sizeof(GLsizei)); 4680gc->pc += cmdlen; 4681if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); } 4682} 4683 4684#define X_GLsop_GetColorTable 147 4685void __indirect_glGetColorTable(GLenum target, GLenum format, GLenum type, GLvoid * table) 4686{ 4687 struct glx_context * const gc = __glXGetCurrentContext(); 4688 const __GLXattribute * const state = gc->client_state_private; 4689 Display * const dpy = gc->currentDpy; 4690#ifndef USE_XCB 4691 const GLuint cmdlen = 16; 4692#endif 4693 if (__builtin_expect(dpy != NULL, 1)) { 4694#ifdef USE_XCB 4695 xcb_connection_t *c = XGetXCBConnection(dpy); 4696 (void) __glXFlushRenderBuffer(gc, gc->pc); 4697 xcb_glx_get_color_table_reply_t *reply = xcb_glx_get_color_table_reply(c, xcb_glx_get_color_table(c, gc->currentContextTag, target, format, type, state->storePack.swapEndian), NULL); 4698 __glEmptyImage(gc, 3, reply->width, 1, 1, format, type, xcb_glx_get_color_table_data(reply), table); 4699 free(reply); 4700#else 4701 GLubyte const * pc = __glXSetupSingleRequest(gc, X_GLsop_GetColorTable, cmdlen); 4702(void) memcpy((void *)(pc + 0), (void *)(&target), 1 * sizeof(GLenum)); 4703(void) memcpy((void *)(pc + 4), (void *)(&format), 1 * sizeof(GLenum)); 4704(void) memcpy((void *)(pc + 8), (void *)(&type), 1 * sizeof(GLenum)); 4705 *(int32_t *)(pc + 12) = 0; 4706 * (int8_t *)(pc + 12) = state->storePack.swapEndian; 4707 __glXReadPixelReply(dpy, gc, 1, 0, 0, 0, format, type, table, GL_TRUE); 4708 UnlockDisplay(dpy); SyncHandle(); 4709#endif /* USE_XCB */ 4710 } 4711 return; 4712} 4713 4714#define X_GLvop_GetColorTableSGI 4098 4715void gl_dispatch_stub_343(GLenum target, GLenum format, GLenum type, GLvoid * table) 4716{ 4717#if defined(GLX_DIRECT_RENDERING) && !defined(GLX_USE_APPLEGL) 4718 if (((struct glx_context *)__glXGetCurrentContext())->isDirect) { 4719 const _glapi_proc *const disp_table = (_glapi_proc *)GET_DISPATCH(); 4720 PFNGLGETCOLORTABLESGIPROC p = 4721 (PFNGLGETCOLORTABLESGIPROC) disp_table[343]; 4722 p(target, format, type, table); 4723 } else 4724#endif 4725 { 4726 struct glx_context * const gc = __glXGetCurrentContext(); 4727 const __GLXattribute * const state = gc->client_state_private; 4728 Display * const dpy = gc->currentDpy; 4729 const GLuint cmdlen = 16; 4730 if (__builtin_expect(dpy != NULL, 1)) { 4731 GLubyte const * pc = __glXSetupVendorRequest(gc, X_GLXVendorPrivateWithReply, X_GLvop_GetColorTableSGI, cmdlen); 4732(void) memcpy((void *)(pc + 0), (void *)(&target), 1 * sizeof(GLenum)); 4733(void) memcpy((void *)(pc + 4), (void *)(&format), 1 * sizeof(GLenum)); 4734(void) memcpy((void *)(pc + 8), (void *)(&type), 1 * sizeof(GLenum)); 4735 *(int32_t *)(pc + 12) = 0; 4736 * (int8_t *)(pc + 12) = state->storePack.swapEndian; 4737 __glXReadPixelReply(dpy, gc, 1, 0, 0, 0, format, type, table, GL_TRUE); 4738 UnlockDisplay(dpy); SyncHandle(); 4739 } 4740 return; 4741} 4742} 4743 4744#define X_GLsop_GetColorTableParameterfv 148 4745void __indirect_glGetColorTableParameterfv(GLenum target, GLenum pname, GLfloat * params) 4746{ 4747 struct glx_context * const gc = __glXGetCurrentContext(); 4748 Display * const dpy = gc->currentDpy; 4749#ifndef USE_XCB 4750 const GLuint cmdlen = 8; 4751#endif 4752 if (__builtin_expect(dpy != NULL, 1)) { 4753#ifdef USE_XCB 4754 xcb_connection_t *c = XGetXCBConnection(dpy); 4755 (void) __glXFlushRenderBuffer(gc, gc->pc); 4756 xcb_glx_get_color_table_parameterfv_reply_t *reply = xcb_glx_get_color_table_parameterfv_reply(c, xcb_glx_get_color_table_parameterfv(c, gc->currentContextTag, target, pname), NULL); 4757 /* the XXX_data_length() xcb function name is misleading, it returns the number */ 4758 /* of elements, not the length of the data part. A single element is embedded. */ 4759 if (xcb_glx_get_color_table_parameterfv_data_length(reply) == 1) 4760 (void)memcpy(params, &reply->datum, sizeof(reply->datum)); 4761 else 4762 (void)memcpy(params, xcb_glx_get_color_table_parameterfv_data(reply), xcb_glx_get_color_table_parameterfv_data_length(reply) * sizeof(GLfloat)); 4763 free(reply); 4764#else 4765 GLubyte const * pc = __glXSetupSingleRequest(gc, X_GLsop_GetColorTableParameterfv, cmdlen); 4766(void) memcpy((void *)(pc + 0), (void *)(&target), 1 * sizeof(GLenum)); 4767(void) memcpy((void *)(pc + 4), (void *)(&pname), 1 * sizeof(GLenum)); 4768 (void) __glXReadReply(dpy, 4, params, GL_FALSE); 4769 UnlockDisplay(dpy); SyncHandle(); 4770#endif /* USE_XCB */ 4771 } 4772 return; 4773} 4774 4775#define X_GLvop_GetColorTableParameterfvSGI 4099 4776void gl_dispatch_stub_344(GLenum target, GLenum pname, GLfloat * params) 4777{ 4778#if defined(GLX_DIRECT_RENDERING) && !defined(GLX_USE_APPLEGL) 4779 if (((struct glx_context *)__glXGetCurrentContext())->isDirect) { 4780 const _glapi_proc *const disp_table = (_glapi_proc *)GET_DISPATCH(); 4781 PFNGLGETCOLORTABLEPARAMETERFVSGIPROC p = 4782 (PFNGLGETCOLORTABLEPARAMETERFVSGIPROC) disp_table[344]; 4783 p(target, pname, params); 4784 } else 4785#endif 4786 { 4787 struct glx_context * const gc = __glXGetCurrentContext(); 4788 Display * const dpy = gc->currentDpy; 4789 const GLuint cmdlen = 8; 4790 if (__builtin_expect(dpy != NULL, 1)) { 4791 GLubyte const * pc = __glXSetupVendorRequest(gc, X_GLXVendorPrivateWithReply, X_GLvop_GetColorTableParameterfvSGI, cmdlen); 4792(void) memcpy((void *)(pc + 0), (void *)(&target), 1 * sizeof(GLenum)); 4793(void) memcpy((void *)(pc + 4), (void *)(&pname), 1 * sizeof(GLenum)); 4794 (void) __glXReadReply(dpy, 4, params, GL_FALSE); 4795 UnlockDisplay(dpy); SyncHandle(); 4796 } 4797 return; 4798} 4799} 4800 4801#define X_GLsop_GetColorTableParameteriv 149 4802void __indirect_glGetColorTableParameteriv(GLenum target, GLenum pname, GLint * params) 4803{ 4804 struct glx_context * const gc = __glXGetCurrentContext(); 4805 Display * const dpy = gc->currentDpy; 4806#ifndef USE_XCB 4807 const GLuint cmdlen = 8; 4808#endif 4809 if (__builtin_expect(dpy != NULL, 1)) { 4810#ifdef USE_XCB 4811 xcb_connection_t *c = XGetXCBConnection(dpy); 4812 (void) __glXFlushRenderBuffer(gc, gc->pc); 4813 xcb_glx_get_color_table_parameteriv_reply_t *reply = xcb_glx_get_color_table_parameteriv_reply(c, xcb_glx_get_color_table_parameteriv(c, gc->currentContextTag, target, pname), NULL); 4814 /* the XXX_data_length() xcb function name is misleading, it returns the number */ 4815 /* of elements, not the length of the data part. A single element is embedded. */ 4816 if (xcb_glx_get_color_table_parameteriv_data_length(reply) == 1) 4817 (void)memcpy(params, &reply->datum, sizeof(reply->datum)); 4818 else 4819 (void)memcpy(params, xcb_glx_get_color_table_parameteriv_data(reply), xcb_glx_get_color_table_parameteriv_data_length(reply) * sizeof(GLint)); 4820 free(reply); 4821#else 4822 GLubyte const * pc = __glXSetupSingleRequest(gc, X_GLsop_GetColorTableParameteriv, cmdlen); 4823(void) memcpy((void *)(pc + 0), (void *)(&target), 1 * sizeof(GLenum)); 4824(void) memcpy((void *)(pc + 4), (void *)(&pname), 1 * sizeof(GLenum)); 4825 (void) __glXReadReply(dpy, 4, params, GL_FALSE); 4826 UnlockDisplay(dpy); SyncHandle(); 4827#endif /* USE_XCB */ 4828 } 4829 return; 4830} 4831 4832#define X_GLvop_GetColorTableParameterivSGI 4100 4833void gl_dispatch_stub_345(GLenum target, GLenum pname, GLint * params) 4834{ 4835#if defined(GLX_DIRECT_RENDERING) && !defined(GLX_USE_APPLEGL) 4836 if (((struct glx_context *)__glXGetCurrentContext())->isDirect) { 4837 const _glapi_proc *const disp_table = (_glapi_proc *)GET_DISPATCH(); 4838 PFNGLGETCOLORTABLEPARAMETERIVSGIPROC p = 4839 (PFNGLGETCOLORTABLEPARAMETERIVSGIPROC) disp_table[345]; 4840 p(target, pname, params); 4841 } else 4842#endif 4843 { 4844 struct glx_context * const gc = __glXGetCurrentContext(); 4845 Display * const dpy = gc->currentDpy; 4846 const GLuint cmdlen = 8; 4847 if (__builtin_expect(dpy != NULL, 1)) { 4848 GLubyte const * pc = __glXSetupVendorRequest(gc, X_GLXVendorPrivateWithReply, X_GLvop_GetColorTableParameterivSGI, cmdlen); 4849(void) memcpy((void *)(pc + 0), (void *)(&target), 1 * sizeof(GLenum)); 4850(void) memcpy((void *)(pc + 4), (void *)(&pname), 1 * sizeof(GLenum)); 4851 (void) __glXReadReply(dpy, 4, params, GL_FALSE); 4852 UnlockDisplay(dpy); SyncHandle(); 4853 } 4854 return; 4855} 4856} 4857 4858#define X_GLrop_ColorSubTable 195 4859void __indirect_glColorSubTable(GLenum target, GLsizei start, GLsizei count, GLenum format, GLenum type, const GLvoid * data) 4860{ 4861 struct glx_context * const gc = __glXGetCurrentContext(); 4862 const GLuint compsize = (data != NULL) ? __glImageSize(count, 1, 1, format, type, target) : 0; 4863 const GLuint cmdlen = 44 + safe_pad(compsize); 4864 if (0 + safe_pad(compsize) < 0) { 4865 __glXSetError(gc, GL_INVALID_VALUE); 4866 return; 4867 } 4868 if (__builtin_expect(gc->currentDpy != NULL, 1)) { 4869if (cmdlen <= gc->maxSmallRenderCommandSize) { 4870 if ( (gc->pc + cmdlen) > gc->bufEnd ) { 4871 (void) __glXFlushRenderBuffer(gc, gc->pc); 4872 } 4873emit_header(gc->pc, X_GLrop_ColorSubTable, cmdlen); 4874(void) memcpy((void *)(gc->pc + 24), (void *)(&target), 1 * sizeof(GLenum)); 4875(void) memcpy((void *)(gc->pc + 28), (void *)(&start), 1 * sizeof(GLsizei)); 4876(void) memcpy((void *)(gc->pc + 32), (void *)(&count), 1 * sizeof(GLsizei)); 4877(void) memcpy((void *)(gc->pc + 36), (void *)(&format), 1 * sizeof(GLenum)); 4878(void) memcpy((void *)(gc->pc + 40), (void *)(&type), 1 * sizeof(GLenum)); 4879if (compsize > 0) { 4880 __glFillImage(gc, 1, count, 1, 1, format, type, data, gc->pc + 44, gc->pc + 4); 4881} else { 4882 (void) memcpy( gc->pc + 4, default_pixel_store_1D, default_pixel_store_1D_size ); 4883} 4884gc->pc += cmdlen; 4885if (gc->pc > gc->limit) { (void) __glXFlushRenderBuffer(gc, gc->pc); } 4886} 4887else { 4888const GLint op = X_GLrop_ColorSubTable; 4889const GLuint cmdlenLarge = cmdlen + 4; 4890GLubyte * const pc = __glXFlushRenderBuffer(gc, gc->pc); 4891(void) memcpy((void *)(pc + 0), (void *)(&cmdlenLarge), 4); 4892(void) memcpy((void *)(pc + 4), (void *)(&op), 4); 4893(void) memcpy((void *)(pc + 28), (void *)(&target), 1 * sizeof(GLenum)); 4894(void) memcpy((void *)(pc + 32), (void *)(&start), 1 * sizeof(GLsizei)); 4895(void) memcpy((void *)(pc + 36), (void *)(&count), 1 * sizeof(GLsizei)); 4896(void) memcpy((void *)(pc + 40), (void *)(&format), 1 * sizeof(GLenum)); 4897(void) memcpy((void *)(pc + 44), (void *)(&type), 1 * sizeof(GLenum)); 4898__glXSendLargeImage(gc, compsize, 1, count, 1, 1, format, type, data, pc + 48, pc + 8); 4899} 4900 } 4901} 4902 4903#define X_GLrop_CopyColorSubTable 196 4904void __indirect_glCopyColorSubTable(GLenum target, GLsizei start, GLint x, GLint y, GLsizei width) 4905{ 4906 struct glx_context * const gc = __glXGetCurrentContext(); 4907 const GLuint cmdlen = 24; 4908emit_header(gc->pc, X_GLrop_CopyColorSubTable, cmdlen); 4909(void) memcpy((void *)(gc->pc + 4), (void *)(&target), 1 * sizeof(GLenum)); 4910(void) memcpy((void *)(gc->pc + 8), (void *)(&start), 1 * sizeof(GLsizei)); 4911(void) memcpy((void *)(gc->pc + 12), (void *)(&x), 1 * sizeof(GLint)); 4912(void) memcpy((void *)(gc->pc + 16), (void *)(&y), 1 * sizeof(GLint)); 4913(void) memcpy((void *)(gc->pc + 20), (void *)(&width), 1 * sizeof(GLsizei)); 4914gc->pc += cmdlen; 4915if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); } 4916} 4917 4918static void 4919__glx_ConvolutionFilter_1D2D( unsigned opcode, unsigned dim, GLenum target, GLenum internalformat, GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid * image ) 4920{ 4921 struct glx_context * const gc = __glXGetCurrentContext(); 4922 const GLuint compsize = (image != NULL) ? __glImageSize(width, height, 1, format, type, target) : 0; 4923 const GLuint cmdlen = 48 + safe_pad(compsize); 4924 if (0 + safe_pad(compsize) < 0) { 4925 __glXSetError(gc, GL_INVALID_VALUE); 4926 return; 4927 } 4928 if (__builtin_expect(gc->currentDpy != NULL, 1)) { 4929if (cmdlen <= gc->maxSmallRenderCommandSize) { 4930 if ( (gc->pc + cmdlen) > gc->bufEnd ) { 4931 (void) __glXFlushRenderBuffer(gc, gc->pc); 4932 } 4933emit_header(gc->pc, opcode, cmdlen); 4934(void) memcpy((void *)(gc->pc + 24), (void *)(&target), 1 * sizeof(GLenum)); 4935(void) memcpy((void *)(gc->pc + 28), (void *)(&internalformat), 1 * sizeof(GLenum)); 4936(void) memcpy((void *)(gc->pc + 32), (void *)(&width), 1 * sizeof(GLsizei)); 4937(void) memcpy((void *)(gc->pc + 36), (void *)(&height), 1 * sizeof(GLsizei)); 4938(void) memcpy((void *)(gc->pc + 40), (void *)(&format), 1 * sizeof(GLenum)); 4939(void) memcpy((void *)(gc->pc + 44), (void *)(&type), 1 * sizeof(GLenum)); 4940if (compsize > 0) { 4941 __glFillImage(gc, dim, width, height, 1, format, type, image, gc->pc + 48, gc->pc + 4); 4942} else { 4943 (void) memcpy( gc->pc + 4, default_pixel_store_2D, default_pixel_store_2D_size ); 4944} 4945gc->pc += cmdlen; 4946if (gc->pc > gc->limit) { (void) __glXFlushRenderBuffer(gc, gc->pc); } 4947} 4948else { 4949const GLint op = opcode; 4950const GLuint cmdlenLarge = cmdlen + 4; 4951GLubyte * const pc = __glXFlushRenderBuffer(gc, gc->pc); 4952(void) memcpy((void *)(pc + 0), (void *)(&cmdlenLarge), 4); 4953(void) memcpy((void *)(pc + 4), (void *)(&op), 4); 4954(void) memcpy((void *)(pc + 28), (void *)(&target), 1 * sizeof(GLenum)); 4955(void) memcpy((void *)(pc + 32), (void *)(&internalformat), 1 * sizeof(GLenum)); 4956(void) memcpy((void *)(pc + 36), (void *)(&width), 1 * sizeof(GLsizei)); 4957(void) memcpy((void *)(pc + 40), (void *)(&height), 1 * sizeof(GLsizei)); 4958(void) memcpy((void *)(pc + 44), (void *)(&format), 1 * sizeof(GLenum)); 4959(void) memcpy((void *)(pc + 48), (void *)(&type), 1 * sizeof(GLenum)); 4960__glXSendLargeImage(gc, compsize, dim, width, height, 1, format, type, image, pc + 52, pc + 8); 4961} 4962 } 4963} 4964 4965#define X_GLrop_ConvolutionFilter1D 4101 4966void __indirect_glConvolutionFilter1D(GLenum target, GLenum internalformat, GLsizei width, GLenum format, GLenum type, const GLvoid * image) 4967{ 4968 __glx_ConvolutionFilter_1D2D(X_GLrop_ConvolutionFilter1D, 1, target, internalformat, width, 1, format, type, image ); 4969} 4970 4971#define X_GLrop_ConvolutionFilter2D 4102 4972void __indirect_glConvolutionFilter2D(GLenum target, GLenum internalformat, GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid * image) 4973{ 4974 __glx_ConvolutionFilter_1D2D(X_GLrop_ConvolutionFilter2D, 2, target, internalformat, width, height, format, type, image ); 4975} 4976 4977#define X_GLrop_ConvolutionParameterf 4103 4978void __indirect_glConvolutionParameterf(GLenum target, GLenum pname, GLfloat params) 4979{ 4980 struct glx_context * const gc = __glXGetCurrentContext(); 4981 const GLuint cmdlen = 16; 4982emit_header(gc->pc, X_GLrop_ConvolutionParameterf, cmdlen); 4983(void) memcpy((void *)(gc->pc + 4), (void *)(&target), 1 * sizeof(GLenum)); 4984(void) memcpy((void *)(gc->pc + 8), (void *)(&pname), 1 * sizeof(GLenum)); 4985(void) memcpy((void *)(gc->pc + 12), (void *)(¶ms), 1 * sizeof(GLfloat)); 4986gc->pc += cmdlen; 4987if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); } 4988} 4989 4990#define X_GLrop_ConvolutionParameterfv 4104 4991void __indirect_glConvolutionParameterfv(GLenum target, GLenum pname, const GLfloat * params) 4992{ 4993 struct glx_context * const gc = __glXGetCurrentContext(); 4994 const GLuint compsize = __glConvolutionParameterfv_size(pname); 4995 const GLuint cmdlen = 12 + safe_pad(safe_mul(compsize, 1 * sizeof(GLfloat))); 4996 if (0 + safe_pad(safe_mul(compsize, 1 * sizeof(GLfloat))) < 0) { 4997 __glXSetError(gc, GL_INVALID_VALUE); 4998 return; 4999 } 5000emit_header(gc->pc, X_GLrop_ConvolutionParameterfv, cmdlen); 5001(void) memcpy((void *)(gc->pc + 4), (void *)(&target), 1 * sizeof(GLenum)); 5002(void) memcpy((void *)(gc->pc + 8), (void *)(&pname), 1 * sizeof(GLenum)); 5003(void) memcpy((void *)(gc->pc + 12), (void *)(params), safe_mul(compsize, 1 * sizeof(GLfloat))); 5004gc->pc += cmdlen; 5005if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); } 5006} 5007 5008#define X_GLrop_ConvolutionParameteri 4105 5009void __indirect_glConvolutionParameteri(GLenum target, GLenum pname, GLint params) 5010{ 5011 struct glx_context * const gc = __glXGetCurrentContext(); 5012 const GLuint cmdlen = 16; 5013emit_header(gc->pc, X_GLrop_ConvolutionParameteri, cmdlen); 5014(void) memcpy((void *)(gc->pc + 4), (void *)(&target), 1 * sizeof(GLenum)); 5015(void) memcpy((void *)(gc->pc + 8), (void *)(&pname), 1 * sizeof(GLenum)); 5016(void) memcpy((void *)(gc->pc + 12), (void *)(¶ms), 1 * sizeof(GLint)); 5017gc->pc += cmdlen; 5018if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); } 5019} 5020 5021#define X_GLrop_ConvolutionParameteriv 4106 5022void __indirect_glConvolutionParameteriv(GLenum target, GLenum pname, const GLint * params) 5023{ 5024 struct glx_context * const gc = __glXGetCurrentContext(); 5025 const GLuint compsize = __glConvolutionParameteriv_size(pname); 5026 const GLuint cmdlen = 12 + safe_pad(safe_mul(compsize, 1 * sizeof(GLint))); 5027 if (0 + safe_pad(safe_mul(compsize, 1 * sizeof(GLint))) < 0) { 5028 __glXSetError(gc, GL_INVALID_VALUE); 5029 return; 5030 } 5031emit_header(gc->pc, X_GLrop_ConvolutionParameteriv, cmdlen); 5032(void) memcpy((void *)(gc->pc + 4), (void *)(&target), 1 * sizeof(GLenum)); 5033(void) memcpy((void *)(gc->pc + 8), (void *)(&pname), 1 * sizeof(GLenum)); 5034(void) memcpy((void *)(gc->pc + 12), (void *)(params), safe_mul(compsize, 1 * sizeof(GLint))); 5035gc->pc += cmdlen; 5036if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); } 5037} 5038 5039#define X_GLrop_CopyConvolutionFilter1D 4107 5040void __indirect_glCopyConvolutionFilter1D(GLenum target, GLenum internalformat, GLint x, GLint y, GLsizei width) 5041{ 5042 struct glx_context * const gc = __glXGetCurrentContext(); 5043 const GLuint cmdlen = 24; 5044emit_header(gc->pc, X_GLrop_CopyConvolutionFilter1D, cmdlen); 5045(void) memcpy((void *)(gc->pc + 4), (void *)(&target), 1 * sizeof(GLenum)); 5046(void) memcpy((void *)(gc->pc + 8), (void *)(&internalformat), 1 * sizeof(GLenum)); 5047(void) memcpy((void *)(gc->pc + 12), (void *)(&x), 1 * sizeof(GLint)); 5048(void) memcpy((void *)(gc->pc + 16), (void *)(&y), 1 * sizeof(GLint)); 5049(void) memcpy((void *)(gc->pc + 20), (void *)(&width), 1 * sizeof(GLsizei)); 5050gc->pc += cmdlen; 5051if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); } 5052} 5053 5054#define X_GLrop_CopyConvolutionFilter2D 4108 5055void __indirect_glCopyConvolutionFilter2D(GLenum target, GLenum internalformat, GLint x, GLint y, GLsizei width, GLsizei height) 5056{ 5057 struct glx_context * const gc = __glXGetCurrentContext(); 5058 const GLuint cmdlen = 28; 5059emit_header(gc->pc, X_GLrop_CopyConvolutionFilter2D, cmdlen); 5060(void) memcpy((void *)(gc->pc + 4), (void *)(&target), 1 * sizeof(GLenum)); 5061(void) memcpy((void *)(gc->pc + 8), (void *)(&internalformat), 1 * sizeof(GLenum)); 5062(void) memcpy((void *)(gc->pc + 12), (void *)(&x), 1 * sizeof(GLint)); 5063(void) memcpy((void *)(gc->pc + 16), (void *)(&y), 1 * sizeof(GLint)); 5064(void) memcpy((void *)(gc->pc + 20), (void *)(&width), 1 * sizeof(GLsizei)); 5065(void) memcpy((void *)(gc->pc + 24), (void *)(&height), 1 * sizeof(GLsizei)); 5066gc->pc += cmdlen; 5067if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); } 5068} 5069 5070#define X_GLsop_GetConvolutionFilter 150 5071void __indirect_glGetConvolutionFilter(GLenum target, GLenum format, GLenum type, GLvoid * image) 5072{ 5073 struct glx_context * const gc = __glXGetCurrentContext(); 5074 const __GLXattribute * const state = gc->client_state_private; 5075 Display * const dpy = gc->currentDpy; 5076#ifndef USE_XCB 5077 const GLuint cmdlen = 16; 5078#endif 5079 if (__builtin_expect(dpy != NULL, 1)) { 5080#ifdef USE_XCB 5081 xcb_connection_t *c = XGetXCBConnection(dpy); 5082 (void) __glXFlushRenderBuffer(gc, gc->pc); 5083 xcb_glx_get_convolution_filter_reply_t *reply = xcb_glx_get_convolution_filter_reply(c, xcb_glx_get_convolution_filter(c, gc->currentContextTag, target, format, type, state->storePack.swapEndian), NULL); 5084 if (reply->height == 0) { reply->height = 1; } 5085 __glEmptyImage(gc, 3, reply->width, reply->height, 1, format, type, xcb_glx_get_convolution_filter_data(reply), image); 5086 free(reply); 5087#else 5088 GLubyte const * pc = __glXSetupSingleRequest(gc, X_GLsop_GetConvolutionFilter, cmdlen); 5089(void) memcpy((void *)(pc + 0), (void *)(&target), 1 * sizeof(GLenum)); 5090(void) memcpy((void *)(pc + 4), (void *)(&format), 1 * sizeof(GLenum)); 5091(void) memcpy((void *)(pc + 8), (void *)(&type), 1 * sizeof(GLenum)); 5092 *(int32_t *)(pc + 12) = 0; 5093 * (int8_t *)(pc + 12) = state->storePack.swapEndian; 5094 __glXReadPixelReply(dpy, gc, 2, 0, 0, 0, format, type, image, GL_TRUE); 5095 UnlockDisplay(dpy); SyncHandle(); 5096#endif /* USE_XCB */ 5097 } 5098 return; 5099} 5100 5101#define X_GLvop_GetConvolutionFilterEXT 1 5102void gl_dispatch_stub_356(GLenum target, GLenum format, GLenum type, GLvoid * image) 5103{ 5104#if defined(GLX_DIRECT_RENDERING) && !defined(GLX_USE_APPLEGL) 5105 if (((struct glx_context *)__glXGetCurrentContext())->isDirect) { 5106 const _glapi_proc *const disp_table = (_glapi_proc *)GET_DISPATCH(); 5107 PFNGLGETCONVOLUTIONFILTEREXTPROC p = 5108 (PFNGLGETCONVOLUTIONFILTEREXTPROC) disp_table[356]; 5109 p(target, format, type, image); 5110 } else 5111#endif 5112 { 5113 struct glx_context * const gc = __glXGetCurrentContext(); 5114 const __GLXattribute * const state = gc->client_state_private; 5115 Display * const dpy = gc->currentDpy; 5116 const GLuint cmdlen = 16; 5117 if (__builtin_expect(dpy != NULL, 1)) { 5118 GLubyte const * pc = __glXSetupVendorRequest(gc, X_GLXVendorPrivateWithReply, X_GLvop_GetConvolutionFilterEXT, cmdlen); 5119(void) memcpy((void *)(pc + 0), (void *)(&target), 1 * sizeof(GLenum)); 5120(void) memcpy((void *)(pc + 4), (void *)(&format), 1 * sizeof(GLenum)); 5121(void) memcpy((void *)(pc + 8), (void *)(&type), 1 * sizeof(GLenum)); 5122 *(int32_t *)(pc + 12) = 0; 5123 * (int8_t *)(pc + 12) = state->storePack.swapEndian; 5124 __glXReadPixelReply(dpy, gc, 2, 0, 0, 0, format, type, image, GL_TRUE); 5125 UnlockDisplay(dpy); SyncHandle(); 5126 } 5127 return; 5128} 5129} 5130 5131#define X_GLsop_GetConvolutionParameterfv 151 5132void __indirect_glGetConvolutionParameterfv(GLenum target, GLenum pname, GLfloat * params) 5133{ 5134 struct glx_context * const gc = __glXGetCurrentContext(); 5135 Display * const dpy = gc->currentDpy; 5136#ifndef USE_XCB 5137 const GLuint cmdlen = 8; 5138#endif 5139 if (__builtin_expect(dpy != NULL, 1)) { 5140#ifdef USE_XCB 5141 xcb_connection_t *c = XGetXCBConnection(dpy); 5142 (void) __glXFlushRenderBuffer(gc, gc->pc); 5143 xcb_glx_get_convolution_parameterfv_reply_t *reply = xcb_glx_get_convolution_parameterfv_reply(c, xcb_glx_get_convolution_parameterfv(c, gc->currentContextTag, target, pname), NULL); 5144 /* the XXX_data_length() xcb function name is misleading, it returns the number */ 5145 /* of elements, not the length of the data part. A single element is embedded. */ 5146 if (xcb_glx_get_convolution_parameterfv_data_length(reply) == 1) 5147 (void)memcpy(params, &reply->datum, sizeof(reply->datum)); 5148 else 5149 (void)memcpy(params, xcb_glx_get_convolution_parameterfv_data(reply), xcb_glx_get_convolution_parameterfv_data_length(reply) * sizeof(GLfloat)); 5150 free(reply); 5151#else 5152 GLubyte const * pc = __glXSetupSingleRequest(gc, X_GLsop_GetConvolutionParameterfv, cmdlen); 5153(void) memcpy((void *)(pc + 0), (void *)(&target), 1 * sizeof(GLenum)); 5154(void) memcpy((void *)(pc + 4), (void *)(&pname), 1 * sizeof(GLenum)); 5155 (void) __glXReadReply(dpy, 4, params, GL_FALSE); 5156 UnlockDisplay(dpy); SyncHandle(); 5157#endif /* USE_XCB */ 5158 } 5159 return; 5160} 5161 5162#define X_GLvop_GetConvolutionParameterfvEXT 2 5163void gl_dispatch_stub_357(GLenum target, GLenum pname, GLfloat * params) 5164{ 5165#if defined(GLX_DIRECT_RENDERING) && !defined(GLX_USE_APPLEGL) 5166 if (((struct glx_context *)__glXGetCurrentContext())->isDirect) { 5167 const _glapi_proc *const disp_table = (_glapi_proc *)GET_DISPATCH(); 5168 PFNGLGETCONVOLUTIONPARAMETERFVEXTPROC p = 5169 (PFNGLGETCONVOLUTIONPARAMETERFVEXTPROC) disp_table[357]; 5170 p(target, pname, params); 5171 } else 5172#endif 5173 { 5174 struct glx_context * const gc = __glXGetCurrentContext(); 5175 Display * const dpy = gc->currentDpy; 5176 const GLuint cmdlen = 8; 5177 if (__builtin_expect(dpy != NULL, 1)) { 5178 GLubyte const * pc = __glXSetupVendorRequest(gc, X_GLXVendorPrivateWithReply, X_GLvop_GetConvolutionParameterfvEXT, cmdlen); 5179(void) memcpy((void *)(pc + 0), (void *)(&target), 1 * sizeof(GLenum)); 5180(void) memcpy((void *)(pc + 4), (void *)(&pname), 1 * sizeof(GLenum)); 5181 (void) __glXReadReply(dpy, 4, params, GL_FALSE); 5182 UnlockDisplay(dpy); SyncHandle(); 5183 } 5184 return; 5185} 5186} 5187 5188#define X_GLsop_GetConvolutionParameteriv 152 5189void __indirect_glGetConvolutionParameteriv(GLenum target, GLenum pname, GLint * params) 5190{ 5191 struct glx_context * const gc = __glXGetCurrentContext(); 5192 Display * const dpy = gc->currentDpy; 5193#ifndef USE_XCB 5194 const GLuint cmdlen = 8; 5195#endif 5196 if (__builtin_expect(dpy != NULL, 1)) { 5197#ifdef USE_XCB 5198 xcb_connection_t *c = XGetXCBConnection(dpy); 5199 (void) __glXFlushRenderBuffer(gc, gc->pc); 5200 xcb_glx_get_convolution_parameteriv_reply_t *reply = xcb_glx_get_convolution_parameteriv_reply(c, xcb_glx_get_convolution_parameteriv(c, gc->currentContextTag, target, pname), NULL); 5201 /* the XXX_data_length() xcb function name is misleading, it returns the number */ 5202 /* of elements, not the length of the data part. A single element is embedded. */ 5203 if (xcb_glx_get_convolution_parameteriv_data_length(reply) == 1) 5204 (void)memcpy(params, &reply->datum, sizeof(reply->datum)); 5205 else 5206 (void)memcpy(params, xcb_glx_get_convolution_parameteriv_data(reply), xcb_glx_get_convolution_parameteriv_data_length(reply) * sizeof(GLint)); 5207 free(reply); 5208#else 5209 GLubyte const * pc = __glXSetupSingleRequest(gc, X_GLsop_GetConvolutionParameteriv, cmdlen); 5210(void) memcpy((void *)(pc + 0), (void *)(&target), 1 * sizeof(GLenum)); 5211(void) memcpy((void *)(pc + 4), (void *)(&pname), 1 * sizeof(GLenum)); 5212 (void) __glXReadReply(dpy, 4, params, GL_FALSE); 5213 UnlockDisplay(dpy); SyncHandle(); 5214#endif /* USE_XCB */ 5215 } 5216 return; 5217} 5218 5219#define X_GLvop_GetConvolutionParameterivEXT 3 5220void gl_dispatch_stub_358(GLenum target, GLenum pname, GLint * params) 5221{ 5222#if defined(GLX_DIRECT_RENDERING) && !defined(GLX_USE_APPLEGL) 5223 if (((struct glx_context *)__glXGetCurrentContext())->isDirect) { 5224 const _glapi_proc *const disp_table = (_glapi_proc *)GET_DISPATCH(); 5225 PFNGLGETCONVOLUTIONPARAMETERIVEXTPROC p = 5226 (PFNGLGETCONVOLUTIONPARAMETERIVEXTPROC) disp_table[358]; 5227 p(target, pname, params); 5228 } else 5229#endif 5230 { 5231 struct glx_context * const gc = __glXGetCurrentContext(); 5232 Display * const dpy = gc->currentDpy; 5233 const GLuint cmdlen = 8; 5234 if (__builtin_expect(dpy != NULL, 1)) { 5235 GLubyte const * pc = __glXSetupVendorRequest(gc, X_GLXVendorPrivateWithReply, X_GLvop_GetConvolutionParameterivEXT, cmdlen); 5236(void) memcpy((void *)(pc + 0), (void *)(&target), 1 * sizeof(GLenum)); 5237(void) memcpy((void *)(pc + 4), (void *)(&pname), 1 * sizeof(GLenum)); 5238 (void) __glXReadReply(dpy, 4, params, GL_FALSE); 5239 UnlockDisplay(dpy); SyncHandle(); 5240 } 5241 return; 5242} 5243} 5244 5245#define X_GLsop_GetHistogram 154 5246void __indirect_glGetHistogram(GLenum target, GLboolean reset, GLenum format, GLenum type, GLvoid * values) 5247{ 5248 struct glx_context * const gc = __glXGetCurrentContext(); 5249 const __GLXattribute * const state = gc->client_state_private; 5250 Display * const dpy = gc->currentDpy; 5251#ifndef USE_XCB 5252 const GLuint cmdlen = 16; 5253#endif 5254 if (__builtin_expect(dpy != NULL, 1)) { 5255#ifdef USE_XCB 5256 xcb_connection_t *c = XGetXCBConnection(dpy); 5257 (void) __glXFlushRenderBuffer(gc, gc->pc); 5258 xcb_glx_get_histogram_reply_t *reply = xcb_glx_get_histogram_reply(c, xcb_glx_get_histogram(c, gc->currentContextTag, target, reset, format, type, state->storePack.swapEndian), NULL); 5259 __glEmptyImage(gc, 3, reply->width, 1, 1, format, type, xcb_glx_get_histogram_data(reply), values); 5260 free(reply); 5261#else 5262 GLubyte const * pc = __glXSetupSingleRequest(gc, X_GLsop_GetHistogram, cmdlen); 5263(void) memcpy((void *)(pc + 0), (void *)(&target), 1 * sizeof(GLenum)); 5264(void) memcpy((void *)(pc + 4), (void *)(&format), 1 * sizeof(GLenum)); 5265(void) memcpy((void *)(pc + 8), (void *)(&type), 1 * sizeof(GLenum)); 5266 *(int32_t *)(pc + 12) = 0; 5267 * (int8_t *)(pc + 12) = state->storePack.swapEndian; 5268 * (int8_t *)(pc + 13) = reset; 5269 __glXReadPixelReply(dpy, gc, 1, 0, 0, 0, format, type, values, GL_TRUE); 5270 UnlockDisplay(dpy); SyncHandle(); 5271#endif /* USE_XCB */ 5272 } 5273 return; 5274} 5275 5276#define X_GLvop_GetHistogramEXT 5 5277void gl_dispatch_stub_361(GLenum target, GLboolean reset, GLenum format, GLenum type, GLvoid * values) 5278{ 5279#if defined(GLX_DIRECT_RENDERING) && !defined(GLX_USE_APPLEGL) 5280 if (((struct glx_context *)__glXGetCurrentContext())->isDirect) { 5281 const _glapi_proc *const disp_table = (_glapi_proc *)GET_DISPATCH(); 5282 PFNGLGETHISTOGRAMEXTPROC p = 5283 (PFNGLGETHISTOGRAMEXTPROC) disp_table[361]; 5284 p(target, reset, format, type, values); 5285 } else 5286#endif 5287 { 5288 struct glx_context * const gc = __glXGetCurrentContext(); 5289 const __GLXattribute * const state = gc->client_state_private; 5290 Display * const dpy = gc->currentDpy; 5291 const GLuint cmdlen = 16; 5292 if (__builtin_expect(dpy != NULL, 1)) { 5293 GLubyte const * pc = __glXSetupVendorRequest(gc, X_GLXVendorPrivateWithReply, X_GLvop_GetHistogramEXT, cmdlen); 5294(void) memcpy((void *)(pc + 0), (void *)(&target), 1 * sizeof(GLenum)); 5295(void) memcpy((void *)(pc + 4), (void *)(&format), 1 * sizeof(GLenum)); 5296(void) memcpy((void *)(pc + 8), (void *)(&type), 1 * sizeof(GLenum)); 5297 *(int32_t *)(pc + 12) = 0; 5298 * (int8_t *)(pc + 12) = state->storePack.swapEndian; 5299 * (int8_t *)(pc + 13) = reset; 5300 __glXReadPixelReply(dpy, gc, 1, 0, 0, 0, format, type, values, GL_TRUE); 5301 UnlockDisplay(dpy); SyncHandle(); 5302 } 5303 return; 5304} 5305} 5306 5307#define X_GLsop_GetHistogramParameterfv 155 5308void __indirect_glGetHistogramParameterfv(GLenum target, GLenum pname, GLfloat * params) 5309{ 5310 struct glx_context * const gc = __glXGetCurrentContext(); 5311 Display * const dpy = gc->currentDpy; 5312#ifndef USE_XCB 5313 const GLuint cmdlen = 8; 5314#endif 5315 if (__builtin_expect(dpy != NULL, 1)) { 5316#ifdef USE_XCB 5317 xcb_connection_t *c = XGetXCBConnection(dpy); 5318 (void) __glXFlushRenderBuffer(gc, gc->pc); 5319 xcb_glx_get_histogram_parameterfv_reply_t *reply = xcb_glx_get_histogram_parameterfv_reply(c, xcb_glx_get_histogram_parameterfv(c, gc->currentContextTag, target, pname), NULL); 5320 /* the XXX_data_length() xcb function name is misleading, it returns the number */ 5321 /* of elements, not the length of the data part. A single element is embedded. */ 5322 if (xcb_glx_get_histogram_parameterfv_data_length(reply) == 1) 5323 (void)memcpy(params, &reply->datum, sizeof(reply->datum)); 5324 else 5325 (void)memcpy(params, xcb_glx_get_histogram_parameterfv_data(reply), xcb_glx_get_histogram_parameterfv_data_length(reply) * sizeof(GLfloat)); 5326 free(reply); 5327#else 5328 GLubyte const * pc = __glXSetupSingleRequest(gc, X_GLsop_GetHistogramParameterfv, cmdlen); 5329(void) memcpy((void *)(pc + 0), (void *)(&target), 1 * sizeof(GLenum)); 5330(void) memcpy((void *)(pc + 4), (void *)(&pname), 1 * sizeof(GLenum)); 5331 (void) __glXReadReply(dpy, 4, params, GL_FALSE); 5332 UnlockDisplay(dpy); SyncHandle(); 5333#endif /* USE_XCB */ 5334 } 5335 return; 5336} 5337 5338#define X_GLvop_GetHistogramParameterfvEXT 6 5339void gl_dispatch_stub_362(GLenum target, GLenum pname, GLfloat * params) 5340{ 5341#if defined(GLX_DIRECT_RENDERING) && !defined(GLX_USE_APPLEGL) 5342 if (((struct glx_context *)__glXGetCurrentContext())->isDirect) { 5343 const _glapi_proc *const disp_table = (_glapi_proc *)GET_DISPATCH(); 5344 PFNGLGETHISTOGRAMPARAMETERFVEXTPROC p = 5345 (PFNGLGETHISTOGRAMPARAMETERFVEXTPROC) disp_table[362]; 5346 p(target, pname, params); 5347 } else 5348#endif 5349 { 5350 struct glx_context * const gc = __glXGetCurrentContext(); 5351 Display * const dpy = gc->currentDpy; 5352 const GLuint cmdlen = 8; 5353 if (__builtin_expect(dpy != NULL, 1)) { 5354 GLubyte const * pc = __glXSetupVendorRequest(gc, X_GLXVendorPrivateWithReply, X_GLvop_GetHistogramParameterfvEXT, cmdlen); 5355(void) memcpy((void *)(pc + 0), (void *)(&target), 1 * sizeof(GLenum)); 5356(void) memcpy((void *)(pc + 4), (void *)(&pname), 1 * sizeof(GLenum)); 5357 (void) __glXReadReply(dpy, 4, params, GL_FALSE); 5358 UnlockDisplay(dpy); SyncHandle(); 5359 } 5360 return; 5361} 5362} 5363 5364#define X_GLsop_GetHistogramParameteriv 156 5365void __indirect_glGetHistogramParameteriv(GLenum target, GLenum pname, GLint * params) 5366{ 5367 struct glx_context * const gc = __glXGetCurrentContext(); 5368 Display * const dpy = gc->currentDpy; 5369#ifndef USE_XCB 5370 const GLuint cmdlen = 8; 5371#endif 5372 if (__builtin_expect(dpy != NULL, 1)) { 5373#ifdef USE_XCB 5374 xcb_connection_t *c = XGetXCBConnection(dpy); 5375 (void) __glXFlushRenderBuffer(gc, gc->pc); 5376 xcb_glx_get_histogram_parameteriv_reply_t *reply = xcb_glx_get_histogram_parameteriv_reply(c, xcb_glx_get_histogram_parameteriv(c, gc->currentContextTag, target, pname), NULL); 5377 /* the XXX_data_length() xcb function name is misleading, it returns the number */ 5378 /* of elements, not the length of the data part. A single element is embedded. */ 5379 if (xcb_glx_get_histogram_parameteriv_data_length(reply) == 1) 5380 (void)memcpy(params, &reply->datum, sizeof(reply->datum)); 5381 else 5382 (void)memcpy(params, xcb_glx_get_histogram_parameteriv_data(reply), xcb_glx_get_histogram_parameteriv_data_length(reply) * sizeof(GLint)); 5383 free(reply); 5384#else 5385 GLubyte const * pc = __glXSetupSingleRequest(gc, X_GLsop_GetHistogramParameteriv, cmdlen); 5386(void) memcpy((void *)(pc + 0), (void *)(&target), 1 * sizeof(GLenum)); 5387(void) memcpy((void *)(pc + 4), (void *)(&pname), 1 * sizeof(GLenum)); 5388 (void) __glXReadReply(dpy, 4, params, GL_FALSE); 5389 UnlockDisplay(dpy); SyncHandle(); 5390#endif /* USE_XCB */ 5391 } 5392 return; 5393} 5394 5395#define X_GLvop_GetHistogramParameterivEXT 7 5396void gl_dispatch_stub_363(GLenum target, GLenum pname, GLint * params) 5397{ 5398#if defined(GLX_DIRECT_RENDERING) && !defined(GLX_USE_APPLEGL) 5399 if (((struct glx_context *)__glXGetCurrentContext())->isDirect) { 5400 const _glapi_proc *const disp_table = (_glapi_proc *)GET_DISPATCH(); 5401 PFNGLGETHISTOGRAMPARAMETERIVEXTPROC p = 5402 (PFNGLGETHISTOGRAMPARAMETERIVEXTPROC) disp_table[363]; 5403 p(target, pname, params); 5404 } else 5405#endif 5406 { 5407 struct glx_context * const gc = __glXGetCurrentContext(); 5408 Display * const dpy = gc->currentDpy; 5409 const GLuint cmdlen = 8; 5410 if (__builtin_expect(dpy != NULL, 1)) { 5411 GLubyte const * pc = __glXSetupVendorRequest(gc, X_GLXVendorPrivateWithReply, X_GLvop_GetHistogramParameterivEXT, cmdlen); 5412(void) memcpy((void *)(pc + 0), (void *)(&target), 1 * sizeof(GLenum)); 5413(void) memcpy((void *)(pc + 4), (void *)(&pname), 1 * sizeof(GLenum)); 5414 (void) __glXReadReply(dpy, 4, params, GL_FALSE); 5415 UnlockDisplay(dpy); SyncHandle(); 5416 } 5417 return; 5418} 5419} 5420 5421#define X_GLsop_GetMinmax 157 5422void __indirect_glGetMinmax(GLenum target, GLboolean reset, GLenum format, GLenum type, GLvoid * values) 5423{ 5424 struct glx_context * const gc = __glXGetCurrentContext(); 5425 const __GLXattribute * const state = gc->client_state_private; 5426 Display * const dpy = gc->currentDpy; 5427#ifndef USE_XCB 5428 const GLuint cmdlen = 16; 5429#endif 5430 if (__builtin_expect(dpy != NULL, 1)) { 5431#ifdef USE_XCB 5432 xcb_connection_t *c = XGetXCBConnection(dpy); 5433 (void) __glXFlushRenderBuffer(gc, gc->pc); 5434 xcb_glx_get_minmax_reply_t *reply = xcb_glx_get_minmax_reply(c, xcb_glx_get_minmax(c, gc->currentContextTag, target, reset, format, type, state->storePack.swapEndian), NULL); 5435 __glEmptyImage(gc, 3, 2, 1, 1, format, type, xcb_glx_get_minmax_data(reply), values); 5436 free(reply); 5437#else 5438 GLubyte const * pc = __glXSetupSingleRequest(gc, X_GLsop_GetMinmax, cmdlen); 5439(void) memcpy((void *)(pc + 0), (void *)(&target), 1 * sizeof(GLenum)); 5440(void) memcpy((void *)(pc + 4), (void *)(&format), 1 * sizeof(GLenum)); 5441(void) memcpy((void *)(pc + 8), (void *)(&type), 1 * sizeof(GLenum)); 5442 *(int32_t *)(pc + 12) = 0; 5443 * (int8_t *)(pc + 12) = state->storePack.swapEndian; 5444 * (int8_t *)(pc + 13) = reset; 5445 __glXReadPixelReply(dpy, gc, 1, 2, 1, 1, format, type, values, GL_FALSE); 5446 UnlockDisplay(dpy); SyncHandle(); 5447#endif /* USE_XCB */ 5448 } 5449 return; 5450} 5451 5452#define X_GLvop_GetMinmaxEXT 8 5453void gl_dispatch_stub_364(GLenum target, GLboolean reset, GLenum format, GLenum type, GLvoid * values) 5454{ 5455#if defined(GLX_DIRECT_RENDERING) && !defined(GLX_USE_APPLEGL) 5456 if (((struct glx_context *)__glXGetCurrentContext())->isDirect) { 5457 const _glapi_proc *const disp_table = (_glapi_proc *)GET_DISPATCH(); 5458 PFNGLGETMINMAXEXTPROC p = 5459 (PFNGLGETMINMAXEXTPROC) disp_table[364]; 5460 p(target, reset, format, type, values); 5461 } else 5462#endif 5463 { 5464 struct glx_context * const gc = __glXGetCurrentContext(); 5465 const __GLXattribute * const state = gc->client_state_private; 5466 Display * const dpy = gc->currentDpy; 5467 const GLuint cmdlen = 16; 5468 if (__builtin_expect(dpy != NULL, 1)) { 5469 GLubyte const * pc = __glXSetupVendorRequest(gc, X_GLXVendorPrivateWithReply, X_GLvop_GetMinmaxEXT, cmdlen); 5470(void) memcpy((void *)(pc + 0), (void *)(&target), 1 * sizeof(GLenum)); 5471(void) memcpy((void *)(pc + 4), (void *)(&format), 1 * sizeof(GLenum)); 5472(void) memcpy((void *)(pc + 8), (void *)(&type), 1 * sizeof(GLenum)); 5473 *(int32_t *)(pc + 12) = 0; 5474 * (int8_t *)(pc + 12) = state->storePack.swapEndian; 5475 * (int8_t *)(pc + 13) = reset; 5476 __glXReadPixelReply(dpy, gc, 1, 2, 1, 1, format, type, values, GL_FALSE); 5477 UnlockDisplay(dpy); SyncHandle(); 5478 } 5479 return; 5480} 5481} 5482 5483#define X_GLsop_GetMinmaxParameterfv 158 5484void __indirect_glGetMinmaxParameterfv(GLenum target, GLenum pname, GLfloat * params) 5485{ 5486 struct glx_context * const gc = __glXGetCurrentContext(); 5487 Display * const dpy = gc->currentDpy; 5488#ifndef USE_XCB 5489 const GLuint cmdlen = 8; 5490#endif 5491 if (__builtin_expect(dpy != NULL, 1)) { 5492#ifdef USE_XCB 5493 xcb_connection_t *c = XGetXCBConnection(dpy); 5494 (void) __glXFlushRenderBuffer(gc, gc->pc); 5495 xcb_glx_get_minmax_parameterfv_reply_t *reply = xcb_glx_get_minmax_parameterfv_reply(c, xcb_glx_get_minmax_parameterfv(c, gc->currentContextTag, target, pname), NULL); 5496 /* the XXX_data_length() xcb function name is misleading, it returns the number */ 5497 /* of elements, not the length of the data part. A single element is embedded. */ 5498 if (xcb_glx_get_minmax_parameterfv_data_length(reply) == 1) 5499 (void)memcpy(params, &reply->datum, sizeof(reply->datum)); 5500 else 5501 (void)memcpy(params, xcb_glx_get_minmax_parameterfv_data(reply), xcb_glx_get_minmax_parameterfv_data_length(reply) * sizeof(GLfloat)); 5502 free(reply); 5503#else 5504 GLubyte const * pc = __glXSetupSingleRequest(gc, X_GLsop_GetMinmaxParameterfv, cmdlen); 5505(void) memcpy((void *)(pc + 0), (void *)(&target), 1 * sizeof(GLenum)); 5506(void) memcpy((void *)(pc + 4), (void *)(&pname), 1 * sizeof(GLenum)); 5507 (void) __glXReadReply(dpy, 4, params, GL_FALSE); 5508 UnlockDisplay(dpy); SyncHandle(); 5509#endif /* USE_XCB */ 5510 } 5511 return; 5512} 5513 5514#define X_GLvop_GetMinmaxParameterfvEXT 9 5515void gl_dispatch_stub_365(GLenum target, GLenum pname, GLfloat * params) 5516{ 5517#if defined(GLX_DIRECT_RENDERING) && !defined(GLX_USE_APPLEGL) 5518 if (((struct glx_context *)__glXGetCurrentContext())->isDirect) { 5519 const _glapi_proc *const disp_table = (_glapi_proc *)GET_DISPATCH(); 5520 PFNGLGETMINMAXPARAMETERFVEXTPROC p = 5521 (PFNGLGETMINMAXPARAMETERFVEXTPROC) disp_table[365]; 5522 p(target, pname, params); 5523 } else 5524#endif 5525 { 5526 struct glx_context * const gc = __glXGetCurrentContext(); 5527 Display * const dpy = gc->currentDpy; 5528 const GLuint cmdlen = 8; 5529 if (__builtin_expect(dpy != NULL, 1)) { 5530 GLubyte const * pc = __glXSetupVendorRequest(gc, X_GLXVendorPrivateWithReply, X_GLvop_GetMinmaxParameterfvEXT, cmdlen); 5531(void) memcpy((void *)(pc + 0), (void *)(&target), 1 * sizeof(GLenum)); 5532(void) memcpy((void *)(pc + 4), (void *)(&pname), 1 * sizeof(GLenum)); 5533 (void) __glXReadReply(dpy, 4, params, GL_FALSE); 5534 UnlockDisplay(dpy); SyncHandle(); 5535 } 5536 return; 5537} 5538} 5539 5540#define X_GLsop_GetMinmaxParameteriv 159 5541void __indirect_glGetMinmaxParameteriv(GLenum target, GLenum pname, GLint * params) 5542{ 5543 struct glx_context * const gc = __glXGetCurrentContext(); 5544 Display * const dpy = gc->currentDpy; 5545#ifndef USE_XCB 5546 const GLuint cmdlen = 8; 5547#endif 5548 if (__builtin_expect(dpy != NULL, 1)) { 5549#ifdef USE_XCB 5550 xcb_connection_t *c = XGetXCBConnection(dpy); 5551 (void) __glXFlushRenderBuffer(gc, gc->pc); 5552 xcb_glx_get_minmax_parameteriv_reply_t *reply = xcb_glx_get_minmax_parameteriv_reply(c, xcb_glx_get_minmax_parameteriv(c, gc->currentContextTag, target, pname), NULL); 5553 /* the XXX_data_length() xcb function name is misleading, it returns the number */ 5554 /* of elements, not the length of the data part. A single element is embedded. */ 5555 if (xcb_glx_get_minmax_parameteriv_data_length(reply) == 1) 5556 (void)memcpy(params, &reply->datum, sizeof(reply->datum)); 5557 else 5558 (void)memcpy(params, xcb_glx_get_minmax_parameteriv_data(reply), xcb_glx_get_minmax_parameteriv_data_length(reply) * sizeof(GLint)); 5559 free(reply); 5560#else 5561 GLubyte const * pc = __glXSetupSingleRequest(gc, X_GLsop_GetMinmaxParameteriv, cmdlen); 5562(void) memcpy((void *)(pc + 0), (void *)(&target), 1 * sizeof(GLenum)); 5563(void) memcpy((void *)(pc + 4), (void *)(&pname), 1 * sizeof(GLenum)); 5564 (void) __glXReadReply(dpy, 4, params, GL_FALSE); 5565 UnlockDisplay(dpy); SyncHandle(); 5566#endif /* USE_XCB */ 5567 } 5568 return; 5569} 5570 5571#define X_GLvop_GetMinmaxParameterivEXT 10 5572void gl_dispatch_stub_366(GLenum target, GLenum pname, GLint * params) 5573{ 5574#if defined(GLX_DIRECT_RENDERING) && !defined(GLX_USE_APPLEGL) 5575 if (((struct glx_context *)__glXGetCurrentContext())->isDirect) { 5576 const _glapi_proc *const disp_table = (_glapi_proc *)GET_DISPATCH(); 5577 PFNGLGETMINMAXPARAMETERIVEXTPROC p = 5578 (PFNGLGETMINMAXPARAMETERIVEXTPROC) disp_table[366]; 5579 p(target, pname, params); 5580 } else 5581#endif 5582 { 5583 struct glx_context * const gc = __glXGetCurrentContext(); 5584 Display * const dpy = gc->currentDpy; 5585 const GLuint cmdlen = 8; 5586 if (__builtin_expect(dpy != NULL, 1)) { 5587 GLubyte const * pc = __glXSetupVendorRequest(gc, X_GLXVendorPrivateWithReply, X_GLvop_GetMinmaxParameterivEXT, cmdlen); 5588(void) memcpy((void *)(pc + 0), (void *)(&target), 1 * sizeof(GLenum)); 5589(void) memcpy((void *)(pc + 4), (void *)(&pname), 1 * sizeof(GLenum)); 5590 (void) __glXReadReply(dpy, 4, params, GL_FALSE); 5591 UnlockDisplay(dpy); SyncHandle(); 5592 } 5593 return; 5594} 5595} 5596 5597#define X_GLrop_Histogram 4110 5598void __indirect_glHistogram(GLenum target, GLsizei width, GLenum internalformat, GLboolean sink) 5599{ 5600 struct glx_context * const gc = __glXGetCurrentContext(); 5601 const GLuint cmdlen = 20; 5602emit_header(gc->pc, X_GLrop_Histogram, cmdlen); 5603(void) memcpy((void *)(gc->pc + 4), (void *)(&target), 1 * sizeof(GLenum)); 5604(void) memcpy((void *)(gc->pc + 8), (void *)(&width), 1 * sizeof(GLsizei)); 5605(void) memcpy((void *)(gc->pc + 12), (void *)(&internalformat), 1 * sizeof(GLenum)); 5606(void) memcpy((void *)(gc->pc + 16), (void *)(&sink), 1 * sizeof(GLboolean)); 5607gc->pc += cmdlen; 5608if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); } 5609} 5610 5611#define X_GLrop_Minmax 4111 5612void __indirect_glMinmax(GLenum target, GLenum internalformat, GLboolean sink) 5613{ 5614 struct glx_context * const gc = __glXGetCurrentContext(); 5615 const GLuint cmdlen = 16; 5616emit_header(gc->pc, X_GLrop_Minmax, cmdlen); 5617(void) memcpy((void *)(gc->pc + 4), (void *)(&target), 1 * sizeof(GLenum)); 5618(void) memcpy((void *)(gc->pc + 8), (void *)(&internalformat), 1 * sizeof(GLenum)); 5619(void) memcpy((void *)(gc->pc + 12), (void *)(&sink), 1 * sizeof(GLboolean)); 5620gc->pc += cmdlen; 5621if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); } 5622} 5623 5624#define X_GLrop_ResetHistogram 4112 5625void __indirect_glResetHistogram(GLenum target) 5626{ 5627 struct glx_context * const gc = __glXGetCurrentContext(); 5628 const GLuint cmdlen = 8; 5629emit_header(gc->pc, X_GLrop_ResetHistogram, cmdlen); 5630(void) memcpy((void *)(gc->pc + 4), (void *)(&target), 1 * sizeof(GLenum)); 5631gc->pc += cmdlen; 5632if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); } 5633} 5634 5635#define X_GLrop_ResetMinmax 4113 5636void __indirect_glResetMinmax(GLenum target) 5637{ 5638 struct glx_context * const gc = __glXGetCurrentContext(); 5639 const GLuint cmdlen = 8; 5640emit_header(gc->pc, X_GLrop_ResetMinmax, cmdlen); 5641(void) memcpy((void *)(gc->pc + 4), (void *)(&target), 1 * sizeof(GLenum)); 5642gc->pc += cmdlen; 5643if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); } 5644} 5645 5646static void 5647__glx_TexImage_3D4D( unsigned opcode, unsigned dim, GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLsizei depth, GLsizei extent, GLint border, GLenum format, GLenum type, const GLvoid * pixels ) 5648{ 5649 struct glx_context * const gc = __glXGetCurrentContext(); 5650 const GLuint compsize = (pixels != NULL) ? __glImageSize(width, height, depth, format, type, target) : 0; 5651 const GLuint cmdlen = 84 + safe_pad(compsize); 5652 if (0 + safe_pad(compsize) < 0) { 5653 __glXSetError(gc, GL_INVALID_VALUE); 5654 return; 5655 } 5656 if (__builtin_expect(gc->currentDpy != NULL, 1)) { 5657if (cmdlen <= gc->maxSmallRenderCommandSize) { 5658 if ( (gc->pc + cmdlen) > gc->bufEnd ) { 5659 (void) __glXFlushRenderBuffer(gc, gc->pc); 5660 } 5661emit_header(gc->pc, opcode, cmdlen); 5662(void) memcpy((void *)(gc->pc + 40), (void *)(&target), 1 * sizeof(GLenum)); 5663(void) memcpy((void *)(gc->pc + 44), (void *)(&level), 1 * sizeof(GLint)); 5664(void) memcpy((void *)(gc->pc + 48), (void *)(&internalformat), 1 * sizeof(GLint)); 5665(void) memcpy((void *)(gc->pc + 52), (void *)(&width), 1 * sizeof(GLsizei)); 5666(void) memcpy((void *)(gc->pc + 56), (void *)(&height), 1 * sizeof(GLsizei)); 5667(void) memcpy((void *)(gc->pc + 60), (void *)(&depth), 1 * sizeof(GLsizei)); 5668(void) memcpy((void *)(gc->pc + 64), (void *)(&extent), 1 * sizeof(GLsizei)); 5669(void) memcpy((void *)(gc->pc + 68), (void *)(&border), 1 * sizeof(GLint)); 5670(void) memcpy((void *)(gc->pc + 72), (void *)(&format), 1 * sizeof(GLenum)); 5671(void) memcpy((void *)(gc->pc + 76), (void *)(&type), 1 * sizeof(GLenum)); 5672(void) memcpy((void *)(gc->pc + 80), (void *)((pixels == NULL) ? one : zero), 4); 5673if (compsize > 0) { 5674 __glFillImage(gc, dim, width, height, depth, format, type, pixels, gc->pc + 84, gc->pc + 4); 5675} else { 5676 (void) memcpy( gc->pc + 4, default_pixel_store_4D, default_pixel_store_4D_size ); 5677} 5678gc->pc += cmdlen; 5679if (gc->pc > gc->limit) { (void) __glXFlushRenderBuffer(gc, gc->pc); } 5680} 5681else { 5682const GLint op = opcode; 5683const GLuint cmdlenLarge = cmdlen + 4; 5684GLubyte * const pc = __glXFlushRenderBuffer(gc, gc->pc); 5685(void) memcpy((void *)(pc + 0), (void *)(&cmdlenLarge), 4); 5686(void) memcpy((void *)(pc + 4), (void *)(&op), 4); 5687(void) memcpy((void *)(pc + 44), (void *)(&target), 1 * sizeof(GLenum)); 5688(void) memcpy((void *)(pc + 48), (void *)(&level), 1 * sizeof(GLint)); 5689(void) memcpy((void *)(pc + 52), (void *)(&internalformat), 1 * sizeof(GLint)); 5690(void) memcpy((void *)(pc + 56), (void *)(&width), 1 * sizeof(GLsizei)); 5691(void) memcpy((void *)(pc + 60), (void *)(&height), 1 * sizeof(GLsizei)); 5692(void) memcpy((void *)(pc + 64), (void *)(&depth), 1 * sizeof(GLsizei)); 5693(void) memcpy((void *)(pc + 68), (void *)(&extent), 1 * sizeof(GLsizei)); 5694(void) memcpy((void *)(pc + 72), (void *)(&border), 1 * sizeof(GLint)); 5695(void) memcpy((void *)(pc + 76), (void *)(&format), 1 * sizeof(GLenum)); 5696(void) memcpy((void *)(pc + 80), (void *)(&type), 1 * sizeof(GLenum)); 5697(void) memcpy((void *)(pc + 84), zero, 4); 5698__glXSendLargeImage(gc, compsize, dim, width, height, depth, format, type, pixels, pc + 88, pc + 8); 5699} 5700 } 5701} 5702 5703#define X_GLrop_TexImage3D 4114 5704void __indirect_glTexImage3D(GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLenum format, GLenum type, const GLvoid * pixels) 5705{ 5706 __glx_TexImage_3D4D(X_GLrop_TexImage3D, 3, target, level, internalformat, width, height, depth, 1, border, format, type, pixels ); 5707} 5708 5709static void 5710__glx_TexSubImage_3D4D( unsigned opcode, unsigned dim, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLint woffset, GLsizei width, GLsizei height, GLsizei depth, GLsizei extent, GLenum format, GLenum type, const GLvoid * pixels ) 5711{ 5712 struct glx_context * const gc = __glXGetCurrentContext(); 5713 const GLuint compsize = (pixels != NULL) ? __glImageSize(width, height, depth, format, type, target) : 0; 5714 const GLuint cmdlen = 92 + safe_pad(compsize); 5715 if (0 + safe_pad(compsize) < 0) { 5716 __glXSetError(gc, GL_INVALID_VALUE); 5717 return; 5718 } 5719 if (__builtin_expect(gc->currentDpy != NULL, 1)) { 5720if (cmdlen <= gc->maxSmallRenderCommandSize) { 5721 if ( (gc->pc + cmdlen) > gc->bufEnd ) { 5722 (void) __glXFlushRenderBuffer(gc, gc->pc); 5723 } 5724emit_header(gc->pc, opcode, cmdlen); 5725(void) memcpy((void *)(gc->pc + 40), (void *)(&target), 1 * sizeof(GLenum)); 5726(void) memcpy((void *)(gc->pc + 44), (void *)(&level), 1 * sizeof(GLint)); 5727(void) memcpy((void *)(gc->pc + 48), (void *)(&xoffset), 1 * sizeof(GLint)); 5728(void) memcpy((void *)(gc->pc + 52), (void *)(&yoffset), 1 * sizeof(GLint)); 5729(void) memcpy((void *)(gc->pc + 56), (void *)(&zoffset), 1 * sizeof(GLint)); 5730(void) memcpy((void *)(gc->pc + 60), (void *)(&woffset), 1 * sizeof(GLint)); 5731(void) memcpy((void *)(gc->pc + 64), (void *)(&width), 1 * sizeof(GLsizei)); 5732(void) memcpy((void *)(gc->pc + 68), (void *)(&height), 1 * sizeof(GLsizei)); 5733(void) memcpy((void *)(gc->pc + 72), (void *)(&depth), 1 * sizeof(GLsizei)); 5734(void) memcpy((void *)(gc->pc + 76), (void *)(&extent), 1 * sizeof(GLsizei)); 5735(void) memcpy((void *)(gc->pc + 80), (void *)(&format), 1 * sizeof(GLenum)); 5736(void) memcpy((void *)(gc->pc + 84), (void *)(&type), 1 * sizeof(GLenum)); 5737(void) memset((void *)(gc->pc + 88), 0, 1 * sizeof(GLuint)); 5738if (compsize > 0) { 5739 __glFillImage(gc, dim, width, height, depth, format, type, pixels, gc->pc + 92, gc->pc + 4); 5740} else { 5741 (void) memcpy( gc->pc + 4, default_pixel_store_4D, default_pixel_store_4D_size ); 5742} 5743gc->pc += cmdlen; 5744if (gc->pc > gc->limit) { (void) __glXFlushRenderBuffer(gc, gc->pc); } 5745} 5746else { 5747const GLint op = opcode; 5748const GLuint cmdlenLarge = cmdlen + 4; 5749GLubyte * const pc = __glXFlushRenderBuffer(gc, gc->pc); 5750(void) memcpy((void *)(pc + 0), (void *)(&cmdlenLarge), 4); 5751(void) memcpy((void *)(pc + 4), (void *)(&op), 4); 5752(void) memcpy((void *)(pc + 44), (void *)(&target), 1 * sizeof(GLenum)); 5753(void) memcpy((void *)(pc + 48), (void *)(&level), 1 * sizeof(GLint)); 5754(void) memcpy((void *)(pc + 52), (void *)(&xoffset), 1 * sizeof(GLint)); 5755(void) memcpy((void *)(pc + 56), (void *)(&yoffset), 1 * sizeof(GLint)); 5756(void) memcpy((void *)(pc + 60), (void *)(&zoffset), 1 * sizeof(GLint)); 5757(void) memcpy((void *)(pc + 64), (void *)(&woffset), 1 * sizeof(GLint)); 5758(void) memcpy((void *)(pc + 68), (void *)(&width), 1 * sizeof(GLsizei)); 5759(void) memcpy((void *)(pc + 72), (void *)(&height), 1 * sizeof(GLsizei)); 5760(void) memcpy((void *)(pc + 76), (void *)(&depth), 1 * sizeof(GLsizei)); 5761(void) memcpy((void *)(pc + 80), (void *)(&extent), 1 * sizeof(GLsizei)); 5762(void) memcpy((void *)(pc + 84), (void *)(&format), 1 * sizeof(GLenum)); 5763(void) memcpy((void *)(pc + 88), (void *)(&type), 1 * sizeof(GLenum)); 5764(void) memset((void *)(pc + 92), 0, 1 * sizeof(GLuint)); 5765__glXSendLargeImage(gc, compsize, dim, width, height, depth, format, type, pixels, pc + 96, pc + 8); 5766} 5767 } 5768} 5769 5770#define X_GLrop_TexSubImage3D 4115 5771void __indirect_glTexSubImage3D(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, const GLvoid * pixels) 5772{ 5773 __glx_TexSubImage_3D4D(X_GLrop_TexSubImage3D, 3, target, level, xoffset, yoffset, zoffset, 1, width, height, depth, 1, format, type, pixels ); 5774} 5775 5776#define X_GLrop_CopyTexSubImage3D 4123 5777void __indirect_glCopyTexSubImage3D(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLint x, GLint y, GLsizei width, GLsizei height) 5778{ 5779 struct glx_context * const gc = __glXGetCurrentContext(); 5780 const GLuint cmdlen = 40; 5781emit_header(gc->pc, X_GLrop_CopyTexSubImage3D, cmdlen); 5782(void) memcpy((void *)(gc->pc + 4), (void *)(&target), 1 * sizeof(GLenum)); 5783(void) memcpy((void *)(gc->pc + 8), (void *)(&level), 1 * sizeof(GLint)); 5784(void) memcpy((void *)(gc->pc + 12), (void *)(&xoffset), 1 * sizeof(GLint)); 5785(void) memcpy((void *)(gc->pc + 16), (void *)(&yoffset), 1 * sizeof(GLint)); 5786(void) memcpy((void *)(gc->pc + 20), (void *)(&zoffset), 1 * sizeof(GLint)); 5787(void) memcpy((void *)(gc->pc + 24), (void *)(&x), 1 * sizeof(GLint)); 5788(void) memcpy((void *)(gc->pc + 28), (void *)(&y), 1 * sizeof(GLint)); 5789(void) memcpy((void *)(gc->pc + 32), (void *)(&width), 1 * sizeof(GLsizei)); 5790(void) memcpy((void *)(gc->pc + 36), (void *)(&height), 1 * sizeof(GLsizei)); 5791gc->pc += cmdlen; 5792if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); } 5793} 5794 5795#define X_GLrop_ActiveTexture 197 5796void __indirect_glActiveTexture(GLenum texture) 5797{ 5798 struct glx_context * const gc = __glXGetCurrentContext(); 5799 const GLuint cmdlen = 8; 5800emit_header(gc->pc, X_GLrop_ActiveTexture, cmdlen); 5801(void) memcpy((void *)(gc->pc + 4), (void *)(&texture), 1 * sizeof(GLenum)); 5802gc->pc += cmdlen; 5803if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); } 5804} 5805 5806#define X_GLrop_MultiTexCoord1dv 198 5807void __indirect_glMultiTexCoord1d(GLenum target, GLdouble s) 5808{ 5809 struct glx_context * const gc = __glXGetCurrentContext(); 5810 const GLuint cmdlen = 16; 5811emit_header(gc->pc, X_GLrop_MultiTexCoord1dv, cmdlen); 5812(void) memcpy((void *)(gc->pc + 4), (void *)(&s), 1 * sizeof(GLdouble)); 5813(void) memcpy((void *)(gc->pc + 12), (void *)(&target), 1 * sizeof(GLenum)); 5814gc->pc += cmdlen; 5815if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); } 5816} 5817 5818#define X_GLrop_MultiTexCoord1dv 198 5819void __indirect_glMultiTexCoord1dv(GLenum target, const GLdouble * v) 5820{ 5821 struct glx_context * const gc = __glXGetCurrentContext(); 5822 const GLuint cmdlen = 16; 5823emit_header(gc->pc, X_GLrop_MultiTexCoord1dv, cmdlen); 5824(void) memcpy((void *)(gc->pc + 4), (void *)(v), 1 * sizeof(GLdouble)); 5825(void) memcpy((void *)(gc->pc + 12), (void *)(&target), 1 * sizeof(GLenum)); 5826gc->pc += cmdlen; 5827if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); } 5828} 5829 5830#define X_GLrop_MultiTexCoord1fvARB 199 5831void __indirect_glMultiTexCoord1fARB(GLenum target, GLfloat s) 5832{ 5833 struct glx_context * const gc = __glXGetCurrentContext(); 5834 const GLuint cmdlen = 12; 5835emit_header(gc->pc, X_GLrop_MultiTexCoord1fvARB, cmdlen); 5836(void) memcpy((void *)(gc->pc + 4), (void *)(&target), 1 * sizeof(GLenum)); 5837(void) memcpy((void *)(gc->pc + 8), (void *)(&s), 1 * sizeof(GLfloat)); 5838gc->pc += cmdlen; 5839if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); } 5840} 5841 5842#define X_GLrop_MultiTexCoord1fvARB 199 5843void __indirect_glMultiTexCoord1fvARB(GLenum target, const GLfloat * v) 5844{ 5845 struct glx_context * const gc = __glXGetCurrentContext(); 5846 const GLuint cmdlen = 12; 5847emit_header(gc->pc, X_GLrop_MultiTexCoord1fvARB, cmdlen); 5848(void) memcpy((void *)(gc->pc + 4), (void *)(&target), 1 * sizeof(GLenum)); 5849(void) memcpy((void *)(gc->pc + 8), (void *)(v), 1 * sizeof(GLfloat)); 5850gc->pc += cmdlen; 5851if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); } 5852} 5853 5854#define X_GLrop_MultiTexCoord1iv 200 5855void __indirect_glMultiTexCoord1i(GLenum target, GLint s) 5856{ 5857 struct glx_context * const gc = __glXGetCurrentContext(); 5858 const GLuint cmdlen = 12; 5859emit_header(gc->pc, X_GLrop_MultiTexCoord1iv, cmdlen); 5860(void) memcpy((void *)(gc->pc + 4), (void *)(&target), 1 * sizeof(GLenum)); 5861(void) memcpy((void *)(gc->pc + 8), (void *)(&s), 1 * sizeof(GLint)); 5862gc->pc += cmdlen; 5863if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); } 5864} 5865 5866#define X_GLrop_MultiTexCoord1iv 200 5867void __indirect_glMultiTexCoord1iv(GLenum target, const GLint * v) 5868{ 5869 struct glx_context * const gc = __glXGetCurrentContext(); 5870 const GLuint cmdlen = 12; 5871emit_header(gc->pc, X_GLrop_MultiTexCoord1iv, cmdlen); 5872(void) memcpy((void *)(gc->pc + 4), (void *)(&target), 1 * sizeof(GLenum)); 5873(void) memcpy((void *)(gc->pc + 8), (void *)(v), 1 * sizeof(GLint)); 5874gc->pc += cmdlen; 5875if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); } 5876} 5877 5878#define X_GLrop_MultiTexCoord1sv 201 5879void __indirect_glMultiTexCoord1s(GLenum target, GLshort s) 5880{ 5881 struct glx_context * const gc = __glXGetCurrentContext(); 5882 const GLuint cmdlen = 12; 5883emit_header(gc->pc, X_GLrop_MultiTexCoord1sv, cmdlen); 5884(void) memcpy((void *)(gc->pc + 4), (void *)(&target), 1 * sizeof(GLenum)); 5885(void) memcpy((void *)(gc->pc + 8), (void *)(&s), 1 * sizeof(GLshort)); 5886gc->pc += cmdlen; 5887if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); } 5888} 5889 5890#define X_GLrop_MultiTexCoord1sv 201 5891void __indirect_glMultiTexCoord1sv(GLenum target, const GLshort * v) 5892{ 5893 struct glx_context * const gc = __glXGetCurrentContext(); 5894 const GLuint cmdlen = 12; 5895emit_header(gc->pc, X_GLrop_MultiTexCoord1sv, cmdlen); 5896(void) memcpy((void *)(gc->pc + 4), (void *)(&target), 1 * sizeof(GLenum)); 5897(void) memcpy((void *)(gc->pc + 8), (void *)(v), 1 * sizeof(GLshort)); 5898gc->pc += cmdlen; 5899if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); } 5900} 5901 5902#define X_GLrop_MultiTexCoord2dv 202 5903void __indirect_glMultiTexCoord2d(GLenum target, GLdouble s, GLdouble t) 5904{ 5905 struct glx_context * const gc = __glXGetCurrentContext(); 5906 const GLuint cmdlen = 24; 5907emit_header(gc->pc, X_GLrop_MultiTexCoord2dv, cmdlen); 5908(void) memcpy((void *)(gc->pc + 4), (void *)(&s), 1 * sizeof(GLdouble)); 5909(void) memcpy((void *)(gc->pc + 12), (void *)(&t), 1 * sizeof(GLdouble)); 5910(void) memcpy((void *)(gc->pc + 20), (void *)(&target), 1 * sizeof(GLenum)); 5911gc->pc += cmdlen; 5912if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); } 5913} 5914 5915#define X_GLrop_MultiTexCoord2dv 202 5916void __indirect_glMultiTexCoord2dv(GLenum target, const GLdouble * v) 5917{ 5918 struct glx_context * const gc = __glXGetCurrentContext(); 5919 const GLuint cmdlen = 24; 5920emit_header(gc->pc, X_GLrop_MultiTexCoord2dv, cmdlen); 5921(void) memcpy((void *)(gc->pc + 4), (void *)(v), 2 * sizeof(GLdouble)); 5922(void) memcpy((void *)(gc->pc + 20), (void *)(&target), 1 * sizeof(GLenum)); 5923gc->pc += cmdlen; 5924if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); } 5925} 5926 5927#define X_GLrop_MultiTexCoord2fvARB 203 5928void __indirect_glMultiTexCoord2fARB(GLenum target, GLfloat s, GLfloat t) 5929{ 5930 struct glx_context * const gc = __glXGetCurrentContext(); 5931 const GLuint cmdlen = 16; 5932emit_header(gc->pc, X_GLrop_MultiTexCoord2fvARB, cmdlen); 5933(void) memcpy((void *)(gc->pc + 4), (void *)(&target), 1 * sizeof(GLenum)); 5934(void) memcpy((void *)(gc->pc + 8), (void *)(&s), 1 * sizeof(GLfloat)); 5935(void) memcpy((void *)(gc->pc + 12), (void *)(&t), 1 * sizeof(GLfloat)); 5936gc->pc += cmdlen; 5937if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); } 5938} 5939 5940#define X_GLrop_MultiTexCoord2fvARB 203 5941void __indirect_glMultiTexCoord2fvARB(GLenum target, const GLfloat * v) 5942{ 5943 struct glx_context * const gc = __glXGetCurrentContext(); 5944 const GLuint cmdlen = 16; 5945emit_header(gc->pc, X_GLrop_MultiTexCoord2fvARB, cmdlen); 5946(void) memcpy((void *)(gc->pc + 4), (void *)(&target), 1 * sizeof(GLenum)); 5947(void) memcpy((void *)(gc->pc + 8), (void *)(v), 2 * sizeof(GLfloat)); 5948gc->pc += cmdlen; 5949if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); } 5950} 5951 5952#define X_GLrop_MultiTexCoord2iv 204 5953void __indirect_glMultiTexCoord2i(GLenum target, GLint s, GLint t) 5954{ 5955 struct glx_context * const gc = __glXGetCurrentContext(); 5956 const GLuint cmdlen = 16; 5957emit_header(gc->pc, X_GLrop_MultiTexCoord2iv, cmdlen); 5958(void) memcpy((void *)(gc->pc + 4), (void *)(&target), 1 * sizeof(GLenum)); 5959(void) memcpy((void *)(gc->pc + 8), (void *)(&s), 1 * sizeof(GLint)); 5960(void) memcpy((void *)(gc->pc + 12), (void *)(&t), 1 * sizeof(GLint)); 5961gc->pc += cmdlen; 5962if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); } 5963} 5964 5965#define X_GLrop_MultiTexCoord2iv 204 5966void __indirect_glMultiTexCoord2iv(GLenum target, const GLint * v) 5967{ 5968 struct glx_context * const gc = __glXGetCurrentContext(); 5969 const GLuint cmdlen = 16; 5970emit_header(gc->pc, X_GLrop_MultiTexCoord2iv, cmdlen); 5971(void) memcpy((void *)(gc->pc + 4), (void *)(&target), 1 * sizeof(GLenum)); 5972(void) memcpy((void *)(gc->pc + 8), (void *)(v), 2 * sizeof(GLint)); 5973gc->pc += cmdlen; 5974if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); } 5975} 5976 5977#define X_GLrop_MultiTexCoord2sv 205 5978void __indirect_glMultiTexCoord2s(GLenum target, GLshort s, GLshort t) 5979{ 5980 struct glx_context * const gc = __glXGetCurrentContext(); 5981 const GLuint cmdlen = 12; 5982emit_header(gc->pc, X_GLrop_MultiTexCoord2sv, cmdlen); 5983(void) memcpy((void *)(gc->pc + 4), (void *)(&target), 1 * sizeof(GLenum)); 5984(void) memcpy((void *)(gc->pc + 8), (void *)(&s), 1 * sizeof(GLshort)); 5985(void) memcpy((void *)(gc->pc + 10), (void *)(&t), 1 * sizeof(GLshort)); 5986gc->pc += cmdlen; 5987if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); } 5988} 5989 5990#define X_GLrop_MultiTexCoord2sv 205 5991void __indirect_glMultiTexCoord2sv(GLenum target, const GLshort * v) 5992{ 5993 struct glx_context * const gc = __glXGetCurrentContext(); 5994 const GLuint cmdlen = 12; 5995emit_header(gc->pc, X_GLrop_MultiTexCoord2sv, cmdlen); 5996(void) memcpy((void *)(gc->pc + 4), (void *)(&target), 1 * sizeof(GLenum)); 5997(void) memcpy((void *)(gc->pc + 8), (void *)(v), 2 * sizeof(GLshort)); 5998gc->pc += cmdlen; 5999if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); } 6000} 6001 6002#define X_GLrop_MultiTexCoord3dv 206 6003void __indirect_glMultiTexCoord3d(GLenum target, GLdouble s, GLdouble t, GLdouble r) 6004{ 6005 struct glx_context * const gc = __glXGetCurrentContext(); 6006 const GLuint cmdlen = 32; 6007emit_header(gc->pc, X_GLrop_MultiTexCoord3dv, cmdlen); 6008(void) memcpy((void *)(gc->pc + 4), (void *)(&s), 1 * sizeof(GLdouble)); 6009(void) memcpy((void *)(gc->pc + 12), (void *)(&t), 1 * sizeof(GLdouble)); 6010(void) memcpy((void *)(gc->pc + 20), (void *)(&r), 1 * sizeof(GLdouble)); 6011(void) memcpy((void *)(gc->pc + 28), (void *)(&target), 1 * sizeof(GLenum)); 6012gc->pc += cmdlen; 6013if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); } 6014} 6015 6016#define X_GLrop_MultiTexCoord3dv 206 6017void __indirect_glMultiTexCoord3dv(GLenum target, const GLdouble * v) 6018{ 6019 struct glx_context * const gc = __glXGetCurrentContext(); 6020 const GLuint cmdlen = 32; 6021emit_header(gc->pc, X_GLrop_MultiTexCoord3dv, cmdlen); 6022(void) memcpy((void *)(gc->pc + 4), (void *)(v), 3 * sizeof(GLdouble)); 6023(void) memcpy((void *)(gc->pc + 28), (void *)(&target), 1 * sizeof(GLenum)); 6024gc->pc += cmdlen; 6025if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); } 6026} 6027 6028#define X_GLrop_MultiTexCoord3fvARB 207 6029void __indirect_glMultiTexCoord3fARB(GLenum target, GLfloat s, GLfloat t, GLfloat r) 6030{ 6031 struct glx_context * const gc = __glXGetCurrentContext(); 6032 const GLuint cmdlen = 20; 6033emit_header(gc->pc, X_GLrop_MultiTexCoord3fvARB, cmdlen); 6034(void) memcpy((void *)(gc->pc + 4), (void *)(&target), 1 * sizeof(GLenum)); 6035(void) memcpy((void *)(gc->pc + 8), (void *)(&s), 1 * sizeof(GLfloat)); 6036(void) memcpy((void *)(gc->pc + 12), (void *)(&t), 1 * sizeof(GLfloat)); 6037(void) memcpy((void *)(gc->pc + 16), (void *)(&r), 1 * sizeof(GLfloat)); 6038gc->pc += cmdlen; 6039if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); } 6040} 6041 6042#define X_GLrop_MultiTexCoord3fvARB 207 6043void __indirect_glMultiTexCoord3fvARB(GLenum target, const GLfloat * v) 6044{ 6045 struct glx_context * const gc = __glXGetCurrentContext(); 6046 const GLuint cmdlen = 20; 6047emit_header(gc->pc, X_GLrop_MultiTexCoord3fvARB, cmdlen); 6048(void) memcpy((void *)(gc->pc + 4), (void *)(&target), 1 * sizeof(GLenum)); 6049(void) memcpy((void *)(gc->pc + 8), (void *)(v), 3 * sizeof(GLfloat)); 6050gc->pc += cmdlen; 6051if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); } 6052} 6053 6054#define X_GLrop_MultiTexCoord3iv 208 6055void __indirect_glMultiTexCoord3i(GLenum target, GLint s, GLint t, GLint r) 6056{ 6057 struct glx_context * const gc = __glXGetCurrentContext(); 6058 const GLuint cmdlen = 20; 6059emit_header(gc->pc, X_GLrop_MultiTexCoord3iv, cmdlen); 6060(void) memcpy((void *)(gc->pc + 4), (void *)(&target), 1 * sizeof(GLenum)); 6061(void) memcpy((void *)(gc->pc + 8), (void *)(&s), 1 * sizeof(GLint)); 6062(void) memcpy((void *)(gc->pc + 12), (void *)(&t), 1 * sizeof(GLint)); 6063(void) memcpy((void *)(gc->pc + 16), (void *)(&r), 1 * sizeof(GLint)); 6064gc->pc += cmdlen; 6065if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); } 6066} 6067 6068#define X_GLrop_MultiTexCoord3iv 208 6069void __indirect_glMultiTexCoord3iv(GLenum target, const GLint * v) 6070{ 6071 struct glx_context * const gc = __glXGetCurrentContext(); 6072 const GLuint cmdlen = 20; 6073emit_header(gc->pc, X_GLrop_MultiTexCoord3iv, cmdlen); 6074(void) memcpy((void *)(gc->pc + 4), (void *)(&target), 1 * sizeof(GLenum)); 6075(void) memcpy((void *)(gc->pc + 8), (void *)(v), 3 * sizeof(GLint)); 6076gc->pc += cmdlen; 6077if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); } 6078} 6079 6080#define X_GLrop_MultiTexCoord3sv 209 6081void __indirect_glMultiTexCoord3s(GLenum target, GLshort s, GLshort t, GLshort r) 6082{ 6083 struct glx_context * const gc = __glXGetCurrentContext(); 6084 const GLuint cmdlen = 16; 6085emit_header(gc->pc, X_GLrop_MultiTexCoord3sv, cmdlen); 6086(void) memcpy((void *)(gc->pc + 4), (void *)(&target), 1 * sizeof(GLenum)); 6087(void) memcpy((void *)(gc->pc + 8), (void *)(&s), 1 * sizeof(GLshort)); 6088(void) memcpy((void *)(gc->pc + 10), (void *)(&t), 1 * sizeof(GLshort)); 6089(void) memcpy((void *)(gc->pc + 12), (void *)(&r), 1 * sizeof(GLshort)); 6090gc->pc += cmdlen; 6091if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); } 6092} 6093 6094#define X_GLrop_MultiTexCoord3sv 209 6095void __indirect_glMultiTexCoord3sv(GLenum target, const GLshort * v) 6096{ 6097 struct glx_context * const gc = __glXGetCurrentContext(); 6098 const GLuint cmdlen = 16; 6099emit_header(gc->pc, X_GLrop_MultiTexCoord3sv, cmdlen); 6100(void) memcpy((void *)(gc->pc + 4), (void *)(&target), 1 * sizeof(GLenum)); 6101(void) memcpy((void *)(gc->pc + 8), (void *)(v), 3 * sizeof(GLshort)); 6102gc->pc += cmdlen; 6103if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); } 6104} 6105 6106#define X_GLrop_MultiTexCoord4dv 210 6107void __indirect_glMultiTexCoord4d(GLenum target, GLdouble s, GLdouble t, GLdouble r, GLdouble q) 6108{ 6109 struct glx_context * const gc = __glXGetCurrentContext(); 6110 const GLuint cmdlen = 40; 6111emit_header(gc->pc, X_GLrop_MultiTexCoord4dv, cmdlen); 6112(void) memcpy((void *)(gc->pc + 4), (void *)(&s), 1 * sizeof(GLdouble)); 6113(void) memcpy((void *)(gc->pc + 12), (void *)(&t), 1 * sizeof(GLdouble)); 6114(void) memcpy((void *)(gc->pc + 20), (void *)(&r), 1 * sizeof(GLdouble)); 6115(void) memcpy((void *)(gc->pc + 28), (void *)(&q), 1 * sizeof(GLdouble)); 6116(void) memcpy((void *)(gc->pc + 36), (void *)(&target), 1 * sizeof(GLenum)); 6117gc->pc += cmdlen; 6118if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); } 6119} 6120 6121#define X_GLrop_MultiTexCoord4dv 210 6122void __indirect_glMultiTexCoord4dv(GLenum target, const GLdouble * v) 6123{ 6124 struct glx_context * const gc = __glXGetCurrentContext(); 6125 const GLuint cmdlen = 40; 6126emit_header(gc->pc, X_GLrop_MultiTexCoord4dv, cmdlen); 6127(void) memcpy((void *)(gc->pc + 4), (void *)(v), 4 * sizeof(GLdouble)); 6128(void) memcpy((void *)(gc->pc + 36), (void *)(&target), 1 * sizeof(GLenum)); 6129gc->pc += cmdlen; 6130if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); } 6131} 6132 6133#define X_GLrop_MultiTexCoord4fvARB 211 6134void __indirect_glMultiTexCoord4fARB(GLenum target, GLfloat s, GLfloat t, GLfloat r, GLfloat q) 6135{ 6136 struct glx_context * const gc = __glXGetCurrentContext(); 6137 const GLuint cmdlen = 24; 6138emit_header(gc->pc, X_GLrop_MultiTexCoord4fvARB, cmdlen); 6139(void) memcpy((void *)(gc->pc + 4), (void *)(&target), 1 * sizeof(GLenum)); 6140(void) memcpy((void *)(gc->pc + 8), (void *)(&s), 1 * sizeof(GLfloat)); 6141(void) memcpy((void *)(gc->pc + 12), (void *)(&t), 1 * sizeof(GLfloat)); 6142(void) memcpy((void *)(gc->pc + 16), (void *)(&r), 1 * sizeof(GLfloat)); 6143(void) memcpy((void *)(gc->pc + 20), (void *)(&q), 1 * sizeof(GLfloat)); 6144gc->pc += cmdlen; 6145if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); } 6146} 6147 6148#define X_GLrop_MultiTexCoord4fvARB 211 6149void __indirect_glMultiTexCoord4fvARB(GLenum target, const GLfloat * v) 6150{ 6151 struct glx_context * const gc = __glXGetCurrentContext(); 6152 const GLuint cmdlen = 24; 6153emit_header(gc->pc, X_GLrop_MultiTexCoord4fvARB, cmdlen); 6154(void) memcpy((void *)(gc->pc + 4), (void *)(&target), 1 * sizeof(GLenum)); 6155(void) memcpy((void *)(gc->pc + 8), (void *)(v), 4 * sizeof(GLfloat)); 6156gc->pc += cmdlen; 6157if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); } 6158} 6159 6160#define X_GLrop_MultiTexCoord4iv 212 6161void __indirect_glMultiTexCoord4i(GLenum target, GLint s, GLint t, GLint r, GLint q) 6162{ 6163 struct glx_context * const gc = __glXGetCurrentContext(); 6164 const GLuint cmdlen = 24; 6165emit_header(gc->pc, X_GLrop_MultiTexCoord4iv, cmdlen); 6166(void) memcpy((void *)(gc->pc + 4), (void *)(&target), 1 * sizeof(GLenum)); 6167(void) memcpy((void *)(gc->pc + 8), (void *)(&s), 1 * sizeof(GLint)); 6168(void) memcpy((void *)(gc->pc + 12), (void *)(&t), 1 * sizeof(GLint)); 6169(void) memcpy((void *)(gc->pc + 16), (void *)(&r), 1 * sizeof(GLint)); 6170(void) memcpy((void *)(gc->pc + 20), (void *)(&q), 1 * sizeof(GLint)); 6171gc->pc += cmdlen; 6172if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); } 6173} 6174 6175#define X_GLrop_MultiTexCoord4iv 212 6176void __indirect_glMultiTexCoord4iv(GLenum target, const GLint * v) 6177{ 6178 struct glx_context * const gc = __glXGetCurrentContext(); 6179 const GLuint cmdlen = 24; 6180emit_header(gc->pc, X_GLrop_MultiTexCoord4iv, cmdlen); 6181(void) memcpy((void *)(gc->pc + 4), (void *)(&target), 1 * sizeof(GLenum)); 6182(void) memcpy((void *)(gc->pc + 8), (void *)(v), 4 * sizeof(GLint)); 6183gc->pc += cmdlen; 6184if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); } 6185} 6186 6187#define X_GLrop_MultiTexCoord4sv 213 6188void __indirect_glMultiTexCoord4s(GLenum target, GLshort s, GLshort t, GLshort r, GLshort q) 6189{ 6190 struct glx_context * const gc = __glXGetCurrentContext(); 6191 const GLuint cmdlen = 16; 6192emit_header(gc->pc, X_GLrop_MultiTexCoord4sv, cmdlen); 6193(void) memcpy((void *)(gc->pc + 4), (void *)(&target), 1 * sizeof(GLenum)); 6194(void) memcpy((void *)(gc->pc + 8), (void *)(&s), 1 * sizeof(GLshort)); 6195(void) memcpy((void *)(gc->pc + 10), (void *)(&t), 1 * sizeof(GLshort)); 6196(void) memcpy((void *)(gc->pc + 12), (void *)(&r), 1 * sizeof(GLshort)); 6197(void) memcpy((void *)(gc->pc + 14), (void *)(&q), 1 * sizeof(GLshort)); 6198gc->pc += cmdlen; 6199if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); } 6200} 6201 6202#define X_GLrop_MultiTexCoord4sv 213 6203void __indirect_glMultiTexCoord4sv(GLenum target, const GLshort * v) 6204{ 6205 struct glx_context * const gc = __glXGetCurrentContext(); 6206 const GLuint cmdlen = 16; 6207emit_header(gc->pc, X_GLrop_MultiTexCoord4sv, cmdlen); 6208(void) memcpy((void *)(gc->pc + 4), (void *)(&target), 1 * sizeof(GLenum)); 6209(void) memcpy((void *)(gc->pc + 8), (void *)(v), 4 * sizeof(GLshort)); 6210gc->pc += cmdlen; 6211if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); } 6212} 6213 6214#define X_GLrop_SampleCoverage 229 6215void __indirect_glSampleCoverage(GLclampf value, GLboolean invert) 6216{ 6217 struct glx_context * const gc = __glXGetCurrentContext(); 6218 const GLuint cmdlen = 12; 6219emit_header(gc->pc, X_GLrop_SampleCoverage, cmdlen); 6220(void) memcpy((void *)(gc->pc + 4), (void *)(&value), 1 * sizeof(GLclampf)); 6221(void) memcpy((void *)(gc->pc + 8), (void *)(&invert), 1 * sizeof(GLboolean)); 6222gc->pc += cmdlen; 6223if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); } 6224} 6225 6226#define X_GLrop_BlendFuncSeparate 4134 6227void __indirect_glBlendFuncSeparate(GLenum sfactorRGB, GLenum dfactorRGB, GLenum sfactorAlpha, GLenum dfactorAlpha) 6228{ 6229 struct glx_context * const gc = __glXGetCurrentContext(); 6230 const GLuint cmdlen = 20; 6231emit_header(gc->pc, X_GLrop_BlendFuncSeparate, cmdlen); 6232(void) memcpy((void *)(gc->pc + 4), (void *)(&sfactorRGB), 1 * sizeof(GLenum)); 6233(void) memcpy((void *)(gc->pc + 8), (void *)(&dfactorRGB), 1 * sizeof(GLenum)); 6234(void) memcpy((void *)(gc->pc + 12), (void *)(&sfactorAlpha), 1 * sizeof(GLenum)); 6235(void) memcpy((void *)(gc->pc + 16), (void *)(&dfactorAlpha), 1 * sizeof(GLenum)); 6236gc->pc += cmdlen; 6237if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); } 6238} 6239 6240#define X_GLrop_FogCoorddv 4125 6241void __indirect_glFogCoordd(GLdouble coord) 6242{ 6243 struct glx_context * const gc = __glXGetCurrentContext(); 6244 const GLuint cmdlen = 12; 6245emit_header(gc->pc, X_GLrop_FogCoorddv, cmdlen); 6246(void) memcpy((void *)(gc->pc + 4), (void *)(&coord), 1 * sizeof(GLdouble)); 6247gc->pc += cmdlen; 6248if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); } 6249} 6250 6251#define X_GLrop_FogCoorddv 4125 6252void __indirect_glFogCoorddv(const GLdouble * coord) 6253{ 6254 generic_8_byte( X_GLrop_FogCoorddv, coord ); 6255} 6256 6257#define X_GLrop_PointParameterf 2065 6258void __indirect_glPointParameterf(GLenum pname, GLfloat param) 6259{ 6260 struct glx_context * const gc = __glXGetCurrentContext(); 6261 const GLuint cmdlen = 12; 6262emit_header(gc->pc, X_GLrop_PointParameterf, cmdlen); 6263(void) memcpy((void *)(gc->pc + 4), (void *)(&pname), 1 * sizeof(GLenum)); 6264(void) memcpy((void *)(gc->pc + 8), (void *)(¶m), 1 * sizeof(GLfloat)); 6265gc->pc += cmdlen; 6266if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); } 6267} 6268 6269#define X_GLrop_PointParameterfv 2066 6270void __indirect_glPointParameterfv(GLenum pname, const GLfloat * params) 6271{ 6272 struct glx_context * const gc = __glXGetCurrentContext(); 6273 const GLuint compsize = __glPointParameterfv_size(pname); 6274 const GLuint cmdlen = 8 + safe_pad(safe_mul(compsize, 1 * sizeof(GLfloat))); 6275 if (0 + safe_pad(safe_mul(compsize, 1 * sizeof(GLfloat))) < 0) { 6276 __glXSetError(gc, GL_INVALID_VALUE); 6277 return; 6278 } 6279emit_header(gc->pc, X_GLrop_PointParameterfv, cmdlen); 6280(void) memcpy((void *)(gc->pc + 4), (void *)(&pname), 1 * sizeof(GLenum)); 6281(void) memcpy((void *)(gc->pc + 8), (void *)(params), safe_mul(compsize, 1 * sizeof(GLfloat))); 6282gc->pc += cmdlen; 6283if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); } 6284} 6285 6286#define X_GLrop_PointParameteri 4221 6287void __indirect_glPointParameteri(GLenum pname, GLint param) 6288{ 6289 struct glx_context * const gc = __glXGetCurrentContext(); 6290 const GLuint cmdlen = 12; 6291emit_header(gc->pc, X_GLrop_PointParameteri, cmdlen); 6292(void) memcpy((void *)(gc->pc + 4), (void *)(&pname), 1 * sizeof(GLenum)); 6293(void) memcpy((void *)(gc->pc + 8), (void *)(¶m), 1 * sizeof(GLint)); 6294gc->pc += cmdlen; 6295if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); } 6296} 6297 6298#define X_GLrop_PointParameteriv 4222 6299void __indirect_glPointParameteriv(GLenum pname, const GLint * params) 6300{ 6301 struct glx_context * const gc = __glXGetCurrentContext(); 6302 const GLuint compsize = __glPointParameteriv_size(pname); 6303 const GLuint cmdlen = 8 + safe_pad(safe_mul(compsize, 1 * sizeof(GLint))); 6304 if (0 + safe_pad(safe_mul(compsize, 1 * sizeof(GLint))) < 0) { 6305 __glXSetError(gc, GL_INVALID_VALUE); 6306 return; 6307 } 6308emit_header(gc->pc, X_GLrop_PointParameteriv, cmdlen); 6309(void) memcpy((void *)(gc->pc + 4), (void *)(&pname), 1 * sizeof(GLenum)); 6310(void) memcpy((void *)(gc->pc + 8), (void *)(params), safe_mul(compsize, 1 * sizeof(GLint))); 6311gc->pc += cmdlen; 6312if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); } 6313} 6314 6315#define X_GLrop_SecondaryColor3bv 4126 6316void __indirect_glSecondaryColor3b(GLbyte red, GLbyte green, GLbyte blue) 6317{ 6318 struct glx_context * const gc = __glXGetCurrentContext(); 6319 const GLuint cmdlen = 8; 6320emit_header(gc->pc, X_GLrop_SecondaryColor3bv, cmdlen); 6321(void) memcpy((void *)(gc->pc + 4), (void *)(&red), 1 * sizeof(GLbyte)); 6322(void) memcpy((void *)(gc->pc + 5), (void *)(&green), 1 * sizeof(GLbyte)); 6323(void) memcpy((void *)(gc->pc + 6), (void *)(&blue), 1 * sizeof(GLbyte)); 6324gc->pc += cmdlen; 6325if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); } 6326} 6327 6328#define X_GLrop_SecondaryColor3bv 4126 6329void __indirect_glSecondaryColor3bv(const GLbyte * v) 6330{ 6331 generic_3_byte( X_GLrop_SecondaryColor3bv, v ); 6332} 6333 6334#define X_GLrop_SecondaryColor3dv 4130 6335void __indirect_glSecondaryColor3d(GLdouble red, GLdouble green, GLdouble blue) 6336{ 6337 struct glx_context * const gc = __glXGetCurrentContext(); 6338 const GLuint cmdlen = 28; 6339emit_header(gc->pc, X_GLrop_SecondaryColor3dv, cmdlen); 6340(void) memcpy((void *)(gc->pc + 4), (void *)(&red), 1 * sizeof(GLdouble)); 6341(void) memcpy((void *)(gc->pc + 12), (void *)(&green), 1 * sizeof(GLdouble)); 6342(void) memcpy((void *)(gc->pc + 20), (void *)(&blue), 1 * sizeof(GLdouble)); 6343gc->pc += cmdlen; 6344if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); } 6345} 6346 6347#define X_GLrop_SecondaryColor3dv 4130 6348void __indirect_glSecondaryColor3dv(const GLdouble * v) 6349{ 6350 generic_24_byte( X_GLrop_SecondaryColor3dv, v ); 6351} 6352 6353#define X_GLrop_SecondaryColor3iv 4128 6354void __indirect_glSecondaryColor3i(GLint red, GLint green, GLint blue) 6355{ 6356 struct glx_context * const gc = __glXGetCurrentContext(); 6357 const GLuint cmdlen = 16; 6358emit_header(gc->pc, X_GLrop_SecondaryColor3iv, cmdlen); 6359(void) memcpy((void *)(gc->pc + 4), (void *)(&red), 1 * sizeof(GLint)); 6360(void) memcpy((void *)(gc->pc + 8), (void *)(&green), 1 * sizeof(GLint)); 6361(void) memcpy((void *)(gc->pc + 12), (void *)(&blue), 1 * sizeof(GLint)); 6362gc->pc += cmdlen; 6363if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); } 6364} 6365 6366#define X_GLrop_SecondaryColor3iv 4128 6367void __indirect_glSecondaryColor3iv(const GLint * v) 6368{ 6369 generic_12_byte( X_GLrop_SecondaryColor3iv, v ); 6370} 6371 6372#define X_GLrop_SecondaryColor3sv 4127 6373void __indirect_glSecondaryColor3s(GLshort red, GLshort green, GLshort blue) 6374{ 6375 struct glx_context * const gc = __glXGetCurrentContext(); 6376 const GLuint cmdlen = 12; 6377emit_header(gc->pc, X_GLrop_SecondaryColor3sv, cmdlen); 6378(void) memcpy((void *)(gc->pc + 4), (void *)(&red), 1 * sizeof(GLshort)); 6379(void) memcpy((void *)(gc->pc + 6), (void *)(&green), 1 * sizeof(GLshort)); 6380(void) memcpy((void *)(gc->pc + 8), (void *)(&blue), 1 * sizeof(GLshort)); 6381gc->pc += cmdlen; 6382if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); } 6383} 6384 6385#define X_GLrop_SecondaryColor3sv 4127 6386void __indirect_glSecondaryColor3sv(const GLshort * v) 6387{ 6388 generic_6_byte( X_GLrop_SecondaryColor3sv, v ); 6389} 6390 6391#define X_GLrop_SecondaryColor3ubv 4131 6392void __indirect_glSecondaryColor3ub(GLubyte red, GLubyte green, GLubyte blue) 6393{ 6394 struct glx_context * const gc = __glXGetCurrentContext(); 6395 const GLuint cmdlen = 8; 6396emit_header(gc->pc, X_GLrop_SecondaryColor3ubv, cmdlen); 6397(void) memcpy((void *)(gc->pc + 4), (void *)(&red), 1 * sizeof(GLubyte)); 6398(void) memcpy((void *)(gc->pc + 5), (void *)(&green), 1 * sizeof(GLubyte)); 6399(void) memcpy((void *)(gc->pc + 6), (void *)(&blue), 1 * sizeof(GLubyte)); 6400gc->pc += cmdlen; 6401if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); } 6402} 6403 6404#define X_GLrop_SecondaryColor3ubv 4131 6405void __indirect_glSecondaryColor3ubv(const GLubyte * v) 6406{ 6407 generic_3_byte( X_GLrop_SecondaryColor3ubv, v ); 6408} 6409 6410#define X_GLrop_SecondaryColor3uiv 4133 6411void __indirect_glSecondaryColor3ui(GLuint red, GLuint green, GLuint blue) 6412{ 6413 struct glx_context * const gc = __glXGetCurrentContext(); 6414 const GLuint cmdlen = 16; 6415emit_header(gc->pc, X_GLrop_SecondaryColor3uiv, cmdlen); 6416(void) memcpy((void *)(gc->pc + 4), (void *)(&red), 1 * sizeof(GLuint)); 6417(void) memcpy((void *)(gc->pc + 8), (void *)(&green), 1 * sizeof(GLuint)); 6418(void) memcpy((void *)(gc->pc + 12), (void *)(&blue), 1 * sizeof(GLuint)); 6419gc->pc += cmdlen; 6420if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); } 6421} 6422 6423#define X_GLrop_SecondaryColor3uiv 4133 6424void __indirect_glSecondaryColor3uiv(const GLuint * v) 6425{ 6426 generic_12_byte( X_GLrop_SecondaryColor3uiv, v ); 6427} 6428 6429#define X_GLrop_SecondaryColor3usv 4132 6430void __indirect_glSecondaryColor3us(GLushort red, GLushort green, GLushort blue) 6431{ 6432 struct glx_context * const gc = __glXGetCurrentContext(); 6433 const GLuint cmdlen = 12; 6434emit_header(gc->pc, X_GLrop_SecondaryColor3usv, cmdlen); 6435(void) memcpy((void *)(gc->pc + 4), (void *)(&red), 1 * sizeof(GLushort)); 6436(void) memcpy((void *)(gc->pc + 6), (void *)(&green), 1 * sizeof(GLushort)); 6437(void) memcpy((void *)(gc->pc + 8), (void *)(&blue), 1 * sizeof(GLushort)); 6438gc->pc += cmdlen; 6439if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); } 6440} 6441 6442#define X_GLrop_SecondaryColor3usv 4132 6443void __indirect_glSecondaryColor3usv(const GLushort * v) 6444{ 6445 generic_6_byte( X_GLrop_SecondaryColor3usv, v ); 6446} 6447 6448#define X_GLrop_WindowPos3fv 230 6449void __indirect_glWindowPos3f(GLfloat x, GLfloat y, GLfloat z) 6450{ 6451 struct glx_context * const gc = __glXGetCurrentContext(); 6452 const GLuint cmdlen = 16; 6453emit_header(gc->pc, X_GLrop_WindowPos3fv, cmdlen); 6454(void) memcpy((void *)(gc->pc + 4), (void *)(&x), 1 * sizeof(GLfloat)); 6455(void) memcpy((void *)(gc->pc + 8), (void *)(&y), 1 * sizeof(GLfloat)); 6456(void) memcpy((void *)(gc->pc + 12), (void *)(&z), 1 * sizeof(GLfloat)); 6457gc->pc += cmdlen; 6458if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); } 6459} 6460 6461#define X_GLrop_WindowPos3fv 230 6462void __indirect_glWindowPos3fv(const GLfloat * v) 6463{ 6464 generic_12_byte( X_GLrop_WindowPos3fv, v ); 6465} 6466 6467#define X_GLrop_BeginQuery 231 6468void __indirect_glBeginQuery(GLenum target, GLuint id) 6469{ 6470 struct glx_context * const gc = __glXGetCurrentContext(); 6471 const GLuint cmdlen = 12; 6472emit_header(gc->pc, X_GLrop_BeginQuery, cmdlen); 6473(void) memcpy((void *)(gc->pc + 4), (void *)(&target), 1 * sizeof(GLenum)); 6474(void) memcpy((void *)(gc->pc + 8), (void *)(&id), 1 * sizeof(GLuint)); 6475gc->pc += cmdlen; 6476if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); } 6477} 6478 6479#define X_GLsop_DeleteQueries 161 6480void __indirect_glDeleteQueries(GLsizei n, const GLuint * ids) 6481{ 6482 struct glx_context * const gc = __glXGetCurrentContext(); 6483 Display * const dpy = gc->currentDpy; 6484#ifndef USE_XCB 6485 const GLuint cmdlen = 4 + safe_pad(safe_mul(n, 1 * sizeof(GLuint))); 6486#endif 6487 if (0 + safe_pad(safe_mul(n, 1 * sizeof(GLuint))) < 0) { 6488 __glXSetError(gc, GL_INVALID_VALUE); 6489 return; 6490 } 6491 if (n < 0) { 6492 __glXSetError(gc, GL_INVALID_VALUE); 6493 return; 6494 } 6495 if (__builtin_expect((n >= 0) && (dpy != NULL), 1)) { 6496#ifdef USE_XCB 6497 xcb_connection_t *c = XGetXCBConnection(dpy); 6498 (void) __glXFlushRenderBuffer(gc, gc->pc); 6499 xcb_glx_delete_queries(c, gc->currentContextTag, n, ids); 6500#else 6501 GLubyte const * pc = __glXSetupSingleRequest(gc, X_GLsop_DeleteQueries, cmdlen); 6502(void) memcpy((void *)(pc + 0), (void *)(&n), 1 * sizeof(GLsizei)); 6503(void) memcpy((void *)(pc + 4), (void *)(ids), safe_mul(n, 1 * sizeof(GLuint))); 6504 UnlockDisplay(dpy); SyncHandle(); 6505#endif /* USE_XCB */ 6506 } 6507 return; 6508} 6509 6510#define X_GLrop_EndQuery 232 6511void __indirect_glEndQuery(GLenum target) 6512{ 6513 struct glx_context * const gc = __glXGetCurrentContext(); 6514 const GLuint cmdlen = 8; 6515emit_header(gc->pc, X_GLrop_EndQuery, cmdlen); 6516(void) memcpy((void *)(gc->pc + 4), (void *)(&target), 1 * sizeof(GLenum)); 6517gc->pc += cmdlen; 6518if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); } 6519} 6520 6521#define X_GLsop_GenQueries 162 6522void __indirect_glGenQueries(GLsizei n, GLuint * ids) 6523{ 6524 struct glx_context * const gc = __glXGetCurrentContext(); 6525 Display * const dpy = gc->currentDpy; 6526#ifndef USE_XCB 6527 const GLuint cmdlen = 4; 6528#endif 6529 if (n < 0) { 6530 __glXSetError(gc, GL_INVALID_VALUE); 6531 return; 6532 } 6533 if (__builtin_expect((n >= 0) && (dpy != NULL), 1)) { 6534#ifdef USE_XCB 6535 xcb_connection_t *c = XGetXCBConnection(dpy); 6536 (void) __glXFlushRenderBuffer(gc, gc->pc); 6537 xcb_glx_gen_queries_reply_t *reply = xcb_glx_gen_queries_reply(c, xcb_glx_gen_queries(c, gc->currentContextTag, n), NULL); 6538 (void)memcpy(ids, xcb_glx_gen_queries_data(reply), xcb_glx_gen_queries_data_length(reply) * sizeof(GLuint)); 6539 free(reply); 6540#else 6541 GLubyte const * pc = __glXSetupSingleRequest(gc, X_GLsop_GenQueries, cmdlen); 6542(void) memcpy((void *)(pc + 0), (void *)(&n), 1 * sizeof(GLsizei)); 6543 (void) __glXReadReply(dpy, 4, ids, GL_TRUE); 6544 UnlockDisplay(dpy); SyncHandle(); 6545#endif /* USE_XCB */ 6546 } 6547 return; 6548} 6549 6550#define X_GLsop_GetQueryObjectiv 165 6551void __indirect_glGetQueryObjectiv(GLuint id, GLenum pname, GLint * params) 6552{ 6553 struct glx_context * const gc = __glXGetCurrentContext(); 6554 Display * const dpy = gc->currentDpy; 6555#ifndef USE_XCB 6556 const GLuint cmdlen = 8; 6557#endif 6558 if (__builtin_expect(dpy != NULL, 1)) { 6559#ifdef USE_XCB 6560 xcb_connection_t *c = XGetXCBConnection(dpy); 6561 (void) __glXFlushRenderBuffer(gc, gc->pc); 6562 xcb_glx_get_query_objectiv_reply_t *reply = xcb_glx_get_query_objectiv_reply(c, xcb_glx_get_query_objectiv(c, gc->currentContextTag, id, pname), NULL); 6563 /* the XXX_data_length() xcb function name is misleading, it returns the number */ 6564 /* of elements, not the length of the data part. A single element is embedded. */ 6565 if (xcb_glx_get_query_objectiv_data_length(reply) == 1) 6566 (void)memcpy(params, &reply->datum, sizeof(reply->datum)); 6567 else 6568 (void)memcpy(params, xcb_glx_get_query_objectiv_data(reply), xcb_glx_get_query_objectiv_data_length(reply) * sizeof(GLint)); 6569 free(reply); 6570#else 6571 GLubyte const * pc = __glXSetupSingleRequest(gc, X_GLsop_GetQueryObjectiv, cmdlen); 6572(void) memcpy((void *)(pc + 0), (void *)(&id), 1 * sizeof(GLuint)); 6573(void) memcpy((void *)(pc + 4), (void *)(&pname), 1 * sizeof(GLenum)); 6574 (void) __glXReadReply(dpy, 4, params, GL_FALSE); 6575 UnlockDisplay(dpy); SyncHandle(); 6576#endif /* USE_XCB */ 6577 } 6578 return; 6579} 6580 6581#define X_GLsop_GetQueryObjectuiv 166 6582void __indirect_glGetQueryObjectuiv(GLuint id, GLenum pname, GLuint * params) 6583{ 6584 struct glx_context * const gc = __glXGetCurrentContext(); 6585 Display * const dpy = gc->currentDpy; 6586#ifndef USE_XCB 6587 const GLuint cmdlen = 8; 6588#endif 6589 if (__builtin_expect(dpy != NULL, 1)) { 6590#ifdef USE_XCB 6591 xcb_connection_t *c = XGetXCBConnection(dpy); 6592 (void) __glXFlushRenderBuffer(gc, gc->pc); 6593 xcb_glx_get_query_objectuiv_reply_t *reply = xcb_glx_get_query_objectuiv_reply(c, xcb_glx_get_query_objectuiv(c, gc->currentContextTag, id, pname), NULL); 6594 /* the XXX_data_length() xcb function name is misleading, it returns the number */ 6595 /* of elements, not the length of the data part. A single element is embedded. */ 6596 if (xcb_glx_get_query_objectuiv_data_length(reply) == 1) 6597 (void)memcpy(params, &reply->datum, sizeof(reply->datum)); 6598 else 6599 (void)memcpy(params, xcb_glx_get_query_objectuiv_data(reply), xcb_glx_get_query_objectuiv_data_length(reply) * sizeof(GLuint)); 6600 free(reply); 6601#else 6602 GLubyte const * pc = __glXSetupSingleRequest(gc, X_GLsop_GetQueryObjectuiv, cmdlen); 6603(void) memcpy((void *)(pc + 0), (void *)(&id), 1 * sizeof(GLuint)); 6604(void) memcpy((void *)(pc + 4), (void *)(&pname), 1 * sizeof(GLenum)); 6605 (void) __glXReadReply(dpy, 4, params, GL_FALSE); 6606 UnlockDisplay(dpy); SyncHandle(); 6607#endif /* USE_XCB */ 6608 } 6609 return; 6610} 6611 6612#define X_GLsop_GetQueryiv 164 6613void __indirect_glGetQueryiv(GLenum target, GLenum pname, GLint * params) 6614{ 6615 struct glx_context * const gc = __glXGetCurrentContext(); 6616 Display * const dpy = gc->currentDpy; 6617#ifndef USE_XCB 6618 const GLuint cmdlen = 8; 6619#endif 6620 if (__builtin_expect(dpy != NULL, 1)) { 6621#ifdef USE_XCB 6622 xcb_connection_t *c = XGetXCBConnection(dpy); 6623 (void) __glXFlushRenderBuffer(gc, gc->pc); 6624 xcb_glx_get_queryiv_reply_t *reply = xcb_glx_get_queryiv_reply(c, xcb_glx_get_queryiv(c, gc->currentContextTag, target, pname), NULL); 6625 /* the XXX_data_length() xcb function name is misleading, it returns the number */ 6626 /* of elements, not the length of the data part. A single element is embedded. */ 6627 if (xcb_glx_get_queryiv_data_length(reply) == 1) 6628 (void)memcpy(params, &reply->datum, sizeof(reply->datum)); 6629 else 6630 (void)memcpy(params, xcb_glx_get_queryiv_data(reply), xcb_glx_get_queryiv_data_length(reply) * sizeof(GLint)); 6631 free(reply); 6632#else 6633 GLubyte const * pc = __glXSetupSingleRequest(gc, X_GLsop_GetQueryiv, cmdlen); 6634(void) memcpy((void *)(pc + 0), (void *)(&target), 1 * sizeof(GLenum)); 6635(void) memcpy((void *)(pc + 4), (void *)(&pname), 1 * sizeof(GLenum)); 6636 (void) __glXReadReply(dpy, 4, params, GL_FALSE); 6637 UnlockDisplay(dpy); SyncHandle(); 6638#endif /* USE_XCB */ 6639 } 6640 return; 6641} 6642 6643#define X_GLsop_IsQuery 163 6644GLboolean __indirect_glIsQuery(GLuint id) 6645{ 6646 struct glx_context * const gc = __glXGetCurrentContext(); 6647 Display * const dpy = gc->currentDpy; 6648 GLboolean retval = (GLboolean) 0; 6649#ifndef USE_XCB 6650 const GLuint cmdlen = 4; 6651#endif 6652 if (__builtin_expect(dpy != NULL, 1)) { 6653#ifdef USE_XCB 6654 xcb_connection_t *c = XGetXCBConnection(dpy); 6655 (void) __glXFlushRenderBuffer(gc, gc->pc); 6656 xcb_glx_is_query_reply_t *reply = xcb_glx_is_query_reply(c, xcb_glx_is_query(c, gc->currentContextTag, id), NULL); 6657 retval = reply->ret_val; 6658 free(reply); 6659#else 6660 GLubyte const * pc = __glXSetupSingleRequest(gc, X_GLsop_IsQuery, cmdlen); 6661(void) memcpy((void *)(pc + 0), (void *)(&id), 1 * sizeof(GLuint)); 6662 retval = (GLboolean) __glXReadReply(dpy, 0, NULL, GL_FALSE); 6663 UnlockDisplay(dpy); SyncHandle(); 6664#endif /* USE_XCB */ 6665 } 6666 return retval; 6667} 6668 6669#define X_GLrop_BlendEquationSeparate 4228 6670void __indirect_glBlendEquationSeparate(GLenum modeRGB, GLenum modeA) 6671{ 6672 struct glx_context * const gc = __glXGetCurrentContext(); 6673 const GLuint cmdlen = 12; 6674emit_header(gc->pc, X_GLrop_BlendEquationSeparate, cmdlen); 6675(void) memcpy((void *)(gc->pc + 4), (void *)(&modeRGB), 1 * sizeof(GLenum)); 6676(void) memcpy((void *)(gc->pc + 8), (void *)(&modeA), 1 * sizeof(GLenum)); 6677gc->pc += cmdlen; 6678if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); } 6679} 6680 6681#define X_GLrop_DrawBuffers 233 6682void __indirect_glDrawBuffers(GLsizei n, const GLenum * bufs) 6683{ 6684 struct glx_context * const gc = __glXGetCurrentContext(); 6685 const GLuint cmdlen = 8 + safe_pad(safe_mul(n, 1 * sizeof(GLenum))); 6686 if (0 + safe_pad(safe_mul(n, 1 * sizeof(GLenum))) < 0) { 6687 __glXSetError(gc, GL_INVALID_VALUE); 6688 return; 6689 } 6690 if (n < 0) { 6691 __glXSetError(gc, GL_INVALID_VALUE); 6692 return; 6693 } 6694 if (__builtin_expect((n >= 0) && (gc->currentDpy != NULL), 1)) { 6695if (cmdlen <= gc->maxSmallRenderCommandSize) { 6696 if ( (gc->pc + cmdlen) > gc->bufEnd ) { 6697 (void) __glXFlushRenderBuffer(gc, gc->pc); 6698 } 6699emit_header(gc->pc, X_GLrop_DrawBuffers, cmdlen); 6700(void) memcpy((void *)(gc->pc + 4), (void *)(&n), 1 * sizeof(GLsizei)); 6701(void) memcpy((void *)(gc->pc + 8), (void *)(bufs), safe_mul(n, 1 * sizeof(GLenum))); 6702gc->pc += cmdlen; 6703if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); } 6704} 6705else { 6706const GLint op = X_GLrop_DrawBuffers; 6707const GLuint cmdlenLarge = cmdlen + 4; 6708GLubyte * const pc = __glXFlushRenderBuffer(gc, gc->pc); 6709(void) memcpy((void *)(pc + 0), (void *)(&cmdlenLarge), 4); 6710(void) memcpy((void *)(pc + 4), (void *)(&op), 4); 6711(void) memcpy((void *)(pc + 8), (void *)(&n), 1 * sizeof(GLsizei)); 6712 __glXSendLargeCommand(gc, pc, 12, bufs, safe_mul(n, 1 * sizeof(GLenum))); 6713} 6714 } 6715} 6716 6717#define X_GLrop_VertexAttrib1dv 4197 6718void __indirect_glVertexAttrib1d(GLuint index, GLdouble x) 6719{ 6720 struct glx_context * const gc = __glXGetCurrentContext(); 6721 const GLuint cmdlen = 16; 6722emit_header(gc->pc, X_GLrop_VertexAttrib1dv, cmdlen); 6723(void) memcpy((void *)(gc->pc + 4), (void *)(&index), 1 * sizeof(GLuint)); 6724(void) memcpy((void *)(gc->pc + 8), (void *)(&x), 1 * sizeof(GLdouble)); 6725gc->pc += cmdlen; 6726if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); } 6727} 6728 6729#define X_GLrop_VertexAttrib1dv 4197 6730void __indirect_glVertexAttrib1dv(GLuint index, const GLdouble * v) 6731{ 6732 struct glx_context * const gc = __glXGetCurrentContext(); 6733 const GLuint cmdlen = 16; 6734emit_header(gc->pc, X_GLrop_VertexAttrib1dv, cmdlen); 6735(void) memcpy((void *)(gc->pc + 4), (void *)(&index), 1 * sizeof(GLuint)); 6736(void) memcpy((void *)(gc->pc + 8), (void *)(v), 1 * sizeof(GLdouble)); 6737gc->pc += cmdlen; 6738if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); } 6739} 6740 6741#define X_GLrop_VertexAttrib1sv 4189 6742void __indirect_glVertexAttrib1s(GLuint index, GLshort x) 6743{ 6744 struct glx_context * const gc = __glXGetCurrentContext(); 6745 const GLuint cmdlen = 12; 6746emit_header(gc->pc, X_GLrop_VertexAttrib1sv, cmdlen); 6747(void) memcpy((void *)(gc->pc + 4), (void *)(&index), 1 * sizeof(GLuint)); 6748(void) memcpy((void *)(gc->pc + 8), (void *)(&x), 1 * sizeof(GLshort)); 6749gc->pc += cmdlen; 6750if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); } 6751} 6752 6753#define X_GLrop_VertexAttrib1sv 4189 6754void __indirect_glVertexAttrib1sv(GLuint index, const GLshort * v) 6755{ 6756 struct glx_context * const gc = __glXGetCurrentContext(); 6757 const GLuint cmdlen = 12; 6758emit_header(gc->pc, X_GLrop_VertexAttrib1sv, cmdlen); 6759(void) memcpy((void *)(gc->pc + 4), (void *)(&index), 1 * sizeof(GLuint)); 6760(void) memcpy((void *)(gc->pc + 8), (void *)(v), 1 * sizeof(GLshort)); 6761gc->pc += cmdlen; 6762if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); } 6763} 6764 6765#define X_GLrop_VertexAttrib2dv 4198 6766void __indirect_glVertexAttrib2d(GLuint index, GLdouble x, GLdouble y) 6767{ 6768 struct glx_context * const gc = __glXGetCurrentContext(); 6769 const GLuint cmdlen = 24; 6770emit_header(gc->pc, X_GLrop_VertexAttrib2dv, cmdlen); 6771(void) memcpy((void *)(gc->pc + 4), (void *)(&index), 1 * sizeof(GLuint)); 6772(void) memcpy((void *)(gc->pc + 8), (void *)(&x), 1 * sizeof(GLdouble)); 6773(void) memcpy((void *)(gc->pc + 16), (void *)(&y), 1 * sizeof(GLdouble)); 6774gc->pc += cmdlen; 6775if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); } 6776} 6777 6778#define X_GLrop_VertexAttrib2dv 4198 6779void __indirect_glVertexAttrib2dv(GLuint index, const GLdouble * v) 6780{ 6781 struct glx_context * const gc = __glXGetCurrentContext(); 6782 const GLuint cmdlen = 24; 6783emit_header(gc->pc, X_GLrop_VertexAttrib2dv, cmdlen); 6784(void) memcpy((void *)(gc->pc + 4), (void *)(&index), 1 * sizeof(GLuint)); 6785(void) memcpy((void *)(gc->pc + 8), (void *)(v), 2 * sizeof(GLdouble)); 6786gc->pc += cmdlen; 6787if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); } 6788} 6789 6790#define X_GLrop_VertexAttrib2sv 4190 6791void __indirect_glVertexAttrib2s(GLuint index, GLshort x, GLshort y) 6792{ 6793 struct glx_context * const gc = __glXGetCurrentContext(); 6794 const GLuint cmdlen = 12; 6795emit_header(gc->pc, X_GLrop_VertexAttrib2sv, cmdlen); 6796(void) memcpy((void *)(gc->pc + 4), (void *)(&index), 1 * sizeof(GLuint)); 6797(void) memcpy((void *)(gc->pc + 8), (void *)(&x), 1 * sizeof(GLshort)); 6798(void) memcpy((void *)(gc->pc + 10), (void *)(&y), 1 * sizeof(GLshort)); 6799gc->pc += cmdlen; 6800if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); } 6801} 6802 6803#define X_GLrop_VertexAttrib2sv 4190 6804void __indirect_glVertexAttrib2sv(GLuint index, const GLshort * v) 6805{ 6806 struct glx_context * const gc = __glXGetCurrentContext(); 6807 const GLuint cmdlen = 12; 6808emit_header(gc->pc, X_GLrop_VertexAttrib2sv, cmdlen); 6809(void) memcpy((void *)(gc->pc + 4), (void *)(&index), 1 * sizeof(GLuint)); 6810(void) memcpy((void *)(gc->pc + 8), (void *)(v), 2 * sizeof(GLshort)); 6811gc->pc += cmdlen; 6812if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); } 6813} 6814 6815#define X_GLrop_VertexAttrib3dv 4199 6816void __indirect_glVertexAttrib3d(GLuint index, GLdouble x, GLdouble y, GLdouble z) 6817{ 6818 struct glx_context * const gc = __glXGetCurrentContext(); 6819 const GLuint cmdlen = 32; 6820emit_header(gc->pc, X_GLrop_VertexAttrib3dv, cmdlen); 6821(void) memcpy((void *)(gc->pc + 4), (void *)(&index), 1 * sizeof(GLuint)); 6822(void) memcpy((void *)(gc->pc + 8), (void *)(&x), 1 * sizeof(GLdouble)); 6823(void) memcpy((void *)(gc->pc + 16), (void *)(&y), 1 * sizeof(GLdouble)); 6824(void) memcpy((void *)(gc->pc + 24), (void *)(&z), 1 * sizeof(GLdouble)); 6825gc->pc += cmdlen; 6826if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); } 6827} 6828 6829#define X_GLrop_VertexAttrib3dv 4199 6830void __indirect_glVertexAttrib3dv(GLuint index, const GLdouble * v) 6831{ 6832 struct glx_context * const gc = __glXGetCurrentContext(); 6833 const GLuint cmdlen = 32; 6834emit_header(gc->pc, X_GLrop_VertexAttrib3dv, cmdlen); 6835(void) memcpy((void *)(gc->pc + 4), (void *)(&index), 1 * sizeof(GLuint)); 6836(void) memcpy((void *)(gc->pc + 8), (void *)(v), 3 * sizeof(GLdouble)); 6837gc->pc += cmdlen; 6838if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); } 6839} 6840 6841#define X_GLrop_VertexAttrib3sv 4191 6842void __indirect_glVertexAttrib3s(GLuint index, GLshort x, GLshort y, GLshort z) 6843{ 6844 struct glx_context * const gc = __glXGetCurrentContext(); 6845 const GLuint cmdlen = 16; 6846emit_header(gc->pc, X_GLrop_VertexAttrib3sv, cmdlen); 6847(void) memcpy((void *)(gc->pc + 4), (void *)(&index), 1 * sizeof(GLuint)); 6848(void) memcpy((void *)(gc->pc + 8), (void *)(&x), 1 * sizeof(GLshort)); 6849(void) memcpy((void *)(gc->pc + 10), (void *)(&y), 1 * sizeof(GLshort)); 6850(void) memcpy((void *)(gc->pc + 12), (void *)(&z), 1 * sizeof(GLshort)); 6851gc->pc += cmdlen; 6852if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); } 6853} 6854 6855#define X_GLrop_VertexAttrib3sv 4191 6856void __indirect_glVertexAttrib3sv(GLuint index, const GLshort * v) 6857{ 6858 struct glx_context * const gc = __glXGetCurrentContext(); 6859 const GLuint cmdlen = 16; 6860emit_header(gc->pc, X_GLrop_VertexAttrib3sv, cmdlen); 6861(void) memcpy((void *)(gc->pc + 4), (void *)(&index), 1 * sizeof(GLuint)); 6862(void) memcpy((void *)(gc->pc + 8), (void *)(v), 3 * sizeof(GLshort)); 6863gc->pc += cmdlen; 6864if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); } 6865} 6866 6867#define X_GLrop_VertexAttrib4Nbv 4235 6868void __indirect_glVertexAttrib4Nbv(GLuint index, const GLbyte * v) 6869{ 6870 struct glx_context * const gc = __glXGetCurrentContext(); 6871 const GLuint cmdlen = 12; 6872emit_header(gc->pc, X_GLrop_VertexAttrib4Nbv, cmdlen); 6873(void) memcpy((void *)(gc->pc + 4), (void *)(&index), 1 * sizeof(GLuint)); 6874(void) memcpy((void *)(gc->pc + 8), (void *)(v), 4 * sizeof(GLbyte)); 6875gc->pc += cmdlen; 6876if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); } 6877} 6878 6879#define X_GLrop_VertexAttrib4Niv 4237 6880void __indirect_glVertexAttrib4Niv(GLuint index, const GLint * v) 6881{ 6882 struct glx_context * const gc = __glXGetCurrentContext(); 6883 const GLuint cmdlen = 24; 6884emit_header(gc->pc, X_GLrop_VertexAttrib4Niv, cmdlen); 6885(void) memcpy((void *)(gc->pc + 4), (void *)(&index), 1 * sizeof(GLuint)); 6886(void) memcpy((void *)(gc->pc + 8), (void *)(v), 4 * sizeof(GLint)); 6887gc->pc += cmdlen; 6888if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); } 6889} 6890 6891#define X_GLrop_VertexAttrib4Nsv 4236 6892void __indirect_glVertexAttrib4Nsv(GLuint index, const GLshort * v) 6893{ 6894 struct glx_context * const gc = __glXGetCurrentContext(); 6895 const GLuint cmdlen = 16; 6896emit_header(gc->pc, X_GLrop_VertexAttrib4Nsv, cmdlen); 6897(void) memcpy((void *)(gc->pc + 4), (void *)(&index), 1 * sizeof(GLuint)); 6898(void) memcpy((void *)(gc->pc + 8), (void *)(v), 4 * sizeof(GLshort)); 6899gc->pc += cmdlen; 6900if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); } 6901} 6902 6903#define X_GLrop_VertexAttrib4Nubv 4201 6904void __indirect_glVertexAttrib4Nub(GLuint index, GLubyte x, GLubyte y, GLubyte z, GLubyte w) 6905{ 6906 struct glx_context * const gc = __glXGetCurrentContext(); 6907 const GLuint cmdlen = 12; 6908emit_header(gc->pc, X_GLrop_VertexAttrib4Nubv, cmdlen); 6909(void) memcpy((void *)(gc->pc + 4), (void *)(&index), 1 * sizeof(GLuint)); 6910(void) memcpy((void *)(gc->pc + 8), (void *)(&x), 1 * sizeof(GLubyte)); 6911(void) memcpy((void *)(gc->pc + 9), (void *)(&y), 1 * sizeof(GLubyte)); 6912(void) memcpy((void *)(gc->pc + 10), (void *)(&z), 1 * sizeof(GLubyte)); 6913(void) memcpy((void *)(gc->pc + 11), (void *)(&w), 1 * sizeof(GLubyte)); 6914gc->pc += cmdlen; 6915if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); } 6916} 6917 6918#define X_GLrop_VertexAttrib4Nubv 4201 6919void __indirect_glVertexAttrib4Nubv(GLuint index, const GLubyte * v) 6920{ 6921 struct glx_context * const gc = __glXGetCurrentContext(); 6922 const GLuint cmdlen = 12; 6923emit_header(gc->pc, X_GLrop_VertexAttrib4Nubv, cmdlen); 6924(void) memcpy((void *)(gc->pc + 4), (void *)(&index), 1 * sizeof(GLuint)); 6925(void) memcpy((void *)(gc->pc + 8), (void *)(v), 4 * sizeof(GLubyte)); 6926gc->pc += cmdlen; 6927if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); } 6928} 6929 6930#define X_GLrop_VertexAttrib4Nuiv 4239 6931void __indirect_glVertexAttrib4Nuiv(GLuint index, const GLuint * v) 6932{ 6933 struct glx_context * const gc = __glXGetCurrentContext(); 6934 const GLuint cmdlen = 24; 6935emit_header(gc->pc, X_GLrop_VertexAttrib4Nuiv, cmdlen); 6936(void) memcpy((void *)(gc->pc + 4), (void *)(&index), 1 * sizeof(GLuint)); 6937(void) memcpy((void *)(gc->pc + 8), (void *)(v), 4 * sizeof(GLuint)); 6938gc->pc += cmdlen; 6939if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); } 6940} 6941 6942#define X_GLrop_VertexAttrib4Nusv 4238 6943void __indirect_glVertexAttrib4Nusv(GLuint index, const GLushort * v) 6944{ 6945 struct glx_context * const gc = __glXGetCurrentContext(); 6946 const GLuint cmdlen = 16; 6947emit_header(gc->pc, X_GLrop_VertexAttrib4Nusv, cmdlen); 6948(void) memcpy((void *)(gc->pc + 4), (void *)(&index), 1 * sizeof(GLuint)); 6949(void) memcpy((void *)(gc->pc + 8), (void *)(v), 4 * sizeof(GLushort)); 6950gc->pc += cmdlen; 6951if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); } 6952} 6953 6954#define X_GLrop_VertexAttrib4bv 4230 6955void __indirect_glVertexAttrib4bv(GLuint index, const GLbyte * v) 6956{ 6957 struct glx_context * const gc = __glXGetCurrentContext(); 6958 const GLuint cmdlen = 12; 6959emit_header(gc->pc, X_GLrop_VertexAttrib4bv, cmdlen); 6960(void) memcpy((void *)(gc->pc + 4), (void *)(&index), 1 * sizeof(GLuint)); 6961(void) memcpy((void *)(gc->pc + 8), (void *)(v), 4 * sizeof(GLbyte)); 6962gc->pc += cmdlen; 6963if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); } 6964} 6965 6966#define X_GLrop_VertexAttrib4dv 4200 6967void __indirect_glVertexAttrib4d(GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w) 6968{ 6969 struct glx_context * const gc = __glXGetCurrentContext(); 6970 const GLuint cmdlen = 40; 6971emit_header(gc->pc, X_GLrop_VertexAttrib4dv, cmdlen); 6972(void) memcpy((void *)(gc->pc + 4), (void *)(&index), 1 * sizeof(GLuint)); 6973(void) memcpy((void *)(gc->pc + 8), (void *)(&x), 1 * sizeof(GLdouble)); 6974(void) memcpy((void *)(gc->pc + 16), (void *)(&y), 1 * sizeof(GLdouble)); 6975(void) memcpy((void *)(gc->pc + 24), (void *)(&z), 1 * sizeof(GLdouble)); 6976(void) memcpy((void *)(gc->pc + 32), (void *)(&w), 1 * sizeof(GLdouble)); 6977gc->pc += cmdlen; 6978if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); } 6979} 6980 6981#define X_GLrop_VertexAttrib4dv 4200 6982void __indirect_glVertexAttrib4dv(GLuint index, const GLdouble * v) 6983{ 6984 struct glx_context * const gc = __glXGetCurrentContext(); 6985 const GLuint cmdlen = 40; 6986emit_header(gc->pc, X_GLrop_VertexAttrib4dv, cmdlen); 6987(void) memcpy((void *)(gc->pc + 4), (void *)(&index), 1 * sizeof(GLuint)); 6988(void) memcpy((void *)(gc->pc + 8), (void *)(v), 4 * sizeof(GLdouble)); 6989gc->pc += cmdlen; 6990if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); } 6991} 6992 6993#define X_GLrop_VertexAttrib4iv 4231 6994void __indirect_glVertexAttrib4iv(GLuint index, const GLint * v) 6995{ 6996 struct glx_context * const gc = __glXGetCurrentContext(); 6997 const GLuint cmdlen = 24; 6998emit_header(gc->pc, X_GLrop_VertexAttrib4iv, cmdlen); 6999(void) memcpy((void *)(gc->pc + 4), (void *)(&index), 1 * sizeof(GLuint)); 7000(void) memcpy((void *)(gc->pc + 8), (void *)(v), 4 * sizeof(GLint)); 7001gc->pc += cmdlen; 7002if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); } 7003} 7004 7005#define X_GLrop_VertexAttrib4sv 4192 7006void __indirect_glVertexAttrib4s(GLuint index, GLshort x, GLshort y, GLshort z, GLshort w) 7007{ 7008 struct glx_context * const gc = __glXGetCurrentContext(); 7009 const GLuint cmdlen = 16; 7010emit_header(gc->pc, X_GLrop_VertexAttrib4sv, cmdlen); 7011(void) memcpy((void *)(gc->pc + 4), (void *)(&index), 1 * sizeof(GLuint)); 7012(void) memcpy((void *)(gc->pc + 8), (void *)(&x), 1 * sizeof(GLshort)); 7013(void) memcpy((void *)(gc->pc + 10), (void *)(&y), 1 * sizeof(GLshort)); 7014(void) memcpy((void *)(gc->pc + 12), (void *)(&z), 1 * sizeof(GLshort)); 7015(void) memcpy((void *)(gc->pc + 14), (void *)(&w), 1 * sizeof(GLshort)); 7016gc->pc += cmdlen; 7017if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); } 7018} 7019 7020#define X_GLrop_VertexAttrib4sv 4192 7021void __indirect_glVertexAttrib4sv(GLuint index, const GLshort * v) 7022{ 7023 struct glx_context * const gc = __glXGetCurrentContext(); 7024 const GLuint cmdlen = 16; 7025emit_header(gc->pc, X_GLrop_VertexAttrib4sv, cmdlen); 7026(void) memcpy((void *)(gc->pc + 4), (void *)(&index), 1 * sizeof(GLuint)); 7027(void) memcpy((void *)(gc->pc + 8), (void *)(v), 4 * sizeof(GLshort)); 7028gc->pc += cmdlen; 7029if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); } 7030} 7031 7032#define X_GLrop_VertexAttrib4ubv 4232 7033void __indirect_glVertexAttrib4ubv(GLuint index, const GLubyte * v) 7034{ 7035 struct glx_context * const gc = __glXGetCurrentContext(); 7036 const GLuint cmdlen = 12; 7037emit_header(gc->pc, X_GLrop_VertexAttrib4ubv, cmdlen); 7038(void) memcpy((void *)(gc->pc + 4), (void *)(&index), 1 * sizeof(GLuint)); 7039(void) memcpy((void *)(gc->pc + 8), (void *)(v), 4 * sizeof(GLubyte)); 7040gc->pc += cmdlen; 7041if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); } 7042} 7043 7044#define X_GLrop_VertexAttrib4uiv 4234 7045void __indirect_glVertexAttrib4uiv(GLuint index, const GLuint * v) 7046{ 7047 struct glx_context * const gc = __glXGetCurrentContext(); 7048 const GLuint cmdlen = 24; 7049emit_header(gc->pc, X_GLrop_VertexAttrib4uiv, cmdlen); 7050(void) memcpy((void *)(gc->pc + 4), (void *)(&index), 1 * sizeof(GLuint)); 7051(void) memcpy((void *)(gc->pc + 8), (void *)(v), 4 * sizeof(GLuint)); 7052gc->pc += cmdlen; 7053if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); } 7054} 7055 7056#define X_GLrop_VertexAttrib4usv 4233 7057void __indirect_glVertexAttrib4usv(GLuint index, const GLushort * v) 7058{ 7059 struct glx_context * const gc = __glXGetCurrentContext(); 7060 const GLuint cmdlen = 16; 7061emit_header(gc->pc, X_GLrop_VertexAttrib4usv, cmdlen); 7062(void) memcpy((void *)(gc->pc + 4), (void *)(&index), 1 * sizeof(GLuint)); 7063(void) memcpy((void *)(gc->pc + 8), (void *)(v), 4 * sizeof(GLushort)); 7064gc->pc += cmdlen; 7065if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); } 7066} 7067 7068#define X_GLrop_ClampColor 234 7069void __indirect_glClampColor(GLenum target, GLenum clamp) 7070{ 7071 struct glx_context * const gc = __glXGetCurrentContext(); 7072 const GLuint cmdlen = 12; 7073emit_header(gc->pc, X_GLrop_ClampColor, cmdlen); 7074(void) memcpy((void *)(gc->pc + 4), (void *)(&target), 1 * sizeof(GLenum)); 7075(void) memcpy((void *)(gc->pc + 8), (void *)(&clamp), 1 * sizeof(GLenum)); 7076gc->pc += cmdlen; 7077if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); } 7078} 7079 7080#define X_GLrop_BindProgramARB 4180 7081void __indirect_glBindProgramARB(GLenum target, GLuint program) 7082{ 7083 struct glx_context * const gc = __glXGetCurrentContext(); 7084 const GLuint cmdlen = 12; 7085emit_header(gc->pc, X_GLrop_BindProgramARB, cmdlen); 7086(void) memcpy((void *)(gc->pc + 4), (void *)(&target), 1 * sizeof(GLenum)); 7087(void) memcpy((void *)(gc->pc + 8), (void *)(&program), 1 * sizeof(GLuint)); 7088gc->pc += cmdlen; 7089if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); } 7090} 7091 7092#define X_GLvop_DeleteProgramsARB 1294 7093void __indirect_glDeleteProgramsARB(GLsizei n, const GLuint * programs) 7094{ 7095 struct glx_context * const gc = __glXGetCurrentContext(); 7096 Display * const dpy = gc->currentDpy; 7097 const GLuint cmdlen = 4 + safe_pad(safe_mul(n, 1 * sizeof(GLuint))); 7098 if (0 + safe_pad(safe_mul(n, 1 * sizeof(GLuint))) < 0) { 7099 __glXSetError(gc, GL_INVALID_VALUE); 7100 return; 7101 } 7102 if (n < 0) { 7103 __glXSetError(gc, GL_INVALID_VALUE); 7104 return; 7105 } 7106 if (__builtin_expect((n >= 0) && (dpy != NULL), 1)) { 7107 GLubyte const * pc = __glXSetupVendorRequest(gc, X_GLXVendorPrivate, X_GLvop_DeleteProgramsARB, cmdlen); 7108(void) memcpy((void *)(pc + 0), (void *)(&n), 1 * sizeof(GLsizei)); 7109(void) memcpy((void *)(pc + 4), (void *)(programs), safe_mul(n, 1 * sizeof(GLuint))); 7110 UnlockDisplay(dpy); SyncHandle(); 7111 } 7112 return; 7113} 7114 7115#define X_GLvop_GenProgramsARB 1295 7116void __indirect_glGenProgramsARB(GLsizei n, GLuint * programs) 7117{ 7118 struct glx_context * const gc = __glXGetCurrentContext(); 7119 Display * const dpy = gc->currentDpy; 7120 const GLuint cmdlen = 4; 7121 if (n < 0) { 7122 __glXSetError(gc, GL_INVALID_VALUE); 7123 return; 7124 } 7125 if (__builtin_expect((n >= 0) && (dpy != NULL), 1)) { 7126 GLubyte const * pc = __glXSetupVendorRequest(gc, X_GLXVendorPrivateWithReply, X_GLvop_GenProgramsARB, cmdlen); 7127(void) memcpy((void *)(pc + 0), (void *)(&n), 1 * sizeof(GLsizei)); 7128 (void) __glXReadReply(dpy, 4, programs, GL_TRUE); 7129 UnlockDisplay(dpy); SyncHandle(); 7130 } 7131 return; 7132} 7133 7134#define X_GLvop_GetProgramStringARB 1308 7135void __indirect_glGetProgramStringARB(GLenum target, GLenum pname, GLvoid * string) 7136{ 7137 struct glx_context * const gc = __glXGetCurrentContext(); 7138 Display * const dpy = gc->currentDpy; 7139 const GLuint cmdlen = 8; 7140 if (__builtin_expect(dpy != NULL, 1)) { 7141 GLubyte const * pc = __glXSetupVendorRequest(gc, X_GLXVendorPrivateWithReply, X_GLvop_GetProgramStringARB, cmdlen); 7142(void) memcpy((void *)(pc + 0), (void *)(&target), 1 * sizeof(GLenum)); 7143(void) memcpy((void *)(pc + 4), (void *)(&pname), 1 * sizeof(GLenum)); 7144 (void) __glXReadReply(dpy, 1, string, GL_TRUE); 7145 UnlockDisplay(dpy); SyncHandle(); 7146 } 7147 return; 7148} 7149 7150#define X_GLvop_GetProgramivARB 1307 7151void __indirect_glGetProgramivARB(GLenum target, GLenum pname, GLint * params) 7152{ 7153 struct glx_context * const gc = __glXGetCurrentContext(); 7154 Display * const dpy = gc->currentDpy; 7155 const GLuint cmdlen = 8; 7156 if (__builtin_expect(dpy != NULL, 1)) { 7157 GLubyte const * pc = __glXSetupVendorRequest(gc, X_GLXVendorPrivateWithReply, X_GLvop_GetProgramivARB, cmdlen); 7158(void) memcpy((void *)(pc + 0), (void *)(&target), 1 * sizeof(GLenum)); 7159(void) memcpy((void *)(pc + 4), (void *)(&pname), 1 * sizeof(GLenum)); 7160 (void) __glXReadReply(dpy, 4, params, GL_FALSE); 7161 UnlockDisplay(dpy); SyncHandle(); 7162 } 7163 return; 7164} 7165 7166#define X_GLvop_IsProgramARB 1304 7167GLboolean __indirect_glIsProgramARB(GLuint program) 7168{ 7169 struct glx_context * const gc = __glXGetCurrentContext(); 7170 Display * const dpy = gc->currentDpy; 7171 GLboolean retval = (GLboolean) 0; 7172 const GLuint cmdlen = 4; 7173 if (__builtin_expect(dpy != NULL, 1)) { 7174 GLubyte const * pc = __glXSetupVendorRequest(gc, X_GLXVendorPrivateWithReply, X_GLvop_IsProgramARB, cmdlen); 7175(void) memcpy((void *)(pc + 0), (void *)(&program), 1 * sizeof(GLuint)); 7176 retval = (GLboolean) __glXReadReply(dpy, 0, NULL, GL_FALSE); 7177 UnlockDisplay(dpy); SyncHandle(); 7178 } 7179 return retval; 7180} 7181 7182#define X_GLrop_ProgramEnvParameter4dvARB 4185 7183void __indirect_glProgramEnvParameter4dARB(GLenum target, GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w) 7184{ 7185 struct glx_context * const gc = __glXGetCurrentContext(); 7186 const GLuint cmdlen = 44; 7187emit_header(gc->pc, X_GLrop_ProgramEnvParameter4dvARB, cmdlen); 7188(void) memcpy((void *)(gc->pc + 4), (void *)(&target), 1 * sizeof(GLenum)); 7189(void) memcpy((void *)(gc->pc + 8), (void *)(&index), 1 * sizeof(GLuint)); 7190(void) memcpy((void *)(gc->pc + 12), (void *)(&x), 1 * sizeof(GLdouble)); 7191(void) memcpy((void *)(gc->pc + 20), (void *)(&y), 1 * sizeof(GLdouble)); 7192(void) memcpy((void *)(gc->pc + 28), (void *)(&z), 1 * sizeof(GLdouble)); 7193(void) memcpy((void *)(gc->pc + 36), (void *)(&w), 1 * sizeof(GLdouble)); 7194gc->pc += cmdlen; 7195if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); } 7196} 7197 7198#define X_GLrop_ProgramEnvParameter4dvARB 4185 7199void __indirect_glProgramEnvParameter4dvARB(GLenum target, GLuint index, const GLdouble * params) 7200{ 7201 struct glx_context * const gc = __glXGetCurrentContext(); 7202 const GLuint cmdlen = 44; 7203emit_header(gc->pc, X_GLrop_ProgramEnvParameter4dvARB, cmdlen); 7204(void) memcpy((void *)(gc->pc + 4), (void *)(&target), 1 * sizeof(GLenum)); 7205(void) memcpy((void *)(gc->pc + 8), (void *)(&index), 1 * sizeof(GLuint)); 7206(void) memcpy((void *)(gc->pc + 12), (void *)(params), 4 * sizeof(GLdouble)); 7207gc->pc += cmdlen; 7208if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); } 7209} 7210 7211#define X_GLrop_ProgramEnvParameter4fvARB 4184 7212void __indirect_glProgramEnvParameter4fARB(GLenum target, GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w) 7213{ 7214 struct glx_context * const gc = __glXGetCurrentContext(); 7215 const GLuint cmdlen = 28; 7216emit_header(gc->pc, X_GLrop_ProgramEnvParameter4fvARB, cmdlen); 7217(void) memcpy((void *)(gc->pc + 4), (void *)(&target), 1 * sizeof(GLenum)); 7218(void) memcpy((void *)(gc->pc + 8), (void *)(&index), 1 * sizeof(GLuint)); 7219(void) memcpy((void *)(gc->pc + 12), (void *)(&x), 1 * sizeof(GLfloat)); 7220(void) memcpy((void *)(gc->pc + 16), (void *)(&y), 1 * sizeof(GLfloat)); 7221(void) memcpy((void *)(gc->pc + 20), (void *)(&z), 1 * sizeof(GLfloat)); 7222(void) memcpy((void *)(gc->pc + 24), (void *)(&w), 1 * sizeof(GLfloat)); 7223gc->pc += cmdlen; 7224if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); } 7225} 7226 7227#define X_GLrop_ProgramEnvParameter4fvARB 4184 7228void __indirect_glProgramEnvParameter4fvARB(GLenum target, GLuint index, const GLfloat * params) 7229{ 7230 struct glx_context * const gc = __glXGetCurrentContext(); 7231 const GLuint cmdlen = 28; 7232emit_header(gc->pc, X_GLrop_ProgramEnvParameter4fvARB, cmdlen); 7233(void) memcpy((void *)(gc->pc + 4), (void *)(&target), 1 * sizeof(GLenum)); 7234(void) memcpy((void *)(gc->pc + 8), (void *)(&index), 1 * sizeof(GLuint)); 7235(void) memcpy((void *)(gc->pc + 12), (void *)(params), 4 * sizeof(GLfloat)); 7236gc->pc += cmdlen; 7237if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); } 7238} 7239 7240#define X_GLrop_ProgramLocalParameter4dvARB 4216 7241void __indirect_glProgramLocalParameter4dARB(GLenum target, GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w) 7242{ 7243 struct glx_context * const gc = __glXGetCurrentContext(); 7244 const GLuint cmdlen = 44; 7245emit_header(gc->pc, X_GLrop_ProgramLocalParameter4dvARB, cmdlen); 7246(void) memcpy((void *)(gc->pc + 4), (void *)(&target), 1 * sizeof(GLenum)); 7247(void) memcpy((void *)(gc->pc + 8), (void *)(&index), 1 * sizeof(GLuint)); 7248(void) memcpy((void *)(gc->pc + 12), (void *)(&x), 1 * sizeof(GLdouble)); 7249(void) memcpy((void *)(gc->pc + 20), (void *)(&y), 1 * sizeof(GLdouble)); 7250(void) memcpy((void *)(gc->pc + 28), (void *)(&z), 1 * sizeof(GLdouble)); 7251(void) memcpy((void *)(gc->pc + 36), (void *)(&w), 1 * sizeof(GLdouble)); 7252gc->pc += cmdlen; 7253if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); } 7254} 7255 7256#define X_GLrop_ProgramLocalParameter4dvARB 4216 7257void __indirect_glProgramLocalParameter4dvARB(GLenum target, GLuint index, const GLdouble * params) 7258{ 7259 struct glx_context * const gc = __glXGetCurrentContext(); 7260 const GLuint cmdlen = 44; 7261emit_header(gc->pc, X_GLrop_ProgramLocalParameter4dvARB, cmdlen); 7262(void) memcpy((void *)(gc->pc + 4), (void *)(&target), 1 * sizeof(GLenum)); 7263(void) memcpy((void *)(gc->pc + 8), (void *)(&index), 1 * sizeof(GLuint)); 7264(void) memcpy((void *)(gc->pc + 12), (void *)(params), 4 * sizeof(GLdouble)); 7265gc->pc += cmdlen; 7266if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); } 7267} 7268 7269#define X_GLrop_ProgramLocalParameter4fvARB 4215 7270void __indirect_glProgramLocalParameter4fARB(GLenum target, GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w) 7271{ 7272 struct glx_context * const gc = __glXGetCurrentContext(); 7273 const GLuint cmdlen = 28; 7274emit_header(gc->pc, X_GLrop_ProgramLocalParameter4fvARB, cmdlen); 7275(void) memcpy((void *)(gc->pc + 4), (void *)(&target), 1 * sizeof(GLenum)); 7276(void) memcpy((void *)(gc->pc + 8), (void *)(&index), 1 * sizeof(GLuint)); 7277(void) memcpy((void *)(gc->pc + 12), (void *)(&x), 1 * sizeof(GLfloat)); 7278(void) memcpy((void *)(gc->pc + 16), (void *)(&y), 1 * sizeof(GLfloat)); 7279(void) memcpy((void *)(gc->pc + 20), (void *)(&z), 1 * sizeof(GLfloat)); 7280(void) memcpy((void *)(gc->pc + 24), (void *)(&w), 1 * sizeof(GLfloat)); 7281gc->pc += cmdlen; 7282if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); } 7283} 7284 7285#define X_GLrop_ProgramLocalParameter4fvARB 4215 7286void __indirect_glProgramLocalParameter4fvARB(GLenum target, GLuint index, const GLfloat * params) 7287{ 7288 struct glx_context * const gc = __glXGetCurrentContext(); 7289 const GLuint cmdlen = 28; 7290emit_header(gc->pc, X_GLrop_ProgramLocalParameter4fvARB, cmdlen); 7291(void) memcpy((void *)(gc->pc + 4), (void *)(&target), 1 * sizeof(GLenum)); 7292(void) memcpy((void *)(gc->pc + 8), (void *)(&index), 1 * sizeof(GLuint)); 7293(void) memcpy((void *)(gc->pc + 12), (void *)(params), 4 * sizeof(GLfloat)); 7294gc->pc += cmdlen; 7295if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); } 7296} 7297 7298#define X_GLrop_ProgramStringARB 4217 7299void __indirect_glProgramStringARB(GLenum target, GLenum format, GLsizei len, const GLvoid * string) 7300{ 7301 struct glx_context * const gc = __glXGetCurrentContext(); 7302 const GLuint cmdlen = 16 + safe_pad(len); 7303 if (0 + safe_pad(len) < 0) { 7304 __glXSetError(gc, GL_INVALID_VALUE); 7305 return; 7306 } 7307 if (len < 0) { 7308 __glXSetError(gc, GL_INVALID_VALUE); 7309 return; 7310 } 7311 if (__builtin_expect((len >= 0) && (gc->currentDpy != NULL), 1)) { 7312if (cmdlen <= gc->maxSmallRenderCommandSize) { 7313 if ( (gc->pc + cmdlen) > gc->bufEnd ) { 7314 (void) __glXFlushRenderBuffer(gc, gc->pc); 7315 } 7316emit_header(gc->pc, X_GLrop_ProgramStringARB, cmdlen); 7317(void) memcpy((void *)(gc->pc + 4), (void *)(&target), 1 * sizeof(GLenum)); 7318(void) memcpy((void *)(gc->pc + 8), (void *)(&format), 1 * sizeof(GLenum)); 7319(void) memcpy((void *)(gc->pc + 12), (void *)(&len), 1 * sizeof(GLsizei)); 7320(void) memcpy((void *)(gc->pc + 16), (void *)(string), len); 7321gc->pc += cmdlen; 7322if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); } 7323} 7324else { 7325const GLint op = X_GLrop_ProgramStringARB; 7326const GLuint cmdlenLarge = cmdlen + 4; 7327GLubyte * const pc = __glXFlushRenderBuffer(gc, gc->pc); 7328(void) memcpy((void *)(pc + 0), (void *)(&cmdlenLarge), 4); 7329(void) memcpy((void *)(pc + 4), (void *)(&op), 4); 7330(void) memcpy((void *)(pc + 8), (void *)(&target), 1 * sizeof(GLenum)); 7331(void) memcpy((void *)(pc + 12), (void *)(&format), 1 * sizeof(GLenum)); 7332(void) memcpy((void *)(pc + 16), (void *)(&len), 1 * sizeof(GLsizei)); 7333 __glXSendLargeCommand(gc, pc, 20, string, len); 7334} 7335 } 7336} 7337 7338#define X_GLrop_VertexAttrib1fvARB 4193 7339void __indirect_glVertexAttrib1fARB(GLuint index, GLfloat x) 7340{ 7341 struct glx_context * const gc = __glXGetCurrentContext(); 7342 const GLuint cmdlen = 12; 7343emit_header(gc->pc, X_GLrop_VertexAttrib1fvARB, cmdlen); 7344(void) memcpy((void *)(gc->pc + 4), (void *)(&index), 1 * sizeof(GLuint)); 7345(void) memcpy((void *)(gc->pc + 8), (void *)(&x), 1 * sizeof(GLfloat)); 7346gc->pc += cmdlen; 7347if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); } 7348} 7349 7350#define X_GLrop_VertexAttrib1fvARB 4193 7351void __indirect_glVertexAttrib1fvARB(GLuint index, const GLfloat * v) 7352{ 7353 struct glx_context * const gc = __glXGetCurrentContext(); 7354 const GLuint cmdlen = 12; 7355emit_header(gc->pc, X_GLrop_VertexAttrib1fvARB, cmdlen); 7356(void) memcpy((void *)(gc->pc + 4), (void *)(&index), 1 * sizeof(GLuint)); 7357(void) memcpy((void *)(gc->pc + 8), (void *)(v), 1 * sizeof(GLfloat)); 7358gc->pc += cmdlen; 7359if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); } 7360} 7361 7362#define X_GLrop_VertexAttrib2fvARB 4194 7363void __indirect_glVertexAttrib2fARB(GLuint index, GLfloat x, GLfloat y) 7364{ 7365 struct glx_context * const gc = __glXGetCurrentContext(); 7366 const GLuint cmdlen = 16; 7367emit_header(gc->pc, X_GLrop_VertexAttrib2fvARB, cmdlen); 7368(void) memcpy((void *)(gc->pc + 4), (void *)(&index), 1 * sizeof(GLuint)); 7369(void) memcpy((void *)(gc->pc + 8), (void *)(&x), 1 * sizeof(GLfloat)); 7370(void) memcpy((void *)(gc->pc + 12), (void *)(&y), 1 * sizeof(GLfloat)); 7371gc->pc += cmdlen; 7372if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); } 7373} 7374 7375#define X_GLrop_VertexAttrib2fvARB 4194 7376void __indirect_glVertexAttrib2fvARB(GLuint index, const GLfloat * v) 7377{ 7378 struct glx_context * const gc = __glXGetCurrentContext(); 7379 const GLuint cmdlen = 16; 7380emit_header(gc->pc, X_GLrop_VertexAttrib2fvARB, cmdlen); 7381(void) memcpy((void *)(gc->pc + 4), (void *)(&index), 1 * sizeof(GLuint)); 7382(void) memcpy((void *)(gc->pc + 8), (void *)(v), 2 * sizeof(GLfloat)); 7383gc->pc += cmdlen; 7384if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); } 7385} 7386 7387#define X_GLrop_VertexAttrib3fvARB 4195 7388void __indirect_glVertexAttrib3fARB(GLuint index, GLfloat x, GLfloat y, GLfloat z) 7389{ 7390 struct glx_context * const gc = __glXGetCurrentContext(); 7391 const GLuint cmdlen = 20; 7392emit_header(gc->pc, X_GLrop_VertexAttrib3fvARB, cmdlen); 7393(void) memcpy((void *)(gc->pc + 4), (void *)(&index), 1 * sizeof(GLuint)); 7394(void) memcpy((void *)(gc->pc + 8), (void *)(&x), 1 * sizeof(GLfloat)); 7395(void) memcpy((void *)(gc->pc + 12), (void *)(&y), 1 * sizeof(GLfloat)); 7396(void) memcpy((void *)(gc->pc + 16), (void *)(&z), 1 * sizeof(GLfloat)); 7397gc->pc += cmdlen; 7398if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); } 7399} 7400 7401#define X_GLrop_VertexAttrib3fvARB 4195 7402void __indirect_glVertexAttrib3fvARB(GLuint index, const GLfloat * v) 7403{ 7404 struct glx_context * const gc = __glXGetCurrentContext(); 7405 const GLuint cmdlen = 20; 7406emit_header(gc->pc, X_GLrop_VertexAttrib3fvARB, cmdlen); 7407(void) memcpy((void *)(gc->pc + 4), (void *)(&index), 1 * sizeof(GLuint)); 7408(void) memcpy((void *)(gc->pc + 8), (void *)(v), 3 * sizeof(GLfloat)); 7409gc->pc += cmdlen; 7410if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); } 7411} 7412 7413#define X_GLrop_VertexAttrib4fvARB 4196 7414void __indirect_glVertexAttrib4fARB(GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w) 7415{ 7416 struct glx_context * const gc = __glXGetCurrentContext(); 7417 const GLuint cmdlen = 24; 7418emit_header(gc->pc, X_GLrop_VertexAttrib4fvARB, cmdlen); 7419(void) memcpy((void *)(gc->pc + 4), (void *)(&index), 1 * sizeof(GLuint)); 7420(void) memcpy((void *)(gc->pc + 8), (void *)(&x), 1 * sizeof(GLfloat)); 7421(void) memcpy((void *)(gc->pc + 12), (void *)(&y), 1 * sizeof(GLfloat)); 7422(void) memcpy((void *)(gc->pc + 16), (void *)(&z), 1 * sizeof(GLfloat)); 7423(void) memcpy((void *)(gc->pc + 20), (void *)(&w), 1 * sizeof(GLfloat)); 7424gc->pc += cmdlen; 7425if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); } 7426} 7427 7428#define X_GLrop_VertexAttrib4fvARB 4196 7429void __indirect_glVertexAttrib4fvARB(GLuint index, const GLfloat * v) 7430{ 7431 struct glx_context * const gc = __glXGetCurrentContext(); 7432 const GLuint cmdlen = 24; 7433emit_header(gc->pc, X_GLrop_VertexAttrib4fvARB, cmdlen); 7434(void) memcpy((void *)(gc->pc + 4), (void *)(&index), 1 * sizeof(GLuint)); 7435(void) memcpy((void *)(gc->pc + 8), (void *)(v), 4 * sizeof(GLfloat)); 7436gc->pc += cmdlen; 7437if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); } 7438} 7439 7440#define X_GLrop_BindFramebuffer 236 7441void __indirect_glBindFramebuffer(GLenum target, GLuint framebuffer) 7442{ 7443 struct glx_context * const gc = __glXGetCurrentContext(); 7444 const GLuint cmdlen = 12; 7445emit_header(gc->pc, X_GLrop_BindFramebuffer, cmdlen); 7446(void) memcpy((void *)(gc->pc + 4), (void *)(&target), 1 * sizeof(GLenum)); 7447(void) memcpy((void *)(gc->pc + 8), (void *)(&framebuffer), 1 * sizeof(GLuint)); 7448gc->pc += cmdlen; 7449if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); } 7450} 7451 7452#define X_GLrop_BindRenderbuffer 235 7453void __indirect_glBindRenderbuffer(GLenum target, GLuint renderbuffer) 7454{ 7455 struct glx_context * const gc = __glXGetCurrentContext(); 7456 const GLuint cmdlen = 12; 7457emit_header(gc->pc, X_GLrop_BindRenderbuffer, cmdlen); 7458(void) memcpy((void *)(gc->pc + 4), (void *)(&target), 1 * sizeof(GLenum)); 7459(void) memcpy((void *)(gc->pc + 8), (void *)(&renderbuffer), 1 * sizeof(GLuint)); 7460gc->pc += cmdlen; 7461if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); } 7462} 7463 7464#define X_GLrop_BlitFramebuffer 4330 7465void __indirect_glBlitFramebuffer(GLint srcX0, GLint srcY0, GLint srcX1, GLint srcY1, GLint dstX0, GLint dstY0, GLint dstX1, GLint dstY1, GLbitfield mask, GLenum filter) 7466{ 7467 struct glx_context * const gc = __glXGetCurrentContext(); 7468 const GLuint cmdlen = 44; 7469emit_header(gc->pc, X_GLrop_BlitFramebuffer, cmdlen); 7470(void) memcpy((void *)(gc->pc + 4), (void *)(&srcX0), 1 * sizeof(GLint)); 7471(void) memcpy((void *)(gc->pc + 8), (void *)(&srcY0), 1 * sizeof(GLint)); 7472(void) memcpy((void *)(gc->pc + 12), (void *)(&srcX1), 1 * sizeof(GLint)); 7473(void) memcpy((void *)(gc->pc + 16), (void *)(&srcY1), 1 * sizeof(GLint)); 7474(void) memcpy((void *)(gc->pc + 20), (void *)(&dstX0), 1 * sizeof(GLint)); 7475(void) memcpy((void *)(gc->pc + 24), (void *)(&dstY0), 1 * sizeof(GLint)); 7476(void) memcpy((void *)(gc->pc + 28), (void *)(&dstX1), 1 * sizeof(GLint)); 7477(void) memcpy((void *)(gc->pc + 32), (void *)(&dstY1), 1 * sizeof(GLint)); 7478(void) memcpy((void *)(gc->pc + 36), (void *)(&mask), 1 * sizeof(GLbitfield)); 7479(void) memcpy((void *)(gc->pc + 40), (void *)(&filter), 1 * sizeof(GLenum)); 7480gc->pc += cmdlen; 7481if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); } 7482} 7483 7484#define X_GLvop_CheckFramebufferStatus 1427 7485GLenum __indirect_glCheckFramebufferStatus(GLenum target) 7486{ 7487 struct glx_context * const gc = __glXGetCurrentContext(); 7488 Display * const dpy = gc->currentDpy; 7489 GLenum retval = (GLenum) 0; 7490 const GLuint cmdlen = 4; 7491 if (__builtin_expect(dpy != NULL, 1)) { 7492 GLubyte const * pc = __glXSetupVendorRequest(gc, X_GLXVendorPrivateWithReply, X_GLvop_CheckFramebufferStatus, cmdlen); 7493(void) memcpy((void *)(pc + 0), (void *)(&target), 1 * sizeof(GLenum)); 7494 retval = (GLenum) __glXReadReply(dpy, 0, NULL, GL_FALSE); 7495 UnlockDisplay(dpy); SyncHandle(); 7496 } 7497 return retval; 7498} 7499 7500#define X_GLrop_DeleteFramebuffers 4320 7501void __indirect_glDeleteFramebuffers(GLsizei n, const GLuint * framebuffers) 7502{ 7503 struct glx_context * const gc = __glXGetCurrentContext(); 7504 const GLuint cmdlen = 8 + safe_pad(safe_mul(n, 1 * sizeof(GLuint))); 7505 if (0 + safe_pad(safe_mul(n, 1 * sizeof(GLuint))) < 0) { 7506 __glXSetError(gc, GL_INVALID_VALUE); 7507 return; 7508 } 7509 if (n < 0) { 7510 __glXSetError(gc, GL_INVALID_VALUE); 7511 return; 7512 } 7513 if (__builtin_expect(n >= 0, 1)) { 7514emit_header(gc->pc, X_GLrop_DeleteFramebuffers, cmdlen); 7515(void) memcpy((void *)(gc->pc + 4), (void *)(&n), 1 * sizeof(GLsizei)); 7516(void) memcpy((void *)(gc->pc + 8), (void *)(framebuffers), safe_mul(n, 1 * sizeof(GLuint))); 7517gc->pc += cmdlen; 7518if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); } 7519 } 7520} 7521 7522#define X_GLrop_DeleteRenderbuffers 4317 7523void __indirect_glDeleteRenderbuffers(GLsizei n, const GLuint * renderbuffers) 7524{ 7525 struct glx_context * const gc = __glXGetCurrentContext(); 7526 const GLuint cmdlen = 8 + safe_pad(safe_mul(n, 1 * sizeof(GLuint))); 7527 if (0 + safe_pad(safe_mul(n, 1 * sizeof(GLuint))) < 0) { 7528 __glXSetError(gc, GL_INVALID_VALUE); 7529 return; 7530 } 7531 if (n < 0) { 7532 __glXSetError(gc, GL_INVALID_VALUE); 7533 return; 7534 } 7535 if (__builtin_expect(n >= 0, 1)) { 7536emit_header(gc->pc, X_GLrop_DeleteRenderbuffers, cmdlen); 7537(void) memcpy((void *)(gc->pc + 4), (void *)(&n), 1 * sizeof(GLsizei)); 7538(void) memcpy((void *)(gc->pc + 8), (void *)(renderbuffers), safe_mul(n, 1 * sizeof(GLuint))); 7539gc->pc += cmdlen; 7540if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); } 7541 } 7542} 7543 7544#define X_GLrop_FramebufferRenderbuffer 4324 7545void __indirect_glFramebufferRenderbuffer(GLenum target, GLenum attachment, GLenum renderbuffertarget, GLuint renderbuffer) 7546{ 7547 struct glx_context * const gc = __glXGetCurrentContext(); 7548 const GLuint cmdlen = 20; 7549emit_header(gc->pc, X_GLrop_FramebufferRenderbuffer, cmdlen); 7550(void) memcpy((void *)(gc->pc + 4), (void *)(&target), 1 * sizeof(GLenum)); 7551(void) memcpy((void *)(gc->pc + 8), (void *)(&attachment), 1 * sizeof(GLenum)); 7552(void) memcpy((void *)(gc->pc + 12), (void *)(&renderbuffertarget), 1 * sizeof(GLenum)); 7553(void) memcpy((void *)(gc->pc + 16), (void *)(&renderbuffer), 1 * sizeof(GLuint)); 7554gc->pc += cmdlen; 7555if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); } 7556} 7557 7558#define X_GLrop_FramebufferTexture1D 4321 7559void __indirect_glFramebufferTexture1D(GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level) 7560{ 7561 struct glx_context * const gc = __glXGetCurrentContext(); 7562 const GLuint cmdlen = 24; 7563emit_header(gc->pc, X_GLrop_FramebufferTexture1D, cmdlen); 7564(void) memcpy((void *)(gc->pc + 4), (void *)(&target), 1 * sizeof(GLenum)); 7565(void) memcpy((void *)(gc->pc + 8), (void *)(&attachment), 1 * sizeof(GLenum)); 7566(void) memcpy((void *)(gc->pc + 12), (void *)(&textarget), 1 * sizeof(GLenum)); 7567(void) memcpy((void *)(gc->pc + 16), (void *)(&texture), 1 * sizeof(GLuint)); 7568(void) memcpy((void *)(gc->pc + 20), (void *)(&level), 1 * sizeof(GLint)); 7569gc->pc += cmdlen; 7570if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); } 7571} 7572 7573#define X_GLrop_FramebufferTexture2D 4322 7574void __indirect_glFramebufferTexture2D(GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level) 7575{ 7576 struct glx_context * const gc = __glXGetCurrentContext(); 7577 const GLuint cmdlen = 24; 7578emit_header(gc->pc, X_GLrop_FramebufferTexture2D, cmdlen); 7579(void) memcpy((void *)(gc->pc + 4), (void *)(&target), 1 * sizeof(GLenum)); 7580(void) memcpy((void *)(gc->pc + 8), (void *)(&attachment), 1 * sizeof(GLenum)); 7581(void) memcpy((void *)(gc->pc + 12), (void *)(&textarget), 1 * sizeof(GLenum)); 7582(void) memcpy((void *)(gc->pc + 16), (void *)(&texture), 1 * sizeof(GLuint)); 7583(void) memcpy((void *)(gc->pc + 20), (void *)(&level), 1 * sizeof(GLint)); 7584gc->pc += cmdlen; 7585if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); } 7586} 7587 7588#define X_GLrop_FramebufferTexture3D 4323 7589void __indirect_glFramebufferTexture3D(GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level, GLint layer) 7590{ 7591 struct glx_context * const gc = __glXGetCurrentContext(); 7592 const GLuint cmdlen = 28; 7593emit_header(gc->pc, X_GLrop_FramebufferTexture3D, cmdlen); 7594(void) memcpy((void *)(gc->pc + 4), (void *)(&target), 1 * sizeof(GLenum)); 7595(void) memcpy((void *)(gc->pc + 8), (void *)(&attachment), 1 * sizeof(GLenum)); 7596(void) memcpy((void *)(gc->pc + 12), (void *)(&textarget), 1 * sizeof(GLenum)); 7597(void) memcpy((void *)(gc->pc + 16), (void *)(&texture), 1 * sizeof(GLuint)); 7598(void) memcpy((void *)(gc->pc + 20), (void *)(&level), 1 * sizeof(GLint)); 7599(void) memcpy((void *)(gc->pc + 24), (void *)(&layer), 1 * sizeof(GLint)); 7600gc->pc += cmdlen; 7601if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); } 7602} 7603 7604#define X_GLrop_FramebufferTextureLayer 237 7605void __indirect_glFramebufferTextureLayer(GLenum target, GLenum attachment, GLuint texture, GLint level, GLint layer) 7606{ 7607 struct glx_context * const gc = __glXGetCurrentContext(); 7608 const GLuint cmdlen = 24; 7609emit_header(gc->pc, X_GLrop_FramebufferTextureLayer, cmdlen); 7610(void) memcpy((void *)(gc->pc + 4), (void *)(&target), 1 * sizeof(GLenum)); 7611(void) memcpy((void *)(gc->pc + 8), (void *)(&attachment), 1 * sizeof(GLenum)); 7612(void) memcpy((void *)(gc->pc + 12), (void *)(&texture), 1 * sizeof(GLuint)); 7613(void) memcpy((void *)(gc->pc + 16), (void *)(&level), 1 * sizeof(GLint)); 7614(void) memcpy((void *)(gc->pc + 20), (void *)(&layer), 1 * sizeof(GLint)); 7615gc->pc += cmdlen; 7616if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); } 7617} 7618 7619#define X_GLvop_GenFramebuffers 1426 7620void __indirect_glGenFramebuffers(GLsizei n, GLuint * framebuffers) 7621{ 7622 struct glx_context * const gc = __glXGetCurrentContext(); 7623 Display * const dpy = gc->currentDpy; 7624 const GLuint cmdlen = 4; 7625 if (n < 0) { 7626 __glXSetError(gc, GL_INVALID_VALUE); 7627 return; 7628 } 7629 if (__builtin_expect((n >= 0) && (dpy != NULL), 1)) { 7630 GLubyte const * pc = __glXSetupVendorRequest(gc, X_GLXVendorPrivateWithReply, X_GLvop_GenFramebuffers, cmdlen); 7631(void) memcpy((void *)(pc + 0), (void *)(&n), 1 * sizeof(GLsizei)); 7632 (void) __glXReadReply(dpy, 4, framebuffers, GL_TRUE); 7633 UnlockDisplay(dpy); SyncHandle(); 7634 } 7635 return; 7636} 7637 7638#define X_GLvop_GenRenderbuffers 1423 7639void __indirect_glGenRenderbuffers(GLsizei n, GLuint * renderbuffers) 7640{ 7641 struct glx_context * const gc = __glXGetCurrentContext(); 7642 Display * const dpy = gc->currentDpy; 7643 const GLuint cmdlen = 4; 7644 if (n < 0) { 7645 __glXSetError(gc, GL_INVALID_VALUE); 7646 return; 7647 } 7648 if (__builtin_expect((n >= 0) && (dpy != NULL), 1)) { 7649 GLubyte const * pc = __glXSetupVendorRequest(gc, X_GLXVendorPrivateWithReply, X_GLvop_GenRenderbuffers, cmdlen); 7650(void) memcpy((void *)(pc + 0), (void *)(&n), 1 * sizeof(GLsizei)); 7651 (void) __glXReadReply(dpy, 4, renderbuffers, GL_TRUE); 7652 UnlockDisplay(dpy); SyncHandle(); 7653 } 7654 return; 7655} 7656 7657#define X_GLrop_GenerateMipmap 4325 7658void __indirect_glGenerateMipmap(GLenum target) 7659{ 7660 struct glx_context * const gc = __glXGetCurrentContext(); 7661 const GLuint cmdlen = 8; 7662emit_header(gc->pc, X_GLrop_GenerateMipmap, cmdlen); 7663(void) memcpy((void *)(gc->pc + 4), (void *)(&target), 1 * sizeof(GLenum)); 7664gc->pc += cmdlen; 7665if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); } 7666} 7667 7668#define X_GLvop_GetFramebufferAttachmentParameteriv 1428 7669void __indirect_glGetFramebufferAttachmentParameteriv(GLenum target, GLenum attachment, GLenum pname, GLint * params) 7670{ 7671 struct glx_context * const gc = __glXGetCurrentContext(); 7672 Display * const dpy = gc->currentDpy; 7673 const GLuint cmdlen = 12; 7674 if (__builtin_expect(dpy != NULL, 1)) { 7675 GLubyte const * pc = __glXSetupVendorRequest(gc, X_GLXVendorPrivateWithReply, X_GLvop_GetFramebufferAttachmentParameteriv, cmdlen); 7676(void) memcpy((void *)(pc + 0), (void *)(&target), 1 * sizeof(GLenum)); 7677(void) memcpy((void *)(pc + 4), (void *)(&attachment), 1 * sizeof(GLenum)); 7678(void) memcpy((void *)(pc + 8), (void *)(&pname), 1 * sizeof(GLenum)); 7679 (void) __glXReadReply(dpy, 4, params, GL_FALSE); 7680 UnlockDisplay(dpy); SyncHandle(); 7681 } 7682 return; 7683} 7684 7685#define X_GLvop_GetRenderbufferParameteriv 1424 7686void __indirect_glGetRenderbufferParameteriv(GLenum target, GLenum pname, GLint * params) 7687{ 7688 struct glx_context * const gc = __glXGetCurrentContext(); 7689 Display * const dpy = gc->currentDpy; 7690 const GLuint cmdlen = 8; 7691 if (__builtin_expect(dpy != NULL, 1)) { 7692 GLubyte const * pc = __glXSetupVendorRequest(gc, X_GLXVendorPrivateWithReply, X_GLvop_GetRenderbufferParameteriv, cmdlen); 7693(void) memcpy((void *)(pc + 0), (void *)(&target), 1 * sizeof(GLenum)); 7694(void) memcpy((void *)(pc + 4), (void *)(&pname), 1 * sizeof(GLenum)); 7695 (void) __glXReadReply(dpy, 4, params, GL_FALSE); 7696 UnlockDisplay(dpy); SyncHandle(); 7697 } 7698 return; 7699} 7700 7701#define X_GLvop_IsFramebuffer 1425 7702GLboolean __indirect_glIsFramebuffer(GLuint framebuffer) 7703{ 7704 struct glx_context * const gc = __glXGetCurrentContext(); 7705 Display * const dpy = gc->currentDpy; 7706 GLboolean retval = (GLboolean) 0; 7707 const GLuint cmdlen = 4; 7708 if (__builtin_expect(dpy != NULL, 1)) { 7709 GLubyte const * pc = __glXSetupVendorRequest(gc, X_GLXVendorPrivateWithReply, X_GLvop_IsFramebuffer, cmdlen); 7710(void) memcpy((void *)(pc + 0), (void *)(&framebuffer), 1 * sizeof(GLuint)); 7711 retval = (GLboolean) __glXReadReply(dpy, 0, NULL, GL_FALSE); 7712 UnlockDisplay(dpy); SyncHandle(); 7713 } 7714 return retval; 7715} 7716 7717#define X_GLvop_IsRenderbuffer 1422 7718GLboolean __indirect_glIsRenderbuffer(GLuint renderbuffer) 7719{ 7720 struct glx_context * const gc = __glXGetCurrentContext(); 7721 Display * const dpy = gc->currentDpy; 7722 GLboolean retval = (GLboolean) 0; 7723 const GLuint cmdlen = 4; 7724 if (__builtin_expect(dpy != NULL, 1)) { 7725 GLubyte const * pc = __glXSetupVendorRequest(gc, X_GLXVendorPrivateWithReply, X_GLvop_IsRenderbuffer, cmdlen); 7726(void) memcpy((void *)(pc + 0), (void *)(&renderbuffer), 1 * sizeof(GLuint)); 7727 retval = (GLboolean) __glXReadReply(dpy, 0, NULL, GL_FALSE); 7728 UnlockDisplay(dpy); SyncHandle(); 7729 } 7730 return retval; 7731} 7732 7733#define X_GLrop_RenderbufferStorage 4318 7734void __indirect_glRenderbufferStorage(GLenum target, GLenum internalformat, GLsizei width, GLsizei height) 7735{ 7736 struct glx_context * const gc = __glXGetCurrentContext(); 7737 const GLuint cmdlen = 20; 7738emit_header(gc->pc, X_GLrop_RenderbufferStorage, cmdlen); 7739(void) memcpy((void *)(gc->pc + 4), (void *)(&target), 1 * sizeof(GLenum)); 7740(void) memcpy((void *)(gc->pc + 8), (void *)(&internalformat), 1 * sizeof(GLenum)); 7741(void) memcpy((void *)(gc->pc + 12), (void *)(&width), 1 * sizeof(GLsizei)); 7742(void) memcpy((void *)(gc->pc + 16), (void *)(&height), 1 * sizeof(GLsizei)); 7743gc->pc += cmdlen; 7744if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); } 7745} 7746 7747#define X_GLrop_RenderbufferStorageMultisample 4331 7748void __indirect_glRenderbufferStorageMultisample(GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height) 7749{ 7750 struct glx_context * const gc = __glXGetCurrentContext(); 7751 const GLuint cmdlen = 24; 7752emit_header(gc->pc, X_GLrop_RenderbufferStorageMultisample, cmdlen); 7753(void) memcpy((void *)(gc->pc + 4), (void *)(&target), 1 * sizeof(GLenum)); 7754(void) memcpy((void *)(gc->pc + 8), (void *)(&samples), 1 * sizeof(GLsizei)); 7755(void) memcpy((void *)(gc->pc + 12), (void *)(&internalformat), 1 * sizeof(GLenum)); 7756(void) memcpy((void *)(gc->pc + 16), (void *)(&width), 1 * sizeof(GLsizei)); 7757(void) memcpy((void *)(gc->pc + 20), (void *)(&height), 1 * sizeof(GLsizei)); 7758gc->pc += cmdlen; 7759if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); } 7760} 7761 7762#define X_GLrop_SampleMaskSGIS 2048 7763void __indirect_glSampleMaskSGIS(GLclampf value, GLboolean invert) 7764{ 7765 struct glx_context * const gc = __glXGetCurrentContext(); 7766 const GLuint cmdlen = 12; 7767emit_header(gc->pc, X_GLrop_SampleMaskSGIS, cmdlen); 7768(void) memcpy((void *)(gc->pc + 4), (void *)(&value), 1 * sizeof(GLclampf)); 7769(void) memcpy((void *)(gc->pc + 8), (void *)(&invert), 1 * sizeof(GLboolean)); 7770gc->pc += cmdlen; 7771if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); } 7772} 7773 7774#define X_GLrop_SamplePatternSGIS 2049 7775void __indirect_glSamplePatternSGIS(GLenum pattern) 7776{ 7777 struct glx_context * const gc = __glXGetCurrentContext(); 7778 const GLuint cmdlen = 8; 7779emit_header(gc->pc, X_GLrop_SamplePatternSGIS, cmdlen); 7780(void) memcpy((void *)(gc->pc + 4), (void *)(&pattern), 1 * sizeof(GLenum)); 7781gc->pc += cmdlen; 7782if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); } 7783} 7784 7785#define X_GLrop_SecondaryColor3fvEXT 4129 7786void __indirect_glSecondaryColor3fEXT(GLfloat red, GLfloat green, GLfloat blue) 7787{ 7788 struct glx_context * const gc = __glXGetCurrentContext(); 7789 const GLuint cmdlen = 16; 7790emit_header(gc->pc, X_GLrop_SecondaryColor3fvEXT, cmdlen); 7791(void) memcpy((void *)(gc->pc + 4), (void *)(&red), 1 * sizeof(GLfloat)); 7792(void) memcpy((void *)(gc->pc + 8), (void *)(&green), 1 * sizeof(GLfloat)); 7793(void) memcpy((void *)(gc->pc + 12), (void *)(&blue), 1 * sizeof(GLfloat)); 7794gc->pc += cmdlen; 7795if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); } 7796} 7797 7798#define X_GLrop_SecondaryColor3fvEXT 4129 7799void __indirect_glSecondaryColor3fvEXT(const GLfloat * v) 7800{ 7801 generic_12_byte( X_GLrop_SecondaryColor3fvEXT, v ); 7802} 7803 7804#define X_GLrop_FogCoordfvEXT 4124 7805void __indirect_glFogCoordfEXT(GLfloat coord) 7806{ 7807 struct glx_context * const gc = __glXGetCurrentContext(); 7808 const GLuint cmdlen = 8; 7809emit_header(gc->pc, X_GLrop_FogCoordfvEXT, cmdlen); 7810(void) memcpy((void *)(gc->pc + 4), (void *)(&coord), 1 * sizeof(GLfloat)); 7811gc->pc += cmdlen; 7812if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); } 7813} 7814 7815#define X_GLrop_FogCoordfvEXT 4124 7816void __indirect_glFogCoordfvEXT(const GLfloat * coord) 7817{ 7818 generic_4_byte( X_GLrop_FogCoordfvEXT, coord ); 7819} 7820 7821#define X_GLvop_AreProgramsResidentNV 1293 7822GLboolean __indirect_glAreProgramsResidentNV(GLsizei n, const GLuint * ids, GLboolean * residences) 7823{ 7824 struct glx_context * const gc = __glXGetCurrentContext(); 7825 Display * const dpy = gc->currentDpy; 7826 GLboolean retval = (GLboolean) 0; 7827 const GLuint cmdlen = 4 + safe_pad(safe_mul(n, 1 * sizeof(GLuint))); 7828 if (0 + safe_pad(safe_mul(n, 1 * sizeof(GLuint))) < 0) { 7829 __glXSetError(gc, GL_INVALID_VALUE); 7830 return 0; 7831 } 7832 if (n < 0) { 7833 __glXSetError(gc, GL_INVALID_VALUE); 7834 return 0; 7835 } 7836 if (__builtin_expect((n >= 0) && (dpy != NULL), 1)) { 7837 GLubyte const * pc = __glXSetupVendorRequest(gc, X_GLXVendorPrivateWithReply, X_GLvop_AreProgramsResidentNV, cmdlen); 7838(void) memcpy((void *)(pc + 0), (void *)(&n), 1 * sizeof(GLsizei)); 7839(void) memcpy((void *)(pc + 4), (void *)(ids), safe_mul(n, 1 * sizeof(GLuint))); 7840 retval = (GLboolean) __glXReadReply(dpy, 1, residences, GL_FALSE); 7841 UnlockDisplay(dpy); SyncHandle(); 7842 } 7843 return retval; 7844} 7845 7846#define X_GLrop_ExecuteProgramNV 4181 7847void __indirect_glExecuteProgramNV(GLenum target, GLuint id, const GLfloat * params) 7848{ 7849 struct glx_context * const gc = __glXGetCurrentContext(); 7850 const GLuint cmdlen = 28; 7851emit_header(gc->pc, X_GLrop_ExecuteProgramNV, cmdlen); 7852(void) memcpy((void *)(gc->pc + 4), (void *)(&target), 1 * sizeof(GLenum)); 7853(void) memcpy((void *)(gc->pc + 8), (void *)(&id), 1 * sizeof(GLuint)); 7854(void) memcpy((void *)(gc->pc + 12), (void *)(params), 4 * sizeof(GLfloat)); 7855gc->pc += cmdlen; 7856if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); } 7857} 7858 7859#define X_GLvop_GetProgramParameterdvNV 1297 7860void __indirect_glGetProgramParameterdvNV(GLenum target, GLuint index, GLenum pname, GLdouble * params) 7861{ 7862 struct glx_context * const gc = __glXGetCurrentContext(); 7863 Display * const dpy = gc->currentDpy; 7864 const GLuint cmdlen = 12; 7865 if (__builtin_expect(dpy != NULL, 1)) { 7866 GLubyte const * pc = __glXSetupVendorRequest(gc, X_GLXVendorPrivateWithReply, X_GLvop_GetProgramParameterdvNV, cmdlen); 7867(void) memcpy((void *)(pc + 0), (void *)(&target), 1 * sizeof(GLenum)); 7868(void) memcpy((void *)(pc + 4), (void *)(&index), 1 * sizeof(GLuint)); 7869(void) memcpy((void *)(pc + 8), (void *)(&pname), 1 * sizeof(GLenum)); 7870 (void) __glXReadReply(dpy, 8, params, GL_FALSE); 7871 UnlockDisplay(dpy); SyncHandle(); 7872 } 7873 return; 7874} 7875 7876#define X_GLvop_GetProgramParameterfvNV 1296 7877void __indirect_glGetProgramParameterfvNV(GLenum target, GLuint index, GLenum pname, GLfloat * params) 7878{ 7879 struct glx_context * const gc = __glXGetCurrentContext(); 7880 Display * const dpy = gc->currentDpy; 7881 const GLuint cmdlen = 12; 7882 if (__builtin_expect(dpy != NULL, 1)) { 7883 GLubyte const * pc = __glXSetupVendorRequest(gc, X_GLXVendorPrivateWithReply, X_GLvop_GetProgramParameterfvNV, cmdlen); 7884(void) memcpy((void *)(pc + 0), (void *)(&target), 1 * sizeof(GLenum)); 7885(void) memcpy((void *)(pc + 4), (void *)(&index), 1 * sizeof(GLuint)); 7886(void) memcpy((void *)(pc + 8), (void *)(&pname), 1 * sizeof(GLenum)); 7887 (void) __glXReadReply(dpy, 4, params, GL_FALSE); 7888 UnlockDisplay(dpy); SyncHandle(); 7889 } 7890 return; 7891} 7892 7893#define X_GLvop_GetProgramStringNV 1299 7894void __indirect_glGetProgramStringNV(GLuint id, GLenum pname, GLubyte * program) 7895{ 7896 struct glx_context * const gc = __glXGetCurrentContext(); 7897 Display * const dpy = gc->currentDpy; 7898 const GLuint cmdlen = 8; 7899 if (__builtin_expect(dpy != NULL, 1)) { 7900 GLubyte const * pc = __glXSetupVendorRequest(gc, X_GLXVendorPrivateWithReply, X_GLvop_GetProgramStringNV, cmdlen); 7901(void) memcpy((void *)(pc + 0), (void *)(&id), 1 * sizeof(GLuint)); 7902(void) memcpy((void *)(pc + 4), (void *)(&pname), 1 * sizeof(GLenum)); 7903 (void) __glXReadReply(dpy, 1, program, GL_TRUE); 7904 UnlockDisplay(dpy); SyncHandle(); 7905 } 7906 return; 7907} 7908 7909#define X_GLvop_GetProgramivNV 1298 7910void __indirect_glGetProgramivNV(GLuint id, GLenum pname, GLint * params) 7911{ 7912 struct glx_context * const gc = __glXGetCurrentContext(); 7913 Display * const dpy = gc->currentDpy; 7914 const GLuint cmdlen = 8; 7915 if (__builtin_expect(dpy != NULL, 1)) { 7916 GLubyte const * pc = __glXSetupVendorRequest(gc, X_GLXVendorPrivateWithReply, X_GLvop_GetProgramivNV, cmdlen); 7917(void) memcpy((void *)(pc + 0), (void *)(&id), 1 * sizeof(GLuint)); 7918(void) memcpy((void *)(pc + 4), (void *)(&pname), 1 * sizeof(GLenum)); 7919 (void) __glXReadReply(dpy, 4, params, GL_FALSE); 7920 UnlockDisplay(dpy); SyncHandle(); 7921 } 7922 return; 7923} 7924 7925#define X_GLvop_GetTrackMatrixivNV 1300 7926void __indirect_glGetTrackMatrixivNV(GLenum target, GLuint address, GLenum pname, GLint * params) 7927{ 7928 struct glx_context * const gc = __glXGetCurrentContext(); 7929 Display * const dpy = gc->currentDpy; 7930 const GLuint cmdlen = 12; 7931 if (__builtin_expect(dpy != NULL, 1)) { 7932 GLubyte const * pc = __glXSetupVendorRequest(gc, X_GLXVendorPrivateWithReply, X_GLvop_GetTrackMatrixivNV, cmdlen); 7933(void) memcpy((void *)(pc + 0), (void *)(&target), 1 * sizeof(GLenum)); 7934(void) memcpy((void *)(pc + 4), (void *)(&address), 1 * sizeof(GLuint)); 7935(void) memcpy((void *)(pc + 8), (void *)(&pname), 1 * sizeof(GLenum)); 7936 (void) __glXReadReply(dpy, 4, params, GL_FALSE); 7937 UnlockDisplay(dpy); SyncHandle(); 7938 } 7939 return; 7940} 7941 7942#define X_GLvop_GetVertexAttribdvNV 1301 7943void __indirect_glGetVertexAttribdvNV(GLuint index, GLenum pname, GLdouble * params) 7944{ 7945 struct glx_context * const gc = __glXGetCurrentContext(); 7946 Display * const dpy = gc->currentDpy; 7947 const GLuint cmdlen = 8; 7948 if (__builtin_expect(dpy != NULL, 1)) { 7949 GLubyte const * pc = __glXSetupVendorRequest(gc, X_GLXVendorPrivateWithReply, X_GLvop_GetVertexAttribdvNV, cmdlen); 7950(void) memcpy((void *)(pc + 0), (void *)(&index), 1 * sizeof(GLuint)); 7951(void) memcpy((void *)(pc + 4), (void *)(&pname), 1 * sizeof(GLenum)); 7952 (void) __glXReadReply(dpy, 8, params, GL_FALSE); 7953 UnlockDisplay(dpy); SyncHandle(); 7954 } 7955 return; 7956} 7957 7958#define X_GLvop_GetVertexAttribfvNV 1302 7959void __indirect_glGetVertexAttribfvNV(GLuint index, GLenum pname, GLfloat * params) 7960{ 7961 struct glx_context * const gc = __glXGetCurrentContext(); 7962 Display * const dpy = gc->currentDpy; 7963 const GLuint cmdlen = 8; 7964 if (__builtin_expect(dpy != NULL, 1)) { 7965 GLubyte const * pc = __glXSetupVendorRequest(gc, X_GLXVendorPrivateWithReply, X_GLvop_GetVertexAttribfvNV, cmdlen); 7966(void) memcpy((void *)(pc + 0), (void *)(&index), 1 * sizeof(GLuint)); 7967(void) memcpy((void *)(pc + 4), (void *)(&pname), 1 * sizeof(GLenum)); 7968 (void) __glXReadReply(dpy, 4, params, GL_FALSE); 7969 UnlockDisplay(dpy); SyncHandle(); 7970 } 7971 return; 7972} 7973 7974#define X_GLvop_GetVertexAttribivNV 1303 7975void __indirect_glGetVertexAttribivNV(GLuint index, GLenum pname, GLint * params) 7976{ 7977 struct glx_context * const gc = __glXGetCurrentContext(); 7978 Display * const dpy = gc->currentDpy; 7979 const GLuint cmdlen = 8; 7980 if (__builtin_expect(dpy != NULL, 1)) { 7981 GLubyte const * pc = __glXSetupVendorRequest(gc, X_GLXVendorPrivateWithReply, X_GLvop_GetVertexAttribivNV, cmdlen); 7982(void) memcpy((void *)(pc + 0), (void *)(&index), 1 * sizeof(GLuint)); 7983(void) memcpy((void *)(pc + 4), (void *)(&pname), 1 * sizeof(GLenum)); 7984 (void) __glXReadReply(dpy, 4, params, GL_FALSE); 7985 UnlockDisplay(dpy); SyncHandle(); 7986 } 7987 return; 7988} 7989 7990#define X_GLrop_LoadProgramNV 4183 7991void __indirect_glLoadProgramNV(GLenum target, GLuint id, GLsizei len, const GLubyte * program) 7992{ 7993 struct glx_context * const gc = __glXGetCurrentContext(); 7994 const GLuint cmdlen = 16 + safe_pad(len); 7995 if (0 + safe_pad(len) < 0) { 7996 __glXSetError(gc, GL_INVALID_VALUE); 7997 return; 7998 } 7999 if (len < 0) { 8000 __glXSetError(gc, GL_INVALID_VALUE); 8001 return; 8002 } 8003 if (__builtin_expect(len >= 0, 1)) { 8004emit_header(gc->pc, X_GLrop_LoadProgramNV, cmdlen); 8005(void) memcpy((void *)(gc->pc + 4), (void *)(&target), 1 * sizeof(GLenum)); 8006(void) memcpy((void *)(gc->pc + 8), (void *)(&id), 1 * sizeof(GLuint)); 8007(void) memcpy((void *)(gc->pc + 12), (void *)(&len), 1 * sizeof(GLsizei)); 8008(void) memcpy((void *)(gc->pc + 16), (void *)(program), len); 8009gc->pc += cmdlen; 8010if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); } 8011 } 8012} 8013 8014#define X_GLrop_ProgramParameters4dvNV 4187 8015void __indirect_glProgramParameters4dvNV(GLenum target, GLuint index, GLsizei num, const GLdouble * params) 8016{ 8017 struct glx_context * const gc = __glXGetCurrentContext(); 8018 const GLuint cmdlen = 16 + safe_pad(safe_mul(num, 4 * sizeof(GLdouble))); 8019 if (0 + safe_pad(safe_mul(num, 4 * sizeof(GLdouble))) < 0) { 8020 __glXSetError(gc, GL_INVALID_VALUE); 8021 return; 8022 } 8023 if (num < 0) { 8024 __glXSetError(gc, GL_INVALID_VALUE); 8025 return; 8026 } 8027 if (__builtin_expect(num >= 0, 1)) { 8028emit_header(gc->pc, X_GLrop_ProgramParameters4dvNV, cmdlen); 8029(void) memcpy((void *)(gc->pc + 4), (void *)(&target), 1 * sizeof(GLenum)); 8030(void) memcpy((void *)(gc->pc + 8), (void *)(&index), 1 * sizeof(GLuint)); 8031(void) memcpy((void *)(gc->pc + 12), (void *)(&num), 1 * sizeof(GLsizei)); 8032(void) memcpy((void *)(gc->pc + 16), (void *)(params), safe_mul(num, 4 * sizeof(GLdouble))); 8033gc->pc += cmdlen; 8034if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); } 8035 } 8036} 8037 8038#define X_GLrop_ProgramParameters4fvNV 4186 8039void __indirect_glProgramParameters4fvNV(GLenum target, GLuint index, GLsizei num, const GLfloat * params) 8040{ 8041 struct glx_context * const gc = __glXGetCurrentContext(); 8042 const GLuint cmdlen = 16 + safe_pad(safe_mul(num, 4 * sizeof(GLfloat))); 8043 if (0 + safe_pad(safe_mul(num, 4 * sizeof(GLfloat))) < 0) { 8044 __glXSetError(gc, GL_INVALID_VALUE); 8045 return; 8046 } 8047 if (num < 0) { 8048 __glXSetError(gc, GL_INVALID_VALUE); 8049 return; 8050 } 8051 if (__builtin_expect(num >= 0, 1)) { 8052emit_header(gc->pc, X_GLrop_ProgramParameters4fvNV, cmdlen); 8053(void) memcpy((void *)(gc->pc + 4), (void *)(&target), 1 * sizeof(GLenum)); 8054(void) memcpy((void *)(gc->pc + 8), (void *)(&index), 1 * sizeof(GLuint)); 8055(void) memcpy((void *)(gc->pc + 12), (void *)(&num), 1 * sizeof(GLsizei)); 8056(void) memcpy((void *)(gc->pc + 16), (void *)(params), safe_mul(num, 4 * sizeof(GLfloat))); 8057gc->pc += cmdlen; 8058if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); } 8059 } 8060} 8061 8062#define X_GLrop_RequestResidentProgramsNV 4182 8063void __indirect_glRequestResidentProgramsNV(GLsizei n, const GLuint * ids) 8064{ 8065 struct glx_context * const gc = __glXGetCurrentContext(); 8066 const GLuint cmdlen = 8 + safe_pad(safe_mul(n, 1 * sizeof(GLuint))); 8067 if (0 + safe_pad(safe_mul(n, 1 * sizeof(GLuint))) < 0) { 8068 __glXSetError(gc, GL_INVALID_VALUE); 8069 return; 8070 } 8071 if (n < 0) { 8072 __glXSetError(gc, GL_INVALID_VALUE); 8073 return; 8074 } 8075 if (__builtin_expect(n >= 0, 1)) { 8076emit_header(gc->pc, X_GLrop_RequestResidentProgramsNV, cmdlen); 8077(void) memcpy((void *)(gc->pc + 4), (void *)(&n), 1 * sizeof(GLsizei)); 8078(void) memcpy((void *)(gc->pc + 8), (void *)(ids), safe_mul(n, 1 * sizeof(GLuint))); 8079gc->pc += cmdlen; 8080if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); } 8081 } 8082} 8083 8084#define X_GLrop_TrackMatrixNV 4188 8085void __indirect_glTrackMatrixNV(GLenum target, GLuint address, GLenum matrix, GLenum transform) 8086{ 8087 struct glx_context * const gc = __glXGetCurrentContext(); 8088 const GLuint cmdlen = 20; 8089emit_header(gc->pc, X_GLrop_TrackMatrixNV, cmdlen); 8090(void) memcpy((void *)(gc->pc + 4), (void *)(&target), 1 * sizeof(GLenum)); 8091(void) memcpy((void *)(gc->pc + 8), (void *)(&address), 1 * sizeof(GLuint)); 8092(void) memcpy((void *)(gc->pc + 12), (void *)(&matrix), 1 * sizeof(GLenum)); 8093(void) memcpy((void *)(gc->pc + 16), (void *)(&transform), 1 * sizeof(GLenum)); 8094gc->pc += cmdlen; 8095if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); } 8096} 8097 8098#define X_GLrop_VertexAttrib1dvNV 4273 8099void __indirect_glVertexAttrib1dNV(GLuint index, GLdouble x) 8100{ 8101 struct glx_context * const gc = __glXGetCurrentContext(); 8102 const GLuint cmdlen = 16; 8103emit_header(gc->pc, X_GLrop_VertexAttrib1dvNV, cmdlen); 8104(void) memcpy((void *)(gc->pc + 4), (void *)(&index), 1 * sizeof(GLuint)); 8105(void) memcpy((void *)(gc->pc + 8), (void *)(&x), 1 * sizeof(GLdouble)); 8106gc->pc += cmdlen; 8107if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); } 8108} 8109 8110#define X_GLrop_VertexAttrib1dvNV 4273 8111void __indirect_glVertexAttrib1dvNV(GLuint index, const GLdouble * v) 8112{ 8113 struct glx_context * const gc = __glXGetCurrentContext(); 8114 const GLuint cmdlen = 16; 8115emit_header(gc->pc, X_GLrop_VertexAttrib1dvNV, cmdlen); 8116(void) memcpy((void *)(gc->pc + 4), (void *)(&index), 1 * sizeof(GLuint)); 8117(void) memcpy((void *)(gc->pc + 8), (void *)(v), 1 * sizeof(GLdouble)); 8118gc->pc += cmdlen; 8119if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); } 8120} 8121 8122#define X_GLrop_VertexAttrib1fvNV 4269 8123void __indirect_glVertexAttrib1fNV(GLuint index, GLfloat x) 8124{ 8125 struct glx_context * const gc = __glXGetCurrentContext(); 8126 const GLuint cmdlen = 12; 8127emit_header(gc->pc, X_GLrop_VertexAttrib1fvNV, cmdlen); 8128(void) memcpy((void *)(gc->pc + 4), (void *)(&index), 1 * sizeof(GLuint)); 8129(void) memcpy((void *)(gc->pc + 8), (void *)(&x), 1 * sizeof(GLfloat)); 8130gc->pc += cmdlen; 8131if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); } 8132} 8133 8134#define X_GLrop_VertexAttrib1fvNV 4269 8135void __indirect_glVertexAttrib1fvNV(GLuint index, const GLfloat * v) 8136{ 8137 struct glx_context * const gc = __glXGetCurrentContext(); 8138 const GLuint cmdlen = 12; 8139emit_header(gc->pc, X_GLrop_VertexAttrib1fvNV, cmdlen); 8140(void) memcpy((void *)(gc->pc + 4), (void *)(&index), 1 * sizeof(GLuint)); 8141(void) memcpy((void *)(gc->pc + 8), (void *)(v), 1 * sizeof(GLfloat)); 8142gc->pc += cmdlen; 8143if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); } 8144} 8145 8146#define X_GLrop_VertexAttrib1svNV 4265 8147void __indirect_glVertexAttrib1sNV(GLuint index, GLshort x) 8148{ 8149 struct glx_context * const gc = __glXGetCurrentContext(); 8150 const GLuint cmdlen = 12; 8151emit_header(gc->pc, X_GLrop_VertexAttrib1svNV, cmdlen); 8152(void) memcpy((void *)(gc->pc + 4), (void *)(&index), 1 * sizeof(GLuint)); 8153(void) memcpy((void *)(gc->pc + 8), (void *)(&x), 1 * sizeof(GLshort)); 8154gc->pc += cmdlen; 8155if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); } 8156} 8157 8158#define X_GLrop_VertexAttrib1svNV 4265 8159void __indirect_glVertexAttrib1svNV(GLuint index, const GLshort * v) 8160{ 8161 struct glx_context * const gc = __glXGetCurrentContext(); 8162 const GLuint cmdlen = 12; 8163emit_header(gc->pc, X_GLrop_VertexAttrib1svNV, cmdlen); 8164(void) memcpy((void *)(gc->pc + 4), (void *)(&index), 1 * sizeof(GLuint)); 8165(void) memcpy((void *)(gc->pc + 8), (void *)(v), 1 * sizeof(GLshort)); 8166gc->pc += cmdlen; 8167if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); } 8168} 8169 8170#define X_GLrop_VertexAttrib2dvNV 4274 8171void __indirect_glVertexAttrib2dNV(GLuint index, GLdouble x, GLdouble y) 8172{ 8173 struct glx_context * const gc = __glXGetCurrentContext(); 8174 const GLuint cmdlen = 24; 8175emit_header(gc->pc, X_GLrop_VertexAttrib2dvNV, cmdlen); 8176(void) memcpy((void *)(gc->pc + 4), (void *)(&index), 1 * sizeof(GLuint)); 8177(void) memcpy((void *)(gc->pc + 8), (void *)(&x), 1 * sizeof(GLdouble)); 8178(void) memcpy((void *)(gc->pc + 16), (void *)(&y), 1 * sizeof(GLdouble)); 8179gc->pc += cmdlen; 8180if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); } 8181} 8182 8183#define X_GLrop_VertexAttrib2dvNV 4274 8184void __indirect_glVertexAttrib2dvNV(GLuint index, const GLdouble * v) 8185{ 8186 struct glx_context * const gc = __glXGetCurrentContext(); 8187 const GLuint cmdlen = 24; 8188emit_header(gc->pc, X_GLrop_VertexAttrib2dvNV, cmdlen); 8189(void) memcpy((void *)(gc->pc + 4), (void *)(&index), 1 * sizeof(GLuint)); 8190(void) memcpy((void *)(gc->pc + 8), (void *)(v), 2 * sizeof(GLdouble)); 8191gc->pc += cmdlen; 8192if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); } 8193} 8194 8195#define X_GLrop_VertexAttrib2fvNV 4270 8196void __indirect_glVertexAttrib2fNV(GLuint index, GLfloat x, GLfloat y) 8197{ 8198 struct glx_context * const gc = __glXGetCurrentContext(); 8199 const GLuint cmdlen = 16; 8200emit_header(gc->pc, X_GLrop_VertexAttrib2fvNV, cmdlen); 8201(void) memcpy((void *)(gc->pc + 4), (void *)(&index), 1 * sizeof(GLuint)); 8202(void) memcpy((void *)(gc->pc + 8), (void *)(&x), 1 * sizeof(GLfloat)); 8203(void) memcpy((void *)(gc->pc + 12), (void *)(&y), 1 * sizeof(GLfloat)); 8204gc->pc += cmdlen; 8205if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); } 8206} 8207 8208#define X_GLrop_VertexAttrib2fvNV 4270 8209void __indirect_glVertexAttrib2fvNV(GLuint index, const GLfloat * v) 8210{ 8211 struct glx_context * const gc = __glXGetCurrentContext(); 8212 const GLuint cmdlen = 16; 8213emit_header(gc->pc, X_GLrop_VertexAttrib2fvNV, cmdlen); 8214(void) memcpy((void *)(gc->pc + 4), (void *)(&index), 1 * sizeof(GLuint)); 8215(void) memcpy((void *)(gc->pc + 8), (void *)(v), 2 * sizeof(GLfloat)); 8216gc->pc += cmdlen; 8217if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); } 8218} 8219 8220#define X_GLrop_VertexAttrib2svNV 4266 8221void __indirect_glVertexAttrib2sNV(GLuint index, GLshort x, GLshort y) 8222{ 8223 struct glx_context * const gc = __glXGetCurrentContext(); 8224 const GLuint cmdlen = 12; 8225emit_header(gc->pc, X_GLrop_VertexAttrib2svNV, cmdlen); 8226(void) memcpy((void *)(gc->pc + 4), (void *)(&index), 1 * sizeof(GLuint)); 8227(void) memcpy((void *)(gc->pc + 8), (void *)(&x), 1 * sizeof(GLshort)); 8228(void) memcpy((void *)(gc->pc + 10), (void *)(&y), 1 * sizeof(GLshort)); 8229gc->pc += cmdlen; 8230if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); } 8231} 8232 8233#define X_GLrop_VertexAttrib2svNV 4266 8234void __indirect_glVertexAttrib2svNV(GLuint index, const GLshort * v) 8235{ 8236 struct glx_context * const gc = __glXGetCurrentContext(); 8237 const GLuint cmdlen = 12; 8238emit_header(gc->pc, X_GLrop_VertexAttrib2svNV, cmdlen); 8239(void) memcpy((void *)(gc->pc + 4), (void *)(&index), 1 * sizeof(GLuint)); 8240(void) memcpy((void *)(gc->pc + 8), (void *)(v), 2 * sizeof(GLshort)); 8241gc->pc += cmdlen; 8242if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); } 8243} 8244 8245#define X_GLrop_VertexAttrib3dvNV 4275 8246void __indirect_glVertexAttrib3dNV(GLuint index, GLdouble x, GLdouble y, GLdouble z) 8247{ 8248 struct glx_context * const gc = __glXGetCurrentContext(); 8249 const GLuint cmdlen = 32; 8250emit_header(gc->pc, X_GLrop_VertexAttrib3dvNV, cmdlen); 8251(void) memcpy((void *)(gc->pc + 4), (void *)(&index), 1 * sizeof(GLuint)); 8252(void) memcpy((void *)(gc->pc + 8), (void *)(&x), 1 * sizeof(GLdouble)); 8253(void) memcpy((void *)(gc->pc + 16), (void *)(&y), 1 * sizeof(GLdouble)); 8254(void) memcpy((void *)(gc->pc + 24), (void *)(&z), 1 * sizeof(GLdouble)); 8255gc->pc += cmdlen; 8256if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); } 8257} 8258 8259#define X_GLrop_VertexAttrib3dvNV 4275 8260void __indirect_glVertexAttrib3dvNV(GLuint index, const GLdouble * v) 8261{ 8262 struct glx_context * const gc = __glXGetCurrentContext(); 8263 const GLuint cmdlen = 32; 8264emit_header(gc->pc, X_GLrop_VertexAttrib3dvNV, cmdlen); 8265(void) memcpy((void *)(gc->pc + 4), (void *)(&index), 1 * sizeof(GLuint)); 8266(void) memcpy((void *)(gc->pc + 8), (void *)(v), 3 * sizeof(GLdouble)); 8267gc->pc += cmdlen; 8268if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); } 8269} 8270 8271#define X_GLrop_VertexAttrib3fvNV 4271 8272void __indirect_glVertexAttrib3fNV(GLuint index, GLfloat x, GLfloat y, GLfloat z) 8273{ 8274 struct glx_context * const gc = __glXGetCurrentContext(); 8275 const GLuint cmdlen = 20; 8276emit_header(gc->pc, X_GLrop_VertexAttrib3fvNV, cmdlen); 8277(void) memcpy((void *)(gc->pc + 4), (void *)(&index), 1 * sizeof(GLuint)); 8278(void) memcpy((void *)(gc->pc + 8), (void *)(&x), 1 * sizeof(GLfloat)); 8279(void) memcpy((void *)(gc->pc + 12), (void *)(&y), 1 * sizeof(GLfloat)); 8280(void) memcpy((void *)(gc->pc + 16), (void *)(&z), 1 * sizeof(GLfloat)); 8281gc->pc += cmdlen; 8282if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); } 8283} 8284 8285#define X_GLrop_VertexAttrib3fvNV 4271 8286void __indirect_glVertexAttrib3fvNV(GLuint index, const GLfloat * v) 8287{ 8288 struct glx_context * const gc = __glXGetCurrentContext(); 8289 const GLuint cmdlen = 20; 8290emit_header(gc->pc, X_GLrop_VertexAttrib3fvNV, cmdlen); 8291(void) memcpy((void *)(gc->pc + 4), (void *)(&index), 1 * sizeof(GLuint)); 8292(void) memcpy((void *)(gc->pc + 8), (void *)(v), 3 * sizeof(GLfloat)); 8293gc->pc += cmdlen; 8294if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); } 8295} 8296 8297#define X_GLrop_VertexAttrib3svNV 4267 8298void __indirect_glVertexAttrib3sNV(GLuint index, GLshort x, GLshort y, GLshort z) 8299{ 8300 struct glx_context * const gc = __glXGetCurrentContext(); 8301 const GLuint cmdlen = 16; 8302emit_header(gc->pc, X_GLrop_VertexAttrib3svNV, cmdlen); 8303(void) memcpy((void *)(gc->pc + 4), (void *)(&index), 1 * sizeof(GLuint)); 8304(void) memcpy((void *)(gc->pc + 8), (void *)(&x), 1 * sizeof(GLshort)); 8305(void) memcpy((void *)(gc->pc + 10), (void *)(&y), 1 * sizeof(GLshort)); 8306(void) memcpy((void *)(gc->pc + 12), (void *)(&z), 1 * sizeof(GLshort)); 8307gc->pc += cmdlen; 8308if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); } 8309} 8310 8311#define X_GLrop_VertexAttrib3svNV 4267 8312void __indirect_glVertexAttrib3svNV(GLuint index, const GLshort * v) 8313{ 8314 struct glx_context * const gc = __glXGetCurrentContext(); 8315 const GLuint cmdlen = 16; 8316emit_header(gc->pc, X_GLrop_VertexAttrib3svNV, cmdlen); 8317(void) memcpy((void *)(gc->pc + 4), (void *)(&index), 1 * sizeof(GLuint)); 8318(void) memcpy((void *)(gc->pc + 8), (void *)(v), 3 * sizeof(GLshort)); 8319gc->pc += cmdlen; 8320if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); } 8321} 8322 8323#define X_GLrop_VertexAttrib4dvNV 4276 8324void __indirect_glVertexAttrib4dNV(GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w) 8325{ 8326 struct glx_context * const gc = __glXGetCurrentContext(); 8327 const GLuint cmdlen = 40; 8328emit_header(gc->pc, X_GLrop_VertexAttrib4dvNV, cmdlen); 8329(void) memcpy((void *)(gc->pc + 4), (void *)(&index), 1 * sizeof(GLuint)); 8330(void) memcpy((void *)(gc->pc + 8), (void *)(&x), 1 * sizeof(GLdouble)); 8331(void) memcpy((void *)(gc->pc + 16), (void *)(&y), 1 * sizeof(GLdouble)); 8332(void) memcpy((void *)(gc->pc + 24), (void *)(&z), 1 * sizeof(GLdouble)); 8333(void) memcpy((void *)(gc->pc + 32), (void *)(&w), 1 * sizeof(GLdouble)); 8334gc->pc += cmdlen; 8335if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); } 8336} 8337 8338#define X_GLrop_VertexAttrib4dvNV 4276 8339void __indirect_glVertexAttrib4dvNV(GLuint index, const GLdouble * v) 8340{ 8341 struct glx_context * const gc = __glXGetCurrentContext(); 8342 const GLuint cmdlen = 40; 8343emit_header(gc->pc, X_GLrop_VertexAttrib4dvNV, cmdlen); 8344(void) memcpy((void *)(gc->pc + 4), (void *)(&index), 1 * sizeof(GLuint)); 8345(void) memcpy((void *)(gc->pc + 8), (void *)(v), 4 * sizeof(GLdouble)); 8346gc->pc += cmdlen; 8347if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); } 8348} 8349 8350#define X_GLrop_VertexAttrib4fvNV 4272 8351void __indirect_glVertexAttrib4fNV(GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w) 8352{ 8353 struct glx_context * const gc = __glXGetCurrentContext(); 8354 const GLuint cmdlen = 24; 8355emit_header(gc->pc, X_GLrop_VertexAttrib4fvNV, cmdlen); 8356(void) memcpy((void *)(gc->pc + 4), (void *)(&index), 1 * sizeof(GLuint)); 8357(void) memcpy((void *)(gc->pc + 8), (void *)(&x), 1 * sizeof(GLfloat)); 8358(void) memcpy((void *)(gc->pc + 12), (void *)(&y), 1 * sizeof(GLfloat)); 8359(void) memcpy((void *)(gc->pc + 16), (void *)(&z), 1 * sizeof(GLfloat)); 8360(void) memcpy((void *)(gc->pc + 20), (void *)(&w), 1 * sizeof(GLfloat)); 8361gc->pc += cmdlen; 8362if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); } 8363} 8364 8365#define X_GLrop_VertexAttrib4fvNV 4272 8366void __indirect_glVertexAttrib4fvNV(GLuint index, const GLfloat * v) 8367{ 8368 struct glx_context * const gc = __glXGetCurrentContext(); 8369 const GLuint cmdlen = 24; 8370emit_header(gc->pc, X_GLrop_VertexAttrib4fvNV, cmdlen); 8371(void) memcpy((void *)(gc->pc + 4), (void *)(&index), 1 * sizeof(GLuint)); 8372(void) memcpy((void *)(gc->pc + 8), (void *)(v), 4 * sizeof(GLfloat)); 8373gc->pc += cmdlen; 8374if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); } 8375} 8376 8377#define X_GLrop_VertexAttrib4svNV 4268 8378void __indirect_glVertexAttrib4sNV(GLuint index, GLshort x, GLshort y, GLshort z, GLshort w) 8379{ 8380 struct glx_context * const gc = __glXGetCurrentContext(); 8381 const GLuint cmdlen = 16; 8382emit_header(gc->pc, X_GLrop_VertexAttrib4svNV, cmdlen); 8383(void) memcpy((void *)(gc->pc + 4), (void *)(&index), 1 * sizeof(GLuint)); 8384(void) memcpy((void *)(gc->pc + 8), (void *)(&x), 1 * sizeof(GLshort)); 8385(void) memcpy((void *)(gc->pc + 10), (void *)(&y), 1 * sizeof(GLshort)); 8386(void) memcpy((void *)(gc->pc + 12), (void *)(&z), 1 * sizeof(GLshort)); 8387(void) memcpy((void *)(gc->pc + 14), (void *)(&w), 1 * sizeof(GLshort)); 8388gc->pc += cmdlen; 8389if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); } 8390} 8391 8392#define X_GLrop_VertexAttrib4svNV 4268 8393void __indirect_glVertexAttrib4svNV(GLuint index, const GLshort * v) 8394{ 8395 struct glx_context * const gc = __glXGetCurrentContext(); 8396 const GLuint cmdlen = 16; 8397emit_header(gc->pc, X_GLrop_VertexAttrib4svNV, cmdlen); 8398(void) memcpy((void *)(gc->pc + 4), (void *)(&index), 1 * sizeof(GLuint)); 8399(void) memcpy((void *)(gc->pc + 8), (void *)(v), 4 * sizeof(GLshort)); 8400gc->pc += cmdlen; 8401if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); } 8402} 8403 8404#define X_GLrop_VertexAttrib4ubvNV 4277 8405void __indirect_glVertexAttrib4ubNV(GLuint index, GLubyte x, GLubyte y, GLubyte z, GLubyte w) 8406{ 8407 struct glx_context * const gc = __glXGetCurrentContext(); 8408 const GLuint cmdlen = 12; 8409emit_header(gc->pc, X_GLrop_VertexAttrib4ubvNV, cmdlen); 8410(void) memcpy((void *)(gc->pc + 4), (void *)(&index), 1 * sizeof(GLuint)); 8411(void) memcpy((void *)(gc->pc + 8), (void *)(&x), 1 * sizeof(GLubyte)); 8412(void) memcpy((void *)(gc->pc + 9), (void *)(&y), 1 * sizeof(GLubyte)); 8413(void) memcpy((void *)(gc->pc + 10), (void *)(&z), 1 * sizeof(GLubyte)); 8414(void) memcpy((void *)(gc->pc + 11), (void *)(&w), 1 * sizeof(GLubyte)); 8415gc->pc += cmdlen; 8416if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); } 8417} 8418 8419#define X_GLrop_VertexAttrib4ubvNV 4277 8420void __indirect_glVertexAttrib4ubvNV(GLuint index, const GLubyte * v) 8421{ 8422 struct glx_context * const gc = __glXGetCurrentContext(); 8423 const GLuint cmdlen = 12; 8424emit_header(gc->pc, X_GLrop_VertexAttrib4ubvNV, cmdlen); 8425(void) memcpy((void *)(gc->pc + 4), (void *)(&index), 1 * sizeof(GLuint)); 8426(void) memcpy((void *)(gc->pc + 8), (void *)(v), 4 * sizeof(GLubyte)); 8427gc->pc += cmdlen; 8428if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); } 8429} 8430 8431#define X_GLrop_VertexAttribs1dvNV 4210 8432void __indirect_glVertexAttribs1dvNV(GLuint index, GLsizei n, const GLdouble * v) 8433{ 8434 struct glx_context * const gc = __glXGetCurrentContext(); 8435 const GLuint cmdlen = 12 + safe_pad(safe_mul(n, 1 * sizeof(GLdouble))); 8436 if (0 + safe_pad(safe_mul(n, 1 * sizeof(GLdouble))) < 0) { 8437 __glXSetError(gc, GL_INVALID_VALUE); 8438 return; 8439 } 8440 if (n < 0) { 8441 __glXSetError(gc, GL_INVALID_VALUE); 8442 return; 8443 } 8444 if (__builtin_expect(n >= 0, 1)) { 8445emit_header(gc->pc, X_GLrop_VertexAttribs1dvNV, cmdlen); 8446(void) memcpy((void *)(gc->pc + 4), (void *)(&index), 1 * sizeof(GLuint)); 8447(void) memcpy((void *)(gc->pc + 8), (void *)(&n), 1 * sizeof(GLsizei)); 8448(void) memcpy((void *)(gc->pc + 12), (void *)(v), safe_mul(n, 1 * sizeof(GLdouble))); 8449gc->pc += cmdlen; 8450if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); } 8451 } 8452} 8453 8454#define X_GLrop_VertexAttribs1fvNV 4206 8455void __indirect_glVertexAttribs1fvNV(GLuint index, GLsizei n, const GLfloat * v) 8456{ 8457 struct glx_context * const gc = __glXGetCurrentContext(); 8458 const GLuint cmdlen = 12 + safe_pad(safe_mul(n, 1 * sizeof(GLfloat))); 8459 if (0 + safe_pad(safe_mul(n, 1 * sizeof(GLfloat))) < 0) { 8460 __glXSetError(gc, GL_INVALID_VALUE); 8461 return; 8462 } 8463 if (n < 0) { 8464 __glXSetError(gc, GL_INVALID_VALUE); 8465 return; 8466 } 8467 if (__builtin_expect(n >= 0, 1)) { 8468emit_header(gc->pc, X_GLrop_VertexAttribs1fvNV, cmdlen); 8469(void) memcpy((void *)(gc->pc + 4), (void *)(&index), 1 * sizeof(GLuint)); 8470(void) memcpy((void *)(gc->pc + 8), (void *)(&n), 1 * sizeof(GLsizei)); 8471(void) memcpy((void *)(gc->pc + 12), (void *)(v), safe_mul(n, 1 * sizeof(GLfloat))); 8472gc->pc += cmdlen; 8473if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); } 8474 } 8475} 8476 8477#define X_GLrop_VertexAttribs1svNV 4202 8478void __indirect_glVertexAttribs1svNV(GLuint index, GLsizei n, const GLshort * v) 8479{ 8480 struct glx_context * const gc = __glXGetCurrentContext(); 8481 const GLuint cmdlen = 12 + safe_pad(safe_mul(n, 1 * sizeof(GLshort))); 8482 if (0 + safe_pad(safe_mul(n, 1 * sizeof(GLshort))) < 0) { 8483 __glXSetError(gc, GL_INVALID_VALUE); 8484 return; 8485 } 8486 if (n < 0) { 8487 __glXSetError(gc, GL_INVALID_VALUE); 8488 return; 8489 } 8490 if (__builtin_expect(n >= 0, 1)) { 8491emit_header(gc->pc, X_GLrop_VertexAttribs1svNV, cmdlen); 8492(void) memcpy((void *)(gc->pc + 4), (void *)(&index), 1 * sizeof(GLuint)); 8493(void) memcpy((void *)(gc->pc + 8), (void *)(&n), 1 * sizeof(GLsizei)); 8494(void) memcpy((void *)(gc->pc + 12), (void *)(v), safe_mul(n, 1 * sizeof(GLshort))); 8495gc->pc += cmdlen; 8496if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); } 8497 } 8498} 8499 8500#define X_GLrop_VertexAttribs2dvNV 4211 8501void __indirect_glVertexAttribs2dvNV(GLuint index, GLsizei n, const GLdouble * v) 8502{ 8503 struct glx_context * const gc = __glXGetCurrentContext(); 8504 const GLuint cmdlen = 12 + safe_pad(safe_mul(n, 2 * sizeof(GLdouble))); 8505 if (0 + safe_pad(safe_mul(n, 2 * sizeof(GLdouble))) < 0) { 8506 __glXSetError(gc, GL_INVALID_VALUE); 8507 return; 8508 } 8509 if (n < 0) { 8510 __glXSetError(gc, GL_INVALID_VALUE); 8511 return; 8512 } 8513 if (__builtin_expect(n >= 0, 1)) { 8514emit_header(gc->pc, X_GLrop_VertexAttribs2dvNV, cmdlen); 8515(void) memcpy((void *)(gc->pc + 4), (void *)(&index), 1 * sizeof(GLuint)); 8516(void) memcpy((void *)(gc->pc + 8), (void *)(&n), 1 * sizeof(GLsizei)); 8517(void) memcpy((void *)(gc->pc + 12), (void *)(v), safe_mul(n, 2 * sizeof(GLdouble))); 8518gc->pc += cmdlen; 8519if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); } 8520 } 8521} 8522 8523#define X_GLrop_VertexAttribs2fvNV 4207 8524void __indirect_glVertexAttribs2fvNV(GLuint index, GLsizei n, const GLfloat * v) 8525{ 8526 struct glx_context * const gc = __glXGetCurrentContext(); 8527 const GLuint cmdlen = 12 + safe_pad(safe_mul(n, 2 * sizeof(GLfloat))); 8528 if (0 + safe_pad(safe_mul(n, 2 * sizeof(GLfloat))) < 0) { 8529 __glXSetError(gc, GL_INVALID_VALUE); 8530 return; 8531 } 8532 if (n < 0) { 8533 __glXSetError(gc, GL_INVALID_VALUE); 8534 return; 8535 } 8536 if (__builtin_expect(n >= 0, 1)) { 8537emit_header(gc->pc, X_GLrop_VertexAttribs2fvNV, cmdlen); 8538(void) memcpy((void *)(gc->pc + 4), (void *)(&index), 1 * sizeof(GLuint)); 8539(void) memcpy((void *)(gc->pc + 8), (void *)(&n), 1 * sizeof(GLsizei)); 8540(void) memcpy((void *)(gc->pc + 12), (void *)(v), safe_mul(n, 2 * sizeof(GLfloat))); 8541gc->pc += cmdlen; 8542if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); } 8543 } 8544} 8545 8546#define X_GLrop_VertexAttribs2svNV 4203 8547void __indirect_glVertexAttribs2svNV(GLuint index, GLsizei n, const GLshort * v) 8548{ 8549 struct glx_context * const gc = __glXGetCurrentContext(); 8550 const GLuint cmdlen = 12 + safe_pad(safe_mul(n, 2 * sizeof(GLshort))); 8551 if (0 + safe_pad(safe_mul(n, 2 * sizeof(GLshort))) < 0) { 8552 __glXSetError(gc, GL_INVALID_VALUE); 8553 return; 8554 } 8555 if (n < 0) { 8556 __glXSetError(gc, GL_INVALID_VALUE); 8557 return; 8558 } 8559 if (__builtin_expect(n >= 0, 1)) { 8560emit_header(gc->pc, X_GLrop_VertexAttribs2svNV, cmdlen); 8561(void) memcpy((void *)(gc->pc + 4), (void *)(&index), 1 * sizeof(GLuint)); 8562(void) memcpy((void *)(gc->pc + 8), (void *)(&n), 1 * sizeof(GLsizei)); 8563(void) memcpy((void *)(gc->pc + 12), (void *)(v), safe_mul(n, 2 * sizeof(GLshort))); 8564gc->pc += cmdlen; 8565if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); } 8566 } 8567} 8568 8569#define X_GLrop_VertexAttribs3dvNV 4212 8570void __indirect_glVertexAttribs3dvNV(GLuint index, GLsizei n, const GLdouble * v) 8571{ 8572 struct glx_context * const gc = __glXGetCurrentContext(); 8573 const GLuint cmdlen = 12 + safe_pad(safe_mul(n, 3 * sizeof(GLdouble))); 8574 if (0 + safe_pad(safe_mul(n, 3 * sizeof(GLdouble))) < 0) { 8575 __glXSetError(gc, GL_INVALID_VALUE); 8576 return; 8577 } 8578 if (n < 0) { 8579 __glXSetError(gc, GL_INVALID_VALUE); 8580 return; 8581 } 8582 if (__builtin_expect(n >= 0, 1)) { 8583emit_header(gc->pc, X_GLrop_VertexAttribs3dvNV, cmdlen); 8584(void) memcpy((void *)(gc->pc + 4), (void *)(&index), 1 * sizeof(GLuint)); 8585(void) memcpy((void *)(gc->pc + 8), (void *)(&n), 1 * sizeof(GLsizei)); 8586(void) memcpy((void *)(gc->pc + 12), (void *)(v), safe_mul(n, 3 * sizeof(GLdouble))); 8587gc->pc += cmdlen; 8588if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); } 8589 } 8590} 8591 8592#define X_GLrop_VertexAttribs3fvNV 4208 8593void __indirect_glVertexAttribs3fvNV(GLuint index, GLsizei n, const GLfloat * v) 8594{ 8595 struct glx_context * const gc = __glXGetCurrentContext(); 8596 const GLuint cmdlen = 12 + safe_pad(safe_mul(n, 3 * sizeof(GLfloat))); 8597 if (0 + safe_pad(safe_mul(n, 3 * sizeof(GLfloat))) < 0) { 8598 __glXSetError(gc, GL_INVALID_VALUE); 8599 return; 8600 } 8601 if (n < 0) { 8602 __glXSetError(gc, GL_INVALID_VALUE); 8603 return; 8604 } 8605 if (__builtin_expect(n >= 0, 1)) { 8606emit_header(gc->pc, X_GLrop_VertexAttribs3fvNV, cmdlen); 8607(void) memcpy((void *)(gc->pc + 4), (void *)(&index), 1 * sizeof(GLuint)); 8608(void) memcpy((void *)(gc->pc + 8), (void *)(&n), 1 * sizeof(GLsizei)); 8609(void) memcpy((void *)(gc->pc + 12), (void *)(v), safe_mul(n, 3 * sizeof(GLfloat))); 8610gc->pc += cmdlen; 8611if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); } 8612 } 8613} 8614 8615#define X_GLrop_VertexAttribs3svNV 4204 8616void __indirect_glVertexAttribs3svNV(GLuint index, GLsizei n, const GLshort * v) 8617{ 8618 struct glx_context * const gc = __glXGetCurrentContext(); 8619 const GLuint cmdlen = 12 + safe_pad(safe_mul(n, 3 * sizeof(GLshort))); 8620 if (0 + safe_pad(safe_mul(n, 3 * sizeof(GLshort))) < 0) { 8621 __glXSetError(gc, GL_INVALID_VALUE); 8622 return; 8623 } 8624 if (n < 0) { 8625 __glXSetError(gc, GL_INVALID_VALUE); 8626 return; 8627 } 8628 if (__builtin_expect(n >= 0, 1)) { 8629emit_header(gc->pc, X_GLrop_VertexAttribs3svNV, cmdlen); 8630(void) memcpy((void *)(gc->pc + 4), (void *)(&index), 1 * sizeof(GLuint)); 8631(void) memcpy((void *)(gc->pc + 8), (void *)(&n), 1 * sizeof(GLsizei)); 8632(void) memcpy((void *)(gc->pc + 12), (void *)(v), safe_mul(n, 3 * sizeof(GLshort))); 8633gc->pc += cmdlen; 8634if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); } 8635 } 8636} 8637 8638#define X_GLrop_VertexAttribs4dvNV 4213 8639void __indirect_glVertexAttribs4dvNV(GLuint index, GLsizei n, const GLdouble * v) 8640{ 8641 struct glx_context * const gc = __glXGetCurrentContext(); 8642 const GLuint cmdlen = 12 + safe_pad(safe_mul(n, 4 * sizeof(GLdouble))); 8643 if (0 + safe_pad(safe_mul(n, 4 * sizeof(GLdouble))) < 0) { 8644 __glXSetError(gc, GL_INVALID_VALUE); 8645 return; 8646 } 8647 if (n < 0) { 8648 __glXSetError(gc, GL_INVALID_VALUE); 8649 return; 8650 } 8651 if (__builtin_expect(n >= 0, 1)) { 8652emit_header(gc->pc, X_GLrop_VertexAttribs4dvNV, cmdlen); 8653(void) memcpy((void *)(gc->pc + 4), (void *)(&index), 1 * sizeof(GLuint)); 8654(void) memcpy((void *)(gc->pc + 8), (void *)(&n), 1 * sizeof(GLsizei)); 8655(void) memcpy((void *)(gc->pc + 12), (void *)(v), safe_mul(n, 4 * sizeof(GLdouble))); 8656gc->pc += cmdlen; 8657if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); } 8658 } 8659} 8660 8661#define X_GLrop_VertexAttribs4fvNV 4209 8662void __indirect_glVertexAttribs4fvNV(GLuint index, GLsizei n, const GLfloat * v) 8663{ 8664 struct glx_context * const gc = __glXGetCurrentContext(); 8665 const GLuint cmdlen = 12 + safe_pad(safe_mul(n, 4 * sizeof(GLfloat))); 8666 if (0 + safe_pad(safe_mul(n, 4 * sizeof(GLfloat))) < 0) { 8667 __glXSetError(gc, GL_INVALID_VALUE); 8668 return; 8669 } 8670 if (n < 0) { 8671 __glXSetError(gc, GL_INVALID_VALUE); 8672 return; 8673 } 8674 if (__builtin_expect(n >= 0, 1)) { 8675emit_header(gc->pc, X_GLrop_VertexAttribs4fvNV, cmdlen); 8676(void) memcpy((void *)(gc->pc + 4), (void *)(&index), 1 * sizeof(GLuint)); 8677(void) memcpy((void *)(gc->pc + 8), (void *)(&n), 1 * sizeof(GLsizei)); 8678(void) memcpy((void *)(gc->pc + 12), (void *)(v), safe_mul(n, 4 * sizeof(GLfloat))); 8679gc->pc += cmdlen; 8680if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); } 8681 } 8682} 8683 8684#define X_GLrop_VertexAttribs4svNV 4205 8685void __indirect_glVertexAttribs4svNV(GLuint index, GLsizei n, const GLshort * v) 8686{ 8687 struct glx_context * const gc = __glXGetCurrentContext(); 8688 const GLuint cmdlen = 12 + safe_pad(safe_mul(n, 4 * sizeof(GLshort))); 8689 if (0 + safe_pad(safe_mul(n, 4 * sizeof(GLshort))) < 0) { 8690 __glXSetError(gc, GL_INVALID_VALUE); 8691 return; 8692 } 8693 if (n < 0) { 8694 __glXSetError(gc, GL_INVALID_VALUE); 8695 return; 8696 } 8697 if (__builtin_expect(n >= 0, 1)) { 8698emit_header(gc->pc, X_GLrop_VertexAttribs4svNV, cmdlen); 8699(void) memcpy((void *)(gc->pc + 4), (void *)(&index), 1 * sizeof(GLuint)); 8700(void) memcpy((void *)(gc->pc + 8), (void *)(&n), 1 * sizeof(GLsizei)); 8701(void) memcpy((void *)(gc->pc + 12), (void *)(v), safe_mul(n, 4 * sizeof(GLshort))); 8702gc->pc += cmdlen; 8703if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); } 8704 } 8705} 8706 8707#define X_GLrop_VertexAttribs4ubvNV 4214 8708void __indirect_glVertexAttribs4ubvNV(GLuint index, GLsizei n, const GLubyte * v) 8709{ 8710 struct glx_context * const gc = __glXGetCurrentContext(); 8711 const GLuint cmdlen = 12 + safe_pad(safe_mul(n, 4 * sizeof(GLubyte))); 8712 if (0 + safe_pad(safe_mul(n, 4 * sizeof(GLubyte))) < 0) { 8713 __glXSetError(gc, GL_INVALID_VALUE); 8714 return; 8715 } 8716 if (n < 0) { 8717 __glXSetError(gc, GL_INVALID_VALUE); 8718 return; 8719 } 8720 if (__builtin_expect(n >= 0, 1)) { 8721emit_header(gc->pc, X_GLrop_VertexAttribs4ubvNV, cmdlen); 8722(void) memcpy((void *)(gc->pc + 4), (void *)(&index), 1 * sizeof(GLuint)); 8723(void) memcpy((void *)(gc->pc + 8), (void *)(&n), 1 * sizeof(GLsizei)); 8724(void) memcpy((void *)(gc->pc + 12), (void *)(v), safe_mul(n, 4 * sizeof(GLubyte))); 8725gc->pc += cmdlen; 8726if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); } 8727 } 8728} 8729 8730#define X_GLrop_ActiveStencilFaceEXT 4220 8731void __indirect_glActiveStencilFaceEXT(GLenum face) 8732{ 8733 struct glx_context * const gc = __glXGetCurrentContext(); 8734 const GLuint cmdlen = 8; 8735emit_header(gc->pc, X_GLrop_ActiveStencilFaceEXT, cmdlen); 8736(void) memcpy((void *)(gc->pc + 4), (void *)(&face), 1 * sizeof(GLenum)); 8737gc->pc += cmdlen; 8738if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); } 8739} 8740 8741#define X_GLvop_GetProgramNamedParameterdvNV 1311 8742void __indirect_glGetProgramNamedParameterdvNV(GLuint id, GLsizei len, const GLubyte * name, GLdouble * params) 8743{ 8744 struct glx_context * const gc = __glXGetCurrentContext(); 8745 Display * const dpy = gc->currentDpy; 8746 const GLuint cmdlen = 8 + safe_pad(len); 8747 if (0 + safe_pad(len) < 0) { 8748 __glXSetError(gc, GL_INVALID_VALUE); 8749 return; 8750 } 8751 if (len < 0) { 8752 __glXSetError(gc, GL_INVALID_VALUE); 8753 return; 8754 } 8755 if (__builtin_expect((len >= 0) && (dpy != NULL), 1)) { 8756 GLubyte const * pc = __glXSetupVendorRequest(gc, X_GLXVendorPrivateWithReply, X_GLvop_GetProgramNamedParameterdvNV, cmdlen); 8757(void) memcpy((void *)(pc + 0), (void *)(&id), 1 * sizeof(GLuint)); 8758(void) memcpy((void *)(pc + 4), (void *)(&len), 1 * sizeof(GLsizei)); 8759(void) memcpy((void *)(pc + 8), (void *)(name), len); 8760 (void) __glXReadReply(dpy, 8, params, GL_TRUE); 8761 UnlockDisplay(dpy); SyncHandle(); 8762 } 8763 return; 8764} 8765 8766#define X_GLvop_GetProgramNamedParameterfvNV 1310 8767void __indirect_glGetProgramNamedParameterfvNV(GLuint id, GLsizei len, const GLubyte * name, GLfloat * params) 8768{ 8769 struct glx_context * const gc = __glXGetCurrentContext(); 8770 Display * const dpy = gc->currentDpy; 8771 const GLuint cmdlen = 8 + safe_pad(len); 8772 if (0 + safe_pad(len) < 0) { 8773 __glXSetError(gc, GL_INVALID_VALUE); 8774 return; 8775 } 8776 if (len < 0) { 8777 __glXSetError(gc, GL_INVALID_VALUE); 8778 return; 8779 } 8780 if (__builtin_expect((len >= 0) && (dpy != NULL), 1)) { 8781 GLubyte const * pc = __glXSetupVendorRequest(gc, X_GLXVendorPrivateWithReply, X_GLvop_GetProgramNamedParameterfvNV, cmdlen); 8782(void) memcpy((void *)(pc + 0), (void *)(&id), 1 * sizeof(GLuint)); 8783(void) memcpy((void *)(pc + 4), (void *)(&len), 1 * sizeof(GLsizei)); 8784(void) memcpy((void *)(pc + 8), (void *)(name), len); 8785 (void) __glXReadReply(dpy, 4, params, GL_TRUE); 8786 UnlockDisplay(dpy); SyncHandle(); 8787 } 8788 return; 8789} 8790 8791#define X_GLrop_ProgramNamedParameter4dvNV 4219 8792void __indirect_glProgramNamedParameter4dNV(GLuint id, GLsizei len, const GLubyte * name, GLdouble x, GLdouble y, GLdouble z, GLdouble w) 8793{ 8794 struct glx_context * const gc = __glXGetCurrentContext(); 8795 const GLuint cmdlen = 44 + safe_pad(len); 8796 if (0 + safe_pad(len) < 0) { 8797 __glXSetError(gc, GL_INVALID_VALUE); 8798 return; 8799 } 8800 if (len < 0) { 8801 __glXSetError(gc, GL_INVALID_VALUE); 8802 return; 8803 } 8804 if (__builtin_expect(len >= 0, 1)) { 8805emit_header(gc->pc, X_GLrop_ProgramNamedParameter4dvNV, cmdlen); 8806(void) memcpy((void *)(gc->pc + 4), (void *)(&x), 1 * sizeof(GLdouble)); 8807(void) memcpy((void *)(gc->pc + 12), (void *)(&y), 1 * sizeof(GLdouble)); 8808(void) memcpy((void *)(gc->pc + 20), (void *)(&z), 1 * sizeof(GLdouble)); 8809(void) memcpy((void *)(gc->pc + 28), (void *)(&w), 1 * sizeof(GLdouble)); 8810(void) memcpy((void *)(gc->pc + 36), (void *)(&id), 1 * sizeof(GLuint)); 8811(void) memcpy((void *)(gc->pc + 40), (void *)(&len), 1 * sizeof(GLsizei)); 8812(void) memcpy((void *)(gc->pc + 44), (void *)(name), len); 8813gc->pc += cmdlen; 8814if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); } 8815 } 8816} 8817 8818#define X_GLrop_ProgramNamedParameter4dvNV 4219 8819void __indirect_glProgramNamedParameter4dvNV(GLuint id, GLsizei len, const GLubyte * name, const GLdouble * v) 8820{ 8821 struct glx_context * const gc = __glXGetCurrentContext(); 8822 const GLuint cmdlen = 44 + safe_pad(len); 8823 if (0 + safe_pad(len) < 0) { 8824 __glXSetError(gc, GL_INVALID_VALUE); 8825 return; 8826 } 8827 if (len < 0) { 8828 __glXSetError(gc, GL_INVALID_VALUE); 8829 return; 8830 } 8831 if (__builtin_expect(len >= 0, 1)) { 8832emit_header(gc->pc, X_GLrop_ProgramNamedParameter4dvNV, cmdlen); 8833(void) memcpy((void *)(gc->pc + 4), (void *)(v), 4 * sizeof(GLdouble)); 8834(void) memcpy((void *)(gc->pc + 36), (void *)(&id), 1 * sizeof(GLuint)); 8835(void) memcpy((void *)(gc->pc + 40), (void *)(&len), 1 * sizeof(GLsizei)); 8836(void) memcpy((void *)(gc->pc + 44), (void *)(name), len); 8837gc->pc += cmdlen; 8838if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); } 8839 } 8840} 8841 8842#define X_GLrop_ProgramNamedParameter4fvNV 4218 8843void __indirect_glProgramNamedParameter4fNV(GLuint id, GLsizei len, const GLubyte * name, GLfloat x, GLfloat y, GLfloat z, GLfloat w) 8844{ 8845 struct glx_context * const gc = __glXGetCurrentContext(); 8846 const GLuint cmdlen = 28 + safe_pad(len); 8847 if (0 + safe_pad(len) < 0) { 8848 __glXSetError(gc, GL_INVALID_VALUE); 8849 return; 8850 } 8851 if (len < 0) { 8852 __glXSetError(gc, GL_INVALID_VALUE); 8853 return; 8854 } 8855 if (__builtin_expect(len >= 0, 1)) { 8856emit_header(gc->pc, X_GLrop_ProgramNamedParameter4fvNV, cmdlen); 8857(void) memcpy((void *)(gc->pc + 4), (void *)(&id), 1 * sizeof(GLuint)); 8858(void) memcpy((void *)(gc->pc + 8), (void *)(&len), 1 * sizeof(GLsizei)); 8859(void) memcpy((void *)(gc->pc + 12), (void *)(&x), 1 * sizeof(GLfloat)); 8860(void) memcpy((void *)(gc->pc + 16), (void *)(&y), 1 * sizeof(GLfloat)); 8861(void) memcpy((void *)(gc->pc + 20), (void *)(&z), 1 * sizeof(GLfloat)); 8862(void) memcpy((void *)(gc->pc + 24), (void *)(&w), 1 * sizeof(GLfloat)); 8863(void) memcpy((void *)(gc->pc + 28), (void *)(name), len); 8864gc->pc += cmdlen; 8865if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); } 8866 } 8867} 8868 8869#define X_GLrop_ProgramNamedParameter4fvNV 4218 8870void __indirect_glProgramNamedParameter4fvNV(GLuint id, GLsizei len, const GLubyte * name, const GLfloat * v) 8871{ 8872 struct glx_context * const gc = __glXGetCurrentContext(); 8873 const GLuint cmdlen = 28 + safe_pad(len); 8874 if (0 + safe_pad(len) < 0) { 8875 __glXSetError(gc, GL_INVALID_VALUE); 8876 return; 8877 } 8878 if (len < 0) { 8879 __glXSetError(gc, GL_INVALID_VALUE); 8880 return; 8881 } 8882 if (__builtin_expect(len >= 0, 1)) { 8883emit_header(gc->pc, X_GLrop_ProgramNamedParameter4fvNV, cmdlen); 8884(void) memcpy((void *)(gc->pc + 4), (void *)(&id), 1 * sizeof(GLuint)); 8885(void) memcpy((void *)(gc->pc + 8), (void *)(&len), 1 * sizeof(GLsizei)); 8886(void) memcpy((void *)(gc->pc + 12), (void *)(v), 4 * sizeof(GLfloat)); 8887(void) memcpy((void *)(gc->pc + 28), (void *)(name), len); 8888gc->pc += cmdlen; 8889if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); } 8890 } 8891} 8892 8893#define X_GLrop_BindFramebufferEXT 4319 8894void __indirect_glBindFramebufferEXT(GLenum target, GLuint framebuffer) 8895{ 8896 struct glx_context * const gc = __glXGetCurrentContext(); 8897 const GLuint cmdlen = 12; 8898emit_header(gc->pc, X_GLrop_BindFramebufferEXT, cmdlen); 8899(void) memcpy((void *)(gc->pc + 4), (void *)(&target), 1 * sizeof(GLenum)); 8900(void) memcpy((void *)(gc->pc + 8), (void *)(&framebuffer), 1 * sizeof(GLuint)); 8901gc->pc += cmdlen; 8902if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); } 8903} 8904 8905#define X_GLrop_BindRenderbufferEXT 4316 8906void __indirect_glBindRenderbufferEXT(GLenum target, GLuint renderbuffer) 8907{ 8908 struct glx_context * const gc = __glXGetCurrentContext(); 8909 const GLuint cmdlen = 12; 8910emit_header(gc->pc, X_GLrop_BindRenderbufferEXT, cmdlen); 8911(void) memcpy((void *)(gc->pc + 4), (void *)(&target), 1 * sizeof(GLenum)); 8912(void) memcpy((void *)(gc->pc + 8), (void *)(&renderbuffer), 1 * sizeof(GLuint)); 8913gc->pc += cmdlen; 8914if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); } 8915} 8916 8917 8918#ifdef GLX_INDIRECT_RENDERING 8919 8920static const struct proc_pair 8921{ 8922 const char *name; 8923 _glapi_proc proc; 8924} proc_pairs[20] = { 8925 { "AreTexturesResidentEXT", (_glapi_proc) glAreTexturesResidentEXT }, 8926 { "DeleteTexturesEXT", (_glapi_proc) glDeleteTexturesEXT }, 8927 { "GenTexturesEXT", (_glapi_proc) glGenTexturesEXT }, 8928 { "GetColorTableEXT", (_glapi_proc) gl_dispatch_stub_343 }, 8929 { "GetColorTableParameterfvEXT", (_glapi_proc) gl_dispatch_stub_344 }, 8930 { "GetColorTableParameterfvSGI", (_glapi_proc) gl_dispatch_stub_344 }, 8931 { "GetColorTableParameterivEXT", (_glapi_proc) gl_dispatch_stub_345 }, 8932 { "GetColorTableParameterivSGI", (_glapi_proc) gl_dispatch_stub_345 }, 8933 { "GetColorTableSGI", (_glapi_proc) gl_dispatch_stub_343 }, 8934 { "GetConvolutionFilterEXT", (_glapi_proc) gl_dispatch_stub_356 }, 8935 { "GetConvolutionParameterfvEXT", (_glapi_proc) gl_dispatch_stub_357 }, 8936 { "GetConvolutionParameterivEXT", (_glapi_proc) gl_dispatch_stub_358 }, 8937 { "GetHistogramEXT", (_glapi_proc) gl_dispatch_stub_361 }, 8938 { "GetHistogramParameterfvEXT", (_glapi_proc) gl_dispatch_stub_362 }, 8939 { "GetHistogramParameterivEXT", (_glapi_proc) gl_dispatch_stub_363 }, 8940 { "GetMinmaxEXT", (_glapi_proc) gl_dispatch_stub_364 }, 8941 { "GetMinmaxParameterfvEXT", (_glapi_proc) gl_dispatch_stub_365 }, 8942 { "GetMinmaxParameterivEXT", (_glapi_proc) gl_dispatch_stub_366 }, 8943 { "GetSeparableFilterEXT", (_glapi_proc) gl_dispatch_stub_359 }, 8944 { "IsTextureEXT", (_glapi_proc) glIsTextureEXT } 8945}; 8946 8947static int 8948__indirect_get_proc_compare(const void *key, const void *memb) 8949{ 8950 const struct proc_pair *pair = (const struct proc_pair *) memb; 8951 return strcmp((const char *) key, pair->name); 8952} 8953 8954_glapi_proc 8955__indirect_get_proc_address(const char *name) 8956{ 8957 const struct proc_pair *pair; 8958 8959 /* skip "gl" */ 8960 name += 2; 8961 8962 pair = (const struct proc_pair *) bsearch((const void *) name, 8963 (const void *) proc_pairs, ARRAY_SIZE(proc_pairs), sizeof(proc_pairs[0]), 8964 __indirect_get_proc_compare); 8965 8966 return (pair) ? pair->proc : NULL; 8967} 8968 8969#endif /* GLX_INDIRECT_RENDERING */ 8970 8971 8972# undef FASTCALL 8973# undef NOINLINE 8974