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