indirect.c revision b8e80941
1b8e80941Smrg/* DO NOT EDIT - This file generated automatically by glX_proto_send.py (from Mesa) script */
2848b8605Smrg
3848b8605Smrg/*
4848b8605Smrg * (C) Copyright IBM Corporation 2004, 2005
5848b8605Smrg * All Rights Reserved.
6848b8605Smrg *
7848b8605Smrg * Permission is hereby granted, free of charge, to any person obtaining a
8848b8605Smrg * copy of this software and associated documentation files (the "Software"),
9848b8605Smrg * to deal in the Software without restriction, including without limitation
10848b8605Smrg * the rights to use, copy, modify, merge, publish, distribute, sub license,
11848b8605Smrg * and/or sell copies of the Software, and to permit persons to whom the
12848b8605Smrg * Software is furnished to do so, subject to the following conditions:
13848b8605Smrg *
14848b8605Smrg * The above copyright notice and this permission notice (including the next
15848b8605Smrg * paragraph) shall be included in all copies or substantial portions of the
16848b8605Smrg * Software.
17848b8605Smrg *
18848b8605Smrg * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
19848b8605Smrg * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
20848b8605Smrg * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT.  IN NO EVENT SHALL
21848b8605Smrg * IBM,
22848b8605Smrg * AND/OR THEIR SUPPLIERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
23848b8605Smrg * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF
24848b8605Smrg * OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
25848b8605Smrg * SOFTWARE.
26848b8605Smrg */
27848b8605Smrg
28848b8605Smrg
29848b8605Smrg#include <GL/gl.h>
30848b8605Smrg#include "indirect.h"
31848b8605Smrg#include "glxclient.h"
32848b8605Smrg#include "indirect_size.h"
33848b8605Smrg#include "glapi.h"
34848b8605Smrg#include <GL/glxproto.h>
35848b8605Smrg#include <X11/Xlib-xcb.h>
36848b8605Smrg#include <xcb/xcb.h>
37848b8605Smrg#include <xcb/glx.h>
38b8e80941Smrg#include <limits.h>
39848b8605Smrg
40b8e80941Smrg#  if defined(__i386__) && defined(__GNUC__) && !defined(__CYGWIN__) && !defined(__MINGW32__)
41b8e80941Smrg#    define FASTCALL __attribute__((fastcall))
42b8e80941Smrg#  else
43b8e80941Smrg#    define FASTCALL
44b8e80941Smrg#  endif
45b8e80941Smrg#  if defined(__GNUC__)
46b8e80941Smrg#    define NOINLINE __attribute__((noinline))
47b8e80941Smrg#  else
48b8e80941Smrg#    define NOINLINE
49b8e80941Smrg#  endif
50848b8605Smrg
51b8e80941Smrgstatic _X_INLINE int safe_add(int a, int b)
52b8e80941Smrg{
53b8e80941Smrg    if (a < 0 || b < 0) return -1;
54b8e80941Smrg    if (INT_MAX - a < b) return -1;
55b8e80941Smrg    return a + b;
56b8e80941Smrg}
57b8e80941Smrgstatic _X_INLINE int safe_mul(int a, int b)
58b8e80941Smrg{
59b8e80941Smrg    if (a < 0 || b < 0) return -1;
60b8e80941Smrg    if (a == 0 || b == 0) return 0;
61b8e80941Smrg    if (a > INT_MAX / b) return -1;
62b8e80941Smrg    return a * b;
63b8e80941Smrg}
64b8e80941Smrgstatic _X_INLINE int safe_pad(int a)
65b8e80941Smrg{
66b8e80941Smrg    int ret;
67b8e80941Smrg    if (a < 0) return -1;
68b8e80941Smrg    if ((ret = safe_add(a, 3)) < 0) return -1;
69b8e80941Smrg    return ret & (GLuint)~3;
70b8e80941Smrg}
71848b8605Smrg
72848b8605Smrg#ifndef __GNUC__
73b8e80941Smrg#  define __builtin_expect(x, y) x
74848b8605Smrg#endif
75848b8605Smrg
76b8e80941Smrg/* If the size and opcode values are known at compile-time, this will, on
77b8e80941Smrg * x86 at least, emit them with a single instruction.
78848b8605Smrg */
79848b8605Smrg#define emit_header(dest, op, size)            \
80848b8605Smrg    do { union { short s[2]; int i; } temp;    \
81848b8605Smrg         temp.s[0] = (size); temp.s[1] = (op); \
82848b8605Smrg         *((int *)(dest)) = temp.i; } while(0)
83848b8605Smrg
84b8e80941SmrgNOINLINE CARD32
85b8e80941Smrg__glXReadReply( Display *dpy, size_t size, void * dest, GLboolean reply_is_always_array )
86848b8605Smrg{
87848b8605Smrg    xGLXSingleReply reply;
88b8e80941Smrg
89848b8605Smrg    (void) _XReply(dpy, (xReply *) & reply, 0, False);
90848b8605Smrg    if (size != 0) {
91848b8605Smrg        if ((reply.length > 0) || reply_is_always_array) {
92b8e80941Smrg            const GLint bytes = (reply_is_always_array)
93b8e80941Smrg              ? (4 * reply.length) : (reply.size * size);
94b8e80941Smrg            const GLint extra = 4 - (bytes & 3);
95848b8605Smrg
96848b8605Smrg            _XRead(dpy, dest, bytes);
97b8e80941Smrg            if ( extra < 4 ) {
98848b8605Smrg                _XEatData(dpy, extra);
99848b8605Smrg            }
100b8e80941Smrg        }
101b8e80941Smrg        else {
102b8e80941Smrg            (void) memcpy( dest, &(reply.pad3), size);
103848b8605Smrg        }
104848b8605Smrg    }
105b8e80941Smrg
106848b8605Smrg    return reply.retval;
107848b8605Smrg}
108848b8605Smrg
109848b8605SmrgNOINLINE void
110b8e80941Smrg__glXReadPixelReply( Display *dpy, struct glx_context * gc, unsigned max_dim,
111b8e80941Smrg    GLint width, GLint height, GLint depth, GLenum format, GLenum type,
112b8e80941Smrg    void * dest, GLboolean dimensions_in_reply )
113848b8605Smrg{
114848b8605Smrg    xGLXSingleReply reply;
115b8e80941Smrg    GLint size;
116b8e80941Smrg
117848b8605Smrg    (void) _XReply(dpy, (xReply *) & reply, 0, False);
118848b8605Smrg
119b8e80941Smrg    if ( dimensions_in_reply ) {
120b8e80941Smrg        width  = reply.pad3;
121848b8605Smrg        height = reply.pad4;
122b8e80941Smrg        depth  = reply.pad5;
123b8e80941Smrg
124b8e80941Smrg	if ((height == 0) || (max_dim < 2)) { height = 1; }
125b8e80941Smrg	if ((depth  == 0) || (max_dim < 3)) { depth  = 1; }
126848b8605Smrg    }
127b8e80941Smrg
128848b8605Smrg    size = reply.length * 4;
129848b8605Smrg    if (size != 0) {
130b8e80941Smrg        void * buf = malloc( size );
131848b8605Smrg
132b8e80941Smrg        if ( buf == NULL ) {
133848b8605Smrg            _XEatData(dpy, size);
134848b8605Smrg            __glXSetError(gc, GL_OUT_OF_MEMORY);
135b8e80941Smrg        }
136b8e80941Smrg        else {
137b8e80941Smrg            const GLint extra = 4 - (size & 3);
138848b8605Smrg
139848b8605Smrg            _XRead(dpy, buf, size);
140b8e80941Smrg            if ( extra < 4 ) {
141848b8605Smrg                _XEatData(dpy, extra);
142848b8605Smrg            }
143b8e80941Smrg
144848b8605Smrg            __glEmptyImage(gc, 3, width, height, depth, format, type,
145848b8605Smrg                           buf, dest);
146848b8605Smrg            free(buf);
147848b8605Smrg        }
148848b8605Smrg    }
149848b8605Smrg}
150848b8605Smrg
151848b8605Smrg#define X_GLXSingle 0
152848b8605Smrg
153848b8605SmrgNOINLINE FASTCALL GLubyte *
154b8e80941Smrg__glXSetupSingleRequest( struct glx_context * gc, GLint sop, GLint cmdlen )
155848b8605Smrg{
156b8e80941Smrg    xGLXSingleReq * req;
157b8e80941Smrg    Display * const dpy = gc->currentDpy;
158848b8605Smrg
159848b8605Smrg    (void) __glXFlushRenderBuffer(gc, gc->pc);
160848b8605Smrg    LockDisplay(dpy);
161848b8605Smrg    GetReqExtra(GLXSingle, cmdlen, req);
162848b8605Smrg    req->reqType = gc->majorOpcode;
163848b8605Smrg    req->contextTag = gc->currentContextTag;
164848b8605Smrg    req->glxCode = sop;
165b8e80941Smrg    return (GLubyte *)(req) + sz_xGLXSingleReq;
166848b8605Smrg}
167848b8605Smrg
168848b8605SmrgNOINLINE FASTCALL GLubyte *
169b8e80941Smrg__glXSetupVendorRequest( struct glx_context * gc, GLint code, GLint vop, GLint cmdlen )
170848b8605Smrg{
171b8e80941Smrg    xGLXVendorPrivateReq * req;
172b8e80941Smrg    Display * const dpy = gc->currentDpy;
173848b8605Smrg
174848b8605Smrg    (void) __glXFlushRenderBuffer(gc, gc->pc);
175848b8605Smrg    LockDisplay(dpy);
176848b8605Smrg    GetReqExtra(GLXVendorPrivate, cmdlen, req);
177848b8605Smrg    req->reqType = gc->majorOpcode;
178848b8605Smrg    req->glxCode = code;
179848b8605Smrg    req->vendorCode = vop;
180848b8605Smrg    req->contextTag = gc->currentContextTag;
181b8e80941Smrg    return (GLubyte *)(req) + sz_xGLXVendorPrivateReq;
182848b8605Smrg}
183848b8605Smrg
184b8e80941Smrgconst GLuint __glXDefaultPixelStore[9] = { 0, 0, 0, 0, 0, 0, 0, 0, 1 };
185848b8605Smrg
186848b8605Smrg#define zero                        (__glXDefaultPixelStore+0)
187848b8605Smrg#define one                         (__glXDefaultPixelStore+8)
188848b8605Smrg#define default_pixel_store_1D      (__glXDefaultPixelStore+4)
189848b8605Smrg#define default_pixel_store_1D_size 20
190848b8605Smrg#define default_pixel_store_2D      (__glXDefaultPixelStore+4)
191848b8605Smrg#define default_pixel_store_2D_size 20
192848b8605Smrg#define default_pixel_store_3D      (__glXDefaultPixelStore+0)
193848b8605Smrg#define default_pixel_store_3D_size 36
194848b8605Smrg#define default_pixel_store_4D      (__glXDefaultPixelStore+0)
195848b8605Smrg#define default_pixel_store_4D_size 36
196848b8605Smrg
197848b8605Smrgstatic FASTCALL NOINLINE void
198b8e80941Smrggeneric_3_byte( GLint rop, const void * ptr )
199848b8605Smrg{
200b8e80941Smrg    struct glx_context * const gc = __glXGetCurrentContext();
201b8e80941Smrg    const GLuint cmdlen = 8;
202848b8605Smrg
203848b8605Smrg    emit_header(gc->pc, rop, cmdlen);
204b8e80941Smrg    (void) memcpy((void *)(gc->pc + 4), ptr, 4);
205848b8605Smrg    gc->pc += cmdlen;
206b8e80941Smrg    if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); }
207848b8605Smrg}
208848b8605Smrg
209848b8605Smrgstatic FASTCALL NOINLINE void
210b8e80941Smrggeneric_4_byte( GLint rop, const void * ptr )
211848b8605Smrg{
212b8e80941Smrg    struct glx_context * const gc = __glXGetCurrentContext();
213b8e80941Smrg    const GLuint cmdlen = 8;
214848b8605Smrg
215848b8605Smrg    emit_header(gc->pc, rop, cmdlen);
216b8e80941Smrg    (void) memcpy((void *)(gc->pc + 4), ptr, 4);
217848b8605Smrg    gc->pc += cmdlen;
218b8e80941Smrg    if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); }
219848b8605Smrg}
220848b8605Smrg
221848b8605Smrgstatic FASTCALL NOINLINE void
222b8e80941Smrggeneric_6_byte( GLint rop, const void * ptr )
223848b8605Smrg{
224b8e80941Smrg    struct glx_context * const gc = __glXGetCurrentContext();
225b8e80941Smrg    const GLuint cmdlen = 12;
226848b8605Smrg
227848b8605Smrg    emit_header(gc->pc, rop, cmdlen);
228b8e80941Smrg    (void) memcpy((void *)(gc->pc + 4), ptr, 8);
229848b8605Smrg    gc->pc += cmdlen;
230b8e80941Smrg    if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); }
231848b8605Smrg}
232848b8605Smrg
233848b8605Smrgstatic FASTCALL NOINLINE void
234b8e80941Smrggeneric_8_byte( GLint rop, const void * ptr )
235848b8605Smrg{
236b8e80941Smrg    struct glx_context * const gc = __glXGetCurrentContext();
237b8e80941Smrg    const GLuint cmdlen = 12;
238848b8605Smrg
239848b8605Smrg    emit_header(gc->pc, rop, cmdlen);
240b8e80941Smrg    (void) memcpy((void *)(gc->pc + 4), ptr, 8);
241848b8605Smrg    gc->pc += cmdlen;
242b8e80941Smrg    if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); }
243848b8605Smrg}
244848b8605Smrg
245848b8605Smrgstatic FASTCALL NOINLINE void
246b8e80941Smrggeneric_12_byte( GLint rop, const void * ptr )
247848b8605Smrg{
248b8e80941Smrg    struct glx_context * const gc = __glXGetCurrentContext();
249b8e80941Smrg    const GLuint cmdlen = 16;
250848b8605Smrg
251848b8605Smrg    emit_header(gc->pc, rop, cmdlen);
252b8e80941Smrg    (void) memcpy((void *)(gc->pc + 4), ptr, 12);
253848b8605Smrg    gc->pc += cmdlen;
254b8e80941Smrg    if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); }
255848b8605Smrg}
256848b8605Smrg
257848b8605Smrgstatic FASTCALL NOINLINE void
258b8e80941Smrggeneric_16_byte( GLint rop, const void * ptr )
259848b8605Smrg{
260b8e80941Smrg    struct glx_context * const gc = __glXGetCurrentContext();
261b8e80941Smrg    const GLuint cmdlen = 20;
262848b8605Smrg
263848b8605Smrg    emit_header(gc->pc, rop, cmdlen);
264b8e80941Smrg    (void) memcpy((void *)(gc->pc + 4), ptr, 16);
265848b8605Smrg    gc->pc += cmdlen;
266b8e80941Smrg    if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); }
267848b8605Smrg}
268848b8605Smrg
269848b8605Smrgstatic FASTCALL NOINLINE void
270b8e80941Smrggeneric_24_byte( GLint rop, const void * ptr )
271848b8605Smrg{
272b8e80941Smrg    struct glx_context * const gc = __glXGetCurrentContext();
273b8e80941Smrg    const GLuint cmdlen = 28;
274848b8605Smrg
275848b8605Smrg    emit_header(gc->pc, rop, cmdlen);
276b8e80941Smrg    (void) memcpy((void *)(gc->pc + 4), ptr, 24);
277848b8605Smrg    gc->pc += cmdlen;
278b8e80941Smrg    if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); }
279848b8605Smrg}
280848b8605Smrg
281848b8605Smrgstatic FASTCALL NOINLINE void
282b8e80941Smrggeneric_32_byte( GLint rop, const void * ptr )
283848b8605Smrg{
284b8e80941Smrg    struct glx_context * const gc = __glXGetCurrentContext();
285b8e80941Smrg    const GLuint cmdlen = 36;
286848b8605Smrg
287848b8605Smrg    emit_header(gc->pc, rop, cmdlen);
288b8e80941Smrg    (void) memcpy((void *)(gc->pc + 4), ptr, 32);
289848b8605Smrg    gc->pc += cmdlen;
290b8e80941Smrg    if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); }
291848b8605Smrg}
292848b8605Smrg
293848b8605Smrg#define X_GLsop_NewList 101
294b8e80941Smrgvoid __indirect_glNewList(GLuint list, GLenum mode)
295848b8605Smrg{
296b8e80941Smrg    struct glx_context * const gc = __glXGetCurrentContext();
297b8e80941Smrg    Display * const dpy = gc->currentDpy;
298848b8605Smrg#ifndef USE_XCB
299b8e80941Smrg    const GLuint cmdlen = 8;
300848b8605Smrg#endif
301848b8605Smrg    if (__builtin_expect(dpy != NULL, 1)) {
302848b8605Smrg#ifdef USE_XCB
303848b8605Smrg        xcb_connection_t *c = XGetXCBConnection(dpy);
304848b8605Smrg        (void) __glXFlushRenderBuffer(gc, gc->pc);
305848b8605Smrg        xcb_glx_new_list(c, gc->currentContextTag, list, mode);
306848b8605Smrg#else
307b8e80941Smrg        GLubyte const * pc = __glXSetupSingleRequest(gc, X_GLsop_NewList, cmdlen);
308b8e80941Smrg(void) memcpy((void *)(pc + 0), (void *)(&list), 4);
309b8e80941Smrg(void) memcpy((void *)(pc + 4), (void *)(&mode), 4);
310b8e80941Smrg        UnlockDisplay(dpy); SyncHandle();
311b8e80941Smrg#endif /* USE_XCB */
312848b8605Smrg    }
313848b8605Smrg    return;
314848b8605Smrg}
315848b8605Smrg
316848b8605Smrg#define X_GLsop_EndList 102
317b8e80941Smrgvoid __indirect_glEndList(void)
318848b8605Smrg{
319b8e80941Smrg    struct glx_context * const gc = __glXGetCurrentContext();
320b8e80941Smrg    Display * const dpy = gc->currentDpy;
321848b8605Smrg#ifndef USE_XCB
322b8e80941Smrg    const GLuint cmdlen = 0;
323848b8605Smrg#endif
324848b8605Smrg    if (__builtin_expect(dpy != NULL, 1)) {
325848b8605Smrg#ifdef USE_XCB
326848b8605Smrg        xcb_connection_t *c = XGetXCBConnection(dpy);
327848b8605Smrg        (void) __glXFlushRenderBuffer(gc, gc->pc);
328848b8605Smrg        xcb_glx_end_list(c, gc->currentContextTag);
329848b8605Smrg#else
330848b8605Smrg        (void) __glXSetupSingleRequest(gc, X_GLsop_EndList, cmdlen);
331b8e80941Smrg        UnlockDisplay(dpy); SyncHandle();
332b8e80941Smrg#endif /* USE_XCB */
333848b8605Smrg    }
334848b8605Smrg    return;
335848b8605Smrg}
336848b8605Smrg
337848b8605Smrg#define X_GLrop_CallList 1
338b8e80941Smrgvoid __indirect_glCallList(GLuint list)
339848b8605Smrg{
340b8e80941Smrg    struct glx_context * const gc = __glXGetCurrentContext();
341b8e80941Smrg    const GLuint cmdlen = 8;
342b8e80941Smrgemit_header(gc->pc, X_GLrop_CallList, cmdlen);
343b8e80941Smrg(void) memcpy((void *)(gc->pc + 4), (void *)(&list), 4);
344b8e80941Smrggc->pc += cmdlen;
345b8e80941Smrgif (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); }
346848b8605Smrg}
347848b8605Smrg
348848b8605Smrg#define X_GLrop_CallLists 2
349b8e80941Smrgvoid __indirect_glCallLists(GLsizei n, GLenum type, const GLvoid * lists)
350848b8605Smrg{
351b8e80941Smrg    struct glx_context * const gc = __glXGetCurrentContext();
352b8e80941Smrg    const GLuint compsize = __glCallLists_size(type);
353b8e80941Smrg    const GLuint cmdlen = 12 + safe_pad(safe_mul(compsize, n));
354b8e80941Smrg    if (0 + safe_pad(safe_mul(compsize, n)) < 0) {
355b8e80941Smrg        __glXSetError(gc, GL_INVALID_VALUE);
356b8e80941Smrg        return;
357b8e80941Smrg    }
358848b8605Smrg    if (n < 0) {
359848b8605Smrg        __glXSetError(gc, GL_INVALID_VALUE);
360848b8605Smrg        return;
361848b8605Smrg    }
362848b8605Smrg    if (__builtin_expect((n >= 0) && (gc->currentDpy != NULL), 1)) {
363b8e80941Smrgif (cmdlen <= gc->maxSmallRenderCommandSize) {
364b8e80941Smrg    if ( (gc->pc + cmdlen) > gc->bufEnd ) {
365b8e80941Smrg        (void) __glXFlushRenderBuffer(gc, gc->pc);
366b8e80941Smrg    }
367b8e80941Smrgemit_header(gc->pc, X_GLrop_CallLists, cmdlen);
368b8e80941Smrg(void) memcpy((void *)(gc->pc + 4), (void *)(&n), 4);
369b8e80941Smrg(void) memcpy((void *)(gc->pc + 8), (void *)(&type), 4);
370b8e80941Smrg(void) memcpy((void *)(gc->pc + 12), (void *)(lists), safe_mul(compsize, n));
371b8e80941Smrggc->pc += cmdlen;
372b8e80941Smrgif (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); }
373b8e80941Smrg}
374b8e80941Smrgelse {
375b8e80941Smrgconst GLint op = X_GLrop_CallLists;
376b8e80941Smrgconst GLuint cmdlenLarge = cmdlen + 4;
377b8e80941SmrgGLubyte * const pc = __glXFlushRenderBuffer(gc, gc->pc);
378b8e80941Smrg(void) memcpy((void *)(pc + 0), (void *)(&cmdlenLarge), 4);
379b8e80941Smrg(void) memcpy((void *)(pc + 4), (void *)(&op), 4);
380b8e80941Smrg(void) memcpy((void *)(pc + 8), (void *)(&n), 4);
381b8e80941Smrg(void) memcpy((void *)(pc + 12), (void *)(&type), 4);
382b8e80941Smrg    __glXSendLargeCommand(gc, pc, 16, lists, safe_mul(compsize, n));
383b8e80941Smrg}
384848b8605Smrg    }
385848b8605Smrg}
386848b8605Smrg
387848b8605Smrg#define X_GLsop_DeleteLists 103
388b8e80941Smrgvoid __indirect_glDeleteLists(GLuint list, GLsizei range)
389848b8605Smrg{
390b8e80941Smrg    struct glx_context * const gc = __glXGetCurrentContext();
391b8e80941Smrg    Display * const dpy = gc->currentDpy;
392848b8605Smrg#ifndef USE_XCB
393b8e80941Smrg    const GLuint cmdlen = 8;
394848b8605Smrg#endif
395848b8605Smrg    if (__builtin_expect(dpy != NULL, 1)) {
396848b8605Smrg#ifdef USE_XCB
397848b8605Smrg        xcb_connection_t *c = XGetXCBConnection(dpy);
398848b8605Smrg        (void) __glXFlushRenderBuffer(gc, gc->pc);
399848b8605Smrg        xcb_glx_delete_lists(c, gc->currentContextTag, list, range);
400848b8605Smrg#else
401b8e80941Smrg        GLubyte const * pc = __glXSetupSingleRequest(gc, X_GLsop_DeleteLists, cmdlen);
402b8e80941Smrg(void) memcpy((void *)(pc + 0), (void *)(&list), 4);
403b8e80941Smrg(void) memcpy((void *)(pc + 4), (void *)(&range), 4);
404b8e80941Smrg        UnlockDisplay(dpy); SyncHandle();
405b8e80941Smrg#endif /* USE_XCB */
406848b8605Smrg    }
407848b8605Smrg    return;
408848b8605Smrg}
409848b8605Smrg
410848b8605Smrg#define X_GLsop_GenLists 104
411b8e80941SmrgGLuint __indirect_glGenLists(GLsizei range)
412848b8605Smrg{
413b8e80941Smrg    struct glx_context * const gc = __glXGetCurrentContext();
414b8e80941Smrg    Display * const dpy = gc->currentDpy;
415b8e80941Smrg    GLuint retval = (GLuint) 0;
416848b8605Smrg#ifndef USE_XCB
417b8e80941Smrg    const GLuint cmdlen = 4;
418848b8605Smrg#endif
419848b8605Smrg    if (__builtin_expect(dpy != NULL, 1)) {
420848b8605Smrg#ifdef USE_XCB
421848b8605Smrg        xcb_connection_t *c = XGetXCBConnection(dpy);
422848b8605Smrg        (void) __glXFlushRenderBuffer(gc, gc->pc);
423848b8605Smrg        xcb_glx_gen_lists_reply_t *reply = xcb_glx_gen_lists_reply(c, xcb_glx_gen_lists(c, gc->currentContextTag, range), NULL);
424848b8605Smrg        retval = reply->ret_val;
425848b8605Smrg        free(reply);
426848b8605Smrg#else
427b8e80941Smrg        GLubyte const * pc = __glXSetupSingleRequest(gc, X_GLsop_GenLists, cmdlen);
428b8e80941Smrg(void) memcpy((void *)(pc + 0), (void *)(&range), 4);
429848b8605Smrg        retval = (GLuint) __glXReadReply(dpy, 0, NULL, GL_FALSE);
430b8e80941Smrg        UnlockDisplay(dpy); SyncHandle();
431b8e80941Smrg#endif /* USE_XCB */
432848b8605Smrg    }
433848b8605Smrg    return retval;
434848b8605Smrg}
435848b8605Smrg
436848b8605Smrg#define X_GLrop_ListBase 3
437b8e80941Smrgvoid __indirect_glListBase(GLuint base)
438848b8605Smrg{
439b8e80941Smrg    struct glx_context * const gc = __glXGetCurrentContext();
440b8e80941Smrg    const GLuint cmdlen = 8;
441b8e80941Smrgemit_header(gc->pc, X_GLrop_ListBase, cmdlen);
442b8e80941Smrg(void) memcpy((void *)(gc->pc + 4), (void *)(&base), 4);
443b8e80941Smrggc->pc += cmdlen;
444b8e80941Smrgif (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); }
445848b8605Smrg}
446848b8605Smrg
447848b8605Smrg#define X_GLrop_Begin 4
448b8e80941Smrgvoid __indirect_glBegin(GLenum mode)
449848b8605Smrg{
450b8e80941Smrg    struct glx_context * const gc = __glXGetCurrentContext();
451b8e80941Smrg    const GLuint cmdlen = 8;
452b8e80941Smrgemit_header(gc->pc, X_GLrop_Begin, cmdlen);
453b8e80941Smrg(void) memcpy((void *)(gc->pc + 4), (void *)(&mode), 4);
454b8e80941Smrggc->pc += cmdlen;
455b8e80941Smrgif (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); }
456848b8605Smrg}
457848b8605Smrg
458848b8605Smrg#define X_GLrop_Bitmap 5
459b8e80941Smrgvoid __indirect_glBitmap(GLsizei width, GLsizei height, GLfloat xorig, GLfloat yorig, GLfloat xmove, GLfloat ymove, const GLubyte * bitmap)
460848b8605Smrg{
461b8e80941Smrg    struct glx_context * const gc = __glXGetCurrentContext();
462b8e80941Smrg    const GLuint compsize = (bitmap != NULL) ? __glImageSize(width, height, 1, GL_COLOR_INDEX, GL_BITMAP, 0) : 0;
463b8e80941Smrg    const GLuint cmdlen = 48 + safe_pad(compsize);
464b8e80941Smrg    if (0 + safe_pad(compsize) < 0) {
465b8e80941Smrg        __glXSetError(gc, GL_INVALID_VALUE);
466b8e80941Smrg        return;
467b8e80941Smrg    }
468848b8605Smrg    if (__builtin_expect(gc->currentDpy != NULL, 1)) {
469b8e80941Smrgif (cmdlen <= gc->maxSmallRenderCommandSize) {
470b8e80941Smrg    if ( (gc->pc + cmdlen) > gc->bufEnd ) {
471b8e80941Smrg        (void) __glXFlushRenderBuffer(gc, gc->pc);
472b8e80941Smrg    }
473b8e80941Smrgemit_header(gc->pc, X_GLrop_Bitmap, cmdlen);
474b8e80941Smrg(void) memcpy((void *)(gc->pc + 24), (void *)(&width), 4);
475b8e80941Smrg(void) memcpy((void *)(gc->pc + 28), (void *)(&height), 4);
476b8e80941Smrg(void) memcpy((void *)(gc->pc + 32), (void *)(&xorig), 4);
477b8e80941Smrg(void) memcpy((void *)(gc->pc + 36), (void *)(&yorig), 4);
478b8e80941Smrg(void) memcpy((void *)(gc->pc + 40), (void *)(&xmove), 4);
479b8e80941Smrg(void) memcpy((void *)(gc->pc + 44), (void *)(&ymove), 4);
480b8e80941Smrgif (compsize > 0) {
481b8e80941Smrg    gc->fillImage(gc, 2, width, height, 1, GL_COLOR_INDEX, GL_BITMAP, bitmap, gc->pc + 48, gc->pc + 4);
482b8e80941Smrg} else {
483b8e80941Smrg    (void) memcpy( gc->pc + 4, default_pixel_store_2D, default_pixel_store_2D_size );
484b8e80941Smrg}
485b8e80941Smrggc->pc += cmdlen;
486b8e80941Smrgif (gc->pc > gc->limit) { (void) __glXFlushRenderBuffer(gc, gc->pc); }
487b8e80941Smrg}
488b8e80941Smrgelse {
489b8e80941Smrgconst GLint op = X_GLrop_Bitmap;
490b8e80941Smrgconst GLuint cmdlenLarge = cmdlen + 4;
491b8e80941SmrgGLubyte * const pc = __glXFlushRenderBuffer(gc, gc->pc);
492b8e80941Smrg(void) memcpy((void *)(pc + 0), (void *)(&cmdlenLarge), 4);
493b8e80941Smrg(void) memcpy((void *)(pc + 4), (void *)(&op), 4);
494b8e80941Smrg(void) memcpy((void *)(pc + 28), (void *)(&width), 4);
495b8e80941Smrg(void) memcpy((void *)(pc + 32), (void *)(&height), 4);
496b8e80941Smrg(void) memcpy((void *)(pc + 36), (void *)(&xorig), 4);
497b8e80941Smrg(void) memcpy((void *)(pc + 40), (void *)(&yorig), 4);
498b8e80941Smrg(void) memcpy((void *)(pc + 44), (void *)(&xmove), 4);
499b8e80941Smrg(void) memcpy((void *)(pc + 48), (void *)(&ymove), 4);
500b8e80941Smrg__glXSendLargeImage(gc, compsize, 2, width, height, 1, GL_COLOR_INDEX, GL_BITMAP, bitmap, pc + 52, pc + 8);
501b8e80941Smrg}
502848b8605Smrg    }
503848b8605Smrg}
504848b8605Smrg
505848b8605Smrg#define X_GLrop_Color3bv 6
506b8e80941Smrgvoid __indirect_glColor3b(GLbyte red, GLbyte green, GLbyte blue)
507b8e80941Smrg{
508b8e80941Smrg    struct glx_context * const gc = __glXGetCurrentContext();
509b8e80941Smrg    const GLuint cmdlen = 8;
510b8e80941Smrgemit_header(gc->pc, X_GLrop_Color3bv, cmdlen);
511b8e80941Smrg(void) memcpy((void *)(gc->pc + 4), (void *)(&red), 1);
512b8e80941Smrg(void) memcpy((void *)(gc->pc + 5), (void *)(&green), 1);
513b8e80941Smrg(void) memcpy((void *)(gc->pc + 6), (void *)(&blue), 1);
514b8e80941Smrggc->pc += cmdlen;
515b8e80941Smrgif (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); }
516848b8605Smrg}
517848b8605Smrg
518848b8605Smrg#define X_GLrop_Color3bv 6
519b8e80941Smrgvoid __indirect_glColor3bv(const GLbyte * v)
520848b8605Smrg{
521b8e80941Smrg    generic_3_byte( X_GLrop_Color3bv, v );
522848b8605Smrg}
523848b8605Smrg
524848b8605Smrg#define X_GLrop_Color3dv 7
525b8e80941Smrgvoid __indirect_glColor3d(GLdouble red, GLdouble green, GLdouble blue)
526b8e80941Smrg{
527b8e80941Smrg    struct glx_context * const gc = __glXGetCurrentContext();
528b8e80941Smrg    const GLuint cmdlen = 28;
529b8e80941Smrgemit_header(gc->pc, X_GLrop_Color3dv, cmdlen);
530b8e80941Smrg(void) memcpy((void *)(gc->pc + 4), (void *)(&red), 8);
531b8e80941Smrg(void) memcpy((void *)(gc->pc + 12), (void *)(&green), 8);
532b8e80941Smrg(void) memcpy((void *)(gc->pc + 20), (void *)(&blue), 8);
533b8e80941Smrggc->pc += cmdlen;
534b8e80941Smrgif (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); }
535848b8605Smrg}
536848b8605Smrg
537848b8605Smrg#define X_GLrop_Color3dv 7
538b8e80941Smrgvoid __indirect_glColor3dv(const GLdouble * v)
539848b8605Smrg{
540b8e80941Smrg    generic_24_byte( X_GLrop_Color3dv, v );
541848b8605Smrg}
542848b8605Smrg
543848b8605Smrg#define X_GLrop_Color3fv 8
544b8e80941Smrgvoid __indirect_glColor3f(GLfloat red, GLfloat green, GLfloat blue)
545b8e80941Smrg{
546b8e80941Smrg    struct glx_context * const gc = __glXGetCurrentContext();
547b8e80941Smrg    const GLuint cmdlen = 16;
548b8e80941Smrgemit_header(gc->pc, X_GLrop_Color3fv, cmdlen);
549b8e80941Smrg(void) memcpy((void *)(gc->pc + 4), (void *)(&red), 4);
550b8e80941Smrg(void) memcpy((void *)(gc->pc + 8), (void *)(&green), 4);
551b8e80941Smrg(void) memcpy((void *)(gc->pc + 12), (void *)(&blue), 4);
552b8e80941Smrggc->pc += cmdlen;
553b8e80941Smrgif (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); }
554848b8605Smrg}
555848b8605Smrg
556848b8605Smrg#define X_GLrop_Color3fv 8
557b8e80941Smrgvoid __indirect_glColor3fv(const GLfloat * v)
558848b8605Smrg{
559b8e80941Smrg    generic_12_byte( X_GLrop_Color3fv, v );
560848b8605Smrg}
561848b8605Smrg
562848b8605Smrg#define X_GLrop_Color3iv 9
563b8e80941Smrgvoid __indirect_glColor3i(GLint red, GLint green, GLint blue)
564b8e80941Smrg{
565b8e80941Smrg    struct glx_context * const gc = __glXGetCurrentContext();
566b8e80941Smrg    const GLuint cmdlen = 16;
567b8e80941Smrgemit_header(gc->pc, X_GLrop_Color3iv, cmdlen);
568b8e80941Smrg(void) memcpy((void *)(gc->pc + 4), (void *)(&red), 4);
569b8e80941Smrg(void) memcpy((void *)(gc->pc + 8), (void *)(&green), 4);
570b8e80941Smrg(void) memcpy((void *)(gc->pc + 12), (void *)(&blue), 4);
571b8e80941Smrggc->pc += cmdlen;
572b8e80941Smrgif (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); }
573848b8605Smrg}
574848b8605Smrg
575848b8605Smrg#define X_GLrop_Color3iv 9
576b8e80941Smrgvoid __indirect_glColor3iv(const GLint * v)
577848b8605Smrg{
578b8e80941Smrg    generic_12_byte( X_GLrop_Color3iv, v );
579848b8605Smrg}
580848b8605Smrg
581848b8605Smrg#define X_GLrop_Color3sv 10
582b8e80941Smrgvoid __indirect_glColor3s(GLshort red, GLshort green, GLshort blue)
583b8e80941Smrg{
584b8e80941Smrg    struct glx_context * const gc = __glXGetCurrentContext();
585b8e80941Smrg    const GLuint cmdlen = 12;
586b8e80941Smrgemit_header(gc->pc, X_GLrop_Color3sv, cmdlen);
587b8e80941Smrg(void) memcpy((void *)(gc->pc + 4), (void *)(&red), 2);
588b8e80941Smrg(void) memcpy((void *)(gc->pc + 6), (void *)(&green), 2);
589b8e80941Smrg(void) memcpy((void *)(gc->pc + 8), (void *)(&blue), 2);
590b8e80941Smrggc->pc += cmdlen;
591b8e80941Smrgif (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); }
592848b8605Smrg}
593848b8605Smrg
594848b8605Smrg#define X_GLrop_Color3sv 10
595b8e80941Smrgvoid __indirect_glColor3sv(const GLshort * v)
596848b8605Smrg{
597b8e80941Smrg    generic_6_byte( X_GLrop_Color3sv, v );
598848b8605Smrg}
599848b8605Smrg
600848b8605Smrg#define X_GLrop_Color3ubv 11
601b8e80941Smrgvoid __indirect_glColor3ub(GLubyte red, GLubyte green, GLubyte blue)
602b8e80941Smrg{
603b8e80941Smrg    struct glx_context * const gc = __glXGetCurrentContext();
604b8e80941Smrg    const GLuint cmdlen = 8;
605b8e80941Smrgemit_header(gc->pc, X_GLrop_Color3ubv, cmdlen);
606b8e80941Smrg(void) memcpy((void *)(gc->pc + 4), (void *)(&red), 1);
607b8e80941Smrg(void) memcpy((void *)(gc->pc + 5), (void *)(&green), 1);
608b8e80941Smrg(void) memcpy((void *)(gc->pc + 6), (void *)(&blue), 1);
609b8e80941Smrggc->pc += cmdlen;
610b8e80941Smrgif (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); }
611848b8605Smrg}
612848b8605Smrg
613848b8605Smrg#define X_GLrop_Color3ubv 11
614b8e80941Smrgvoid __indirect_glColor3ubv(const GLubyte * v)
615848b8605Smrg{
616b8e80941Smrg    generic_3_byte( X_GLrop_Color3ubv, v );
617848b8605Smrg}
618848b8605Smrg
619848b8605Smrg#define X_GLrop_Color3uiv 12
620b8e80941Smrgvoid __indirect_glColor3ui(GLuint red, GLuint green, GLuint blue)
621b8e80941Smrg{
622b8e80941Smrg    struct glx_context * const gc = __glXGetCurrentContext();
623b8e80941Smrg    const GLuint cmdlen = 16;
624b8e80941Smrgemit_header(gc->pc, X_GLrop_Color3uiv, cmdlen);
625b8e80941Smrg(void) memcpy((void *)(gc->pc + 4), (void *)(&red), 4);
626b8e80941Smrg(void) memcpy((void *)(gc->pc + 8), (void *)(&green), 4);
627b8e80941Smrg(void) memcpy((void *)(gc->pc + 12), (void *)(&blue), 4);
628b8e80941Smrggc->pc += cmdlen;
629b8e80941Smrgif (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); }
630848b8605Smrg}
631848b8605Smrg
632848b8605Smrg#define X_GLrop_Color3uiv 12
633b8e80941Smrgvoid __indirect_glColor3uiv(const GLuint * v)
634848b8605Smrg{
635b8e80941Smrg    generic_12_byte( X_GLrop_Color3uiv, v );
636848b8605Smrg}
637848b8605Smrg
638848b8605Smrg#define X_GLrop_Color3usv 13
639b8e80941Smrgvoid __indirect_glColor3us(GLushort red, GLushort green, GLushort blue)
640b8e80941Smrg{
641b8e80941Smrg    struct glx_context * const gc = __glXGetCurrentContext();
642b8e80941Smrg    const GLuint cmdlen = 12;
643b8e80941Smrgemit_header(gc->pc, X_GLrop_Color3usv, cmdlen);
644b8e80941Smrg(void) memcpy((void *)(gc->pc + 4), (void *)(&red), 2);
645b8e80941Smrg(void) memcpy((void *)(gc->pc + 6), (void *)(&green), 2);
646b8e80941Smrg(void) memcpy((void *)(gc->pc + 8), (void *)(&blue), 2);
647b8e80941Smrggc->pc += cmdlen;
648b8e80941Smrgif (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); }
649848b8605Smrg}
650848b8605Smrg
651848b8605Smrg#define X_GLrop_Color3usv 13
652b8e80941Smrgvoid __indirect_glColor3usv(const GLushort * v)
653848b8605Smrg{
654b8e80941Smrg    generic_6_byte( X_GLrop_Color3usv, v );
655848b8605Smrg}
656848b8605Smrg
657848b8605Smrg#define X_GLrop_Color4bv 14
658b8e80941Smrgvoid __indirect_glColor4b(GLbyte red, GLbyte green, GLbyte blue, GLbyte alpha)
659b8e80941Smrg{
660b8e80941Smrg    struct glx_context * const gc = __glXGetCurrentContext();
661b8e80941Smrg    const GLuint cmdlen = 8;
662b8e80941Smrgemit_header(gc->pc, X_GLrop_Color4bv, cmdlen);
663b8e80941Smrg(void) memcpy((void *)(gc->pc + 4), (void *)(&red), 1);
664b8e80941Smrg(void) memcpy((void *)(gc->pc + 5), (void *)(&green), 1);
665b8e80941Smrg(void) memcpy((void *)(gc->pc + 6), (void *)(&blue), 1);
666b8e80941Smrg(void) memcpy((void *)(gc->pc + 7), (void *)(&alpha), 1);
667b8e80941Smrggc->pc += cmdlen;
668b8e80941Smrgif (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); }
669848b8605Smrg}
670848b8605Smrg
671848b8605Smrg#define X_GLrop_Color4bv 14
672b8e80941Smrgvoid __indirect_glColor4bv(const GLbyte * v)
673848b8605Smrg{
674b8e80941Smrg    generic_4_byte( X_GLrop_Color4bv, v );
675848b8605Smrg}
676848b8605Smrg
677848b8605Smrg#define X_GLrop_Color4dv 15
678b8e80941Smrgvoid __indirect_glColor4d(GLdouble red, GLdouble green, GLdouble blue, GLdouble alpha)
679b8e80941Smrg{
680b8e80941Smrg    struct glx_context * const gc = __glXGetCurrentContext();
681b8e80941Smrg    const GLuint cmdlen = 36;
682b8e80941Smrgemit_header(gc->pc, X_GLrop_Color4dv, cmdlen);
683b8e80941Smrg(void) memcpy((void *)(gc->pc + 4), (void *)(&red), 8);
684b8e80941Smrg(void) memcpy((void *)(gc->pc + 12), (void *)(&green), 8);
685b8e80941Smrg(void) memcpy((void *)(gc->pc + 20), (void *)(&blue), 8);
686b8e80941Smrg(void) memcpy((void *)(gc->pc + 28), (void *)(&alpha), 8);
687b8e80941Smrggc->pc += cmdlen;
688b8e80941Smrgif (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); }
689848b8605Smrg}
690848b8605Smrg
691848b8605Smrg#define X_GLrop_Color4dv 15
692b8e80941Smrgvoid __indirect_glColor4dv(const GLdouble * v)
693848b8605Smrg{
694b8e80941Smrg    generic_32_byte( X_GLrop_Color4dv, v );
695848b8605Smrg}
696848b8605Smrg
697848b8605Smrg#define X_GLrop_Color4fv 16
698b8e80941Smrgvoid __indirect_glColor4f(GLfloat red, GLfloat green, GLfloat blue, GLfloat alpha)
699b8e80941Smrg{
700b8e80941Smrg    struct glx_context * const gc = __glXGetCurrentContext();
701b8e80941Smrg    const GLuint cmdlen = 20;
702b8e80941Smrgemit_header(gc->pc, X_GLrop_Color4fv, cmdlen);
703b8e80941Smrg(void) memcpy((void *)(gc->pc + 4), (void *)(&red), 4);
704b8e80941Smrg(void) memcpy((void *)(gc->pc + 8), (void *)(&green), 4);
705b8e80941Smrg(void) memcpy((void *)(gc->pc + 12), (void *)(&blue), 4);
706b8e80941Smrg(void) memcpy((void *)(gc->pc + 16), (void *)(&alpha), 4);
707b8e80941Smrggc->pc += cmdlen;
708b8e80941Smrgif (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); }
709848b8605Smrg}
710848b8605Smrg
711848b8605Smrg#define X_GLrop_Color4fv 16
712b8e80941Smrgvoid __indirect_glColor4fv(const GLfloat * v)
713848b8605Smrg{
714b8e80941Smrg    generic_16_byte( X_GLrop_Color4fv, v );
715848b8605Smrg}
716848b8605Smrg
717848b8605Smrg#define X_GLrop_Color4iv 17
718b8e80941Smrgvoid __indirect_glColor4i(GLint red, GLint green, GLint blue, GLint alpha)
719b8e80941Smrg{
720b8e80941Smrg    struct glx_context * const gc = __glXGetCurrentContext();
721b8e80941Smrg    const GLuint cmdlen = 20;
722b8e80941Smrgemit_header(gc->pc, X_GLrop_Color4iv, cmdlen);
723b8e80941Smrg(void) memcpy((void *)(gc->pc + 4), (void *)(&red), 4);
724b8e80941Smrg(void) memcpy((void *)(gc->pc + 8), (void *)(&green), 4);
725b8e80941Smrg(void) memcpy((void *)(gc->pc + 12), (void *)(&blue), 4);
726b8e80941Smrg(void) memcpy((void *)(gc->pc + 16), (void *)(&alpha), 4);
727b8e80941Smrggc->pc += cmdlen;
728b8e80941Smrgif (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); }
729848b8605Smrg}
730848b8605Smrg
731848b8605Smrg#define X_GLrop_Color4iv 17
732b8e80941Smrgvoid __indirect_glColor4iv(const GLint * v)
733848b8605Smrg{
734b8e80941Smrg    generic_16_byte( X_GLrop_Color4iv, v );
735848b8605Smrg}
736848b8605Smrg
737848b8605Smrg#define X_GLrop_Color4sv 18
738b8e80941Smrgvoid __indirect_glColor4s(GLshort red, GLshort green, GLshort blue, GLshort alpha)
739b8e80941Smrg{
740b8e80941Smrg    struct glx_context * const gc = __glXGetCurrentContext();
741b8e80941Smrg    const GLuint cmdlen = 12;
742b8e80941Smrgemit_header(gc->pc, X_GLrop_Color4sv, cmdlen);
743b8e80941Smrg(void) memcpy((void *)(gc->pc + 4), (void *)(&red), 2);
744b8e80941Smrg(void) memcpy((void *)(gc->pc + 6), (void *)(&green), 2);
745b8e80941Smrg(void) memcpy((void *)(gc->pc + 8), (void *)(&blue), 2);
746b8e80941Smrg(void) memcpy((void *)(gc->pc + 10), (void *)(&alpha), 2);
747b8e80941Smrggc->pc += cmdlen;
748b8e80941Smrgif (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); }
749848b8605Smrg}
750848b8605Smrg
751848b8605Smrg#define X_GLrop_Color4sv 18
752b8e80941Smrgvoid __indirect_glColor4sv(const GLshort * v)
753848b8605Smrg{
754b8e80941Smrg    generic_8_byte( X_GLrop_Color4sv, v );
755848b8605Smrg}
756848b8605Smrg
757848b8605Smrg#define X_GLrop_Color4ubv 19
758b8e80941Smrgvoid __indirect_glColor4ub(GLubyte red, GLubyte green, GLubyte blue, GLubyte alpha)
759b8e80941Smrg{
760b8e80941Smrg    struct glx_context * const gc = __glXGetCurrentContext();
761b8e80941Smrg    const GLuint cmdlen = 8;
762b8e80941Smrgemit_header(gc->pc, X_GLrop_Color4ubv, cmdlen);
763b8e80941Smrg(void) memcpy((void *)(gc->pc + 4), (void *)(&red), 1);
764b8e80941Smrg(void) memcpy((void *)(gc->pc + 5), (void *)(&green), 1);
765b8e80941Smrg(void) memcpy((void *)(gc->pc + 6), (void *)(&blue), 1);
766b8e80941Smrg(void) memcpy((void *)(gc->pc + 7), (void *)(&alpha), 1);
767b8e80941Smrggc->pc += cmdlen;
768b8e80941Smrgif (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); }
769848b8605Smrg}
770848b8605Smrg
771848b8605Smrg#define X_GLrop_Color4ubv 19
772b8e80941Smrgvoid __indirect_glColor4ubv(const GLubyte * v)
773848b8605Smrg{
774b8e80941Smrg    generic_4_byte( X_GLrop_Color4ubv, v );
775848b8605Smrg}
776848b8605Smrg
777848b8605Smrg#define X_GLrop_Color4uiv 20
778b8e80941Smrgvoid __indirect_glColor4ui(GLuint red, GLuint green, GLuint blue, GLuint alpha)
779b8e80941Smrg{
780b8e80941Smrg    struct glx_context * const gc = __glXGetCurrentContext();
781b8e80941Smrg    const GLuint cmdlen = 20;
782b8e80941Smrgemit_header(gc->pc, X_GLrop_Color4uiv, cmdlen);
783b8e80941Smrg(void) memcpy((void *)(gc->pc + 4), (void *)(&red), 4);
784b8e80941Smrg(void) memcpy((void *)(gc->pc + 8), (void *)(&green), 4);
785b8e80941Smrg(void) memcpy((void *)(gc->pc + 12), (void *)(&blue), 4);
786b8e80941Smrg(void) memcpy((void *)(gc->pc + 16), (void *)(&alpha), 4);
787b8e80941Smrggc->pc += cmdlen;
788b8e80941Smrgif (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); }
789848b8605Smrg}
790848b8605Smrg
791848b8605Smrg#define X_GLrop_Color4uiv 20
792b8e80941Smrgvoid __indirect_glColor4uiv(const GLuint * v)
793848b8605Smrg{
794b8e80941Smrg    generic_16_byte( X_GLrop_Color4uiv, v );
795848b8605Smrg}
796848b8605Smrg
797848b8605Smrg#define X_GLrop_Color4usv 21
798b8e80941Smrgvoid __indirect_glColor4us(GLushort red, GLushort green, GLushort blue, GLushort alpha)
799b8e80941Smrg{
800b8e80941Smrg    struct glx_context * const gc = __glXGetCurrentContext();
801b8e80941Smrg    const GLuint cmdlen = 12;
802b8e80941Smrgemit_header(gc->pc, X_GLrop_Color4usv, cmdlen);
803b8e80941Smrg(void) memcpy((void *)(gc->pc + 4), (void *)(&red), 2);
804b8e80941Smrg(void) memcpy((void *)(gc->pc + 6), (void *)(&green), 2);
805b8e80941Smrg(void) memcpy((void *)(gc->pc + 8), (void *)(&blue), 2);
806b8e80941Smrg(void) memcpy((void *)(gc->pc + 10), (void *)(&alpha), 2);
807b8e80941Smrggc->pc += cmdlen;
808b8e80941Smrgif (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); }
809848b8605Smrg}
810848b8605Smrg
811848b8605Smrg#define X_GLrop_Color4usv 21
812b8e80941Smrgvoid __indirect_glColor4usv(const GLushort * v)
813848b8605Smrg{
814b8e80941Smrg    generic_8_byte( X_GLrop_Color4usv, v );
815848b8605Smrg}
816848b8605Smrg
817848b8605Smrg#define X_GLrop_EdgeFlagv 22
818b8e80941Smrgvoid __indirect_glEdgeFlag(GLboolean flag)
819848b8605Smrg{
820b8e80941Smrg    struct glx_context * const gc = __glXGetCurrentContext();
821b8e80941Smrg    const GLuint cmdlen = 8;
822b8e80941Smrgemit_header(gc->pc, X_GLrop_EdgeFlagv, cmdlen);
823b8e80941Smrg(void) memcpy((void *)(gc->pc + 4), (void *)(&flag), 1);
824b8e80941Smrggc->pc += cmdlen;
825b8e80941Smrgif (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); }
826848b8605Smrg}
827848b8605Smrg
828848b8605Smrg#define X_GLrop_EdgeFlagv 22
829b8e80941Smrgvoid __indirect_glEdgeFlagv(const GLboolean * flag)
830848b8605Smrg{
831b8e80941Smrg    struct glx_context * const gc = __glXGetCurrentContext();
832b8e80941Smrg    const GLuint cmdlen = 8;
833b8e80941Smrgemit_header(gc->pc, X_GLrop_EdgeFlagv, cmdlen);
834b8e80941Smrg(void) memcpy((void *)(gc->pc + 4), (void *)(flag), 1);
835b8e80941Smrggc->pc += cmdlen;
836b8e80941Smrgif (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); }
837848b8605Smrg}
838848b8605Smrg
839848b8605Smrg#define X_GLrop_End 23
840b8e80941Smrgvoid __indirect_glEnd(void)
841848b8605Smrg{
842b8e80941Smrg    struct glx_context * const gc = __glXGetCurrentContext();
843b8e80941Smrg    const GLuint cmdlen = 4;
844b8e80941Smrgemit_header(gc->pc, X_GLrop_End, cmdlen);
845b8e80941Smrggc->pc += cmdlen;
846b8e80941Smrgif (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); }
847848b8605Smrg}
848848b8605Smrg
849848b8605Smrg#define X_GLrop_Indexdv 24
850b8e80941Smrgvoid __indirect_glIndexd(GLdouble c)
851848b8605Smrg{
852b8e80941Smrg    struct glx_context * const gc = __glXGetCurrentContext();
853b8e80941Smrg    const GLuint cmdlen = 12;
854b8e80941Smrgemit_header(gc->pc, X_GLrop_Indexdv, cmdlen);
855b8e80941Smrg(void) memcpy((void *)(gc->pc + 4), (void *)(&c), 8);
856b8e80941Smrggc->pc += cmdlen;
857b8e80941Smrgif (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); }
858848b8605Smrg}
859848b8605Smrg
860848b8605Smrg#define X_GLrop_Indexdv 24
861b8e80941Smrgvoid __indirect_glIndexdv(const GLdouble * c)
862848b8605Smrg{
863b8e80941Smrg    generic_8_byte( X_GLrop_Indexdv, c );
864848b8605Smrg}
865848b8605Smrg
866848b8605Smrg#define X_GLrop_Indexfv 25
867b8e80941Smrgvoid __indirect_glIndexf(GLfloat c)
868848b8605Smrg{
869b8e80941Smrg    struct glx_context * const gc = __glXGetCurrentContext();
870b8e80941Smrg    const GLuint cmdlen = 8;
871b8e80941Smrgemit_header(gc->pc, X_GLrop_Indexfv, cmdlen);
872b8e80941Smrg(void) memcpy((void *)(gc->pc + 4), (void *)(&c), 4);
873b8e80941Smrggc->pc += cmdlen;
874b8e80941Smrgif (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); }
875848b8605Smrg}
876848b8605Smrg
877848b8605Smrg#define X_GLrop_Indexfv 25
878b8e80941Smrgvoid __indirect_glIndexfv(const GLfloat * c)
879848b8605Smrg{
880b8e80941Smrg    generic_4_byte( X_GLrop_Indexfv, c );
881848b8605Smrg}
882848b8605Smrg
883848b8605Smrg#define X_GLrop_Indexiv 26
884b8e80941Smrgvoid __indirect_glIndexi(GLint c)
885848b8605Smrg{
886b8e80941Smrg    struct glx_context * const gc = __glXGetCurrentContext();
887b8e80941Smrg    const GLuint cmdlen = 8;
888b8e80941Smrgemit_header(gc->pc, X_GLrop_Indexiv, cmdlen);
889b8e80941Smrg(void) memcpy((void *)(gc->pc + 4), (void *)(&c), 4);
890b8e80941Smrggc->pc += cmdlen;
891b8e80941Smrgif (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); }
892848b8605Smrg}
893848b8605Smrg
894848b8605Smrg#define X_GLrop_Indexiv 26
895b8e80941Smrgvoid __indirect_glIndexiv(const GLint * c)
896848b8605Smrg{
897b8e80941Smrg    generic_4_byte( X_GLrop_Indexiv, c );
898848b8605Smrg}
899848b8605Smrg
900848b8605Smrg#define X_GLrop_Indexsv 27
901b8e80941Smrgvoid __indirect_glIndexs(GLshort c)
902848b8605Smrg{
903b8e80941Smrg    struct glx_context * const gc = __glXGetCurrentContext();
904b8e80941Smrg    const GLuint cmdlen = 8;
905b8e80941Smrgemit_header(gc->pc, X_GLrop_Indexsv, cmdlen);
906b8e80941Smrg(void) memcpy((void *)(gc->pc + 4), (void *)(&c), 2);
907b8e80941Smrggc->pc += cmdlen;
908b8e80941Smrgif (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); }
909848b8605Smrg}
910848b8605Smrg
911848b8605Smrg#define X_GLrop_Indexsv 27
912b8e80941Smrgvoid __indirect_glIndexsv(const GLshort * c)
913848b8605Smrg{
914b8e80941Smrg    struct glx_context * const gc = __glXGetCurrentContext();
915b8e80941Smrg    const GLuint cmdlen = 8;
916b8e80941Smrgemit_header(gc->pc, X_GLrop_Indexsv, cmdlen);
917b8e80941Smrg(void) memcpy((void *)(gc->pc + 4), (void *)(c), 2);
918b8e80941Smrggc->pc += cmdlen;
919b8e80941Smrgif (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); }
920848b8605Smrg}
921848b8605Smrg
922848b8605Smrg#define X_GLrop_Normal3bv 28
923b8e80941Smrgvoid __indirect_glNormal3b(GLbyte nx, GLbyte ny, GLbyte nz)
924b8e80941Smrg{
925b8e80941Smrg    struct glx_context * const gc = __glXGetCurrentContext();
926b8e80941Smrg    const GLuint cmdlen = 8;
927b8e80941Smrgemit_header(gc->pc, X_GLrop_Normal3bv, cmdlen);
928b8e80941Smrg(void) memcpy((void *)(gc->pc + 4), (void *)(&nx), 1);
929b8e80941Smrg(void) memcpy((void *)(gc->pc + 5), (void *)(&ny), 1);
930b8e80941Smrg(void) memcpy((void *)(gc->pc + 6), (void *)(&nz), 1);
931b8e80941Smrggc->pc += cmdlen;
932b8e80941Smrgif (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); }
933848b8605Smrg}
934848b8605Smrg
935848b8605Smrg#define X_GLrop_Normal3bv 28
936b8e80941Smrgvoid __indirect_glNormal3bv(const GLbyte * v)
937848b8605Smrg{
938b8e80941Smrg    generic_3_byte( X_GLrop_Normal3bv, v );
939848b8605Smrg}
940848b8605Smrg
941848b8605Smrg#define X_GLrop_Normal3dv 29
942b8e80941Smrgvoid __indirect_glNormal3d(GLdouble nx, GLdouble ny, GLdouble nz)
943b8e80941Smrg{
944b8e80941Smrg    struct glx_context * const gc = __glXGetCurrentContext();
945b8e80941Smrg    const GLuint cmdlen = 28;
946b8e80941Smrgemit_header(gc->pc, X_GLrop_Normal3dv, cmdlen);
947b8e80941Smrg(void) memcpy((void *)(gc->pc + 4), (void *)(&nx), 8);
948b8e80941Smrg(void) memcpy((void *)(gc->pc + 12), (void *)(&ny), 8);
949b8e80941Smrg(void) memcpy((void *)(gc->pc + 20), (void *)(&nz), 8);
950b8e80941Smrggc->pc += cmdlen;
951b8e80941Smrgif (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); }
952848b8605Smrg}
953848b8605Smrg
954848b8605Smrg#define X_GLrop_Normal3dv 29
955b8e80941Smrgvoid __indirect_glNormal3dv(const GLdouble * v)
956848b8605Smrg{
957b8e80941Smrg    generic_24_byte( X_GLrop_Normal3dv, v );
958848b8605Smrg}
959848b8605Smrg
960848b8605Smrg#define X_GLrop_Normal3fv 30
961b8e80941Smrgvoid __indirect_glNormal3f(GLfloat nx, GLfloat ny, GLfloat nz)
962b8e80941Smrg{
963b8e80941Smrg    struct glx_context * const gc = __glXGetCurrentContext();
964b8e80941Smrg    const GLuint cmdlen = 16;
965b8e80941Smrgemit_header(gc->pc, X_GLrop_Normal3fv, cmdlen);
966b8e80941Smrg(void) memcpy((void *)(gc->pc + 4), (void *)(&nx), 4);
967b8e80941Smrg(void) memcpy((void *)(gc->pc + 8), (void *)(&ny), 4);
968b8e80941Smrg(void) memcpy((void *)(gc->pc + 12), (void *)(&nz), 4);
969b8e80941Smrggc->pc += cmdlen;
970b8e80941Smrgif (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); }
971848b8605Smrg}
972848b8605Smrg
973848b8605Smrg#define X_GLrop_Normal3fv 30
974b8e80941Smrgvoid __indirect_glNormal3fv(const GLfloat * v)
975848b8605Smrg{
976b8e80941Smrg    generic_12_byte( X_GLrop_Normal3fv, v );
977848b8605Smrg}
978848b8605Smrg
979848b8605Smrg#define X_GLrop_Normal3iv 31
980b8e80941Smrgvoid __indirect_glNormal3i(GLint nx, GLint ny, GLint nz)
981b8e80941Smrg{
982b8e80941Smrg    struct glx_context * const gc = __glXGetCurrentContext();
983b8e80941Smrg    const GLuint cmdlen = 16;
984b8e80941Smrgemit_header(gc->pc, X_GLrop_Normal3iv, cmdlen);
985b8e80941Smrg(void) memcpy((void *)(gc->pc + 4), (void *)(&nx), 4);
986b8e80941Smrg(void) memcpy((void *)(gc->pc + 8), (void *)(&ny), 4);
987b8e80941Smrg(void) memcpy((void *)(gc->pc + 12), (void *)(&nz), 4);
988b8e80941Smrggc->pc += cmdlen;
989b8e80941Smrgif (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); }
990848b8605Smrg}
991848b8605Smrg
992848b8605Smrg#define X_GLrop_Normal3iv 31
993b8e80941Smrgvoid __indirect_glNormal3iv(const GLint * v)
994848b8605Smrg{
995b8e80941Smrg    generic_12_byte( X_GLrop_Normal3iv, v );
996848b8605Smrg}
997848b8605Smrg
998848b8605Smrg#define X_GLrop_Normal3sv 32
999b8e80941Smrgvoid __indirect_glNormal3s(GLshort nx, GLshort ny, GLshort nz)
1000b8e80941Smrg{
1001b8e80941Smrg    struct glx_context * const gc = __glXGetCurrentContext();
1002b8e80941Smrg    const GLuint cmdlen = 12;
1003b8e80941Smrgemit_header(gc->pc, X_GLrop_Normal3sv, cmdlen);
1004b8e80941Smrg(void) memcpy((void *)(gc->pc + 4), (void *)(&nx), 2);
1005b8e80941Smrg(void) memcpy((void *)(gc->pc + 6), (void *)(&ny), 2);
1006b8e80941Smrg(void) memcpy((void *)(gc->pc + 8), (void *)(&nz), 2);
1007b8e80941Smrggc->pc += cmdlen;
1008b8e80941Smrgif (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); }
1009848b8605Smrg}
1010848b8605Smrg
1011848b8605Smrg#define X_GLrop_Normal3sv 32
1012b8e80941Smrgvoid __indirect_glNormal3sv(const GLshort * v)
1013848b8605Smrg{
1014b8e80941Smrg    generic_6_byte( X_GLrop_Normal3sv, v );
1015848b8605Smrg}
1016848b8605Smrg
1017848b8605Smrg#define X_GLrop_RasterPos2dv 33
1018b8e80941Smrgvoid __indirect_glRasterPos2d(GLdouble x, GLdouble y)
1019b8e80941Smrg{
1020b8e80941Smrg    struct glx_context * const gc = __glXGetCurrentContext();
1021b8e80941Smrg    const GLuint cmdlen = 20;
1022b8e80941Smrgemit_header(gc->pc, X_GLrop_RasterPos2dv, cmdlen);
1023b8e80941Smrg(void) memcpy((void *)(gc->pc + 4), (void *)(&x), 8);
1024b8e80941Smrg(void) memcpy((void *)(gc->pc + 12), (void *)(&y), 8);
1025b8e80941Smrggc->pc += cmdlen;
1026b8e80941Smrgif (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); }
1027848b8605Smrg}
1028848b8605Smrg
1029848b8605Smrg#define X_GLrop_RasterPos2dv 33
1030b8e80941Smrgvoid __indirect_glRasterPos2dv(const GLdouble * v)
1031848b8605Smrg{
1032b8e80941Smrg    generic_16_byte( X_GLrop_RasterPos2dv, v );
1033848b8605Smrg}
1034848b8605Smrg
1035848b8605Smrg#define X_GLrop_RasterPos2fv 34
1036b8e80941Smrgvoid __indirect_glRasterPos2f(GLfloat x, GLfloat y)
1037b8e80941Smrg{
1038b8e80941Smrg    struct glx_context * const gc = __glXGetCurrentContext();
1039b8e80941Smrg    const GLuint cmdlen = 12;
1040b8e80941Smrgemit_header(gc->pc, X_GLrop_RasterPos2fv, cmdlen);
1041b8e80941Smrg(void) memcpy((void *)(gc->pc + 4), (void *)(&x), 4);
1042b8e80941Smrg(void) memcpy((void *)(gc->pc + 8), (void *)(&y), 4);
1043b8e80941Smrggc->pc += cmdlen;
1044b8e80941Smrgif (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); }
1045848b8605Smrg}
1046848b8605Smrg
1047848b8605Smrg#define X_GLrop_RasterPos2fv 34
1048b8e80941Smrgvoid __indirect_glRasterPos2fv(const GLfloat * v)
1049848b8605Smrg{
1050b8e80941Smrg    generic_8_byte( X_GLrop_RasterPos2fv, v );
1051848b8605Smrg}
1052848b8605Smrg
1053848b8605Smrg#define X_GLrop_RasterPos2iv 35
1054b8e80941Smrgvoid __indirect_glRasterPos2i(GLint x, GLint y)
1055b8e80941Smrg{
1056b8e80941Smrg    struct glx_context * const gc = __glXGetCurrentContext();
1057b8e80941Smrg    const GLuint cmdlen = 12;
1058b8e80941Smrgemit_header(gc->pc, X_GLrop_RasterPos2iv, cmdlen);
1059b8e80941Smrg(void) memcpy((void *)(gc->pc + 4), (void *)(&x), 4);
1060b8e80941Smrg(void) memcpy((void *)(gc->pc + 8), (void *)(&y), 4);
1061b8e80941Smrggc->pc += cmdlen;
1062b8e80941Smrgif (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); }
1063848b8605Smrg}
1064848b8605Smrg
1065848b8605Smrg#define X_GLrop_RasterPos2iv 35
1066b8e80941Smrgvoid __indirect_glRasterPos2iv(const GLint * v)
1067848b8605Smrg{
1068b8e80941Smrg    generic_8_byte( X_GLrop_RasterPos2iv, v );
1069848b8605Smrg}
1070848b8605Smrg
1071848b8605Smrg#define X_GLrop_RasterPos2sv 36
1072b8e80941Smrgvoid __indirect_glRasterPos2s(GLshort x, GLshort y)
1073b8e80941Smrg{
1074b8e80941Smrg    struct glx_context * const gc = __glXGetCurrentContext();
1075b8e80941Smrg    const GLuint cmdlen = 8;
1076b8e80941Smrgemit_header(gc->pc, X_GLrop_RasterPos2sv, cmdlen);
1077b8e80941Smrg(void) memcpy((void *)(gc->pc + 4), (void *)(&x), 2);
1078b8e80941Smrg(void) memcpy((void *)(gc->pc + 6), (void *)(&y), 2);
1079b8e80941Smrggc->pc += cmdlen;
1080b8e80941Smrgif (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); }
1081848b8605Smrg}
1082848b8605Smrg
1083848b8605Smrg#define X_GLrop_RasterPos2sv 36
1084b8e80941Smrgvoid __indirect_glRasterPos2sv(const GLshort * v)
1085848b8605Smrg{
1086b8e80941Smrg    generic_4_byte( X_GLrop_RasterPos2sv, v );
1087848b8605Smrg}
1088848b8605Smrg
1089848b8605Smrg#define X_GLrop_RasterPos3dv 37
1090b8e80941Smrgvoid __indirect_glRasterPos3d(GLdouble x, GLdouble y, GLdouble z)
1091b8e80941Smrg{
1092b8e80941Smrg    struct glx_context * const gc = __glXGetCurrentContext();
1093b8e80941Smrg    const GLuint cmdlen = 28;
1094b8e80941Smrgemit_header(gc->pc, X_GLrop_RasterPos3dv, cmdlen);
1095b8e80941Smrg(void) memcpy((void *)(gc->pc + 4), (void *)(&x), 8);
1096b8e80941Smrg(void) memcpy((void *)(gc->pc + 12), (void *)(&y), 8);
1097b8e80941Smrg(void) memcpy((void *)(gc->pc + 20), (void *)(&z), 8);
1098b8e80941Smrggc->pc += cmdlen;
1099b8e80941Smrgif (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); }
1100848b8605Smrg}
1101848b8605Smrg
1102848b8605Smrg#define X_GLrop_RasterPos3dv 37
1103b8e80941Smrgvoid __indirect_glRasterPos3dv(const GLdouble * v)
1104848b8605Smrg{
1105b8e80941Smrg    generic_24_byte( X_GLrop_RasterPos3dv, v );
1106848b8605Smrg}
1107848b8605Smrg
1108848b8605Smrg#define X_GLrop_RasterPos3fv 38
1109b8e80941Smrgvoid __indirect_glRasterPos3f(GLfloat x, GLfloat y, GLfloat z)
1110b8e80941Smrg{
1111b8e80941Smrg    struct glx_context * const gc = __glXGetCurrentContext();
1112b8e80941Smrg    const GLuint cmdlen = 16;
1113b8e80941Smrgemit_header(gc->pc, X_GLrop_RasterPos3fv, cmdlen);
1114b8e80941Smrg(void) memcpy((void *)(gc->pc + 4), (void *)(&x), 4);
1115b8e80941Smrg(void) memcpy((void *)(gc->pc + 8), (void *)(&y), 4);
1116b8e80941Smrg(void) memcpy((void *)(gc->pc + 12), (void *)(&z), 4);
1117b8e80941Smrggc->pc += cmdlen;
1118b8e80941Smrgif (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); }
1119848b8605Smrg}
1120848b8605Smrg
1121848b8605Smrg#define X_GLrop_RasterPos3fv 38
1122b8e80941Smrgvoid __indirect_glRasterPos3fv(const GLfloat * v)
1123848b8605Smrg{
1124b8e80941Smrg    generic_12_byte( X_GLrop_RasterPos3fv, v );
1125848b8605Smrg}
1126848b8605Smrg
1127848b8605Smrg#define X_GLrop_RasterPos3iv 39
1128b8e80941Smrgvoid __indirect_glRasterPos3i(GLint x, GLint y, GLint z)
1129b8e80941Smrg{
1130b8e80941Smrg    struct glx_context * const gc = __glXGetCurrentContext();
1131b8e80941Smrg    const GLuint cmdlen = 16;
1132b8e80941Smrgemit_header(gc->pc, X_GLrop_RasterPos3iv, cmdlen);
1133b8e80941Smrg(void) memcpy((void *)(gc->pc + 4), (void *)(&x), 4);
1134b8e80941Smrg(void) memcpy((void *)(gc->pc + 8), (void *)(&y), 4);
1135b8e80941Smrg(void) memcpy((void *)(gc->pc + 12), (void *)(&z), 4);
1136b8e80941Smrggc->pc += cmdlen;
1137b8e80941Smrgif (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); }
1138848b8605Smrg}
1139848b8605Smrg
1140848b8605Smrg#define X_GLrop_RasterPos3iv 39
1141b8e80941Smrgvoid __indirect_glRasterPos3iv(const GLint * v)
1142848b8605Smrg{
1143b8e80941Smrg    generic_12_byte( X_GLrop_RasterPos3iv, v );
1144848b8605Smrg}
1145848b8605Smrg
1146848b8605Smrg#define X_GLrop_RasterPos3sv 40
1147b8e80941Smrgvoid __indirect_glRasterPos3s(GLshort x, GLshort y, GLshort z)
1148b8e80941Smrg{
1149b8e80941Smrg    struct glx_context * const gc = __glXGetCurrentContext();
1150b8e80941Smrg    const GLuint cmdlen = 12;
1151b8e80941Smrgemit_header(gc->pc, X_GLrop_RasterPos3sv, cmdlen);
1152b8e80941Smrg(void) memcpy((void *)(gc->pc + 4), (void *)(&x), 2);
1153b8e80941Smrg(void) memcpy((void *)(gc->pc + 6), (void *)(&y), 2);
1154b8e80941Smrg(void) memcpy((void *)(gc->pc + 8), (void *)(&z), 2);
1155b8e80941Smrggc->pc += cmdlen;
1156b8e80941Smrgif (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); }
1157848b8605Smrg}
1158848b8605Smrg
1159848b8605Smrg#define X_GLrop_RasterPos3sv 40
1160b8e80941Smrgvoid __indirect_glRasterPos3sv(const GLshort * v)
1161848b8605Smrg{
1162b8e80941Smrg    generic_6_byte( X_GLrop_RasterPos3sv, v );
1163848b8605Smrg}
1164848b8605Smrg
1165848b8605Smrg#define X_GLrop_RasterPos4dv 41
1166b8e80941Smrgvoid __indirect_glRasterPos4d(GLdouble x, GLdouble y, GLdouble z, GLdouble w)
1167b8e80941Smrg{
1168b8e80941Smrg    struct glx_context * const gc = __glXGetCurrentContext();
1169b8e80941Smrg    const GLuint cmdlen = 36;
1170b8e80941Smrgemit_header(gc->pc, X_GLrop_RasterPos4dv, cmdlen);
1171b8e80941Smrg(void) memcpy((void *)(gc->pc + 4), (void *)(&x), 8);
1172b8e80941Smrg(void) memcpy((void *)(gc->pc + 12), (void *)(&y), 8);
1173b8e80941Smrg(void) memcpy((void *)(gc->pc + 20), (void *)(&z), 8);
1174b8e80941Smrg(void) memcpy((void *)(gc->pc + 28), (void *)(&w), 8);
1175b8e80941Smrggc->pc += cmdlen;
1176b8e80941Smrgif (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); }
1177848b8605Smrg}
1178848b8605Smrg
1179848b8605Smrg#define X_GLrop_RasterPos4dv 41
1180b8e80941Smrgvoid __indirect_glRasterPos4dv(const GLdouble * v)
1181848b8605Smrg{
1182b8e80941Smrg    generic_32_byte( X_GLrop_RasterPos4dv, v );
1183848b8605Smrg}
1184848b8605Smrg
1185848b8605Smrg#define X_GLrop_RasterPos4fv 42
1186b8e80941Smrgvoid __indirect_glRasterPos4f(GLfloat x, GLfloat y, GLfloat z, GLfloat w)
1187b8e80941Smrg{
1188b8e80941Smrg    struct glx_context * const gc = __glXGetCurrentContext();
1189b8e80941Smrg    const GLuint cmdlen = 20;
1190b8e80941Smrgemit_header(gc->pc, X_GLrop_RasterPos4fv, cmdlen);
1191b8e80941Smrg(void) memcpy((void *)(gc->pc + 4), (void *)(&x), 4);
1192b8e80941Smrg(void) memcpy((void *)(gc->pc + 8), (void *)(&y), 4);
1193b8e80941Smrg(void) memcpy((void *)(gc->pc + 12), (void *)(&z), 4);
1194b8e80941Smrg(void) memcpy((void *)(gc->pc + 16), (void *)(&w), 4);
1195b8e80941Smrggc->pc += cmdlen;
1196b8e80941Smrgif (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); }
1197848b8605Smrg}
1198848b8605Smrg
1199848b8605Smrg#define X_GLrop_RasterPos4fv 42
1200b8e80941Smrgvoid __indirect_glRasterPos4fv(const GLfloat * v)
1201848b8605Smrg{
1202b8e80941Smrg    generic_16_byte( X_GLrop_RasterPos4fv, v );
1203848b8605Smrg}
1204848b8605Smrg
1205848b8605Smrg#define X_GLrop_RasterPos4iv 43
1206b8e80941Smrgvoid __indirect_glRasterPos4i(GLint x, GLint y, GLint z, GLint w)
1207b8e80941Smrg{
1208b8e80941Smrg    struct glx_context * const gc = __glXGetCurrentContext();
1209b8e80941Smrg    const GLuint cmdlen = 20;
1210b8e80941Smrgemit_header(gc->pc, X_GLrop_RasterPos4iv, cmdlen);
1211b8e80941Smrg(void) memcpy((void *)(gc->pc + 4), (void *)(&x), 4);
1212b8e80941Smrg(void) memcpy((void *)(gc->pc + 8), (void *)(&y), 4);
1213b8e80941Smrg(void) memcpy((void *)(gc->pc + 12), (void *)(&z), 4);
1214b8e80941Smrg(void) memcpy((void *)(gc->pc + 16), (void *)(&w), 4);
1215b8e80941Smrggc->pc += cmdlen;
1216b8e80941Smrgif (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); }
1217848b8605Smrg}
1218848b8605Smrg
1219848b8605Smrg#define X_GLrop_RasterPos4iv 43
1220b8e80941Smrgvoid __indirect_glRasterPos4iv(const GLint * v)
1221848b8605Smrg{
1222b8e80941Smrg    generic_16_byte( X_GLrop_RasterPos4iv, v );
1223848b8605Smrg}
1224848b8605Smrg
1225848b8605Smrg#define X_GLrop_RasterPos4sv 44
1226b8e80941Smrgvoid __indirect_glRasterPos4s(GLshort x, GLshort y, GLshort z, GLshort w)
1227b8e80941Smrg{
1228b8e80941Smrg    struct glx_context * const gc = __glXGetCurrentContext();
1229b8e80941Smrg    const GLuint cmdlen = 12;
1230b8e80941Smrgemit_header(gc->pc, X_GLrop_RasterPos4sv, cmdlen);
1231b8e80941Smrg(void) memcpy((void *)(gc->pc + 4), (void *)(&x), 2);
1232b8e80941Smrg(void) memcpy((void *)(gc->pc + 6), (void *)(&y), 2);
1233b8e80941Smrg(void) memcpy((void *)(gc->pc + 8), (void *)(&z), 2);
1234b8e80941Smrg(void) memcpy((void *)(gc->pc + 10), (void *)(&w), 2);
1235b8e80941Smrggc->pc += cmdlen;
1236b8e80941Smrgif (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); }
1237848b8605Smrg}
1238848b8605Smrg
1239848b8605Smrg#define X_GLrop_RasterPos4sv 44
1240b8e80941Smrgvoid __indirect_glRasterPos4sv(const GLshort * v)
1241848b8605Smrg{
1242b8e80941Smrg    generic_8_byte( X_GLrop_RasterPos4sv, v );
1243848b8605Smrg}
1244848b8605Smrg
1245848b8605Smrg#define X_GLrop_Rectdv 45
1246b8e80941Smrgvoid __indirect_glRectd(GLdouble x1, GLdouble y1, GLdouble x2, GLdouble y2)
1247b8e80941Smrg{
1248b8e80941Smrg    struct glx_context * const gc = __glXGetCurrentContext();
1249b8e80941Smrg    const GLuint cmdlen = 36;
1250b8e80941Smrgemit_header(gc->pc, X_GLrop_Rectdv, cmdlen);
1251b8e80941Smrg(void) memcpy((void *)(gc->pc + 4), (void *)(&x1), 8);
1252b8e80941Smrg(void) memcpy((void *)(gc->pc + 12), (void *)(&y1), 8);
1253b8e80941Smrg(void) memcpy((void *)(gc->pc + 20), (void *)(&x2), 8);
1254b8e80941Smrg(void) memcpy((void *)(gc->pc + 28), (void *)(&y2), 8);
1255b8e80941Smrggc->pc += cmdlen;
1256b8e80941Smrgif (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); }
1257848b8605Smrg}
1258848b8605Smrg
1259848b8605Smrg#define X_GLrop_Rectdv 45
1260b8e80941Smrgvoid __indirect_glRectdv(const GLdouble * v1, const GLdouble * v2)
1261b8e80941Smrg{
1262b8e80941Smrg    struct glx_context * const gc = __glXGetCurrentContext();
1263b8e80941Smrg    const GLuint cmdlen = 36;
1264b8e80941Smrgemit_header(gc->pc, X_GLrop_Rectdv, cmdlen);
1265b8e80941Smrg(void) memcpy((void *)(gc->pc + 4), (void *)(v1), 16);
1266b8e80941Smrg(void) memcpy((void *)(gc->pc + 20), (void *)(v2), 16);
1267b8e80941Smrggc->pc += cmdlen;
1268b8e80941Smrgif (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); }
1269848b8605Smrg}
1270848b8605Smrg
1271848b8605Smrg#define X_GLrop_Rectfv 46
1272b8e80941Smrgvoid __indirect_glRectf(GLfloat x1, GLfloat y1, GLfloat x2, GLfloat y2)
1273b8e80941Smrg{
1274b8e80941Smrg    struct glx_context * const gc = __glXGetCurrentContext();
1275b8e80941Smrg    const GLuint cmdlen = 20;
1276b8e80941Smrgemit_header(gc->pc, X_GLrop_Rectfv, cmdlen);
1277b8e80941Smrg(void) memcpy((void *)(gc->pc + 4), (void *)(&x1), 4);
1278b8e80941Smrg(void) memcpy((void *)(gc->pc + 8), (void *)(&y1), 4);
1279b8e80941Smrg(void) memcpy((void *)(gc->pc + 12), (void *)(&x2), 4);
1280b8e80941Smrg(void) memcpy((void *)(gc->pc + 16), (void *)(&y2), 4);
1281b8e80941Smrggc->pc += cmdlen;
1282b8e80941Smrgif (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); }
1283848b8605Smrg}
1284848b8605Smrg
1285848b8605Smrg#define X_GLrop_Rectfv 46
1286b8e80941Smrgvoid __indirect_glRectfv(const GLfloat * v1, const GLfloat * v2)
1287b8e80941Smrg{
1288b8e80941Smrg    struct glx_context * const gc = __glXGetCurrentContext();
1289b8e80941Smrg    const GLuint cmdlen = 20;
1290b8e80941Smrgemit_header(gc->pc, X_GLrop_Rectfv, cmdlen);
1291b8e80941Smrg(void) memcpy((void *)(gc->pc + 4), (void *)(v1), 8);
1292b8e80941Smrg(void) memcpy((void *)(gc->pc + 12), (void *)(v2), 8);
1293b8e80941Smrggc->pc += cmdlen;
1294b8e80941Smrgif (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); }
1295848b8605Smrg}
1296848b8605Smrg
1297848b8605Smrg#define X_GLrop_Rectiv 47
1298b8e80941Smrgvoid __indirect_glRecti(GLint x1, GLint y1, GLint x2, GLint y2)
1299b8e80941Smrg{
1300b8e80941Smrg    struct glx_context * const gc = __glXGetCurrentContext();
1301b8e80941Smrg    const GLuint cmdlen = 20;
1302b8e80941Smrgemit_header(gc->pc, X_GLrop_Rectiv, cmdlen);
1303b8e80941Smrg(void) memcpy((void *)(gc->pc + 4), (void *)(&x1), 4);
1304b8e80941Smrg(void) memcpy((void *)(gc->pc + 8), (void *)(&y1), 4);
1305b8e80941Smrg(void) memcpy((void *)(gc->pc + 12), (void *)(&x2), 4);
1306b8e80941Smrg(void) memcpy((void *)(gc->pc + 16), (void *)(&y2), 4);
1307b8e80941Smrggc->pc += cmdlen;
1308b8e80941Smrgif (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); }
1309848b8605Smrg}
1310848b8605Smrg
1311848b8605Smrg#define X_GLrop_Rectiv 47
1312b8e80941Smrgvoid __indirect_glRectiv(const GLint * v1, const GLint * v2)
1313b8e80941Smrg{
1314b8e80941Smrg    struct glx_context * const gc = __glXGetCurrentContext();
1315b8e80941Smrg    const GLuint cmdlen = 20;
1316b8e80941Smrgemit_header(gc->pc, X_GLrop_Rectiv, cmdlen);
1317b8e80941Smrg(void) memcpy((void *)(gc->pc + 4), (void *)(v1), 8);
1318b8e80941Smrg(void) memcpy((void *)(gc->pc + 12), (void *)(v2), 8);
1319b8e80941Smrggc->pc += cmdlen;
1320b8e80941Smrgif (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); }
1321848b8605Smrg}
1322848b8605Smrg
1323848b8605Smrg#define X_GLrop_Rectsv 48
1324b8e80941Smrgvoid __indirect_glRects(GLshort x1, GLshort y1, GLshort x2, GLshort y2)
1325b8e80941Smrg{
1326b8e80941Smrg    struct glx_context * const gc = __glXGetCurrentContext();
1327b8e80941Smrg    const GLuint cmdlen = 12;
1328b8e80941Smrgemit_header(gc->pc, X_GLrop_Rectsv, cmdlen);
1329b8e80941Smrg(void) memcpy((void *)(gc->pc + 4), (void *)(&x1), 2);
1330b8e80941Smrg(void) memcpy((void *)(gc->pc + 6), (void *)(&y1), 2);
1331b8e80941Smrg(void) memcpy((void *)(gc->pc + 8), (void *)(&x2), 2);
1332b8e80941Smrg(void) memcpy((void *)(gc->pc + 10), (void *)(&y2), 2);
1333b8e80941Smrggc->pc += cmdlen;
1334b8e80941Smrgif (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); }
1335848b8605Smrg}
1336848b8605Smrg
1337848b8605Smrg#define X_GLrop_Rectsv 48
1338b8e80941Smrgvoid __indirect_glRectsv(const GLshort * v1, const GLshort * v2)
1339b8e80941Smrg{
1340b8e80941Smrg    struct glx_context * const gc = __glXGetCurrentContext();
1341b8e80941Smrg    const GLuint cmdlen = 12;
1342b8e80941Smrgemit_header(gc->pc, X_GLrop_Rectsv, cmdlen);
1343b8e80941Smrg(void) memcpy((void *)(gc->pc + 4), (void *)(v1), 4);
1344b8e80941Smrg(void) memcpy((void *)(gc->pc + 8), (void *)(v2), 4);
1345b8e80941Smrggc->pc += cmdlen;
1346b8e80941Smrgif (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); }
1347848b8605Smrg}
1348848b8605Smrg
1349848b8605Smrg#define X_GLrop_TexCoord1dv 49
1350b8e80941Smrgvoid __indirect_glTexCoord1d(GLdouble s)
1351848b8605Smrg{
1352b8e80941Smrg    struct glx_context * const gc = __glXGetCurrentContext();
1353b8e80941Smrg    const GLuint cmdlen = 12;
1354b8e80941Smrgemit_header(gc->pc, X_GLrop_TexCoord1dv, cmdlen);
1355b8e80941Smrg(void) memcpy((void *)(gc->pc + 4), (void *)(&s), 8);
1356b8e80941Smrggc->pc += cmdlen;
1357b8e80941Smrgif (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); }
1358848b8605Smrg}
1359848b8605Smrg
1360848b8605Smrg#define X_GLrop_TexCoord1dv 49
1361b8e80941Smrgvoid __indirect_glTexCoord1dv(const GLdouble * v)
1362848b8605Smrg{
1363b8e80941Smrg    generic_8_byte( X_GLrop_TexCoord1dv, v );
1364848b8605Smrg}
1365848b8605Smrg
1366848b8605Smrg#define X_GLrop_TexCoord1fv 50
1367b8e80941Smrgvoid __indirect_glTexCoord1f(GLfloat s)
1368848b8605Smrg{
1369b8e80941Smrg    struct glx_context * const gc = __glXGetCurrentContext();
1370b8e80941Smrg    const GLuint cmdlen = 8;
1371b8e80941Smrgemit_header(gc->pc, X_GLrop_TexCoord1fv, cmdlen);
1372b8e80941Smrg(void) memcpy((void *)(gc->pc + 4), (void *)(&s), 4);
1373b8e80941Smrggc->pc += cmdlen;
1374b8e80941Smrgif (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); }
1375848b8605Smrg}
1376848b8605Smrg
1377848b8605Smrg#define X_GLrop_TexCoord1fv 50
1378b8e80941Smrgvoid __indirect_glTexCoord1fv(const GLfloat * v)
1379848b8605Smrg{
1380b8e80941Smrg    generic_4_byte( X_GLrop_TexCoord1fv, v );
1381848b8605Smrg}
1382848b8605Smrg
1383848b8605Smrg#define X_GLrop_TexCoord1iv 51
1384b8e80941Smrgvoid __indirect_glTexCoord1i(GLint s)
1385848b8605Smrg{
1386b8e80941Smrg    struct glx_context * const gc = __glXGetCurrentContext();
1387b8e80941Smrg    const GLuint cmdlen = 8;
1388b8e80941Smrgemit_header(gc->pc, X_GLrop_TexCoord1iv, cmdlen);
1389b8e80941Smrg(void) memcpy((void *)(gc->pc + 4), (void *)(&s), 4);
1390b8e80941Smrggc->pc += cmdlen;
1391b8e80941Smrgif (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); }
1392848b8605Smrg}
1393848b8605Smrg
1394848b8605Smrg#define X_GLrop_TexCoord1iv 51
1395b8e80941Smrgvoid __indirect_glTexCoord1iv(const GLint * v)
1396848b8605Smrg{
1397b8e80941Smrg    generic_4_byte( X_GLrop_TexCoord1iv, v );
1398848b8605Smrg}
1399848b8605Smrg
1400848b8605Smrg#define X_GLrop_TexCoord1sv 52
1401b8e80941Smrgvoid __indirect_glTexCoord1s(GLshort s)
1402848b8605Smrg{
1403b8e80941Smrg    struct glx_context * const gc = __glXGetCurrentContext();
1404b8e80941Smrg    const GLuint cmdlen = 8;
1405b8e80941Smrgemit_header(gc->pc, X_GLrop_TexCoord1sv, cmdlen);
1406b8e80941Smrg(void) memcpy((void *)(gc->pc + 4), (void *)(&s), 2);
1407b8e80941Smrggc->pc += cmdlen;
1408b8e80941Smrgif (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); }
1409848b8605Smrg}
1410848b8605Smrg
1411848b8605Smrg#define X_GLrop_TexCoord1sv 52
1412b8e80941Smrgvoid __indirect_glTexCoord1sv(const GLshort * v)
1413848b8605Smrg{
1414b8e80941Smrg    struct glx_context * const gc = __glXGetCurrentContext();
1415b8e80941Smrg    const GLuint cmdlen = 8;
1416b8e80941Smrgemit_header(gc->pc, X_GLrop_TexCoord1sv, cmdlen);
1417b8e80941Smrg(void) memcpy((void *)(gc->pc + 4), (void *)(v), 2);
1418b8e80941Smrggc->pc += cmdlen;
1419b8e80941Smrgif (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); }
1420848b8605Smrg}
1421848b8605Smrg
1422848b8605Smrg#define X_GLrop_TexCoord2dv 53
1423b8e80941Smrgvoid __indirect_glTexCoord2d(GLdouble s, GLdouble t)
1424b8e80941Smrg{
1425b8e80941Smrg    struct glx_context * const gc = __glXGetCurrentContext();
1426b8e80941Smrg    const GLuint cmdlen = 20;
1427b8e80941Smrgemit_header(gc->pc, X_GLrop_TexCoord2dv, cmdlen);
1428b8e80941Smrg(void) memcpy((void *)(gc->pc + 4), (void *)(&s), 8);
1429b8e80941Smrg(void) memcpy((void *)(gc->pc + 12), (void *)(&t), 8);
1430b8e80941Smrggc->pc += cmdlen;
1431b8e80941Smrgif (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); }
1432848b8605Smrg}
1433848b8605Smrg
1434848b8605Smrg#define X_GLrop_TexCoord2dv 53
1435b8e80941Smrgvoid __indirect_glTexCoord2dv(const GLdouble * v)
1436848b8605Smrg{
1437b8e80941Smrg    generic_16_byte( X_GLrop_TexCoord2dv, v );
1438848b8605Smrg}
1439848b8605Smrg
1440848b8605Smrg#define X_GLrop_TexCoord2fv 54
1441b8e80941Smrgvoid __indirect_glTexCoord2f(GLfloat s, GLfloat t)
1442b8e80941Smrg{
1443b8e80941Smrg    struct glx_context * const gc = __glXGetCurrentContext();
1444b8e80941Smrg    const GLuint cmdlen = 12;
1445b8e80941Smrgemit_header(gc->pc, X_GLrop_TexCoord2fv, cmdlen);
1446b8e80941Smrg(void) memcpy((void *)(gc->pc + 4), (void *)(&s), 4);
1447b8e80941Smrg(void) memcpy((void *)(gc->pc + 8), (void *)(&t), 4);
1448b8e80941Smrggc->pc += cmdlen;
1449b8e80941Smrgif (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); }
1450848b8605Smrg}
1451848b8605Smrg
1452848b8605Smrg#define X_GLrop_TexCoord2fv 54
1453b8e80941Smrgvoid __indirect_glTexCoord2fv(const GLfloat * v)
1454848b8605Smrg{
1455b8e80941Smrg    generic_8_byte( X_GLrop_TexCoord2fv, v );
1456848b8605Smrg}
1457848b8605Smrg
1458848b8605Smrg#define X_GLrop_TexCoord2iv 55
1459b8e80941Smrgvoid __indirect_glTexCoord2i(GLint s, GLint t)
1460b8e80941Smrg{
1461b8e80941Smrg    struct glx_context * const gc = __glXGetCurrentContext();
1462b8e80941Smrg    const GLuint cmdlen = 12;
1463b8e80941Smrgemit_header(gc->pc, X_GLrop_TexCoord2iv, cmdlen);
1464b8e80941Smrg(void) memcpy((void *)(gc->pc + 4), (void *)(&s), 4);
1465b8e80941Smrg(void) memcpy((void *)(gc->pc + 8), (void *)(&t), 4);
1466b8e80941Smrggc->pc += cmdlen;
1467b8e80941Smrgif (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); }
1468848b8605Smrg}
1469848b8605Smrg
1470848b8605Smrg#define X_GLrop_TexCoord2iv 55
1471b8e80941Smrgvoid __indirect_glTexCoord2iv(const GLint * v)
1472848b8605Smrg{
1473b8e80941Smrg    generic_8_byte( X_GLrop_TexCoord2iv, v );
1474848b8605Smrg}
1475848b8605Smrg
1476848b8605Smrg#define X_GLrop_TexCoord2sv 56
1477b8e80941Smrgvoid __indirect_glTexCoord2s(GLshort s, GLshort t)
1478b8e80941Smrg{
1479b8e80941Smrg    struct glx_context * const gc = __glXGetCurrentContext();
1480b8e80941Smrg    const GLuint cmdlen = 8;
1481b8e80941Smrgemit_header(gc->pc, X_GLrop_TexCoord2sv, cmdlen);
1482b8e80941Smrg(void) memcpy((void *)(gc->pc + 4), (void *)(&s), 2);
1483b8e80941Smrg(void) memcpy((void *)(gc->pc + 6), (void *)(&t), 2);
1484b8e80941Smrggc->pc += cmdlen;
1485b8e80941Smrgif (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); }
1486848b8605Smrg}
1487848b8605Smrg
1488848b8605Smrg#define X_GLrop_TexCoord2sv 56
1489b8e80941Smrgvoid __indirect_glTexCoord2sv(const GLshort * v)
1490848b8605Smrg{
1491b8e80941Smrg    generic_4_byte( X_GLrop_TexCoord2sv, v );
1492848b8605Smrg}
1493848b8605Smrg
1494848b8605Smrg#define X_GLrop_TexCoord3dv 57
1495b8e80941Smrgvoid __indirect_glTexCoord3d(GLdouble s, GLdouble t, GLdouble r)
1496b8e80941Smrg{
1497b8e80941Smrg    struct glx_context * const gc = __glXGetCurrentContext();
1498b8e80941Smrg    const GLuint cmdlen = 28;
1499b8e80941Smrgemit_header(gc->pc, X_GLrop_TexCoord3dv, cmdlen);
1500b8e80941Smrg(void) memcpy((void *)(gc->pc + 4), (void *)(&s), 8);
1501b8e80941Smrg(void) memcpy((void *)(gc->pc + 12), (void *)(&t), 8);
1502b8e80941Smrg(void) memcpy((void *)(gc->pc + 20), (void *)(&r), 8);
1503b8e80941Smrggc->pc += cmdlen;
1504b8e80941Smrgif (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); }
1505848b8605Smrg}
1506848b8605Smrg
1507848b8605Smrg#define X_GLrop_TexCoord3dv 57
1508b8e80941Smrgvoid __indirect_glTexCoord3dv(const GLdouble * v)
1509848b8605Smrg{
1510b8e80941Smrg    generic_24_byte( X_GLrop_TexCoord3dv, v );
1511848b8605Smrg}
1512848b8605Smrg
1513848b8605Smrg#define X_GLrop_TexCoord3fv 58
1514b8e80941Smrgvoid __indirect_glTexCoord3f(GLfloat s, GLfloat t, GLfloat r)
1515b8e80941Smrg{
1516b8e80941Smrg    struct glx_context * const gc = __glXGetCurrentContext();
1517b8e80941Smrg    const GLuint cmdlen = 16;
1518b8e80941Smrgemit_header(gc->pc, X_GLrop_TexCoord3fv, cmdlen);
1519b8e80941Smrg(void) memcpy((void *)(gc->pc + 4), (void *)(&s), 4);
1520b8e80941Smrg(void) memcpy((void *)(gc->pc + 8), (void *)(&t), 4);
1521b8e80941Smrg(void) memcpy((void *)(gc->pc + 12), (void *)(&r), 4);
1522b8e80941Smrggc->pc += cmdlen;
1523b8e80941Smrgif (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); }
1524848b8605Smrg}
1525848b8605Smrg
1526848b8605Smrg#define X_GLrop_TexCoord3fv 58
1527b8e80941Smrgvoid __indirect_glTexCoord3fv(const GLfloat * v)
1528848b8605Smrg{
1529b8e80941Smrg    generic_12_byte( X_GLrop_TexCoord3fv, v );
1530848b8605Smrg}
1531848b8605Smrg
1532848b8605Smrg#define X_GLrop_TexCoord3iv 59
1533b8e80941Smrgvoid __indirect_glTexCoord3i(GLint s, GLint t, GLint r)
1534b8e80941Smrg{
1535b8e80941Smrg    struct glx_context * const gc = __glXGetCurrentContext();
1536b8e80941Smrg    const GLuint cmdlen = 16;
1537b8e80941Smrgemit_header(gc->pc, X_GLrop_TexCoord3iv, cmdlen);
1538b8e80941Smrg(void) memcpy((void *)(gc->pc + 4), (void *)(&s), 4);
1539b8e80941Smrg(void) memcpy((void *)(gc->pc + 8), (void *)(&t), 4);
1540b8e80941Smrg(void) memcpy((void *)(gc->pc + 12), (void *)(&r), 4);
1541b8e80941Smrggc->pc += cmdlen;
1542b8e80941Smrgif (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); }
1543848b8605Smrg}
1544848b8605Smrg
1545848b8605Smrg#define X_GLrop_TexCoord3iv 59
1546b8e80941Smrgvoid __indirect_glTexCoord3iv(const GLint * v)
1547848b8605Smrg{
1548b8e80941Smrg    generic_12_byte( X_GLrop_TexCoord3iv, v );
1549848b8605Smrg}
1550848b8605Smrg
1551848b8605Smrg#define X_GLrop_TexCoord3sv 60
1552b8e80941Smrgvoid __indirect_glTexCoord3s(GLshort s, GLshort t, GLshort r)
1553b8e80941Smrg{
1554b8e80941Smrg    struct glx_context * const gc = __glXGetCurrentContext();
1555b8e80941Smrg    const GLuint cmdlen = 12;
1556b8e80941Smrgemit_header(gc->pc, X_GLrop_TexCoord3sv, cmdlen);
1557b8e80941Smrg(void) memcpy((void *)(gc->pc + 4), (void *)(&s), 2);
1558b8e80941Smrg(void) memcpy((void *)(gc->pc + 6), (void *)(&t), 2);
1559b8e80941Smrg(void) memcpy((void *)(gc->pc + 8), (void *)(&r), 2);
1560b8e80941Smrggc->pc += cmdlen;
1561b8e80941Smrgif (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); }
1562848b8605Smrg}
1563848b8605Smrg
1564848b8605Smrg#define X_GLrop_TexCoord3sv 60
1565b8e80941Smrgvoid __indirect_glTexCoord3sv(const GLshort * v)
1566848b8605Smrg{
1567b8e80941Smrg    generic_6_byte( X_GLrop_TexCoord3sv, v );
1568848b8605Smrg}
1569848b8605Smrg
1570848b8605Smrg#define X_GLrop_TexCoord4dv 61
1571b8e80941Smrgvoid __indirect_glTexCoord4d(GLdouble s, GLdouble t, GLdouble r, GLdouble q)
1572b8e80941Smrg{
1573b8e80941Smrg    struct glx_context * const gc = __glXGetCurrentContext();
1574b8e80941Smrg    const GLuint cmdlen = 36;
1575b8e80941Smrgemit_header(gc->pc, X_GLrop_TexCoord4dv, cmdlen);
1576b8e80941Smrg(void) memcpy((void *)(gc->pc + 4), (void *)(&s), 8);
1577b8e80941Smrg(void) memcpy((void *)(gc->pc + 12), (void *)(&t), 8);
1578b8e80941Smrg(void) memcpy((void *)(gc->pc + 20), (void *)(&r), 8);
1579b8e80941Smrg(void) memcpy((void *)(gc->pc + 28), (void *)(&q), 8);
1580b8e80941Smrggc->pc += cmdlen;
1581b8e80941Smrgif (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); }
1582848b8605Smrg}
1583848b8605Smrg
1584848b8605Smrg#define X_GLrop_TexCoord4dv 61
1585b8e80941Smrgvoid __indirect_glTexCoord4dv(const GLdouble * v)
1586848b8605Smrg{
1587b8e80941Smrg    generic_32_byte( X_GLrop_TexCoord4dv, v );
1588848b8605Smrg}
1589848b8605Smrg
1590848b8605Smrg#define X_GLrop_TexCoord4fv 62
1591b8e80941Smrgvoid __indirect_glTexCoord4f(GLfloat s, GLfloat t, GLfloat r, GLfloat q)
1592b8e80941Smrg{
1593b8e80941Smrg    struct glx_context * const gc = __glXGetCurrentContext();
1594b8e80941Smrg    const GLuint cmdlen = 20;
1595b8e80941Smrgemit_header(gc->pc, X_GLrop_TexCoord4fv, cmdlen);
1596b8e80941Smrg(void) memcpy((void *)(gc->pc + 4), (void *)(&s), 4);
1597b8e80941Smrg(void) memcpy((void *)(gc->pc + 8), (void *)(&t), 4);
1598b8e80941Smrg(void) memcpy((void *)(gc->pc + 12), (void *)(&r), 4);
1599b8e80941Smrg(void) memcpy((void *)(gc->pc + 16), (void *)(&q), 4);
1600b8e80941Smrggc->pc += cmdlen;
1601b8e80941Smrgif (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); }
1602848b8605Smrg}
1603848b8605Smrg
1604848b8605Smrg#define X_GLrop_TexCoord4fv 62
1605b8e80941Smrgvoid __indirect_glTexCoord4fv(const GLfloat * v)
1606848b8605Smrg{
1607b8e80941Smrg    generic_16_byte( X_GLrop_TexCoord4fv, v );
1608848b8605Smrg}
1609848b8605Smrg
1610848b8605Smrg#define X_GLrop_TexCoord4iv 63
1611b8e80941Smrgvoid __indirect_glTexCoord4i(GLint s, GLint t, GLint r, GLint q)
1612b8e80941Smrg{
1613b8e80941Smrg    struct glx_context * const gc = __glXGetCurrentContext();
1614b8e80941Smrg    const GLuint cmdlen = 20;
1615b8e80941Smrgemit_header(gc->pc, X_GLrop_TexCoord4iv, cmdlen);
1616b8e80941Smrg(void) memcpy((void *)(gc->pc + 4), (void *)(&s), 4);
1617b8e80941Smrg(void) memcpy((void *)(gc->pc + 8), (void *)(&t), 4);
1618b8e80941Smrg(void) memcpy((void *)(gc->pc + 12), (void *)(&r), 4);
1619b8e80941Smrg(void) memcpy((void *)(gc->pc + 16), (void *)(&q), 4);
1620b8e80941Smrggc->pc += cmdlen;
1621b8e80941Smrgif (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); }
1622848b8605Smrg}
1623848b8605Smrg
1624848b8605Smrg#define X_GLrop_TexCoord4iv 63
1625b8e80941Smrgvoid __indirect_glTexCoord4iv(const GLint * v)
1626848b8605Smrg{
1627b8e80941Smrg    generic_16_byte( X_GLrop_TexCoord4iv, v );
1628848b8605Smrg}
1629848b8605Smrg
1630848b8605Smrg#define X_GLrop_TexCoord4sv 64
1631b8e80941Smrgvoid __indirect_glTexCoord4s(GLshort s, GLshort t, GLshort r, GLshort q)
1632b8e80941Smrg{
1633b8e80941Smrg    struct glx_context * const gc = __glXGetCurrentContext();
1634b8e80941Smrg    const GLuint cmdlen = 12;
1635b8e80941Smrgemit_header(gc->pc, X_GLrop_TexCoord4sv, cmdlen);
1636b8e80941Smrg(void) memcpy((void *)(gc->pc + 4), (void *)(&s), 2);
1637b8e80941Smrg(void) memcpy((void *)(gc->pc + 6), (void *)(&t), 2);
1638b8e80941Smrg(void) memcpy((void *)(gc->pc + 8), (void *)(&r), 2);
1639b8e80941Smrg(void) memcpy((void *)(gc->pc + 10), (void *)(&q), 2);
1640b8e80941Smrggc->pc += cmdlen;
1641b8e80941Smrgif (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); }
1642848b8605Smrg}
1643848b8605Smrg
1644848b8605Smrg#define X_GLrop_TexCoord4sv 64
1645b8e80941Smrgvoid __indirect_glTexCoord4sv(const GLshort * v)
1646848b8605Smrg{
1647b8e80941Smrg    generic_8_byte( X_GLrop_TexCoord4sv, v );
1648848b8605Smrg}
1649848b8605Smrg
1650848b8605Smrg#define X_GLrop_Vertex2dv 65
1651b8e80941Smrgvoid __indirect_glVertex2d(GLdouble x, GLdouble y)
1652b8e80941Smrg{
1653b8e80941Smrg    struct glx_context * const gc = __glXGetCurrentContext();
1654b8e80941Smrg    const GLuint cmdlen = 20;
1655b8e80941Smrgemit_header(gc->pc, X_GLrop_Vertex2dv, cmdlen);
1656b8e80941Smrg(void) memcpy((void *)(gc->pc + 4), (void *)(&x), 8);
1657b8e80941Smrg(void) memcpy((void *)(gc->pc + 12), (void *)(&y), 8);
1658b8e80941Smrggc->pc += cmdlen;
1659b8e80941Smrgif (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); }
1660848b8605Smrg}
1661848b8605Smrg
1662848b8605Smrg#define X_GLrop_Vertex2dv 65
1663b8e80941Smrgvoid __indirect_glVertex2dv(const GLdouble * v)
1664848b8605Smrg{
1665b8e80941Smrg    generic_16_byte( X_GLrop_Vertex2dv, v );
1666848b8605Smrg}
1667848b8605Smrg
1668848b8605Smrg#define X_GLrop_Vertex2fv 66
1669b8e80941Smrgvoid __indirect_glVertex2f(GLfloat x, GLfloat y)
1670b8e80941Smrg{
1671b8e80941Smrg    struct glx_context * const gc = __glXGetCurrentContext();
1672b8e80941Smrg    const GLuint cmdlen = 12;
1673b8e80941Smrgemit_header(gc->pc, X_GLrop_Vertex2fv, cmdlen);
1674b8e80941Smrg(void) memcpy((void *)(gc->pc + 4), (void *)(&x), 4);
1675b8e80941Smrg(void) memcpy((void *)(gc->pc + 8), (void *)(&y), 4);
1676b8e80941Smrggc->pc += cmdlen;
1677b8e80941Smrgif (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); }
1678848b8605Smrg}
1679848b8605Smrg
1680848b8605Smrg#define X_GLrop_Vertex2fv 66
1681b8e80941Smrgvoid __indirect_glVertex2fv(const GLfloat * v)
1682848b8605Smrg{
1683b8e80941Smrg    generic_8_byte( X_GLrop_Vertex2fv, v );
1684848b8605Smrg}
1685848b8605Smrg
1686848b8605Smrg#define X_GLrop_Vertex2iv 67
1687b8e80941Smrgvoid __indirect_glVertex2i(GLint x, GLint y)
1688b8e80941Smrg{
1689b8e80941Smrg    struct glx_context * const gc = __glXGetCurrentContext();
1690b8e80941Smrg    const GLuint cmdlen = 12;
1691b8e80941Smrgemit_header(gc->pc, X_GLrop_Vertex2iv, cmdlen);
1692b8e80941Smrg(void) memcpy((void *)(gc->pc + 4), (void *)(&x), 4);
1693b8e80941Smrg(void) memcpy((void *)(gc->pc + 8), (void *)(&y), 4);
1694b8e80941Smrggc->pc += cmdlen;
1695b8e80941Smrgif (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); }
1696848b8605Smrg}
1697848b8605Smrg
1698848b8605Smrg#define X_GLrop_Vertex2iv 67
1699b8e80941Smrgvoid __indirect_glVertex2iv(const GLint * v)
1700848b8605Smrg{
1701b8e80941Smrg    generic_8_byte( X_GLrop_Vertex2iv, v );
1702848b8605Smrg}
1703848b8605Smrg
1704848b8605Smrg#define X_GLrop_Vertex2sv 68
1705b8e80941Smrgvoid __indirect_glVertex2s(GLshort x, GLshort y)
1706b8e80941Smrg{
1707b8e80941Smrg    struct glx_context * const gc = __glXGetCurrentContext();
1708b8e80941Smrg    const GLuint cmdlen = 8;
1709b8e80941Smrgemit_header(gc->pc, X_GLrop_Vertex2sv, cmdlen);
1710b8e80941Smrg(void) memcpy((void *)(gc->pc + 4), (void *)(&x), 2);
1711b8e80941Smrg(void) memcpy((void *)(gc->pc + 6), (void *)(&y), 2);
1712b8e80941Smrggc->pc += cmdlen;
1713b8e80941Smrgif (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); }
1714848b8605Smrg}
1715848b8605Smrg
1716848b8605Smrg#define X_GLrop_Vertex2sv 68
1717b8e80941Smrgvoid __indirect_glVertex2sv(const GLshort * v)
1718848b8605Smrg{
1719b8e80941Smrg    generic_4_byte( X_GLrop_Vertex2sv, v );
1720848b8605Smrg}
1721848b8605Smrg
1722848b8605Smrg#define X_GLrop_Vertex3dv 69
1723b8e80941Smrgvoid __indirect_glVertex3d(GLdouble x, GLdouble y, GLdouble z)
1724b8e80941Smrg{
1725b8e80941Smrg    struct glx_context * const gc = __glXGetCurrentContext();
1726b8e80941Smrg    const GLuint cmdlen = 28;
1727b8e80941Smrgemit_header(gc->pc, X_GLrop_Vertex3dv, cmdlen);
1728b8e80941Smrg(void) memcpy((void *)(gc->pc + 4), (void *)(&x), 8);
1729b8e80941Smrg(void) memcpy((void *)(gc->pc + 12), (void *)(&y), 8);
1730b8e80941Smrg(void) memcpy((void *)(gc->pc + 20), (void *)(&z), 8);
1731b8e80941Smrggc->pc += cmdlen;
1732b8e80941Smrgif (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); }
1733848b8605Smrg}
1734848b8605Smrg
1735848b8605Smrg#define X_GLrop_Vertex3dv 69
1736b8e80941Smrgvoid __indirect_glVertex3dv(const GLdouble * v)
1737848b8605Smrg{
1738b8e80941Smrg    generic_24_byte( X_GLrop_Vertex3dv, v );
1739848b8605Smrg}
1740848b8605Smrg
1741848b8605Smrg#define X_GLrop_Vertex3fv 70
1742b8e80941Smrgvoid __indirect_glVertex3f(GLfloat x, GLfloat y, GLfloat z)
1743b8e80941Smrg{
1744b8e80941Smrg    struct glx_context * const gc = __glXGetCurrentContext();
1745b8e80941Smrg    const GLuint cmdlen = 16;
1746b8e80941Smrgemit_header(gc->pc, X_GLrop_Vertex3fv, cmdlen);
1747b8e80941Smrg(void) memcpy((void *)(gc->pc + 4), (void *)(&x), 4);
1748b8e80941Smrg(void) memcpy((void *)(gc->pc + 8), (void *)(&y), 4);
1749b8e80941Smrg(void) memcpy((void *)(gc->pc + 12), (void *)(&z), 4);
1750b8e80941Smrggc->pc += cmdlen;
1751b8e80941Smrgif (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); }
1752848b8605Smrg}
1753848b8605Smrg
1754848b8605Smrg#define X_GLrop_Vertex3fv 70
1755b8e80941Smrgvoid __indirect_glVertex3fv(const GLfloat * v)
1756848b8605Smrg{
1757b8e80941Smrg    generic_12_byte( X_GLrop_Vertex3fv, v );
1758848b8605Smrg}
1759848b8605Smrg
1760848b8605Smrg#define X_GLrop_Vertex3iv 71
1761b8e80941Smrgvoid __indirect_glVertex3i(GLint x, GLint y, GLint z)
1762b8e80941Smrg{
1763b8e80941Smrg    struct glx_context * const gc = __glXGetCurrentContext();
1764b8e80941Smrg    const GLuint cmdlen = 16;
1765b8e80941Smrgemit_header(gc->pc, X_GLrop_Vertex3iv, cmdlen);
1766b8e80941Smrg(void) memcpy((void *)(gc->pc + 4), (void *)(&x), 4);
1767b8e80941Smrg(void) memcpy((void *)(gc->pc + 8), (void *)(&y), 4);
1768b8e80941Smrg(void) memcpy((void *)(gc->pc + 12), (void *)(&z), 4);
1769b8e80941Smrggc->pc += cmdlen;
1770b8e80941Smrgif (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); }
1771848b8605Smrg}
1772848b8605Smrg
1773848b8605Smrg#define X_GLrop_Vertex3iv 71
1774b8e80941Smrgvoid __indirect_glVertex3iv(const GLint * v)
1775848b8605Smrg{
1776b8e80941Smrg    generic_12_byte( X_GLrop_Vertex3iv, v );
1777848b8605Smrg}
1778848b8605Smrg
1779848b8605Smrg#define X_GLrop_Vertex3sv 72
1780b8e80941Smrgvoid __indirect_glVertex3s(GLshort x, GLshort y, GLshort z)
1781b8e80941Smrg{
1782b8e80941Smrg    struct glx_context * const gc = __glXGetCurrentContext();
1783b8e80941Smrg    const GLuint cmdlen = 12;
1784b8e80941Smrgemit_header(gc->pc, X_GLrop_Vertex3sv, cmdlen);
1785b8e80941Smrg(void) memcpy((void *)(gc->pc + 4), (void *)(&x), 2);
1786b8e80941Smrg(void) memcpy((void *)(gc->pc + 6), (void *)(&y), 2);
1787b8e80941Smrg(void) memcpy((void *)(gc->pc + 8), (void *)(&z), 2);
1788b8e80941Smrggc->pc += cmdlen;
1789b8e80941Smrgif (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); }
1790848b8605Smrg}
1791848b8605Smrg
1792848b8605Smrg#define X_GLrop_Vertex3sv 72
1793b8e80941Smrgvoid __indirect_glVertex3sv(const GLshort * v)
1794848b8605Smrg{
1795b8e80941Smrg    generic_6_byte( X_GLrop_Vertex3sv, v );
1796848b8605Smrg}
1797848b8605Smrg
1798848b8605Smrg#define X_GLrop_Vertex4dv 73
1799b8e80941Smrgvoid __indirect_glVertex4d(GLdouble x, GLdouble y, GLdouble z, GLdouble w)
1800b8e80941Smrg{
1801b8e80941Smrg    struct glx_context * const gc = __glXGetCurrentContext();
1802b8e80941Smrg    const GLuint cmdlen = 36;
1803b8e80941Smrgemit_header(gc->pc, X_GLrop_Vertex4dv, cmdlen);
1804b8e80941Smrg(void) memcpy((void *)(gc->pc + 4), (void *)(&x), 8);
1805b8e80941Smrg(void) memcpy((void *)(gc->pc + 12), (void *)(&y), 8);
1806b8e80941Smrg(void) memcpy((void *)(gc->pc + 20), (void *)(&z), 8);
1807b8e80941Smrg(void) memcpy((void *)(gc->pc + 28), (void *)(&w), 8);
1808b8e80941Smrggc->pc += cmdlen;
1809b8e80941Smrgif (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); }
1810848b8605Smrg}
1811848b8605Smrg
1812848b8605Smrg#define X_GLrop_Vertex4dv 73
1813b8e80941Smrgvoid __indirect_glVertex4dv(const GLdouble * v)
1814848b8605Smrg{
1815b8e80941Smrg    generic_32_byte( X_GLrop_Vertex4dv, v );
1816848b8605Smrg}
1817848b8605Smrg
1818848b8605Smrg#define X_GLrop_Vertex4fv 74
1819b8e80941Smrgvoid __indirect_glVertex4f(GLfloat x, GLfloat y, GLfloat z, GLfloat w)
1820b8e80941Smrg{
1821b8e80941Smrg    struct glx_context * const gc = __glXGetCurrentContext();
1822b8e80941Smrg    const GLuint cmdlen = 20;
1823b8e80941Smrgemit_header(gc->pc, X_GLrop_Vertex4fv, cmdlen);
1824b8e80941Smrg(void) memcpy((void *)(gc->pc + 4), (void *)(&x), 4);
1825b8e80941Smrg(void) memcpy((void *)(gc->pc + 8), (void *)(&y), 4);
1826b8e80941Smrg(void) memcpy((void *)(gc->pc + 12), (void *)(&z), 4);
1827b8e80941Smrg(void) memcpy((void *)(gc->pc + 16), (void *)(&w), 4);
1828b8e80941Smrggc->pc += cmdlen;
1829b8e80941Smrgif (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); }
1830848b8605Smrg}
1831848b8605Smrg
1832848b8605Smrg#define X_GLrop_Vertex4fv 74
1833b8e80941Smrgvoid __indirect_glVertex4fv(const GLfloat * v)
1834848b8605Smrg{
1835b8e80941Smrg    generic_16_byte( X_GLrop_Vertex4fv, v );
1836848b8605Smrg}
1837848b8605Smrg
1838848b8605Smrg#define X_GLrop_Vertex4iv 75
1839b8e80941Smrgvoid __indirect_glVertex4i(GLint x, GLint y, GLint z, GLint w)
1840b8e80941Smrg{
1841b8e80941Smrg    struct glx_context * const gc = __glXGetCurrentContext();
1842b8e80941Smrg    const GLuint cmdlen = 20;
1843b8e80941Smrgemit_header(gc->pc, X_GLrop_Vertex4iv, cmdlen);
1844b8e80941Smrg(void) memcpy((void *)(gc->pc + 4), (void *)(&x), 4);
1845b8e80941Smrg(void) memcpy((void *)(gc->pc + 8), (void *)(&y), 4);
1846b8e80941Smrg(void) memcpy((void *)(gc->pc + 12), (void *)(&z), 4);
1847b8e80941Smrg(void) memcpy((void *)(gc->pc + 16), (void *)(&w), 4);
1848b8e80941Smrggc->pc += cmdlen;
1849b8e80941Smrgif (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); }
1850848b8605Smrg}
1851848b8605Smrg
1852848b8605Smrg#define X_GLrop_Vertex4iv 75
1853b8e80941Smrgvoid __indirect_glVertex4iv(const GLint * v)
1854848b8605Smrg{
1855b8e80941Smrg    generic_16_byte( X_GLrop_Vertex4iv, v );
1856848b8605Smrg}
1857848b8605Smrg
1858848b8605Smrg#define X_GLrop_Vertex4sv 76
1859b8e80941Smrgvoid __indirect_glVertex4s(GLshort x, GLshort y, GLshort z, GLshort w)
1860b8e80941Smrg{
1861b8e80941Smrg    struct glx_context * const gc = __glXGetCurrentContext();
1862b8e80941Smrg    const GLuint cmdlen = 12;
1863b8e80941Smrgemit_header(gc->pc, X_GLrop_Vertex4sv, cmdlen);
1864b8e80941Smrg(void) memcpy((void *)(gc->pc + 4), (void *)(&x), 2);
1865b8e80941Smrg(void) memcpy((void *)(gc->pc + 6), (void *)(&y), 2);
1866b8e80941Smrg(void) memcpy((void *)(gc->pc + 8), (void *)(&z), 2);
1867b8e80941Smrg(void) memcpy((void *)(gc->pc + 10), (void *)(&w), 2);
1868b8e80941Smrggc->pc += cmdlen;
1869b8e80941Smrgif (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); }
1870848b8605Smrg}
1871848b8605Smrg
1872848b8605Smrg#define X_GLrop_Vertex4sv 76
1873b8e80941Smrgvoid __indirect_glVertex4sv(const GLshort * v)
1874848b8605Smrg{
1875b8e80941Smrg    generic_8_byte( X_GLrop_Vertex4sv, v );
1876848b8605Smrg}
1877848b8605Smrg
1878848b8605Smrg#define X_GLrop_ClipPlane 77
1879b8e80941Smrgvoid __indirect_glClipPlane(GLenum plane, const GLdouble * equation)
1880b8e80941Smrg{
1881b8e80941Smrg    struct glx_context * const gc = __glXGetCurrentContext();
1882b8e80941Smrg    const GLuint cmdlen = 40;
1883b8e80941Smrgemit_header(gc->pc, X_GLrop_ClipPlane, cmdlen);
1884b8e80941Smrg(void) memcpy((void *)(gc->pc + 4), (void *)(equation), 32);
1885b8e80941Smrg(void) memcpy((void *)(gc->pc + 36), (void *)(&plane), 4);
1886b8e80941Smrggc->pc += cmdlen;
1887b8e80941Smrgif (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); }
1888848b8605Smrg}
1889848b8605Smrg
1890848b8605Smrg#define X_GLrop_ColorMaterial 78
1891b8e80941Smrgvoid __indirect_glColorMaterial(GLenum face, GLenum mode)
1892b8e80941Smrg{
1893b8e80941Smrg    struct glx_context * const gc = __glXGetCurrentContext();
1894b8e80941Smrg    const GLuint cmdlen = 12;
1895b8e80941Smrgemit_header(gc->pc, X_GLrop_ColorMaterial, cmdlen);
1896b8e80941Smrg(void) memcpy((void *)(gc->pc + 4), (void *)(&face), 4);
1897b8e80941Smrg(void) memcpy((void *)(gc->pc + 8), (void *)(&mode), 4);
1898b8e80941Smrggc->pc += cmdlen;
1899b8e80941Smrgif (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); }
1900848b8605Smrg}
1901848b8605Smrg
1902848b8605Smrg#define X_GLrop_CullFace 79
1903b8e80941Smrgvoid __indirect_glCullFace(GLenum mode)
1904848b8605Smrg{
1905b8e80941Smrg    struct glx_context * const gc = __glXGetCurrentContext();
1906b8e80941Smrg    const GLuint cmdlen = 8;
1907b8e80941Smrgemit_header(gc->pc, X_GLrop_CullFace, cmdlen);
1908b8e80941Smrg(void) memcpy((void *)(gc->pc + 4), (void *)(&mode), 4);
1909b8e80941Smrggc->pc += cmdlen;
1910b8e80941Smrgif (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); }
1911848b8605Smrg}
1912848b8605Smrg
1913848b8605Smrg#define X_GLrop_Fogf 80
1914b8e80941Smrgvoid __indirect_glFogf(GLenum pname, GLfloat param)
1915b8e80941Smrg{
1916b8e80941Smrg    struct glx_context * const gc = __glXGetCurrentContext();
1917b8e80941Smrg    const GLuint cmdlen = 12;
1918b8e80941Smrgemit_header(gc->pc, X_GLrop_Fogf, cmdlen);
1919b8e80941Smrg(void) memcpy((void *)(gc->pc + 4), (void *)(&pname), 4);
1920b8e80941Smrg(void) memcpy((void *)(gc->pc + 8), (void *)(&param), 4);
1921b8e80941Smrggc->pc += cmdlen;
1922b8e80941Smrgif (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); }
1923848b8605Smrg}
1924848b8605Smrg
1925848b8605Smrg#define X_GLrop_Fogfv 81
1926b8e80941Smrgvoid __indirect_glFogfv(GLenum pname, const GLfloat * params)
1927b8e80941Smrg{
1928b8e80941Smrg    struct glx_context * const gc = __glXGetCurrentContext();
1929b8e80941Smrg    const GLuint compsize = __glFogfv_size(pname);
1930b8e80941Smrg    const GLuint cmdlen = 8 + safe_pad(safe_mul(compsize, 4));
1931b8e80941Smrg    if (0 + safe_pad(safe_mul(compsize, 4)) < 0) {
1932b8e80941Smrg        __glXSetError(gc, GL_INVALID_VALUE);
1933b8e80941Smrg        return;
1934848b8605Smrg    }
1935b8e80941Smrgemit_header(gc->pc, X_GLrop_Fogfv, cmdlen);
1936b8e80941Smrg(void) memcpy((void *)(gc->pc + 4), (void *)(&pname), 4);
1937b8e80941Smrg(void) memcpy((void *)(gc->pc + 8), (void *)(params), safe_mul(compsize, 4));
1938b8e80941Smrggc->pc += cmdlen;
1939b8e80941Smrgif (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); }
1940848b8605Smrg}
1941848b8605Smrg
1942848b8605Smrg#define X_GLrop_Fogi 82
1943b8e80941Smrgvoid __indirect_glFogi(GLenum pname, GLint param)
1944b8e80941Smrg{
1945b8e80941Smrg    struct glx_context * const gc = __glXGetCurrentContext();
1946b8e80941Smrg    const GLuint cmdlen = 12;
1947b8e80941Smrgemit_header(gc->pc, X_GLrop_Fogi, cmdlen);
1948b8e80941Smrg(void) memcpy((void *)(gc->pc + 4), (void *)(&pname), 4);
1949b8e80941Smrg(void) memcpy((void *)(gc->pc + 8), (void *)(&param), 4);
1950b8e80941Smrggc->pc += cmdlen;
1951b8e80941Smrgif (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); }
1952848b8605Smrg}
1953848b8605Smrg
1954848b8605Smrg#define X_GLrop_Fogiv 83
1955b8e80941Smrgvoid __indirect_glFogiv(GLenum pname, const GLint * params)
1956b8e80941Smrg{
1957b8e80941Smrg    struct glx_context * const gc = __glXGetCurrentContext();
1958b8e80941Smrg    const GLuint compsize = __glFogiv_size(pname);
1959b8e80941Smrg    const GLuint cmdlen = 8 + safe_pad(safe_mul(compsize, 4));
1960b8e80941Smrg    if (0 + safe_pad(safe_mul(compsize, 4)) < 0) {
1961b8e80941Smrg        __glXSetError(gc, GL_INVALID_VALUE);
1962b8e80941Smrg        return;
1963848b8605Smrg    }
1964b8e80941Smrgemit_header(gc->pc, X_GLrop_Fogiv, cmdlen);
1965b8e80941Smrg(void) memcpy((void *)(gc->pc + 4), (void *)(&pname), 4);
1966b8e80941Smrg(void) memcpy((void *)(gc->pc + 8), (void *)(params), safe_mul(compsize, 4));
1967b8e80941Smrggc->pc += cmdlen;
1968b8e80941Smrgif (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); }
1969848b8605Smrg}
1970848b8605Smrg
1971848b8605Smrg#define X_GLrop_FrontFace 84
1972b8e80941Smrgvoid __indirect_glFrontFace(GLenum mode)
1973848b8605Smrg{
1974b8e80941Smrg    struct glx_context * const gc = __glXGetCurrentContext();
1975b8e80941Smrg    const GLuint cmdlen = 8;
1976b8e80941Smrgemit_header(gc->pc, X_GLrop_FrontFace, cmdlen);
1977b8e80941Smrg(void) memcpy((void *)(gc->pc + 4), (void *)(&mode), 4);
1978b8e80941Smrggc->pc += cmdlen;
1979b8e80941Smrgif (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); }
1980848b8605Smrg}
1981848b8605Smrg
1982848b8605Smrg#define X_GLrop_Hint 85
1983b8e80941Smrgvoid __indirect_glHint(GLenum target, GLenum mode)
1984b8e80941Smrg{
1985b8e80941Smrg    struct glx_context * const gc = __glXGetCurrentContext();
1986b8e80941Smrg    const GLuint cmdlen = 12;
1987b8e80941Smrgemit_header(gc->pc, X_GLrop_Hint, cmdlen);
1988b8e80941Smrg(void) memcpy((void *)(gc->pc + 4), (void *)(&target), 4);
1989b8e80941Smrg(void) memcpy((void *)(gc->pc + 8), (void *)(&mode), 4);
1990b8e80941Smrggc->pc += cmdlen;
1991b8e80941Smrgif (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); }
1992848b8605Smrg}
1993848b8605Smrg
1994848b8605Smrg#define X_GLrop_Lightf 86
1995b8e80941Smrgvoid __indirect_glLightf(GLenum light, GLenum pname, GLfloat param)
1996b8e80941Smrg{
1997b8e80941Smrg    struct glx_context * const gc = __glXGetCurrentContext();
1998b8e80941Smrg    const GLuint cmdlen = 16;
1999b8e80941Smrgemit_header(gc->pc, X_GLrop_Lightf, cmdlen);
2000b8e80941Smrg(void) memcpy((void *)(gc->pc + 4), (void *)(&light), 4);
2001b8e80941Smrg(void) memcpy((void *)(gc->pc + 8), (void *)(&pname), 4);
2002b8e80941Smrg(void) memcpy((void *)(gc->pc + 12), (void *)(&param), 4);
2003b8e80941Smrggc->pc += cmdlen;
2004b8e80941Smrgif (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); }
2005848b8605Smrg}
2006848b8605Smrg
2007848b8605Smrg#define X_GLrop_Lightfv 87
2008b8e80941Smrgvoid __indirect_glLightfv(GLenum light, GLenum pname, const GLfloat * params)
2009b8e80941Smrg{
2010b8e80941Smrg    struct glx_context * const gc = __glXGetCurrentContext();
2011b8e80941Smrg    const GLuint compsize = __glLightfv_size(pname);
2012b8e80941Smrg    const GLuint cmdlen = 12 + safe_pad(safe_mul(compsize, 4));
2013b8e80941Smrg    if (0 + safe_pad(safe_mul(compsize, 4)) < 0) {
2014b8e80941Smrg        __glXSetError(gc, GL_INVALID_VALUE);
2015b8e80941Smrg        return;
2016848b8605Smrg    }
2017b8e80941Smrgemit_header(gc->pc, X_GLrop_Lightfv, cmdlen);
2018b8e80941Smrg(void) memcpy((void *)(gc->pc + 4), (void *)(&light), 4);
2019b8e80941Smrg(void) memcpy((void *)(gc->pc + 8), (void *)(&pname), 4);
2020b8e80941Smrg(void) memcpy((void *)(gc->pc + 12), (void *)(params), safe_mul(compsize, 4));
2021b8e80941Smrggc->pc += cmdlen;
2022b8e80941Smrgif (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); }
2023848b8605Smrg}
2024848b8605Smrg
2025848b8605Smrg#define X_GLrop_Lighti 88
2026b8e80941Smrgvoid __indirect_glLighti(GLenum light, GLenum pname, GLint param)
2027b8e80941Smrg{
2028b8e80941Smrg    struct glx_context * const gc = __glXGetCurrentContext();
2029b8e80941Smrg    const GLuint cmdlen = 16;
2030b8e80941Smrgemit_header(gc->pc, X_GLrop_Lighti, cmdlen);
2031b8e80941Smrg(void) memcpy((void *)(gc->pc + 4), (void *)(&light), 4);
2032b8e80941Smrg(void) memcpy((void *)(gc->pc + 8), (void *)(&pname), 4);
2033b8e80941Smrg(void) memcpy((void *)(gc->pc + 12), (void *)(&param), 4);
2034b8e80941Smrggc->pc += cmdlen;
2035b8e80941Smrgif (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); }
2036848b8605Smrg}
2037848b8605Smrg
2038848b8605Smrg#define X_GLrop_Lightiv 89
2039b8e80941Smrgvoid __indirect_glLightiv(GLenum light, GLenum pname, const GLint * params)
2040b8e80941Smrg{
2041b8e80941Smrg    struct glx_context * const gc = __glXGetCurrentContext();
2042b8e80941Smrg    const GLuint compsize = __glLightiv_size(pname);
2043b8e80941Smrg    const GLuint cmdlen = 12 + safe_pad(safe_mul(compsize, 4));
2044b8e80941Smrg    if (0 + safe_pad(safe_mul(compsize, 4)) < 0) {
2045b8e80941Smrg        __glXSetError(gc, GL_INVALID_VALUE);
2046b8e80941Smrg        return;
2047848b8605Smrg    }
2048b8e80941Smrgemit_header(gc->pc, X_GLrop_Lightiv, cmdlen);
2049b8e80941Smrg(void) memcpy((void *)(gc->pc + 4), (void *)(&light), 4);
2050b8e80941Smrg(void) memcpy((void *)(gc->pc + 8), (void *)(&pname), 4);
2051b8e80941Smrg(void) memcpy((void *)(gc->pc + 12), (void *)(params), safe_mul(compsize, 4));
2052b8e80941Smrggc->pc += cmdlen;
2053b8e80941Smrgif (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); }
2054848b8605Smrg}
2055848b8605Smrg
2056848b8605Smrg#define X_GLrop_LightModelf 90
2057b8e80941Smrgvoid __indirect_glLightModelf(GLenum pname, GLfloat param)
2058b8e80941Smrg{
2059b8e80941Smrg    struct glx_context * const gc = __glXGetCurrentContext();
2060b8e80941Smrg    const GLuint cmdlen = 12;
2061b8e80941Smrgemit_header(gc->pc, X_GLrop_LightModelf, cmdlen);
2062b8e80941Smrg(void) memcpy((void *)(gc->pc + 4), (void *)(&pname), 4);
2063b8e80941Smrg(void) memcpy((void *)(gc->pc + 8), (void *)(&param), 4);
2064b8e80941Smrggc->pc += cmdlen;
2065b8e80941Smrgif (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); }
2066848b8605Smrg}
2067848b8605Smrg
2068848b8605Smrg#define X_GLrop_LightModelfv 91
2069b8e80941Smrgvoid __indirect_glLightModelfv(GLenum pname, const GLfloat * params)
2070b8e80941Smrg{
2071b8e80941Smrg    struct glx_context * const gc = __glXGetCurrentContext();
2072b8e80941Smrg    const GLuint compsize = __glLightModelfv_size(pname);
2073b8e80941Smrg    const GLuint cmdlen = 8 + safe_pad(safe_mul(compsize, 4));
2074b8e80941Smrg    if (0 + safe_pad(safe_mul(compsize, 4)) < 0) {
2075b8e80941Smrg        __glXSetError(gc, GL_INVALID_VALUE);
2076b8e80941Smrg        return;
2077848b8605Smrg    }
2078b8e80941Smrgemit_header(gc->pc, X_GLrop_LightModelfv, cmdlen);
2079b8e80941Smrg(void) memcpy((void *)(gc->pc + 4), (void *)(&pname), 4);
2080b8e80941Smrg(void) memcpy((void *)(gc->pc + 8), (void *)(params), safe_mul(compsize, 4));
2081b8e80941Smrggc->pc += cmdlen;
2082b8e80941Smrgif (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); }
2083848b8605Smrg}
2084848b8605Smrg
2085848b8605Smrg#define X_GLrop_LightModeli 92
2086b8e80941Smrgvoid __indirect_glLightModeli(GLenum pname, GLint param)
2087b8e80941Smrg{
2088b8e80941Smrg    struct glx_context * const gc = __glXGetCurrentContext();
2089b8e80941Smrg    const GLuint cmdlen = 12;
2090b8e80941Smrgemit_header(gc->pc, X_GLrop_LightModeli, cmdlen);
2091b8e80941Smrg(void) memcpy((void *)(gc->pc + 4), (void *)(&pname), 4);
2092b8e80941Smrg(void) memcpy((void *)(gc->pc + 8), (void *)(&param), 4);
2093b8e80941Smrggc->pc += cmdlen;
2094b8e80941Smrgif (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); }
2095848b8605Smrg}
2096848b8605Smrg
2097848b8605Smrg#define X_GLrop_LightModeliv 93
2098b8e80941Smrgvoid __indirect_glLightModeliv(GLenum pname, const GLint * params)
2099b8e80941Smrg{
2100b8e80941Smrg    struct glx_context * const gc = __glXGetCurrentContext();
2101b8e80941Smrg    const GLuint compsize = __glLightModeliv_size(pname);
2102b8e80941Smrg    const GLuint cmdlen = 8 + safe_pad(safe_mul(compsize, 4));
2103b8e80941Smrg    if (0 + safe_pad(safe_mul(compsize, 4)) < 0) {
2104b8e80941Smrg        __glXSetError(gc, GL_INVALID_VALUE);
2105b8e80941Smrg        return;
2106848b8605Smrg    }
2107b8e80941Smrgemit_header(gc->pc, X_GLrop_LightModeliv, cmdlen);
2108b8e80941Smrg(void) memcpy((void *)(gc->pc + 4), (void *)(&pname), 4);
2109b8e80941Smrg(void) memcpy((void *)(gc->pc + 8), (void *)(params), safe_mul(compsize, 4));
2110b8e80941Smrggc->pc += cmdlen;
2111b8e80941Smrgif (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); }
2112848b8605Smrg}
2113848b8605Smrg
2114848b8605Smrg#define X_GLrop_LineStipple 94
2115b8e80941Smrgvoid __indirect_glLineStipple(GLint factor, GLushort pattern)
2116b8e80941Smrg{
2117b8e80941Smrg    struct glx_context * const gc = __glXGetCurrentContext();
2118b8e80941Smrg    const GLuint cmdlen = 12;
2119b8e80941Smrgemit_header(gc->pc, X_GLrop_LineStipple, cmdlen);
2120b8e80941Smrg(void) memcpy((void *)(gc->pc + 4), (void *)(&factor), 4);
2121b8e80941Smrg(void) memcpy((void *)(gc->pc + 8), (void *)(&pattern), 2);
2122b8e80941Smrggc->pc += cmdlen;
2123b8e80941Smrgif (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); }
2124848b8605Smrg}
2125848b8605Smrg
2126848b8605Smrg#define X_GLrop_LineWidth 95
2127b8e80941Smrgvoid __indirect_glLineWidth(GLfloat width)
2128848b8605Smrg{
2129b8e80941Smrg    struct glx_context * const gc = __glXGetCurrentContext();
2130b8e80941Smrg    const GLuint cmdlen = 8;
2131b8e80941Smrgemit_header(gc->pc, X_GLrop_LineWidth, cmdlen);
2132b8e80941Smrg(void) memcpy((void *)(gc->pc + 4), (void *)(&width), 4);
2133b8e80941Smrggc->pc += cmdlen;
2134b8e80941Smrgif (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); }
2135848b8605Smrg}
2136848b8605Smrg
2137848b8605Smrg#define X_GLrop_Materialf 96
2138b8e80941Smrgvoid __indirect_glMaterialf(GLenum face, GLenum pname, GLfloat param)
2139b8e80941Smrg{
2140b8e80941Smrg    struct glx_context * const gc = __glXGetCurrentContext();
2141b8e80941Smrg    const GLuint cmdlen = 16;
2142b8e80941Smrgemit_header(gc->pc, X_GLrop_Materialf, cmdlen);
2143b8e80941Smrg(void) memcpy((void *)(gc->pc + 4), (void *)(&face), 4);
2144b8e80941Smrg(void) memcpy((void *)(gc->pc + 8), (void *)(&pname), 4);
2145b8e80941Smrg(void) memcpy((void *)(gc->pc + 12), (void *)(&param), 4);
2146b8e80941Smrggc->pc += cmdlen;
2147b8e80941Smrgif (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); }
2148848b8605Smrg}
2149848b8605Smrg
2150848b8605Smrg#define X_GLrop_Materialfv 97
2151b8e80941Smrgvoid __indirect_glMaterialfv(GLenum face, GLenum pname, const GLfloat * params)
2152b8e80941Smrg{
2153b8e80941Smrg    struct glx_context * const gc = __glXGetCurrentContext();
2154b8e80941Smrg    const GLuint compsize = __glMaterialfv_size(pname);
2155b8e80941Smrg    const GLuint cmdlen = 12 + safe_pad(safe_mul(compsize, 4));
2156b8e80941Smrg    if (0 + safe_pad(safe_mul(compsize, 4)) < 0) {
2157b8e80941Smrg        __glXSetError(gc, GL_INVALID_VALUE);
2158b8e80941Smrg        return;
2159848b8605Smrg    }
2160b8e80941Smrgemit_header(gc->pc, X_GLrop_Materialfv, cmdlen);
2161b8e80941Smrg(void) memcpy((void *)(gc->pc + 4), (void *)(&face), 4);
2162b8e80941Smrg(void) memcpy((void *)(gc->pc + 8), (void *)(&pname), 4);
2163b8e80941Smrg(void) memcpy((void *)(gc->pc + 12), (void *)(params), safe_mul(compsize, 4));
2164b8e80941Smrggc->pc += cmdlen;
2165b8e80941Smrgif (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); }
2166848b8605Smrg}
2167848b8605Smrg
2168848b8605Smrg#define X_GLrop_Materiali 98
2169b8e80941Smrgvoid __indirect_glMateriali(GLenum face, GLenum pname, GLint param)
2170b8e80941Smrg{
2171b8e80941Smrg    struct glx_context * const gc = __glXGetCurrentContext();
2172b8e80941Smrg    const GLuint cmdlen = 16;
2173b8e80941Smrgemit_header(gc->pc, X_GLrop_Materiali, cmdlen);
2174b8e80941Smrg(void) memcpy((void *)(gc->pc + 4), (void *)(&face), 4);
2175b8e80941Smrg(void) memcpy((void *)(gc->pc + 8), (void *)(&pname), 4);
2176b8e80941Smrg(void) memcpy((void *)(gc->pc + 12), (void *)(&param), 4);
2177b8e80941Smrggc->pc += cmdlen;
2178b8e80941Smrgif (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); }
2179848b8605Smrg}
2180848b8605Smrg
2181848b8605Smrg#define X_GLrop_Materialiv 99
2182b8e80941Smrgvoid __indirect_glMaterialiv(GLenum face, GLenum pname, const GLint * params)
2183b8e80941Smrg{
2184b8e80941Smrg    struct glx_context * const gc = __glXGetCurrentContext();
2185b8e80941Smrg    const GLuint compsize = __glMaterialiv_size(pname);
2186b8e80941Smrg    const GLuint cmdlen = 12 + safe_pad(safe_mul(compsize, 4));
2187b8e80941Smrg    if (0 + safe_pad(safe_mul(compsize, 4)) < 0) {
2188b8e80941Smrg        __glXSetError(gc, GL_INVALID_VALUE);
2189b8e80941Smrg        return;
2190848b8605Smrg    }
2191b8e80941Smrgemit_header(gc->pc, X_GLrop_Materialiv, cmdlen);
2192b8e80941Smrg(void) memcpy((void *)(gc->pc + 4), (void *)(&face), 4);
2193b8e80941Smrg(void) memcpy((void *)(gc->pc + 8), (void *)(&pname), 4);
2194b8e80941Smrg(void) memcpy((void *)(gc->pc + 12), (void *)(params), safe_mul(compsize, 4));
2195b8e80941Smrggc->pc += cmdlen;
2196b8e80941Smrgif (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); }
2197848b8605Smrg}
2198848b8605Smrg
2199848b8605Smrg#define X_GLrop_PointSize 100
2200b8e80941Smrgvoid __indirect_glPointSize(GLfloat size)
2201848b8605Smrg{
2202b8e80941Smrg    struct glx_context * const gc = __glXGetCurrentContext();
2203b8e80941Smrg    const GLuint cmdlen = 8;
2204b8e80941Smrgemit_header(gc->pc, X_GLrop_PointSize, cmdlen);
2205b8e80941Smrg(void) memcpy((void *)(gc->pc + 4), (void *)(&size), 4);
2206b8e80941Smrggc->pc += cmdlen;
2207b8e80941Smrgif (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); }
2208848b8605Smrg}
2209848b8605Smrg
2210848b8605Smrg#define X_GLrop_PolygonMode 101
2211b8e80941Smrgvoid __indirect_glPolygonMode(GLenum face, GLenum mode)
2212b8e80941Smrg{
2213b8e80941Smrg    struct glx_context * const gc = __glXGetCurrentContext();
2214b8e80941Smrg    const GLuint cmdlen = 12;
2215b8e80941Smrgemit_header(gc->pc, X_GLrop_PolygonMode, cmdlen);
2216b8e80941Smrg(void) memcpy((void *)(gc->pc + 4), (void *)(&face), 4);
2217b8e80941Smrg(void) memcpy((void *)(gc->pc + 8), (void *)(&mode), 4);
2218b8e80941Smrggc->pc += cmdlen;
2219b8e80941Smrgif (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); }
2220848b8605Smrg}
2221848b8605Smrg
2222848b8605Smrg#define X_GLrop_PolygonStipple 102
2223b8e80941Smrgvoid __indirect_glPolygonStipple(const GLubyte * mask)
2224b8e80941Smrg{
2225b8e80941Smrg    struct glx_context * const gc = __glXGetCurrentContext();
2226b8e80941Smrg    const GLuint compsize = (mask != NULL) ? __glImageSize(32, 32, 1, GL_COLOR_INDEX, GL_BITMAP, 0) : 0;
2227b8e80941Smrg    const GLuint cmdlen = 24 + safe_pad(compsize);
2228b8e80941Smrg    if (0 + safe_pad(compsize) < 0) {
2229b8e80941Smrg        __glXSetError(gc, GL_INVALID_VALUE);
2230b8e80941Smrg        return;
2231848b8605Smrg    }
2232b8e80941Smrgemit_header(gc->pc, X_GLrop_PolygonStipple, cmdlen);
2233b8e80941Smrgif (compsize > 0) {
2234b8e80941Smrg    gc->fillImage(gc, 2, 32, 32, 1, GL_COLOR_INDEX, GL_BITMAP, mask, gc->pc + 24, gc->pc + 4);
2235b8e80941Smrg} else {
2236b8e80941Smrg    (void) memcpy( gc->pc + 4, default_pixel_store_2D, default_pixel_store_2D_size );
2237b8e80941Smrg}
2238b8e80941Smrggc->pc += cmdlen;
2239b8e80941Smrgif (gc->pc > gc->limit) { (void) __glXFlushRenderBuffer(gc, gc->pc); }
2240848b8605Smrg}
2241848b8605Smrg
2242848b8605Smrg#define X_GLrop_Scissor 103
2243b8e80941Smrgvoid __indirect_glScissor(GLint x, GLint y, GLsizei width, GLsizei height)
2244b8e80941Smrg{
2245b8e80941Smrg    struct glx_context * const gc = __glXGetCurrentContext();
2246b8e80941Smrg    const GLuint cmdlen = 20;
2247b8e80941Smrgemit_header(gc->pc, X_GLrop_Scissor, cmdlen);
2248b8e80941Smrg(void) memcpy((void *)(gc->pc + 4), (void *)(&x), 4);
2249b8e80941Smrg(void) memcpy((void *)(gc->pc + 8), (void *)(&y), 4);
2250b8e80941Smrg(void) memcpy((void *)(gc->pc + 12), (void *)(&width), 4);
2251b8e80941Smrg(void) memcpy((void *)(gc->pc + 16), (void *)(&height), 4);
2252b8e80941Smrggc->pc += cmdlen;
2253b8e80941Smrgif (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); }
2254848b8605Smrg}
2255848b8605Smrg
2256848b8605Smrg#define X_GLrop_ShadeModel 104
2257b8e80941Smrgvoid __indirect_glShadeModel(GLenum mode)
2258848b8605Smrg{
2259b8e80941Smrg    struct glx_context * const gc = __glXGetCurrentContext();
2260b8e80941Smrg    const GLuint cmdlen = 8;
2261b8e80941Smrgemit_header(gc->pc, X_GLrop_ShadeModel, cmdlen);
2262b8e80941Smrg(void) memcpy((void *)(gc->pc + 4), (void *)(&mode), 4);
2263b8e80941Smrggc->pc += cmdlen;
2264b8e80941Smrgif (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); }
2265848b8605Smrg}
2266848b8605Smrg
2267848b8605Smrg#define X_GLrop_TexParameterf 105
2268b8e80941Smrgvoid __indirect_glTexParameterf(GLenum target, GLenum pname, GLfloat param)
2269b8e80941Smrg{
2270b8e80941Smrg    struct glx_context * const gc = __glXGetCurrentContext();
2271b8e80941Smrg    const GLuint cmdlen = 16;
2272b8e80941Smrgemit_header(gc->pc, X_GLrop_TexParameterf, cmdlen);
2273b8e80941Smrg(void) memcpy((void *)(gc->pc + 4), (void *)(&target), 4);
2274b8e80941Smrg(void) memcpy((void *)(gc->pc + 8), (void *)(&pname), 4);
2275b8e80941Smrg(void) memcpy((void *)(gc->pc + 12), (void *)(&param), 4);
2276b8e80941Smrggc->pc += cmdlen;
2277b8e80941Smrgif (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); }
2278848b8605Smrg}
2279848b8605Smrg
2280848b8605Smrg#define X_GLrop_TexParameterfv 106
2281b8e80941Smrgvoid __indirect_glTexParameterfv(GLenum target, GLenum pname, const GLfloat * params)
2282b8e80941Smrg{
2283b8e80941Smrg    struct glx_context * const gc = __glXGetCurrentContext();
2284b8e80941Smrg    const GLuint compsize = __glTexParameterfv_size(pname);
2285b8e80941Smrg    const GLuint cmdlen = 12 + safe_pad(safe_mul(compsize, 4));
2286b8e80941Smrg    if (0 + safe_pad(safe_mul(compsize, 4)) < 0) {
2287b8e80941Smrg        __glXSetError(gc, GL_INVALID_VALUE);
2288b8e80941Smrg        return;
2289848b8605Smrg    }
2290b8e80941Smrgemit_header(gc->pc, X_GLrop_TexParameterfv, cmdlen);
2291b8e80941Smrg(void) memcpy((void *)(gc->pc + 4), (void *)(&target), 4);
2292b8e80941Smrg(void) memcpy((void *)(gc->pc + 8), (void *)(&pname), 4);
2293b8e80941Smrg(void) memcpy((void *)(gc->pc + 12), (void *)(params), safe_mul(compsize, 4));
2294b8e80941Smrggc->pc += cmdlen;
2295b8e80941Smrgif (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); }
2296848b8605Smrg}
2297848b8605Smrg
2298848b8605Smrg#define X_GLrop_TexParameteri 107
2299b8e80941Smrgvoid __indirect_glTexParameteri(GLenum target, GLenum pname, GLint param)
2300b8e80941Smrg{
2301b8e80941Smrg    struct glx_context * const gc = __glXGetCurrentContext();
2302b8e80941Smrg    const GLuint cmdlen = 16;
2303b8e80941Smrgemit_header(gc->pc, X_GLrop_TexParameteri, cmdlen);
2304b8e80941Smrg(void) memcpy((void *)(gc->pc + 4), (void *)(&target), 4);
2305b8e80941Smrg(void) memcpy((void *)(gc->pc + 8), (void *)(&pname), 4);
2306b8e80941Smrg(void) memcpy((void *)(gc->pc + 12), (void *)(&param), 4);
2307b8e80941Smrggc->pc += cmdlen;
2308b8e80941Smrgif (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); }
2309848b8605Smrg}
2310848b8605Smrg
2311848b8605Smrg#define X_GLrop_TexParameteriv 108
2312b8e80941Smrgvoid __indirect_glTexParameteriv(GLenum target, GLenum pname, const GLint * params)
2313b8e80941Smrg{
2314b8e80941Smrg    struct glx_context * const gc = __glXGetCurrentContext();
2315b8e80941Smrg    const GLuint compsize = __glTexParameteriv_size(pname);
2316b8e80941Smrg    const GLuint cmdlen = 12 + safe_pad(safe_mul(compsize, 4));
2317b8e80941Smrg    if (0 + safe_pad(safe_mul(compsize, 4)) < 0) {
2318b8e80941Smrg        __glXSetError(gc, GL_INVALID_VALUE);
2319b8e80941Smrg        return;
2320848b8605Smrg    }
2321b8e80941Smrgemit_header(gc->pc, X_GLrop_TexParameteriv, cmdlen);
2322b8e80941Smrg(void) memcpy((void *)(gc->pc + 4), (void *)(&target), 4);
2323b8e80941Smrg(void) memcpy((void *)(gc->pc + 8), (void *)(&pname), 4);
2324b8e80941Smrg(void) memcpy((void *)(gc->pc + 12), (void *)(params), safe_mul(compsize, 4));
2325b8e80941Smrggc->pc += cmdlen;
2326b8e80941Smrgif (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); }
2327848b8605Smrg}
2328848b8605Smrg
2329848b8605Smrgstatic void
2330b8e80941Smrg__glx_TexImage_1D2D( unsigned opcode, unsigned dim, GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLint border, GLenum format, GLenum type, const GLvoid * pixels )
2331848b8605Smrg{
2332b8e80941Smrg    struct glx_context * const gc = __glXGetCurrentContext();
2333b8e80941Smrg    const GLuint compsize = __glImageSize(width, height, 1, format, type, target);
2334b8e80941Smrg    const GLuint cmdlen = 56 + safe_pad(compsize);
2335b8e80941Smrg    if (0 + safe_pad(compsize) < 0) {
2336b8e80941Smrg        __glXSetError(gc, GL_INVALID_VALUE);
2337b8e80941Smrg        return;
2338b8e80941Smrg    }
2339848b8605Smrg    if (__builtin_expect(gc->currentDpy != NULL, 1)) {
2340b8e80941Smrgif (cmdlen <= gc->maxSmallRenderCommandSize) {
2341b8e80941Smrg    if ( (gc->pc + cmdlen) > gc->bufEnd ) {
2342b8e80941Smrg        (void) __glXFlushRenderBuffer(gc, gc->pc);
2343b8e80941Smrg    }
2344b8e80941Smrgemit_header(gc->pc, opcode, cmdlen);
2345b8e80941Smrg(void) memcpy((void *)(gc->pc + 24), (void *)(&target), 4);
2346b8e80941Smrg(void) memcpy((void *)(gc->pc + 28), (void *)(&level), 4);
2347b8e80941Smrg(void) memcpy((void *)(gc->pc + 32), (void *)(&internalformat), 4);
2348b8e80941Smrg(void) memcpy((void *)(gc->pc + 36), (void *)(&width), 4);
2349b8e80941Smrg(void) memcpy((void *)(gc->pc + 40), (void *)(&height), 4);
2350b8e80941Smrg(void) memcpy((void *)(gc->pc + 44), (void *)(&border), 4);
2351b8e80941Smrg(void) memcpy((void *)(gc->pc + 48), (void *)(&format), 4);
2352b8e80941Smrg(void) memcpy((void *)(gc->pc + 52), (void *)(&type), 4);
2353b8e80941Smrgif ((compsize > 0) && (pixels != NULL)) {
2354b8e80941Smrg    gc->fillImage(gc, dim, width, height, 1, format, type, pixels, gc->pc + 56, gc->pc + 4);
2355b8e80941Smrg} else {
2356b8e80941Smrg    (void) memcpy( gc->pc + 4, default_pixel_store_2D, default_pixel_store_2D_size );
2357b8e80941Smrg}
2358b8e80941Smrggc->pc += cmdlen;
2359b8e80941Smrgif (gc->pc > gc->limit) { (void) __glXFlushRenderBuffer(gc, gc->pc); }
2360b8e80941Smrg}
2361b8e80941Smrgelse {
2362b8e80941Smrgconst GLint op = opcode;
2363b8e80941Smrgconst GLuint cmdlenLarge = cmdlen + 4;
2364b8e80941SmrgGLubyte * const pc = __glXFlushRenderBuffer(gc, gc->pc);
2365b8e80941Smrg(void) memcpy((void *)(pc + 0), (void *)(&cmdlenLarge), 4);
2366b8e80941Smrg(void) memcpy((void *)(pc + 4), (void *)(&op), 4);
2367b8e80941Smrg(void) memcpy((void *)(pc + 28), (void *)(&target), 4);
2368b8e80941Smrg(void) memcpy((void *)(pc + 32), (void *)(&level), 4);
2369b8e80941Smrg(void) memcpy((void *)(pc + 36), (void *)(&internalformat), 4);
2370b8e80941Smrg(void) memcpy((void *)(pc + 40), (void *)(&width), 4);
2371b8e80941Smrg(void) memcpy((void *)(pc + 44), (void *)(&height), 4);
2372b8e80941Smrg(void) memcpy((void *)(pc + 48), (void *)(&border), 4);
2373b8e80941Smrg(void) memcpy((void *)(pc + 52), (void *)(&format), 4);
2374b8e80941Smrg(void) memcpy((void *)(pc + 56), (void *)(&type), 4);
2375b8e80941Smrg__glXSendLargeImage(gc, compsize, dim, width, height, 1, format, type, pixels, pc + 60, pc + 8);
2376b8e80941Smrg}
2377848b8605Smrg    }
2378848b8605Smrg}
2379848b8605Smrg
2380848b8605Smrg#define X_GLrop_TexImage1D 109
2381b8e80941Smrgvoid __indirect_glTexImage1D(GLenum target, GLint level, GLint internalformat, GLsizei width, GLint border, GLenum format, GLenum type, const GLvoid * pixels)
2382848b8605Smrg{
2383b8e80941Smrg    __glx_TexImage_1D2D(X_GLrop_TexImage1D, 1, target, level, internalformat, width, 1, border, format, type, pixels );
2384848b8605Smrg}
2385848b8605Smrg
2386848b8605Smrg#define X_GLrop_TexImage2D 110
2387b8e80941Smrgvoid __indirect_glTexImage2D(GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLint border, GLenum format, GLenum type, const GLvoid * pixels)
2388848b8605Smrg{
2389b8e80941Smrg    __glx_TexImage_1D2D(X_GLrop_TexImage2D, 2, target, level, internalformat, width, height, border, format, type, pixels );
2390848b8605Smrg}
2391848b8605Smrg
2392848b8605Smrg#define X_GLrop_TexEnvf 111
2393b8e80941Smrgvoid __indirect_glTexEnvf(GLenum target, GLenum pname, GLfloat param)
2394b8e80941Smrg{
2395b8e80941Smrg    struct glx_context * const gc = __glXGetCurrentContext();
2396b8e80941Smrg    const GLuint cmdlen = 16;
2397b8e80941Smrgemit_header(gc->pc, X_GLrop_TexEnvf, cmdlen);
2398b8e80941Smrg(void) memcpy((void *)(gc->pc + 4), (void *)(&target), 4);
2399b8e80941Smrg(void) memcpy((void *)(gc->pc + 8), (void *)(&pname), 4);
2400b8e80941Smrg(void) memcpy((void *)(gc->pc + 12), (void *)(&param), 4);
2401b8e80941Smrggc->pc += cmdlen;
2402b8e80941Smrgif (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); }
2403848b8605Smrg}
2404848b8605Smrg
2405848b8605Smrg#define X_GLrop_TexEnvfv 112
2406b8e80941Smrgvoid __indirect_glTexEnvfv(GLenum target, GLenum pname, const GLfloat * params)
2407b8e80941Smrg{
2408b8e80941Smrg    struct glx_context * const gc = __glXGetCurrentContext();
2409b8e80941Smrg    const GLuint compsize = __glTexEnvfv_size(pname);
2410b8e80941Smrg    const GLuint cmdlen = 12 + safe_pad(safe_mul(compsize, 4));
2411b8e80941Smrg    if (0 + safe_pad(safe_mul(compsize, 4)) < 0) {
2412b8e80941Smrg        __glXSetError(gc, GL_INVALID_VALUE);
2413b8e80941Smrg        return;
2414848b8605Smrg    }
2415b8e80941Smrgemit_header(gc->pc, X_GLrop_TexEnvfv, cmdlen);
2416b8e80941Smrg(void) memcpy((void *)(gc->pc + 4), (void *)(&target), 4);
2417b8e80941Smrg(void) memcpy((void *)(gc->pc + 8), (void *)(&pname), 4);
2418b8e80941Smrg(void) memcpy((void *)(gc->pc + 12), (void *)(params), safe_mul(compsize, 4));
2419b8e80941Smrggc->pc += cmdlen;
2420b8e80941Smrgif (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); }
2421848b8605Smrg}
2422848b8605Smrg
2423848b8605Smrg#define X_GLrop_TexEnvi 113
2424b8e80941Smrgvoid __indirect_glTexEnvi(GLenum target, GLenum pname, GLint param)
2425b8e80941Smrg{
2426b8e80941Smrg    struct glx_context * const gc = __glXGetCurrentContext();
2427b8e80941Smrg    const GLuint cmdlen = 16;
2428b8e80941Smrgemit_header(gc->pc, X_GLrop_TexEnvi, cmdlen);
2429b8e80941Smrg(void) memcpy((void *)(gc->pc + 4), (void *)(&target), 4);
2430b8e80941Smrg(void) memcpy((void *)(gc->pc + 8), (void *)(&pname), 4);
2431b8e80941Smrg(void) memcpy((void *)(gc->pc + 12), (void *)(&param), 4);
2432b8e80941Smrggc->pc += cmdlen;
2433b8e80941Smrgif (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); }
2434848b8605Smrg}
2435848b8605Smrg
2436848b8605Smrg#define X_GLrop_TexEnviv 114
2437b8e80941Smrgvoid __indirect_glTexEnviv(GLenum target, GLenum pname, const GLint * params)
2438b8e80941Smrg{
2439b8e80941Smrg    struct glx_context * const gc = __glXGetCurrentContext();
2440b8e80941Smrg    const GLuint compsize = __glTexEnviv_size(pname);
2441b8e80941Smrg    const GLuint cmdlen = 12 + safe_pad(safe_mul(compsize, 4));
2442b8e80941Smrg    if (0 + safe_pad(safe_mul(compsize, 4)) < 0) {
2443b8e80941Smrg        __glXSetError(gc, GL_INVALID_VALUE);
2444b8e80941Smrg        return;
2445848b8605Smrg    }
2446b8e80941Smrgemit_header(gc->pc, X_GLrop_TexEnviv, cmdlen);
2447b8e80941Smrg(void) memcpy((void *)(gc->pc + 4), (void *)(&target), 4);
2448b8e80941Smrg(void) memcpy((void *)(gc->pc + 8), (void *)(&pname), 4);
2449b8e80941Smrg(void) memcpy((void *)(gc->pc + 12), (void *)(params), safe_mul(compsize, 4));
2450b8e80941Smrggc->pc += cmdlen;
2451b8e80941Smrgif (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); }
2452848b8605Smrg}
2453848b8605Smrg
2454848b8605Smrg#define X_GLrop_TexGend 115
2455b8e80941Smrgvoid __indirect_glTexGend(GLenum coord, GLenum pname, GLdouble param)
2456b8e80941Smrg{
2457b8e80941Smrg    struct glx_context * const gc = __glXGetCurrentContext();
2458b8e80941Smrg    const GLuint cmdlen = 20;
2459b8e80941Smrgemit_header(gc->pc, X_GLrop_TexGend, cmdlen);
2460b8e80941Smrg(void) memcpy((void *)(gc->pc + 4), (void *)(&param), 8);
2461b8e80941Smrg(void) memcpy((void *)(gc->pc + 12), (void *)(&coord), 4);
2462b8e80941Smrg(void) memcpy((void *)(gc->pc + 16), (void *)(&pname), 4);
2463b8e80941Smrggc->pc += cmdlen;
2464b8e80941Smrgif (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); }
2465848b8605Smrg}
2466848b8605Smrg
2467848b8605Smrg#define X_GLrop_TexGendv 116
2468b8e80941Smrgvoid __indirect_glTexGendv(GLenum coord, GLenum pname, const GLdouble * params)
2469b8e80941Smrg{
2470b8e80941Smrg    struct glx_context * const gc = __glXGetCurrentContext();
2471b8e80941Smrg    const GLuint compsize = __glTexGendv_size(pname);
2472b8e80941Smrg    const GLuint cmdlen = 12 + safe_pad(safe_mul(compsize, 8));
2473b8e80941Smrg    if (0 + safe_pad(safe_mul(compsize, 8)) < 0) {
2474b8e80941Smrg        __glXSetError(gc, GL_INVALID_VALUE);
2475b8e80941Smrg        return;
2476848b8605Smrg    }
2477b8e80941Smrgemit_header(gc->pc, X_GLrop_TexGendv, cmdlen);
2478b8e80941Smrg(void) memcpy((void *)(gc->pc + 4), (void *)(&coord), 4);
2479b8e80941Smrg(void) memcpy((void *)(gc->pc + 8), (void *)(&pname), 4);
2480b8e80941Smrg(void) memcpy((void *)(gc->pc + 12), (void *)(params), safe_mul(compsize, 8));
2481b8e80941Smrggc->pc += cmdlen;
2482b8e80941Smrgif (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); }
2483848b8605Smrg}
2484848b8605Smrg
2485848b8605Smrg#define X_GLrop_TexGenf 117
2486b8e80941Smrgvoid __indirect_glTexGenf(GLenum coord, GLenum pname, GLfloat param)
2487b8e80941Smrg{
2488b8e80941Smrg    struct glx_context * const gc = __glXGetCurrentContext();
2489b8e80941Smrg    const GLuint cmdlen = 16;
2490b8e80941Smrgemit_header(gc->pc, X_GLrop_TexGenf, cmdlen);
2491b8e80941Smrg(void) memcpy((void *)(gc->pc + 4), (void *)(&coord), 4);
2492b8e80941Smrg(void) memcpy((void *)(gc->pc + 8), (void *)(&pname), 4);
2493b8e80941Smrg(void) memcpy((void *)(gc->pc + 12), (void *)(&param), 4);
2494b8e80941Smrggc->pc += cmdlen;
2495b8e80941Smrgif (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); }
2496848b8605Smrg}
2497848b8605Smrg
2498848b8605Smrg#define X_GLrop_TexGenfv 118
2499b8e80941Smrgvoid __indirect_glTexGenfv(GLenum coord, GLenum pname, const GLfloat * params)
2500b8e80941Smrg{
2501b8e80941Smrg    struct glx_context * const gc = __glXGetCurrentContext();
2502b8e80941Smrg    const GLuint compsize = __glTexGenfv_size(pname);
2503b8e80941Smrg    const GLuint cmdlen = 12 + safe_pad(safe_mul(compsize, 4));
2504b8e80941Smrg    if (0 + safe_pad(safe_mul(compsize, 4)) < 0) {
2505b8e80941Smrg        __glXSetError(gc, GL_INVALID_VALUE);
2506b8e80941Smrg        return;
2507848b8605Smrg    }
2508b8e80941Smrgemit_header(gc->pc, X_GLrop_TexGenfv, cmdlen);
2509b8e80941Smrg(void) memcpy((void *)(gc->pc + 4), (void *)(&coord), 4);
2510b8e80941Smrg(void) memcpy((void *)(gc->pc + 8), (void *)(&pname), 4);
2511b8e80941Smrg(void) memcpy((void *)(gc->pc + 12), (void *)(params), safe_mul(compsize, 4));
2512b8e80941Smrggc->pc += cmdlen;
2513b8e80941Smrgif (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); }
2514848b8605Smrg}
2515848b8605Smrg
2516848b8605Smrg#define X_GLrop_TexGeni 119
2517b8e80941Smrgvoid __indirect_glTexGeni(GLenum coord, GLenum pname, GLint param)
2518b8e80941Smrg{
2519b8e80941Smrg    struct glx_context * const gc = __glXGetCurrentContext();
2520b8e80941Smrg    const GLuint cmdlen = 16;
2521b8e80941Smrgemit_header(gc->pc, X_GLrop_TexGeni, cmdlen);
2522b8e80941Smrg(void) memcpy((void *)(gc->pc + 4), (void *)(&coord), 4);
2523b8e80941Smrg(void) memcpy((void *)(gc->pc + 8), (void *)(&pname), 4);
2524b8e80941Smrg(void) memcpy((void *)(gc->pc + 12), (void *)(&param), 4);
2525b8e80941Smrggc->pc += cmdlen;
2526b8e80941Smrgif (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); }
2527848b8605Smrg}
2528848b8605Smrg
2529848b8605Smrg#define X_GLrop_TexGeniv 120
2530b8e80941Smrgvoid __indirect_glTexGeniv(GLenum coord, GLenum pname, const GLint * params)
2531b8e80941Smrg{
2532b8e80941Smrg    struct glx_context * const gc = __glXGetCurrentContext();
2533b8e80941Smrg    const GLuint compsize = __glTexGeniv_size(pname);
2534b8e80941Smrg    const GLuint cmdlen = 12 + safe_pad(safe_mul(compsize, 4));
2535b8e80941Smrg    if (0 + safe_pad(safe_mul(compsize, 4)) < 0) {
2536b8e80941Smrg        __glXSetError(gc, GL_INVALID_VALUE);
2537b8e80941Smrg        return;
2538848b8605Smrg    }
2539b8e80941Smrgemit_header(gc->pc, X_GLrop_TexGeniv, cmdlen);
2540b8e80941Smrg(void) memcpy((void *)(gc->pc + 4), (void *)(&coord), 4);
2541b8e80941Smrg(void) memcpy((void *)(gc->pc + 8), (void *)(&pname), 4);
2542b8e80941Smrg(void) memcpy((void *)(gc->pc + 12), (void *)(params), safe_mul(compsize, 4));
2543b8e80941Smrggc->pc += cmdlen;
2544b8e80941Smrgif (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); }
2545848b8605Smrg}
2546848b8605Smrg
2547848b8605Smrg#define X_GLrop_InitNames 121
2548b8e80941Smrgvoid __indirect_glInitNames(void)
2549848b8605Smrg{
2550b8e80941Smrg    struct glx_context * const gc = __glXGetCurrentContext();
2551b8e80941Smrg    const GLuint cmdlen = 4;
2552b8e80941Smrgemit_header(gc->pc, X_GLrop_InitNames, cmdlen);
2553b8e80941Smrggc->pc += cmdlen;
2554b8e80941Smrgif (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); }
2555848b8605Smrg}
2556848b8605Smrg
2557848b8605Smrg#define X_GLrop_LoadName 122
2558b8e80941Smrgvoid __indirect_glLoadName(GLuint name)
2559848b8605Smrg{
2560b8e80941Smrg    struct glx_context * const gc = __glXGetCurrentContext();
2561b8e80941Smrg    const GLuint cmdlen = 8;
2562b8e80941Smrgemit_header(gc->pc, X_GLrop_LoadName, cmdlen);
2563b8e80941Smrg(void) memcpy((void *)(gc->pc + 4), (void *)(&name), 4);
2564b8e80941Smrggc->pc += cmdlen;
2565b8e80941Smrgif (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); }
2566848b8605Smrg}
2567848b8605Smrg
2568848b8605Smrg#define X_GLrop_PassThrough 123
2569b8e80941Smrgvoid __indirect_glPassThrough(GLfloat token)
2570848b8605Smrg{
2571b8e80941Smrg    struct glx_context * const gc = __glXGetCurrentContext();
2572b8e80941Smrg    const GLuint cmdlen = 8;
2573b8e80941Smrgemit_header(gc->pc, X_GLrop_PassThrough, cmdlen);
2574b8e80941Smrg(void) memcpy((void *)(gc->pc + 4), (void *)(&token), 4);
2575b8e80941Smrggc->pc += cmdlen;
2576b8e80941Smrgif (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); }
2577848b8605Smrg}
2578848b8605Smrg
2579848b8605Smrg#define X_GLrop_PopName 124
2580b8e80941Smrgvoid __indirect_glPopName(void)
2581848b8605Smrg{
2582b8e80941Smrg    struct glx_context * const gc = __glXGetCurrentContext();
2583b8e80941Smrg    const GLuint cmdlen = 4;
2584b8e80941Smrgemit_header(gc->pc, X_GLrop_PopName, cmdlen);
2585b8e80941Smrggc->pc += cmdlen;
2586b8e80941Smrgif (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); }
2587848b8605Smrg}
2588848b8605Smrg
2589848b8605Smrg#define X_GLrop_PushName 125
2590b8e80941Smrgvoid __indirect_glPushName(GLuint name)
2591848b8605Smrg{
2592b8e80941Smrg    struct glx_context * const gc = __glXGetCurrentContext();
2593b8e80941Smrg    const GLuint cmdlen = 8;
2594b8e80941Smrgemit_header(gc->pc, X_GLrop_PushName, cmdlen);
2595b8e80941Smrg(void) memcpy((void *)(gc->pc + 4), (void *)(&name), 4);
2596b8e80941Smrggc->pc += cmdlen;
2597b8e80941Smrgif (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); }
2598848b8605Smrg}
2599848b8605Smrg
2600848b8605Smrg#define X_GLrop_DrawBuffer 126
2601b8e80941Smrgvoid __indirect_glDrawBuffer(GLenum mode)
2602848b8605Smrg{
2603b8e80941Smrg    struct glx_context * const gc = __glXGetCurrentContext();
2604b8e80941Smrg    const GLuint cmdlen = 8;
2605b8e80941Smrgemit_header(gc->pc, X_GLrop_DrawBuffer, cmdlen);
2606b8e80941Smrg(void) memcpy((void *)(gc->pc + 4), (void *)(&mode), 4);
2607b8e80941Smrggc->pc += cmdlen;
2608b8e80941Smrgif (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); }
2609848b8605Smrg}
2610848b8605Smrg
2611848b8605Smrg#define X_GLrop_Clear 127
2612b8e80941Smrgvoid __indirect_glClear(GLbitfield mask)
2613848b8605Smrg{
2614b8e80941Smrg    struct glx_context * const gc = __glXGetCurrentContext();
2615b8e80941Smrg    const GLuint cmdlen = 8;
2616b8e80941Smrgemit_header(gc->pc, X_GLrop_Clear, cmdlen);
2617b8e80941Smrg(void) memcpy((void *)(gc->pc + 4), (void *)(&mask), 4);
2618b8e80941Smrggc->pc += cmdlen;
2619b8e80941Smrgif (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); }
2620848b8605Smrg}
2621848b8605Smrg
2622848b8605Smrg#define X_GLrop_ClearAccum 128
2623b8e80941Smrgvoid __indirect_glClearAccum(GLfloat red, GLfloat green, GLfloat blue, GLfloat alpha)
2624b8e80941Smrg{
2625b8e80941Smrg    struct glx_context * const gc = __glXGetCurrentContext();
2626b8e80941Smrg    const GLuint cmdlen = 20;
2627b8e80941Smrgemit_header(gc->pc, X_GLrop_ClearAccum, cmdlen);
2628b8e80941Smrg(void) memcpy((void *)(gc->pc + 4), (void *)(&red), 4);
2629b8e80941Smrg(void) memcpy((void *)(gc->pc + 8), (void *)(&green), 4);
2630b8e80941Smrg(void) memcpy((void *)(gc->pc + 12), (void *)(&blue), 4);
2631b8e80941Smrg(void) memcpy((void *)(gc->pc + 16), (void *)(&alpha), 4);
2632b8e80941Smrggc->pc += cmdlen;
2633b8e80941Smrgif (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); }
2634848b8605Smrg}
2635848b8605Smrg
2636848b8605Smrg#define X_GLrop_ClearIndex 129
2637b8e80941Smrgvoid __indirect_glClearIndex(GLfloat c)
2638848b8605Smrg{
2639b8e80941Smrg    struct glx_context * const gc = __glXGetCurrentContext();
2640b8e80941Smrg    const GLuint cmdlen = 8;
2641b8e80941Smrgemit_header(gc->pc, X_GLrop_ClearIndex, cmdlen);
2642b8e80941Smrg(void) memcpy((void *)(gc->pc + 4), (void *)(&c), 4);
2643b8e80941Smrggc->pc += cmdlen;
2644b8e80941Smrgif (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); }
2645848b8605Smrg}
2646848b8605Smrg
2647848b8605Smrg#define X_GLrop_ClearColor 130
2648b8e80941Smrgvoid __indirect_glClearColor(GLclampf red, GLclampf green, GLclampf blue, GLclampf alpha)
2649b8e80941Smrg{
2650b8e80941Smrg    struct glx_context * const gc = __glXGetCurrentContext();
2651b8e80941Smrg    const GLuint cmdlen = 20;
2652b8e80941Smrgemit_header(gc->pc, X_GLrop_ClearColor, cmdlen);
2653b8e80941Smrg(void) memcpy((void *)(gc->pc + 4), (void *)(&red), 4);
2654b8e80941Smrg(void) memcpy((void *)(gc->pc + 8), (void *)(&green), 4);
2655b8e80941Smrg(void) memcpy((void *)(gc->pc + 12), (void *)(&blue), 4);
2656b8e80941Smrg(void) memcpy((void *)(gc->pc + 16), (void *)(&alpha), 4);
2657b8e80941Smrggc->pc += cmdlen;
2658b8e80941Smrgif (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); }
2659848b8605Smrg}
2660848b8605Smrg
2661848b8605Smrg#define X_GLrop_ClearStencil 131
2662b8e80941Smrgvoid __indirect_glClearStencil(GLint s)
2663848b8605Smrg{
2664b8e80941Smrg    struct glx_context * const gc = __glXGetCurrentContext();
2665b8e80941Smrg    const GLuint cmdlen = 8;
2666b8e80941Smrgemit_header(gc->pc, X_GLrop_ClearStencil, cmdlen);
2667b8e80941Smrg(void) memcpy((void *)(gc->pc + 4), (void *)(&s), 4);
2668b8e80941Smrggc->pc += cmdlen;
2669b8e80941Smrgif (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); }
2670848b8605Smrg}
2671848b8605Smrg
2672848b8605Smrg#define X_GLrop_ClearDepth 132
2673b8e80941Smrgvoid __indirect_glClearDepth(GLclampd depth)
2674848b8605Smrg{
2675b8e80941Smrg    struct glx_context * const gc = __glXGetCurrentContext();
2676b8e80941Smrg    const GLuint cmdlen = 12;
2677b8e80941Smrgemit_header(gc->pc, X_GLrop_ClearDepth, cmdlen);
2678b8e80941Smrg(void) memcpy((void *)(gc->pc + 4), (void *)(&depth), 8);
2679b8e80941Smrggc->pc += cmdlen;
2680b8e80941Smrgif (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); }
2681848b8605Smrg}
2682848b8605Smrg
2683848b8605Smrg#define X_GLrop_StencilMask 133
2684b8e80941Smrgvoid __indirect_glStencilMask(GLuint mask)
2685848b8605Smrg{
2686b8e80941Smrg    struct glx_context * const gc = __glXGetCurrentContext();
2687b8e80941Smrg    const GLuint cmdlen = 8;
2688b8e80941Smrgemit_header(gc->pc, X_GLrop_StencilMask, cmdlen);
2689b8e80941Smrg(void) memcpy((void *)(gc->pc + 4), (void *)(&mask), 4);
2690b8e80941Smrggc->pc += cmdlen;
2691b8e80941Smrgif (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); }
2692848b8605Smrg}
2693848b8605Smrg
2694848b8605Smrg#define X_GLrop_ColorMask 134
2695b8e80941Smrgvoid __indirect_glColorMask(GLboolean red, GLboolean green, GLboolean blue, GLboolean alpha)
2696b8e80941Smrg{
2697b8e80941Smrg    struct glx_context * const gc = __glXGetCurrentContext();
2698b8e80941Smrg    const GLuint cmdlen = 8;
2699b8e80941Smrgemit_header(gc->pc, X_GLrop_ColorMask, cmdlen);
2700b8e80941Smrg(void) memcpy((void *)(gc->pc + 4), (void *)(&red), 1);
2701b8e80941Smrg(void) memcpy((void *)(gc->pc + 5), (void *)(&green), 1);
2702b8e80941Smrg(void) memcpy((void *)(gc->pc + 6), (void *)(&blue), 1);
2703b8e80941Smrg(void) memcpy((void *)(gc->pc + 7), (void *)(&alpha), 1);
2704b8e80941Smrggc->pc += cmdlen;
2705b8e80941Smrgif (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); }
2706848b8605Smrg}
2707848b8605Smrg
2708848b8605Smrg#define X_GLrop_DepthMask 135
2709b8e80941Smrgvoid __indirect_glDepthMask(GLboolean flag)
2710848b8605Smrg{
2711b8e80941Smrg    struct glx_context * const gc = __glXGetCurrentContext();
2712b8e80941Smrg    const GLuint cmdlen = 8;
2713b8e80941Smrgemit_header(gc->pc, X_GLrop_DepthMask, cmdlen);
2714b8e80941Smrg(void) memcpy((void *)(gc->pc + 4), (void *)(&flag), 1);
2715b8e80941Smrggc->pc += cmdlen;
2716b8e80941Smrgif (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); }
2717848b8605Smrg}
2718848b8605Smrg
2719848b8605Smrg#define X_GLrop_IndexMask 136
2720b8e80941Smrgvoid __indirect_glIndexMask(GLuint mask)
2721848b8605Smrg{
2722b8e80941Smrg    struct glx_context * const gc = __glXGetCurrentContext();
2723b8e80941Smrg    const GLuint cmdlen = 8;
2724b8e80941Smrgemit_header(gc->pc, X_GLrop_IndexMask, cmdlen);
2725b8e80941Smrg(void) memcpy((void *)(gc->pc + 4), (void *)(&mask), 4);
2726b8e80941Smrggc->pc += cmdlen;
2727b8e80941Smrgif (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); }
2728848b8605Smrg}
2729848b8605Smrg
2730848b8605Smrg#define X_GLrop_Accum 137
2731b8e80941Smrgvoid __indirect_glAccum(GLenum op, GLfloat value)
2732b8e80941Smrg{
2733b8e80941Smrg    struct glx_context * const gc = __glXGetCurrentContext();
2734b8e80941Smrg    const GLuint cmdlen = 12;
2735b8e80941Smrgemit_header(gc->pc, X_GLrop_Accum, cmdlen);
2736b8e80941Smrg(void) memcpy((void *)(gc->pc + 4), (void *)(&op), 4);
2737b8e80941Smrg(void) memcpy((void *)(gc->pc + 8), (void *)(&value), 4);
2738b8e80941Smrggc->pc += cmdlen;
2739b8e80941Smrgif (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); }
2740848b8605Smrg}
2741848b8605Smrg
2742848b8605Smrg#define X_GLrop_PopAttrib 141
2743b8e80941Smrgvoid __indirect_glPopAttrib(void)
2744848b8605Smrg{
2745b8e80941Smrg    struct glx_context * const gc = __glXGetCurrentContext();
2746b8e80941Smrg    const GLuint cmdlen = 4;
2747b8e80941Smrgemit_header(gc->pc, X_GLrop_PopAttrib, cmdlen);
2748b8e80941Smrggc->pc += cmdlen;
2749b8e80941Smrgif (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); }
2750848b8605Smrg}
2751848b8605Smrg
2752848b8605Smrg#define X_GLrop_PushAttrib 142
2753b8e80941Smrgvoid __indirect_glPushAttrib(GLbitfield mask)
2754848b8605Smrg{
2755b8e80941Smrg    struct glx_context * const gc = __glXGetCurrentContext();
2756b8e80941Smrg    const GLuint cmdlen = 8;
2757b8e80941Smrgemit_header(gc->pc, X_GLrop_PushAttrib, cmdlen);
2758b8e80941Smrg(void) memcpy((void *)(gc->pc + 4), (void *)(&mask), 4);
2759b8e80941Smrggc->pc += cmdlen;
2760b8e80941Smrgif (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); }
2761848b8605Smrg}
2762848b8605Smrg
2763848b8605Smrg#define X_GLrop_MapGrid1d 147
2764b8e80941Smrgvoid __indirect_glMapGrid1d(GLint un, GLdouble u1, GLdouble u2)
2765b8e80941Smrg{
2766b8e80941Smrg    struct glx_context * const gc = __glXGetCurrentContext();
2767b8e80941Smrg    const GLuint cmdlen = 24;
2768b8e80941Smrgemit_header(gc->pc, X_GLrop_MapGrid1d, cmdlen);
2769b8e80941Smrg(void) memcpy((void *)(gc->pc + 4), (void *)(&u1), 8);
2770b8e80941Smrg(void) memcpy((void *)(gc->pc + 12), (void *)(&u2), 8);
2771b8e80941Smrg(void) memcpy((void *)(gc->pc + 20), (void *)(&un), 4);
2772b8e80941Smrggc->pc += cmdlen;
2773b8e80941Smrgif (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); }
2774848b8605Smrg}
2775848b8605Smrg
2776848b8605Smrg#define X_GLrop_MapGrid1f 148
2777b8e80941Smrgvoid __indirect_glMapGrid1f(GLint un, GLfloat u1, GLfloat u2)
2778b8e80941Smrg{
2779b8e80941Smrg    struct glx_context * const gc = __glXGetCurrentContext();
2780b8e80941Smrg    const GLuint cmdlen = 16;
2781b8e80941Smrgemit_header(gc->pc, X_GLrop_MapGrid1f, cmdlen);
2782b8e80941Smrg(void) memcpy((void *)(gc->pc + 4), (void *)(&un), 4);
2783b8e80941Smrg(void) memcpy((void *)(gc->pc + 8), (void *)(&u1), 4);
2784b8e80941Smrg(void) memcpy((void *)(gc->pc + 12), (void *)(&u2), 4);
2785b8e80941Smrggc->pc += cmdlen;
2786b8e80941Smrgif (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); }
2787848b8605Smrg}
2788848b8605Smrg
2789848b8605Smrg#define X_GLrop_MapGrid2d 149
2790b8e80941Smrgvoid __indirect_glMapGrid2d(GLint un, GLdouble u1, GLdouble u2, GLint vn, GLdouble v1, GLdouble v2)
2791b8e80941Smrg{
2792b8e80941Smrg    struct glx_context * const gc = __glXGetCurrentContext();
2793b8e80941Smrg    const GLuint cmdlen = 44;
2794b8e80941Smrgemit_header(gc->pc, X_GLrop_MapGrid2d, cmdlen);
2795b8e80941Smrg(void) memcpy((void *)(gc->pc + 4), (void *)(&u1), 8);
2796b8e80941Smrg(void) memcpy((void *)(gc->pc + 12), (void *)(&u2), 8);
2797b8e80941Smrg(void) memcpy((void *)(gc->pc + 20), (void *)(&v1), 8);
2798b8e80941Smrg(void) memcpy((void *)(gc->pc + 28), (void *)(&v2), 8);
2799b8e80941Smrg(void) memcpy((void *)(gc->pc + 36), (void *)(&un), 4);
2800b8e80941Smrg(void) memcpy((void *)(gc->pc + 40), (void *)(&vn), 4);
2801b8e80941Smrggc->pc += cmdlen;
2802b8e80941Smrgif (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); }
2803848b8605Smrg}
2804848b8605Smrg
2805848b8605Smrg#define X_GLrop_MapGrid2f 150
2806b8e80941Smrgvoid __indirect_glMapGrid2f(GLint un, GLfloat u1, GLfloat u2, GLint vn, GLfloat v1, GLfloat v2)
2807b8e80941Smrg{
2808b8e80941Smrg    struct glx_context * const gc = __glXGetCurrentContext();
2809b8e80941Smrg    const GLuint cmdlen = 28;
2810b8e80941Smrgemit_header(gc->pc, X_GLrop_MapGrid2f, cmdlen);
2811b8e80941Smrg(void) memcpy((void *)(gc->pc + 4), (void *)(&un), 4);
2812b8e80941Smrg(void) memcpy((void *)(gc->pc + 8), (void *)(&u1), 4);
2813b8e80941Smrg(void) memcpy((void *)(gc->pc + 12), (void *)(&u2), 4);
2814b8e80941Smrg(void) memcpy((void *)(gc->pc + 16), (void *)(&vn), 4);
2815b8e80941Smrg(void) memcpy((void *)(gc->pc + 20), (void *)(&v1), 4);
2816b8e80941Smrg(void) memcpy((void *)(gc->pc + 24), (void *)(&v2), 4);
2817b8e80941Smrggc->pc += cmdlen;
2818b8e80941Smrgif (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); }
2819848b8605Smrg}
2820848b8605Smrg
2821848b8605Smrg#define X_GLrop_EvalCoord1dv 151
2822b8e80941Smrgvoid __indirect_glEvalCoord1d(GLdouble u)
2823848b8605Smrg{
2824b8e80941Smrg    struct glx_context * const gc = __glXGetCurrentContext();
2825b8e80941Smrg    const GLuint cmdlen = 12;
2826b8e80941Smrgemit_header(gc->pc, X_GLrop_EvalCoord1dv, cmdlen);
2827b8e80941Smrg(void) memcpy((void *)(gc->pc + 4), (void *)(&u), 8);
2828b8e80941Smrggc->pc += cmdlen;
2829b8e80941Smrgif (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); }
2830848b8605Smrg}
2831848b8605Smrg
2832848b8605Smrg#define X_GLrop_EvalCoord1dv 151
2833b8e80941Smrgvoid __indirect_glEvalCoord1dv(const GLdouble * u)
2834848b8605Smrg{
2835b8e80941Smrg    generic_8_byte( X_GLrop_EvalCoord1dv, u );
2836848b8605Smrg}
2837848b8605Smrg
2838848b8605Smrg#define X_GLrop_EvalCoord1fv 152
2839b8e80941Smrgvoid __indirect_glEvalCoord1f(GLfloat u)
2840848b8605Smrg{
2841b8e80941Smrg    struct glx_context * const gc = __glXGetCurrentContext();
2842b8e80941Smrg    const GLuint cmdlen = 8;
2843b8e80941Smrgemit_header(gc->pc, X_GLrop_EvalCoord1fv, cmdlen);
2844b8e80941Smrg(void) memcpy((void *)(gc->pc + 4), (void *)(&u), 4);
2845b8e80941Smrggc->pc += cmdlen;
2846b8e80941Smrgif (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); }
2847848b8605Smrg}
2848848b8605Smrg
2849848b8605Smrg#define X_GLrop_EvalCoord1fv 152
2850b8e80941Smrgvoid __indirect_glEvalCoord1fv(const GLfloat * u)
2851848b8605Smrg{
2852b8e80941Smrg    generic_4_byte( X_GLrop_EvalCoord1fv, u );
2853848b8605Smrg}
2854848b8605Smrg
2855848b8605Smrg#define X_GLrop_EvalCoord2dv 153
2856b8e80941Smrgvoid __indirect_glEvalCoord2d(GLdouble u, GLdouble v)
2857b8e80941Smrg{
2858b8e80941Smrg    struct glx_context * const gc = __glXGetCurrentContext();
2859b8e80941Smrg    const GLuint cmdlen = 20;
2860b8e80941Smrgemit_header(gc->pc, X_GLrop_EvalCoord2dv, cmdlen);
2861b8e80941Smrg(void) memcpy((void *)(gc->pc + 4), (void *)(&u), 8);
2862b8e80941Smrg(void) memcpy((void *)(gc->pc + 12), (void *)(&v), 8);
2863b8e80941Smrggc->pc += cmdlen;
2864b8e80941Smrgif (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); }
2865848b8605Smrg}
2866848b8605Smrg
2867848b8605Smrg#define X_GLrop_EvalCoord2dv 153
2868b8e80941Smrgvoid __indirect_glEvalCoord2dv(const GLdouble * u)
2869848b8605Smrg{
2870b8e80941Smrg    generic_16_byte( X_GLrop_EvalCoord2dv, u );
2871848b8605Smrg}
2872848b8605Smrg
2873848b8605Smrg#define X_GLrop_EvalCoord2fv 154
2874b8e80941Smrgvoid __indirect_glEvalCoord2f(GLfloat u, GLfloat v)
2875b8e80941Smrg{
2876b8e80941Smrg    struct glx_context * const gc = __glXGetCurrentContext();
2877b8e80941Smrg    const GLuint cmdlen = 12;
2878b8e80941Smrgemit_header(gc->pc, X_GLrop_EvalCoord2fv, cmdlen);
2879b8e80941Smrg(void) memcpy((void *)(gc->pc + 4), (void *)(&u), 4);
2880b8e80941Smrg(void) memcpy((void *)(gc->pc + 8), (void *)(&v), 4);
2881b8e80941Smrggc->pc += cmdlen;
2882b8e80941Smrgif (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); }
2883848b8605Smrg}
2884848b8605Smrg
2885848b8605Smrg#define X_GLrop_EvalCoord2fv 154
2886b8e80941Smrgvoid __indirect_glEvalCoord2fv(const GLfloat * u)
2887848b8605Smrg{
2888b8e80941Smrg    generic_8_byte( X_GLrop_EvalCoord2fv, u );
2889848b8605Smrg}
2890848b8605Smrg
2891848b8605Smrg#define X_GLrop_EvalMesh1 155
2892b8e80941Smrgvoid __indirect_glEvalMesh1(GLenum mode, GLint i1, GLint i2)
2893b8e80941Smrg{
2894b8e80941Smrg    struct glx_context * const gc = __glXGetCurrentContext();
2895b8e80941Smrg    const GLuint cmdlen = 16;
2896b8e80941Smrgemit_header(gc->pc, X_GLrop_EvalMesh1, cmdlen);
2897b8e80941Smrg(void) memcpy((void *)(gc->pc + 4), (void *)(&mode), 4);
2898b8e80941Smrg(void) memcpy((void *)(gc->pc + 8), (void *)(&i1), 4);
2899b8e80941Smrg(void) memcpy((void *)(gc->pc + 12), (void *)(&i2), 4);
2900b8e80941Smrggc->pc += cmdlen;
2901b8e80941Smrgif (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); }
2902848b8605Smrg}
2903848b8605Smrg
2904848b8605Smrg#define X_GLrop_EvalPoint1 156
2905b8e80941Smrgvoid __indirect_glEvalPoint1(GLint i)
2906848b8605Smrg{
2907b8e80941Smrg    struct glx_context * const gc = __glXGetCurrentContext();
2908b8e80941Smrg    const GLuint cmdlen = 8;
2909b8e80941Smrgemit_header(gc->pc, X_GLrop_EvalPoint1, cmdlen);
2910b8e80941Smrg(void) memcpy((void *)(gc->pc + 4), (void *)(&i), 4);
2911b8e80941Smrggc->pc += cmdlen;
2912b8e80941Smrgif (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); }
2913848b8605Smrg}
2914848b8605Smrg
2915848b8605Smrg#define X_GLrop_EvalMesh2 157
2916b8e80941Smrgvoid __indirect_glEvalMesh2(GLenum mode, GLint i1, GLint i2, GLint j1, GLint j2)
2917b8e80941Smrg{
2918b8e80941Smrg    struct glx_context * const gc = __glXGetCurrentContext();
2919b8e80941Smrg    const GLuint cmdlen = 24;
2920b8e80941Smrgemit_header(gc->pc, X_GLrop_EvalMesh2, cmdlen);
2921b8e80941Smrg(void) memcpy((void *)(gc->pc + 4), (void *)(&mode), 4);
2922b8e80941Smrg(void) memcpy((void *)(gc->pc + 8), (void *)(&i1), 4);
2923b8e80941Smrg(void) memcpy((void *)(gc->pc + 12), (void *)(&i2), 4);
2924b8e80941Smrg(void) memcpy((void *)(gc->pc + 16), (void *)(&j1), 4);
2925b8e80941Smrg(void) memcpy((void *)(gc->pc + 20), (void *)(&j2), 4);
2926b8e80941Smrggc->pc += cmdlen;
2927b8e80941Smrgif (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); }
2928848b8605Smrg}
2929848b8605Smrg
2930848b8605Smrg#define X_GLrop_EvalPoint2 158
2931b8e80941Smrgvoid __indirect_glEvalPoint2(GLint i, GLint j)
2932b8e80941Smrg{
2933b8e80941Smrg    struct glx_context * const gc = __glXGetCurrentContext();
2934b8e80941Smrg    const GLuint cmdlen = 12;
2935b8e80941Smrgemit_header(gc->pc, X_GLrop_EvalPoint2, cmdlen);
2936b8e80941Smrg(void) memcpy((void *)(gc->pc + 4), (void *)(&i), 4);
2937b8e80941Smrg(void) memcpy((void *)(gc->pc + 8), (void *)(&j), 4);
2938b8e80941Smrggc->pc += cmdlen;
2939b8e80941Smrgif (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); }
2940848b8605Smrg}
2941848b8605Smrg
2942848b8605Smrg#define X_GLrop_AlphaFunc 159
2943b8e80941Smrgvoid __indirect_glAlphaFunc(GLenum func, GLclampf ref)
2944b8e80941Smrg{
2945b8e80941Smrg    struct glx_context * const gc = __glXGetCurrentContext();
2946b8e80941Smrg    const GLuint cmdlen = 12;
2947b8e80941Smrgemit_header(gc->pc, X_GLrop_AlphaFunc, cmdlen);
2948b8e80941Smrg(void) memcpy((void *)(gc->pc + 4), (void *)(&func), 4);
2949b8e80941Smrg(void) memcpy((void *)(gc->pc + 8), (void *)(&ref), 4);
2950b8e80941Smrggc->pc += cmdlen;
2951b8e80941Smrgif (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); }
2952848b8605Smrg}
2953848b8605Smrg
2954848b8605Smrg#define X_GLrop_BlendFunc 160
2955b8e80941Smrgvoid __indirect_glBlendFunc(GLenum sfactor, GLenum dfactor)
2956b8e80941Smrg{
2957b8e80941Smrg    struct glx_context * const gc = __glXGetCurrentContext();
2958b8e80941Smrg    const GLuint cmdlen = 12;
2959b8e80941Smrgemit_header(gc->pc, X_GLrop_BlendFunc, cmdlen);
2960b8e80941Smrg(void) memcpy((void *)(gc->pc + 4), (void *)(&sfactor), 4);
2961b8e80941Smrg(void) memcpy((void *)(gc->pc + 8), (void *)(&dfactor), 4);
2962b8e80941Smrggc->pc += cmdlen;
2963b8e80941Smrgif (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); }
2964848b8605Smrg}
2965848b8605Smrg
2966848b8605Smrg#define X_GLrop_LogicOp 161
2967b8e80941Smrgvoid __indirect_glLogicOp(GLenum opcode)
2968848b8605Smrg{
2969b8e80941Smrg    struct glx_context * const gc = __glXGetCurrentContext();
2970b8e80941Smrg    const GLuint cmdlen = 8;
2971b8e80941Smrgemit_header(gc->pc, X_GLrop_LogicOp, cmdlen);
2972b8e80941Smrg(void) memcpy((void *)(gc->pc + 4), (void *)(&opcode), 4);
2973b8e80941Smrggc->pc += cmdlen;
2974b8e80941Smrgif (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); }
2975848b8605Smrg}
2976848b8605Smrg
2977848b8605Smrg#define X_GLrop_StencilFunc 162
2978b8e80941Smrgvoid __indirect_glStencilFunc(GLenum func, GLint ref, GLuint mask)
2979b8e80941Smrg{
2980b8e80941Smrg    struct glx_context * const gc = __glXGetCurrentContext();
2981b8e80941Smrg    const GLuint cmdlen = 16;
2982b8e80941Smrgemit_header(gc->pc, X_GLrop_StencilFunc, cmdlen);
2983b8e80941Smrg(void) memcpy((void *)(gc->pc + 4), (void *)(&func), 4);
2984b8e80941Smrg(void) memcpy((void *)(gc->pc + 8), (void *)(&ref), 4);
2985b8e80941Smrg(void) memcpy((void *)(gc->pc + 12), (void *)(&mask), 4);
2986b8e80941Smrggc->pc += cmdlen;
2987b8e80941Smrgif (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); }
2988848b8605Smrg}
2989848b8605Smrg
2990848b8605Smrg#define X_GLrop_StencilOp 163
2991b8e80941Smrgvoid __indirect_glStencilOp(GLenum fail, GLenum zfail, GLenum zpass)
2992b8e80941Smrg{
2993b8e80941Smrg    struct glx_context * const gc = __glXGetCurrentContext();
2994b8e80941Smrg    const GLuint cmdlen = 16;
2995b8e80941Smrgemit_header(gc->pc, X_GLrop_StencilOp, cmdlen);
2996b8e80941Smrg(void) memcpy((void *)(gc->pc + 4), (void *)(&fail), 4);
2997b8e80941Smrg(void) memcpy((void *)(gc->pc + 8), (void *)(&zfail), 4);
2998b8e80941Smrg(void) memcpy((void *)(gc->pc + 12), (void *)(&zpass), 4);
2999b8e80941Smrggc->pc += cmdlen;
3000b8e80941Smrgif (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); }
3001848b8605Smrg}
3002848b8605Smrg
3003848b8605Smrg#define X_GLrop_DepthFunc 164
3004b8e80941Smrgvoid __indirect_glDepthFunc(GLenum func)
3005848b8605Smrg{
3006b8e80941Smrg    struct glx_context * const gc = __glXGetCurrentContext();
3007b8e80941Smrg    const GLuint cmdlen = 8;
3008b8e80941Smrgemit_header(gc->pc, X_GLrop_DepthFunc, cmdlen);
3009b8e80941Smrg(void) memcpy((void *)(gc->pc + 4), (void *)(&func), 4);
3010b8e80941Smrggc->pc += cmdlen;
3011b8e80941Smrgif (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); }
3012848b8605Smrg}
3013848b8605Smrg
3014848b8605Smrg#define X_GLrop_PixelZoom 165
3015b8e80941Smrgvoid __indirect_glPixelZoom(GLfloat xfactor, GLfloat yfactor)
3016b8e80941Smrg{
3017b8e80941Smrg    struct glx_context * const gc = __glXGetCurrentContext();
3018b8e80941Smrg    const GLuint cmdlen = 12;
3019b8e80941Smrgemit_header(gc->pc, X_GLrop_PixelZoom, cmdlen);
3020b8e80941Smrg(void) memcpy((void *)(gc->pc + 4), (void *)(&xfactor), 4);
3021b8e80941Smrg(void) memcpy((void *)(gc->pc + 8), (void *)(&yfactor), 4);
3022b8e80941Smrggc->pc += cmdlen;
3023b8e80941Smrgif (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); }
3024848b8605Smrg}
3025848b8605Smrg
3026848b8605Smrg#define X_GLrop_PixelTransferf 166
3027b8e80941Smrgvoid __indirect_glPixelTransferf(GLenum pname, GLfloat param)
3028b8e80941Smrg{
3029b8e80941Smrg    struct glx_context * const gc = __glXGetCurrentContext();
3030b8e80941Smrg    const GLuint cmdlen = 12;
3031b8e80941Smrgemit_header(gc->pc, X_GLrop_PixelTransferf, cmdlen);
3032b8e80941Smrg(void) memcpy((void *)(gc->pc + 4), (void *)(&pname), 4);
3033b8e80941Smrg(void) memcpy((void *)(gc->pc + 8), (void *)(&param), 4);
3034b8e80941Smrggc->pc += cmdlen;
3035b8e80941Smrgif (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); }
3036848b8605Smrg}
3037848b8605Smrg
3038848b8605Smrg#define X_GLrop_PixelTransferi 167
3039b8e80941Smrgvoid __indirect_glPixelTransferi(GLenum pname, GLint param)
3040b8e80941Smrg{
3041b8e80941Smrg    struct glx_context * const gc = __glXGetCurrentContext();
3042b8e80941Smrg    const GLuint cmdlen = 12;
3043b8e80941Smrgemit_header(gc->pc, X_GLrop_PixelTransferi, cmdlen);
3044b8e80941Smrg(void) memcpy((void *)(gc->pc + 4), (void *)(&pname), 4);
3045b8e80941Smrg(void) memcpy((void *)(gc->pc + 8), (void *)(&param), 4);
3046b8e80941Smrggc->pc += cmdlen;
3047b8e80941Smrgif (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); }
3048848b8605Smrg}
3049848b8605Smrg
3050848b8605Smrg#define X_GLrop_PixelMapfv 168
3051b8e80941Smrgvoid __indirect_glPixelMapfv(GLenum map, GLsizei mapsize, const GLfloat * values)
3052848b8605Smrg{
3053b8e80941Smrg    struct glx_context * const gc = __glXGetCurrentContext();
3054b8e80941Smrg    const GLuint cmdlen = 12 + safe_pad(safe_mul(mapsize, 4));
3055b8e80941Smrg    if (0 + safe_pad(safe_mul(mapsize, 4)) < 0) {
3056b8e80941Smrg        __glXSetError(gc, GL_INVALID_VALUE);
3057b8e80941Smrg        return;
3058b8e80941Smrg    }
3059848b8605Smrg    if (mapsize < 0) {
3060848b8605Smrg        __glXSetError(gc, GL_INVALID_VALUE);
3061848b8605Smrg        return;
3062848b8605Smrg    }
3063848b8605Smrg    if (__builtin_expect((mapsize >= 0) && (gc->currentDpy != NULL), 1)) {
3064b8e80941Smrgif (cmdlen <= gc->maxSmallRenderCommandSize) {
3065b8e80941Smrg    if ( (gc->pc + cmdlen) > gc->bufEnd ) {
3066b8e80941Smrg        (void) __glXFlushRenderBuffer(gc, gc->pc);
3067b8e80941Smrg    }
3068b8e80941Smrgemit_header(gc->pc, X_GLrop_PixelMapfv, cmdlen);
3069b8e80941Smrg(void) memcpy((void *)(gc->pc + 4), (void *)(&map), 4);
3070b8e80941Smrg(void) memcpy((void *)(gc->pc + 8), (void *)(&mapsize), 4);
3071b8e80941Smrg(void) memcpy((void *)(gc->pc + 12), (void *)(values), safe_mul(mapsize, 4));
3072b8e80941Smrggc->pc += cmdlen;
3073b8e80941Smrgif (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); }
3074b8e80941Smrg}
3075b8e80941Smrgelse {
3076b8e80941Smrgconst GLint op = X_GLrop_PixelMapfv;
3077b8e80941Smrgconst GLuint cmdlenLarge = cmdlen + 4;
3078b8e80941SmrgGLubyte * const pc = __glXFlushRenderBuffer(gc, gc->pc);
3079b8e80941Smrg(void) memcpy((void *)(pc + 0), (void *)(&cmdlenLarge), 4);
3080b8e80941Smrg(void) memcpy((void *)(pc + 4), (void *)(&op), 4);
3081b8e80941Smrg(void) memcpy((void *)(pc + 8), (void *)(&map), 4);
3082b8e80941Smrg(void) memcpy((void *)(pc + 12), (void *)(&mapsize), 4);
3083b8e80941Smrg    __glXSendLargeCommand(gc, pc, 16, values, safe_mul(mapsize, 4));
3084b8e80941Smrg}
3085848b8605Smrg    }
3086848b8605Smrg}
3087848b8605Smrg
3088848b8605Smrg#define X_GLrop_PixelMapuiv 169
3089b8e80941Smrgvoid __indirect_glPixelMapuiv(GLenum map, GLsizei mapsize, const GLuint * values)
3090848b8605Smrg{
3091b8e80941Smrg    struct glx_context * const gc = __glXGetCurrentContext();
3092b8e80941Smrg    const GLuint cmdlen = 12 + safe_pad(safe_mul(mapsize, 4));
3093b8e80941Smrg    if (0 + safe_pad(safe_mul(mapsize, 4)) < 0) {
3094b8e80941Smrg        __glXSetError(gc, GL_INVALID_VALUE);
3095b8e80941Smrg        return;
3096b8e80941Smrg    }
3097848b8605Smrg    if (mapsize < 0) {
3098848b8605Smrg        __glXSetError(gc, GL_INVALID_VALUE);
3099848b8605Smrg        return;
3100848b8605Smrg    }
3101848b8605Smrg    if (__builtin_expect((mapsize >= 0) && (gc->currentDpy != NULL), 1)) {
3102b8e80941Smrgif (cmdlen <= gc->maxSmallRenderCommandSize) {
3103b8e80941Smrg    if ( (gc->pc + cmdlen) > gc->bufEnd ) {
3104b8e80941Smrg        (void) __glXFlushRenderBuffer(gc, gc->pc);
3105b8e80941Smrg    }
3106b8e80941Smrgemit_header(gc->pc, X_GLrop_PixelMapuiv, cmdlen);
3107b8e80941Smrg(void) memcpy((void *)(gc->pc + 4), (void *)(&map), 4);
3108b8e80941Smrg(void) memcpy((void *)(gc->pc + 8), (void *)(&mapsize), 4);
3109b8e80941Smrg(void) memcpy((void *)(gc->pc + 12), (void *)(values), safe_mul(mapsize, 4));
3110b8e80941Smrggc->pc += cmdlen;
3111b8e80941Smrgif (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); }
3112b8e80941Smrg}
3113b8e80941Smrgelse {
3114b8e80941Smrgconst GLint op = X_GLrop_PixelMapuiv;
3115b8e80941Smrgconst GLuint cmdlenLarge = cmdlen + 4;
3116b8e80941SmrgGLubyte * const pc = __glXFlushRenderBuffer(gc, gc->pc);
3117b8e80941Smrg(void) memcpy((void *)(pc + 0), (void *)(&cmdlenLarge), 4);
3118b8e80941Smrg(void) memcpy((void *)(pc + 4), (void *)(&op), 4);
3119b8e80941Smrg(void) memcpy((void *)(pc + 8), (void *)(&map), 4);
3120b8e80941Smrg(void) memcpy((void *)(pc + 12), (void *)(&mapsize), 4);
3121b8e80941Smrg    __glXSendLargeCommand(gc, pc, 16, values, safe_mul(mapsize, 4));
3122b8e80941Smrg}
3123848b8605Smrg    }
3124848b8605Smrg}
3125848b8605Smrg
3126848b8605Smrg#define X_GLrop_PixelMapusv 170
3127b8e80941Smrgvoid __indirect_glPixelMapusv(GLenum map, GLsizei mapsize, const GLushort * values)
3128848b8605Smrg{
3129b8e80941Smrg    struct glx_context * const gc = __glXGetCurrentContext();
3130b8e80941Smrg    const GLuint cmdlen = 12 + safe_pad(safe_mul(mapsize, 2));
3131b8e80941Smrg    if (0 + safe_pad(safe_mul(mapsize, 2)) < 0) {
3132b8e80941Smrg        __glXSetError(gc, GL_INVALID_VALUE);
3133b8e80941Smrg        return;
3134b8e80941Smrg    }
3135848b8605Smrg    if (mapsize < 0) {
3136848b8605Smrg        __glXSetError(gc, GL_INVALID_VALUE);
3137848b8605Smrg        return;
3138848b8605Smrg    }
3139848b8605Smrg    if (__builtin_expect((mapsize >= 0) && (gc->currentDpy != NULL), 1)) {
3140b8e80941Smrgif (cmdlen <= gc->maxSmallRenderCommandSize) {
3141b8e80941Smrg    if ( (gc->pc + cmdlen) > gc->bufEnd ) {
3142b8e80941Smrg        (void) __glXFlushRenderBuffer(gc, gc->pc);
3143b8e80941Smrg    }
3144b8e80941Smrgemit_header(gc->pc, X_GLrop_PixelMapusv, cmdlen);
3145b8e80941Smrg(void) memcpy((void *)(gc->pc + 4), (void *)(&map), 4);
3146b8e80941Smrg(void) memcpy((void *)(gc->pc + 8), (void *)(&mapsize), 4);
3147b8e80941Smrg(void) memcpy((void *)(gc->pc + 12), (void *)(values), safe_mul(mapsize, 2));
3148b8e80941Smrggc->pc += cmdlen;
3149b8e80941Smrgif (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); }
3150b8e80941Smrg}
3151b8e80941Smrgelse {
3152b8e80941Smrgconst GLint op = X_GLrop_PixelMapusv;
3153b8e80941Smrgconst GLuint cmdlenLarge = cmdlen + 4;
3154b8e80941SmrgGLubyte * const pc = __glXFlushRenderBuffer(gc, gc->pc);
3155b8e80941Smrg(void) memcpy((void *)(pc + 0), (void *)(&cmdlenLarge), 4);
3156b8e80941Smrg(void) memcpy((void *)(pc + 4), (void *)(&op), 4);
3157b8e80941Smrg(void) memcpy((void *)(pc + 8), (void *)(&map), 4);
3158b8e80941Smrg(void) memcpy((void *)(pc + 12), (void *)(&mapsize), 4);
3159b8e80941Smrg    __glXSendLargeCommand(gc, pc, 16, values, safe_mul(mapsize, 2));
3160b8e80941Smrg}
3161848b8605Smrg    }
3162848b8605Smrg}
3163848b8605Smrg
3164848b8605Smrg#define X_GLrop_ReadBuffer 171
3165b8e80941Smrgvoid __indirect_glReadBuffer(GLenum mode)
3166848b8605Smrg{
3167b8e80941Smrg    struct glx_context * const gc = __glXGetCurrentContext();
3168b8e80941Smrg    const GLuint cmdlen = 8;
3169b8e80941Smrgemit_header(gc->pc, X_GLrop_ReadBuffer, cmdlen);
3170b8e80941Smrg(void) memcpy((void *)(gc->pc + 4), (void *)(&mode), 4);
3171b8e80941Smrggc->pc += cmdlen;
3172b8e80941Smrgif (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); }
3173848b8605Smrg}
3174848b8605Smrg
3175848b8605Smrg#define X_GLrop_CopyPixels 172
3176b8e80941Smrgvoid __indirect_glCopyPixels(GLint x, GLint y, GLsizei width, GLsizei height, GLenum type)
3177b8e80941Smrg{
3178b8e80941Smrg    struct glx_context * const gc = __glXGetCurrentContext();
3179b8e80941Smrg    const GLuint cmdlen = 24;
3180b8e80941Smrgemit_header(gc->pc, X_GLrop_CopyPixels, cmdlen);
3181b8e80941Smrg(void) memcpy((void *)(gc->pc + 4), (void *)(&x), 4);
3182b8e80941Smrg(void) memcpy((void *)(gc->pc + 8), (void *)(&y), 4);
3183b8e80941Smrg(void) memcpy((void *)(gc->pc + 12), (void *)(&width), 4);
3184b8e80941Smrg(void) memcpy((void *)(gc->pc + 16), (void *)(&height), 4);
3185b8e80941Smrg(void) memcpy((void *)(gc->pc + 20), (void *)(&type), 4);
3186b8e80941Smrggc->pc += cmdlen;
3187b8e80941Smrgif (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); }
3188848b8605Smrg}
3189848b8605Smrg
3190848b8605Smrg#define X_GLsop_ReadPixels 111
3191b8e80941Smrgvoid __indirect_glReadPixels(GLint x, GLint y, GLsizei width, GLsizei height, GLenum format, GLenum type, GLvoid * pixels)
3192848b8605Smrg{
3193b8e80941Smrg    struct glx_context * const gc = __glXGetCurrentContext();
3194b8e80941Smrg    const __GLXattribute * const state = gc->client_state_private;
3195b8e80941Smrg    Display * const dpy = gc->currentDpy;
3196848b8605Smrg#ifndef USE_XCB
3197b8e80941Smrg    const GLuint cmdlen = 28;
3198848b8605Smrg#endif
3199848b8605Smrg    if (__builtin_expect(dpy != NULL, 1)) {
3200848b8605Smrg#ifdef USE_XCB
3201848b8605Smrg        xcb_connection_t *c = XGetXCBConnection(dpy);
3202848b8605Smrg        (void) __glXFlushRenderBuffer(gc, gc->pc);
3203848b8605Smrg        xcb_glx_read_pixels_reply_t *reply = xcb_glx_read_pixels_reply(c, xcb_glx_read_pixels(c, gc->currentContextTag, x, y, width, height, format, type, state->storePack.swapEndian, 0), NULL);
3204848b8605Smrg        __glEmptyImage(gc, 3, width, height, 1, format, type, xcb_glx_read_pixels_data(reply), pixels);
3205848b8605Smrg        free(reply);
3206848b8605Smrg#else
3207b8e80941Smrg        GLubyte const * pc = __glXSetupSingleRequest(gc, X_GLsop_ReadPixels, cmdlen);
3208b8e80941Smrg(void) memcpy((void *)(pc + 0), (void *)(&x), 4);
3209b8e80941Smrg(void) memcpy((void *)(pc + 4), (void *)(&y), 4);
3210b8e80941Smrg(void) memcpy((void *)(pc + 8), (void *)(&width), 4);
3211b8e80941Smrg(void) memcpy((void *)(pc + 12), (void *)(&height), 4);
3212b8e80941Smrg(void) memcpy((void *)(pc + 16), (void *)(&format), 4);
3213b8e80941Smrg(void) memcpy((void *)(pc + 20), (void *)(&type), 4);
3214b8e80941Smrg        *(int32_t *)(pc + 24) = 0;
3215b8e80941Smrg        * (int8_t *)(pc + 24) = state->storePack.swapEndian;
3216848b8605Smrg        __glXReadPixelReply(dpy, gc, 2, width, height, 1, format, type, pixels, GL_FALSE);
3217b8e80941Smrg        UnlockDisplay(dpy); SyncHandle();
3218b8e80941Smrg#endif /* USE_XCB */
3219848b8605Smrg    }
3220848b8605Smrg    return;
3221848b8605Smrg}
3222848b8605Smrg
3223848b8605Smrg#define X_GLrop_DrawPixels 173
3224b8e80941Smrgvoid __indirect_glDrawPixels(GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid * pixels)
3225848b8605Smrg{
3226b8e80941Smrg    struct glx_context * const gc = __glXGetCurrentContext();
3227b8e80941Smrg    const GLuint compsize = (pixels != NULL) ? __glImageSize(width, height, 1, format, type, 0) : 0;
3228b8e80941Smrg    const GLuint cmdlen = 40 + safe_pad(compsize);
3229b8e80941Smrg    if (0 + safe_pad(compsize) < 0) {
3230b8e80941Smrg        __glXSetError(gc, GL_INVALID_VALUE);
3231b8e80941Smrg        return;
3232b8e80941Smrg    }
3233848b8605Smrg    if (__builtin_expect(gc->currentDpy != NULL, 1)) {
3234b8e80941Smrgif (cmdlen <= gc->maxSmallRenderCommandSize) {
3235b8e80941Smrg    if ( (gc->pc + cmdlen) > gc->bufEnd ) {
3236b8e80941Smrg        (void) __glXFlushRenderBuffer(gc, gc->pc);
3237b8e80941Smrg    }
3238b8e80941Smrgemit_header(gc->pc, X_GLrop_DrawPixels, cmdlen);
3239b8e80941Smrg(void) memcpy((void *)(gc->pc + 24), (void *)(&width), 4);
3240b8e80941Smrg(void) memcpy((void *)(gc->pc + 28), (void *)(&height), 4);
3241b8e80941Smrg(void) memcpy((void *)(gc->pc + 32), (void *)(&format), 4);
3242b8e80941Smrg(void) memcpy((void *)(gc->pc + 36), (void *)(&type), 4);
3243b8e80941Smrgif (compsize > 0) {
3244b8e80941Smrg    gc->fillImage(gc, 2, width, height, 1, format, type, pixels, gc->pc + 40, gc->pc + 4);
3245b8e80941Smrg} else {
3246b8e80941Smrg    (void) memcpy( gc->pc + 4, default_pixel_store_2D, default_pixel_store_2D_size );
3247b8e80941Smrg}
3248b8e80941Smrggc->pc += cmdlen;
3249b8e80941Smrgif (gc->pc > gc->limit) { (void) __glXFlushRenderBuffer(gc, gc->pc); }
3250b8e80941Smrg}
3251b8e80941Smrgelse {
3252b8e80941Smrgconst GLint op = X_GLrop_DrawPixels;
3253b8e80941Smrgconst GLuint cmdlenLarge = cmdlen + 4;
3254b8e80941SmrgGLubyte * const pc = __glXFlushRenderBuffer(gc, gc->pc);
3255b8e80941Smrg(void) memcpy((void *)(pc + 0), (void *)(&cmdlenLarge), 4);
3256b8e80941Smrg(void) memcpy((void *)(pc + 4), (void *)(&op), 4);
3257b8e80941Smrg(void) memcpy((void *)(pc + 28), (void *)(&width), 4);
3258b8e80941Smrg(void) memcpy((void *)(pc + 32), (void *)(&height), 4);
3259b8e80941Smrg(void) memcpy((void *)(pc + 36), (void *)(&format), 4);
3260b8e80941Smrg(void) memcpy((void *)(pc + 40), (void *)(&type), 4);
3261b8e80941Smrg__glXSendLargeImage(gc, compsize, 2, width, height, 1, format, type, pixels, pc + 44, pc + 8);
3262b8e80941Smrg}
3263848b8605Smrg    }
3264848b8605Smrg}
3265848b8605Smrg
3266848b8605Smrg#define X_GLsop_GetClipPlane 113
3267b8e80941Smrgvoid __indirect_glGetClipPlane(GLenum plane, GLdouble * equation)
3268848b8605Smrg{
3269b8e80941Smrg    struct glx_context * const gc = __glXGetCurrentContext();
3270b8e80941Smrg    Display * const dpy = gc->currentDpy;
3271848b8605Smrg#ifndef USE_XCB
3272b8e80941Smrg    const GLuint cmdlen = 4;
3273848b8605Smrg#endif
3274848b8605Smrg    if (__builtin_expect(dpy != NULL, 1)) {
3275848b8605Smrg#ifdef USE_XCB
3276848b8605Smrg        xcb_connection_t *c = XGetXCBConnection(dpy);
3277848b8605Smrg        (void) __glXFlushRenderBuffer(gc, gc->pc);
3278848b8605Smrg        xcb_glx_get_clip_plane_reply_t *reply = xcb_glx_get_clip_plane_reply(c, xcb_glx_get_clip_plane(c, gc->currentContextTag, plane), NULL);
3279b8e80941Smrg        (void)memcpy(equation, xcb_glx_get_clip_plane_data(reply), xcb_glx_get_clip_plane_data_length(reply) * sizeof(GLdouble));
3280848b8605Smrg        free(reply);
3281848b8605Smrg#else
3282b8e80941Smrg        GLubyte const * pc = __glXSetupSingleRequest(gc, X_GLsop_GetClipPlane, cmdlen);
3283b8e80941Smrg(void) memcpy((void *)(pc + 0), (void *)(&plane), 4);
3284848b8605Smrg        (void) __glXReadReply(dpy, 8, equation, GL_TRUE);
3285b8e80941Smrg        UnlockDisplay(dpy); SyncHandle();
3286b8e80941Smrg#endif /* USE_XCB */
3287848b8605Smrg    }
3288848b8605Smrg    return;
3289848b8605Smrg}
3290848b8605Smrg
3291848b8605Smrg#define X_GLsop_GetLightfv 118
3292b8e80941Smrgvoid __indirect_glGetLightfv(GLenum light, GLenum pname, GLfloat * params)
3293848b8605Smrg{
3294b8e80941Smrg    struct glx_context * const gc = __glXGetCurrentContext();
3295b8e80941Smrg    Display * const dpy = gc->currentDpy;
3296848b8605Smrg#ifndef USE_XCB
3297b8e80941Smrg    const GLuint cmdlen = 8;
3298848b8605Smrg#endif
3299848b8605Smrg    if (__builtin_expect(dpy != NULL, 1)) {
3300848b8605Smrg#ifdef USE_XCB
3301848b8605Smrg        xcb_connection_t *c = XGetXCBConnection(dpy);
3302848b8605Smrg        (void) __glXFlushRenderBuffer(gc, gc->pc);
3303848b8605Smrg        xcb_glx_get_lightfv_reply_t *reply = xcb_glx_get_lightfv_reply(c, xcb_glx_get_lightfv(c, gc->currentContextTag, light, pname), NULL);
3304b8e80941Smrg        /* the XXX_data_length() xcb function name is misleading, it returns the number */
3305b8e80941Smrg        /* of elements, not the length of the data part. A single element is embedded. */
3306848b8605Smrg        if (xcb_glx_get_lightfv_data_length(reply) == 1)
3307b8e80941Smrg            (void)memcpy(params, &reply->datum, sizeof(reply->datum));
3308848b8605Smrg        else
3309b8e80941Smrg            (void)memcpy(params, xcb_glx_get_lightfv_data(reply), xcb_glx_get_lightfv_data_length(reply) * sizeof(GLfloat));
3310848b8605Smrg        free(reply);
3311848b8605Smrg#else
3312b8e80941Smrg        GLubyte const * pc = __glXSetupSingleRequest(gc, X_GLsop_GetLightfv, cmdlen);
3313b8e80941Smrg(void) memcpy((void *)(pc + 0), (void *)(&light), 4);
3314b8e80941Smrg(void) memcpy((void *)(pc + 4), (void *)(&pname), 4);
3315848b8605Smrg        (void) __glXReadReply(dpy, 4, params, GL_FALSE);
3316b8e80941Smrg        UnlockDisplay(dpy); SyncHandle();
3317b8e80941Smrg#endif /* USE_XCB */
3318848b8605Smrg    }
3319848b8605Smrg    return;
3320848b8605Smrg}
3321848b8605Smrg
3322848b8605Smrg#define X_GLsop_GetLightiv 119
3323b8e80941Smrgvoid __indirect_glGetLightiv(GLenum light, GLenum pname, GLint * params)
3324848b8605Smrg{
3325b8e80941Smrg    struct glx_context * const gc = __glXGetCurrentContext();
3326b8e80941Smrg    Display * const dpy = gc->currentDpy;
3327848b8605Smrg#ifndef USE_XCB
3328b8e80941Smrg    const GLuint cmdlen = 8;
3329848b8605Smrg#endif
3330848b8605Smrg    if (__builtin_expect(dpy != NULL, 1)) {
3331848b8605Smrg#ifdef USE_XCB
3332848b8605Smrg        xcb_connection_t *c = XGetXCBConnection(dpy);
3333848b8605Smrg        (void) __glXFlushRenderBuffer(gc, gc->pc);
3334848b8605Smrg        xcb_glx_get_lightiv_reply_t *reply = xcb_glx_get_lightiv_reply(c, xcb_glx_get_lightiv(c, gc->currentContextTag, light, pname), NULL);
3335b8e80941Smrg        /* the XXX_data_length() xcb function name is misleading, it returns the number */
3336b8e80941Smrg        /* of elements, not the length of the data part. A single element is embedded. */
3337848b8605Smrg        if (xcb_glx_get_lightiv_data_length(reply) == 1)
3338b8e80941Smrg            (void)memcpy(params, &reply->datum, sizeof(reply->datum));
3339848b8605Smrg        else
3340b8e80941Smrg            (void)memcpy(params, xcb_glx_get_lightiv_data(reply), xcb_glx_get_lightiv_data_length(reply) * sizeof(GLint));
3341848b8605Smrg        free(reply);
3342848b8605Smrg#else
3343b8e80941Smrg        GLubyte const * pc = __glXSetupSingleRequest(gc, X_GLsop_GetLightiv, cmdlen);
3344b8e80941Smrg(void) memcpy((void *)(pc + 0), (void *)(&light), 4);
3345b8e80941Smrg(void) memcpy((void *)(pc + 4), (void *)(&pname), 4);
3346848b8605Smrg        (void) __glXReadReply(dpy, 4, params, GL_FALSE);
3347b8e80941Smrg        UnlockDisplay(dpy); SyncHandle();
3348b8e80941Smrg#endif /* USE_XCB */
3349848b8605Smrg    }
3350848b8605Smrg    return;
3351848b8605Smrg}
3352848b8605Smrg
3353848b8605Smrg#define X_GLsop_GetMapdv 120
3354b8e80941Smrgvoid __indirect_glGetMapdv(GLenum target, GLenum query, GLdouble * v)
3355848b8605Smrg{
3356b8e80941Smrg    struct glx_context * const gc = __glXGetCurrentContext();
3357b8e80941Smrg    Display * const dpy = gc->currentDpy;
3358848b8605Smrg#ifndef USE_XCB
3359b8e80941Smrg    const GLuint cmdlen = 8;
3360848b8605Smrg#endif
3361848b8605Smrg    if (__builtin_expect(dpy != NULL, 1)) {
3362848b8605Smrg#ifdef USE_XCB
3363848b8605Smrg        xcb_connection_t *c = XGetXCBConnection(dpy);
3364848b8605Smrg        (void) __glXFlushRenderBuffer(gc, gc->pc);
3365848b8605Smrg        xcb_glx_get_mapdv_reply_t *reply = xcb_glx_get_mapdv_reply(c, xcb_glx_get_mapdv(c, gc->currentContextTag, target, query), NULL);
3366b8e80941Smrg        /* the XXX_data_length() xcb function name is misleading, it returns the number */
3367b8e80941Smrg        /* of elements, not the length of the data part. A single element is embedded. */
3368848b8605Smrg        if (xcb_glx_get_mapdv_data_length(reply) == 1)
3369b8e80941Smrg            (void)memcpy(v, &reply->datum, sizeof(reply->datum));
3370848b8605Smrg        else
3371b8e80941Smrg            (void)memcpy(v, xcb_glx_get_mapdv_data(reply), xcb_glx_get_mapdv_data_length(reply) * sizeof(GLdouble));
3372848b8605Smrg        free(reply);
3373848b8605Smrg#else
3374b8e80941Smrg        GLubyte const * pc = __glXSetupSingleRequest(gc, X_GLsop_GetMapdv, cmdlen);
3375b8e80941Smrg(void) memcpy((void *)(pc + 0), (void *)(&target), 4);
3376b8e80941Smrg(void) memcpy((void *)(pc + 4), (void *)(&query), 4);
3377848b8605Smrg        (void) __glXReadReply(dpy, 8, v, GL_FALSE);
3378b8e80941Smrg        UnlockDisplay(dpy); SyncHandle();
3379b8e80941Smrg#endif /* USE_XCB */
3380848b8605Smrg    }
3381848b8605Smrg    return;
3382848b8605Smrg}
3383848b8605Smrg
3384848b8605Smrg#define X_GLsop_GetMapfv 121
3385b8e80941Smrgvoid __indirect_glGetMapfv(GLenum target, GLenum query, GLfloat * v)
3386848b8605Smrg{
3387b8e80941Smrg    struct glx_context * const gc = __glXGetCurrentContext();
3388b8e80941Smrg    Display * const dpy = gc->currentDpy;
3389848b8605Smrg#ifndef USE_XCB
3390b8e80941Smrg    const GLuint cmdlen = 8;
3391848b8605Smrg#endif
3392848b8605Smrg    if (__builtin_expect(dpy != NULL, 1)) {
3393848b8605Smrg#ifdef USE_XCB
3394848b8605Smrg        xcb_connection_t *c = XGetXCBConnection(dpy);
3395848b8605Smrg        (void) __glXFlushRenderBuffer(gc, gc->pc);
3396848b8605Smrg        xcb_glx_get_mapfv_reply_t *reply = xcb_glx_get_mapfv_reply(c, xcb_glx_get_mapfv(c, gc->currentContextTag, target, query), NULL);
3397b8e80941Smrg        /* the XXX_data_length() xcb function name is misleading, it returns the number */
3398b8e80941Smrg        /* of elements, not the length of the data part. A single element is embedded. */
3399848b8605Smrg        if (xcb_glx_get_mapfv_data_length(reply) == 1)
3400b8e80941Smrg            (void)memcpy(v, &reply->datum, sizeof(reply->datum));
3401848b8605Smrg        else
3402b8e80941Smrg            (void)memcpy(v, xcb_glx_get_mapfv_data(reply), xcb_glx_get_mapfv_data_length(reply) * sizeof(GLfloat));
3403848b8605Smrg        free(reply);
3404848b8605Smrg#else
3405b8e80941Smrg        GLubyte const * pc = __glXSetupSingleRequest(gc, X_GLsop_GetMapfv, cmdlen);
3406b8e80941Smrg(void) memcpy((void *)(pc + 0), (void *)(&target), 4);
3407b8e80941Smrg(void) memcpy((void *)(pc + 4), (void *)(&query), 4);
3408848b8605Smrg        (void) __glXReadReply(dpy, 4, v, GL_FALSE);
3409b8e80941Smrg        UnlockDisplay(dpy); SyncHandle();
3410b8e80941Smrg#endif /* USE_XCB */
3411848b8605Smrg    }
3412848b8605Smrg    return;
3413848b8605Smrg}
3414848b8605Smrg
3415848b8605Smrg#define X_GLsop_GetMapiv 122
3416b8e80941Smrgvoid __indirect_glGetMapiv(GLenum target, GLenum query, GLint * v)
3417848b8605Smrg{
3418b8e80941Smrg    struct glx_context * const gc = __glXGetCurrentContext();
3419b8e80941Smrg    Display * const dpy = gc->currentDpy;
3420848b8605Smrg#ifndef USE_XCB
3421b8e80941Smrg    const GLuint cmdlen = 8;
3422848b8605Smrg#endif
3423848b8605Smrg    if (__builtin_expect(dpy != NULL, 1)) {
3424848b8605Smrg#ifdef USE_XCB
3425848b8605Smrg        xcb_connection_t *c = XGetXCBConnection(dpy);
3426848b8605Smrg        (void) __glXFlushRenderBuffer(gc, gc->pc);
3427848b8605Smrg        xcb_glx_get_mapiv_reply_t *reply = xcb_glx_get_mapiv_reply(c, xcb_glx_get_mapiv(c, gc->currentContextTag, target, query), NULL);
3428b8e80941Smrg        /* the XXX_data_length() xcb function name is misleading, it returns the number */
3429b8e80941Smrg        /* of elements, not the length of the data part. A single element is embedded. */
3430848b8605Smrg        if (xcb_glx_get_mapiv_data_length(reply) == 1)
3431b8e80941Smrg            (void)memcpy(v, &reply->datum, sizeof(reply->datum));
3432848b8605Smrg        else
3433b8e80941Smrg            (void)memcpy(v, xcb_glx_get_mapiv_data(reply), xcb_glx_get_mapiv_data_length(reply) * sizeof(GLint));
3434848b8605Smrg        free(reply);
3435848b8605Smrg#else
3436b8e80941Smrg        GLubyte const * pc = __glXSetupSingleRequest(gc, X_GLsop_GetMapiv, cmdlen);
3437b8e80941Smrg(void) memcpy((void *)(pc + 0), (void *)(&target), 4);
3438b8e80941Smrg(void) memcpy((void *)(pc + 4), (void *)(&query), 4);
3439848b8605Smrg        (void) __glXReadReply(dpy, 4, v, GL_FALSE);
3440b8e80941Smrg        UnlockDisplay(dpy); SyncHandle();
3441b8e80941Smrg#endif /* USE_XCB */
3442848b8605Smrg    }
3443848b8605Smrg    return;
3444848b8605Smrg}
3445848b8605Smrg
3446848b8605Smrg#define X_GLsop_GetMaterialfv 123
3447b8e80941Smrgvoid __indirect_glGetMaterialfv(GLenum face, GLenum pname, GLfloat * params)
3448848b8605Smrg{
3449b8e80941Smrg    struct glx_context * const gc = __glXGetCurrentContext();
3450b8e80941Smrg    Display * const dpy = gc->currentDpy;
3451848b8605Smrg#ifndef USE_XCB
3452b8e80941Smrg    const GLuint cmdlen = 8;
3453848b8605Smrg#endif
3454848b8605Smrg    if (__builtin_expect(dpy != NULL, 1)) {
3455848b8605Smrg#ifdef USE_XCB
3456848b8605Smrg        xcb_connection_t *c = XGetXCBConnection(dpy);
3457848b8605Smrg        (void) __glXFlushRenderBuffer(gc, gc->pc);
3458848b8605Smrg        xcb_glx_get_materialfv_reply_t *reply = xcb_glx_get_materialfv_reply(c, xcb_glx_get_materialfv(c, gc->currentContextTag, face, pname), NULL);
3459b8e80941Smrg        /* the XXX_data_length() xcb function name is misleading, it returns the number */
3460b8e80941Smrg        /* of elements, not the length of the data part. A single element is embedded. */
3461848b8605Smrg        if (xcb_glx_get_materialfv_data_length(reply) == 1)
3462b8e80941Smrg            (void)memcpy(params, &reply->datum, sizeof(reply->datum));
3463848b8605Smrg        else
3464b8e80941Smrg            (void)memcpy(params, xcb_glx_get_materialfv_data(reply), xcb_glx_get_materialfv_data_length(reply) * sizeof(GLfloat));
3465848b8605Smrg        free(reply);
3466848b8605Smrg#else
3467b8e80941Smrg        GLubyte const * pc = __glXSetupSingleRequest(gc, X_GLsop_GetMaterialfv, cmdlen);
3468b8e80941Smrg(void) memcpy((void *)(pc + 0), (void *)(&face), 4);
3469b8e80941Smrg(void) memcpy((void *)(pc + 4), (void *)(&pname), 4);
3470848b8605Smrg        (void) __glXReadReply(dpy, 4, params, GL_FALSE);
3471b8e80941Smrg        UnlockDisplay(dpy); SyncHandle();
3472b8e80941Smrg#endif /* USE_XCB */
3473848b8605Smrg    }
3474848b8605Smrg    return;
3475848b8605Smrg}
3476848b8605Smrg
3477848b8605Smrg#define X_GLsop_GetMaterialiv 124
3478b8e80941Smrgvoid __indirect_glGetMaterialiv(GLenum face, GLenum pname, GLint * params)
3479848b8605Smrg{
3480b8e80941Smrg    struct glx_context * const gc = __glXGetCurrentContext();
3481b8e80941Smrg    Display * const dpy = gc->currentDpy;
3482848b8605Smrg#ifndef USE_XCB
3483b8e80941Smrg    const GLuint cmdlen = 8;
3484848b8605Smrg#endif
3485848b8605Smrg    if (__builtin_expect(dpy != NULL, 1)) {
3486848b8605Smrg#ifdef USE_XCB
3487848b8605Smrg        xcb_connection_t *c = XGetXCBConnection(dpy);
3488848b8605Smrg        (void) __glXFlushRenderBuffer(gc, gc->pc);
3489848b8605Smrg        xcb_glx_get_materialiv_reply_t *reply = xcb_glx_get_materialiv_reply(c, xcb_glx_get_materialiv(c, gc->currentContextTag, face, pname), NULL);
3490b8e80941Smrg        /* the XXX_data_length() xcb function name is misleading, it returns the number */
3491b8e80941Smrg        /* of elements, not the length of the data part. A single element is embedded. */
3492848b8605Smrg        if (xcb_glx_get_materialiv_data_length(reply) == 1)
3493b8e80941Smrg            (void)memcpy(params, &reply->datum, sizeof(reply->datum));
3494848b8605Smrg        else
3495b8e80941Smrg            (void)memcpy(params, xcb_glx_get_materialiv_data(reply), xcb_glx_get_materialiv_data_length(reply) * sizeof(GLint));
3496848b8605Smrg        free(reply);
3497848b8605Smrg#else
3498b8e80941Smrg        GLubyte const * pc = __glXSetupSingleRequest(gc, X_GLsop_GetMaterialiv, cmdlen);
3499b8e80941Smrg(void) memcpy((void *)(pc + 0), (void *)(&face), 4);
3500b8e80941Smrg(void) memcpy((void *)(pc + 4), (void *)(&pname), 4);
3501848b8605Smrg        (void) __glXReadReply(dpy, 4, params, GL_FALSE);
3502b8e80941Smrg        UnlockDisplay(dpy); SyncHandle();
3503b8e80941Smrg#endif /* USE_XCB */
3504848b8605Smrg    }
3505848b8605Smrg    return;
3506848b8605Smrg}
3507848b8605Smrg
3508848b8605Smrg#define X_GLsop_GetPixelMapfv 125
3509b8e80941Smrgvoid __indirect_glGetPixelMapfv(GLenum map, GLfloat * values)
3510848b8605Smrg{
3511b8e80941Smrg    struct glx_context * const gc = __glXGetCurrentContext();
3512b8e80941Smrg    Display * const dpy = gc->currentDpy;
3513848b8605Smrg#ifndef USE_XCB
3514b8e80941Smrg    const GLuint cmdlen = 4;
3515848b8605Smrg#endif
3516848b8605Smrg    if (__builtin_expect(dpy != NULL, 1)) {
3517848b8605Smrg#ifdef USE_XCB
3518848b8605Smrg        xcb_connection_t *c = XGetXCBConnection(dpy);
3519848b8605Smrg        (void) __glXFlushRenderBuffer(gc, gc->pc);
3520848b8605Smrg        xcb_glx_get_pixel_mapfv_reply_t *reply = xcb_glx_get_pixel_mapfv_reply(c, xcb_glx_get_pixel_mapfv(c, gc->currentContextTag, map), NULL);
3521b8e80941Smrg        /* the XXX_data_length() xcb function name is misleading, it returns the number */
3522b8e80941Smrg        /* of elements, not the length of the data part. A single element is embedded. */
3523848b8605Smrg        if (xcb_glx_get_pixel_mapfv_data_length(reply) == 1)
3524b8e80941Smrg            (void)memcpy(values, &reply->datum, sizeof(reply->datum));
3525848b8605Smrg        else
3526b8e80941Smrg            (void)memcpy(values, xcb_glx_get_pixel_mapfv_data(reply), xcb_glx_get_pixel_mapfv_data_length(reply) * sizeof(GLfloat));
3527848b8605Smrg        free(reply);
3528848b8605Smrg#else
3529b8e80941Smrg        GLubyte const * pc = __glXSetupSingleRequest(gc, X_GLsop_GetPixelMapfv, cmdlen);
3530b8e80941Smrg(void) memcpy((void *)(pc + 0), (void *)(&map), 4);
3531848b8605Smrg        (void) __glXReadReply(dpy, 4, values, GL_FALSE);
3532b8e80941Smrg        UnlockDisplay(dpy); SyncHandle();
3533b8e80941Smrg#endif /* USE_XCB */
3534848b8605Smrg    }
3535848b8605Smrg    return;
3536848b8605Smrg}
3537848b8605Smrg
3538848b8605Smrg#define X_GLsop_GetPixelMapuiv 126
3539b8e80941Smrgvoid __indirect_glGetPixelMapuiv(GLenum map, GLuint * values)
3540848b8605Smrg{
3541b8e80941Smrg    struct glx_context * const gc = __glXGetCurrentContext();
3542b8e80941Smrg    Display * const dpy = gc->currentDpy;
3543848b8605Smrg#ifndef USE_XCB
3544b8e80941Smrg    const GLuint cmdlen = 4;
3545848b8605Smrg#endif
3546848b8605Smrg    if (__builtin_expect(dpy != NULL, 1)) {
3547848b8605Smrg#ifdef USE_XCB
3548848b8605Smrg        xcb_connection_t *c = XGetXCBConnection(dpy);
3549848b8605Smrg        (void) __glXFlushRenderBuffer(gc, gc->pc);
3550848b8605Smrg        xcb_glx_get_pixel_mapuiv_reply_t *reply = xcb_glx_get_pixel_mapuiv_reply(c, xcb_glx_get_pixel_mapuiv(c, gc->currentContextTag, map), NULL);
3551b8e80941Smrg        /* the XXX_data_length() xcb function name is misleading, it returns the number */
3552b8e80941Smrg        /* of elements, not the length of the data part. A single element is embedded. */
3553848b8605Smrg        if (xcb_glx_get_pixel_mapuiv_data_length(reply) == 1)
3554b8e80941Smrg            (void)memcpy(values, &reply->datum, sizeof(reply->datum));
3555848b8605Smrg        else
3556b8e80941Smrg            (void)memcpy(values, xcb_glx_get_pixel_mapuiv_data(reply), xcb_glx_get_pixel_mapuiv_data_length(reply) * sizeof(GLuint));
3557848b8605Smrg        free(reply);
3558848b8605Smrg#else
3559b8e80941Smrg        GLubyte const * pc = __glXSetupSingleRequest(gc, X_GLsop_GetPixelMapuiv, cmdlen);
3560b8e80941Smrg(void) memcpy((void *)(pc + 0), (void *)(&map), 4);
3561848b8605Smrg        (void) __glXReadReply(dpy, 4, values, GL_FALSE);
3562b8e80941Smrg        UnlockDisplay(dpy); SyncHandle();
3563b8e80941Smrg#endif /* USE_XCB */
3564848b8605Smrg    }
3565848b8605Smrg    return;
3566848b8605Smrg}
3567848b8605Smrg
3568848b8605Smrg#define X_GLsop_GetPixelMapusv 127
3569b8e80941Smrgvoid __indirect_glGetPixelMapusv(GLenum map, GLushort * values)
3570848b8605Smrg{
3571b8e80941Smrg    struct glx_context * const gc = __glXGetCurrentContext();
3572b8e80941Smrg    Display * const dpy = gc->currentDpy;
3573848b8605Smrg#ifndef USE_XCB
3574b8e80941Smrg    const GLuint cmdlen = 4;
3575848b8605Smrg#endif
3576848b8605Smrg    if (__builtin_expect(dpy != NULL, 1)) {
3577848b8605Smrg#ifdef USE_XCB
3578848b8605Smrg        xcb_connection_t *c = XGetXCBConnection(dpy);
3579848b8605Smrg        (void) __glXFlushRenderBuffer(gc, gc->pc);
3580848b8605Smrg        xcb_glx_get_pixel_mapusv_reply_t *reply = xcb_glx_get_pixel_mapusv_reply(c, xcb_glx_get_pixel_mapusv(c, gc->currentContextTag, map), NULL);
3581b8e80941Smrg        /* the XXX_data_length() xcb function name is misleading, it returns the number */
3582b8e80941Smrg        /* of elements, not the length of the data part. A single element is embedded. */
3583848b8605Smrg        if (xcb_glx_get_pixel_mapusv_data_length(reply) == 1)
3584b8e80941Smrg            (void)memcpy(values, &reply->datum, sizeof(reply->datum));
3585848b8605Smrg        else
3586b8e80941Smrg            (void)memcpy(values, xcb_glx_get_pixel_mapusv_data(reply), xcb_glx_get_pixel_mapusv_data_length(reply) * sizeof(GLushort));
3587848b8605Smrg        free(reply);
3588848b8605Smrg#else
3589b8e80941Smrg        GLubyte const * pc = __glXSetupSingleRequest(gc, X_GLsop_GetPixelMapusv, cmdlen);
3590b8e80941Smrg(void) memcpy((void *)(pc + 0), (void *)(&map), 4);
3591848b8605Smrg        (void) __glXReadReply(dpy, 2, values, GL_FALSE);
3592b8e80941Smrg        UnlockDisplay(dpy); SyncHandle();
3593b8e80941Smrg#endif /* USE_XCB */
3594848b8605Smrg    }
3595848b8605Smrg    return;
3596848b8605Smrg}
3597848b8605Smrg
3598848b8605Smrg#define X_GLsop_GetPolygonStipple 128
3599b8e80941Smrgvoid __indirect_glGetPolygonStipple(GLubyte * mask)
3600848b8605Smrg{
3601b8e80941Smrg    struct glx_context * const gc = __glXGetCurrentContext();
3602b8e80941Smrg    Display * const dpy = gc->currentDpy;
3603848b8605Smrg#ifndef USE_XCB
3604b8e80941Smrg    const GLuint cmdlen = 4;
3605848b8605Smrg#endif
3606848b8605Smrg    if (__builtin_expect(dpy != NULL, 1)) {
3607848b8605Smrg#ifdef USE_XCB
3608848b8605Smrg        xcb_connection_t *c = XGetXCBConnection(dpy);
3609848b8605Smrg        (void) __glXFlushRenderBuffer(gc, gc->pc);
3610848b8605Smrg        xcb_glx_get_polygon_stipple_reply_t *reply = xcb_glx_get_polygon_stipple_reply(c, xcb_glx_get_polygon_stipple(c, gc->currentContextTag, 0), NULL);
3611848b8605Smrg        __glEmptyImage(gc, 3, 32, 32, 1, GL_COLOR_INDEX, GL_BITMAP, xcb_glx_get_polygon_stipple_data(reply), mask);
3612848b8605Smrg        free(reply);
3613848b8605Smrg#else
3614b8e80941Smrg        GLubyte const * pc = __glXSetupSingleRequest(gc, X_GLsop_GetPolygonStipple, cmdlen);
3615b8e80941Smrg        *(int32_t *)(pc + 0) = 0;
3616848b8605Smrg        __glXReadPixelReply(dpy, gc, 2, 32, 32, 1, GL_COLOR_INDEX, GL_BITMAP, mask, GL_FALSE);
3617b8e80941Smrg        UnlockDisplay(dpy); SyncHandle();
3618b8e80941Smrg#endif /* USE_XCB */
3619848b8605Smrg    }
3620848b8605Smrg    return;
3621848b8605Smrg}
3622848b8605Smrg
3623848b8605Smrg#define X_GLsop_GetTexEnvfv 130
3624b8e80941Smrgvoid __indirect_glGetTexEnvfv(GLenum target, GLenum pname, GLfloat * params)
3625848b8605Smrg{
3626b8e80941Smrg    struct glx_context * const gc = __glXGetCurrentContext();
3627b8e80941Smrg    Display * const dpy = gc->currentDpy;
3628848b8605Smrg#ifndef USE_XCB
3629b8e80941Smrg    const GLuint cmdlen = 8;
3630848b8605Smrg#endif
3631848b8605Smrg    if (__builtin_expect(dpy != NULL, 1)) {
3632848b8605Smrg#ifdef USE_XCB
3633848b8605Smrg        xcb_connection_t *c = XGetXCBConnection(dpy);
3634848b8605Smrg        (void) __glXFlushRenderBuffer(gc, gc->pc);
3635848b8605Smrg        xcb_glx_get_tex_envfv_reply_t *reply = xcb_glx_get_tex_envfv_reply(c, xcb_glx_get_tex_envfv(c, gc->currentContextTag, target, pname), NULL);
3636b8e80941Smrg        /* the XXX_data_length() xcb function name is misleading, it returns the number */
3637b8e80941Smrg        /* of elements, not the length of the data part. A single element is embedded. */
3638848b8605Smrg        if (xcb_glx_get_tex_envfv_data_length(reply) == 1)
3639b8e80941Smrg            (void)memcpy(params, &reply->datum, sizeof(reply->datum));
3640848b8605Smrg        else
3641b8e80941Smrg            (void)memcpy(params, xcb_glx_get_tex_envfv_data(reply), xcb_glx_get_tex_envfv_data_length(reply) * sizeof(GLfloat));
3642848b8605Smrg        free(reply);
3643848b8605Smrg#else
3644b8e80941Smrg        GLubyte const * pc = __glXSetupSingleRequest(gc, X_GLsop_GetTexEnvfv, cmdlen);
3645b8e80941Smrg(void) memcpy((void *)(pc + 0), (void *)(&target), 4);
3646b8e80941Smrg(void) memcpy((void *)(pc + 4), (void *)(&pname), 4);
3647848b8605Smrg        (void) __glXReadReply(dpy, 4, params, GL_FALSE);
3648b8e80941Smrg        UnlockDisplay(dpy); SyncHandle();
3649b8e80941Smrg#endif /* USE_XCB */
3650848b8605Smrg    }
3651848b8605Smrg    return;
3652848b8605Smrg}
3653848b8605Smrg
3654848b8605Smrg#define X_GLsop_GetTexEnviv 131
3655b8e80941Smrgvoid __indirect_glGetTexEnviv(GLenum target, GLenum pname, GLint * params)
3656848b8605Smrg{
3657b8e80941Smrg    struct glx_context * const gc = __glXGetCurrentContext();
3658b8e80941Smrg    Display * const dpy = gc->currentDpy;
3659848b8605Smrg#ifndef USE_XCB
3660b8e80941Smrg    const GLuint cmdlen = 8;
3661848b8605Smrg#endif
3662848b8605Smrg    if (__builtin_expect(dpy != NULL, 1)) {
3663848b8605Smrg#ifdef USE_XCB
3664848b8605Smrg        xcb_connection_t *c = XGetXCBConnection(dpy);
3665848b8605Smrg        (void) __glXFlushRenderBuffer(gc, gc->pc);
3666848b8605Smrg        xcb_glx_get_tex_enviv_reply_t *reply = xcb_glx_get_tex_enviv_reply(c, xcb_glx_get_tex_enviv(c, gc->currentContextTag, target, pname), NULL);
3667b8e80941Smrg        /* the XXX_data_length() xcb function name is misleading, it returns the number */
3668b8e80941Smrg        /* of elements, not the length of the data part. A single element is embedded. */
3669848b8605Smrg        if (xcb_glx_get_tex_enviv_data_length(reply) == 1)
3670b8e80941Smrg            (void)memcpy(params, &reply->datum, sizeof(reply->datum));
3671848b8605Smrg        else
3672b8e80941Smrg            (void)memcpy(params, xcb_glx_get_tex_enviv_data(reply), xcb_glx_get_tex_enviv_data_length(reply) * sizeof(GLint));
3673848b8605Smrg        free(reply);
3674848b8605Smrg#else
3675b8e80941Smrg        GLubyte const * pc = __glXSetupSingleRequest(gc, X_GLsop_GetTexEnviv, cmdlen);
3676b8e80941Smrg(void) memcpy((void *)(pc + 0), (void *)(&target), 4);
3677b8e80941Smrg(void) memcpy((void *)(pc + 4), (void *)(&pname), 4);
3678848b8605Smrg        (void) __glXReadReply(dpy, 4, params, GL_FALSE);
3679b8e80941Smrg        UnlockDisplay(dpy); SyncHandle();
3680b8e80941Smrg#endif /* USE_XCB */
3681848b8605Smrg    }
3682848b8605Smrg    return;
3683848b8605Smrg}
3684848b8605Smrg
3685848b8605Smrg#define X_GLsop_GetTexGendv 132
3686b8e80941Smrgvoid __indirect_glGetTexGendv(GLenum coord, GLenum pname, GLdouble * params)
3687848b8605Smrg{
3688b8e80941Smrg    struct glx_context * const gc = __glXGetCurrentContext();
3689b8e80941Smrg    Display * const dpy = gc->currentDpy;
3690848b8605Smrg#ifndef USE_XCB
3691b8e80941Smrg    const GLuint cmdlen = 8;
3692848b8605Smrg#endif
3693848b8605Smrg    if (__builtin_expect(dpy != NULL, 1)) {
3694848b8605Smrg#ifdef USE_XCB
3695848b8605Smrg        xcb_connection_t *c = XGetXCBConnection(dpy);
3696848b8605Smrg        (void) __glXFlushRenderBuffer(gc, gc->pc);
3697848b8605Smrg        xcb_glx_get_tex_gendv_reply_t *reply = xcb_glx_get_tex_gendv_reply(c, xcb_glx_get_tex_gendv(c, gc->currentContextTag, coord, pname), NULL);
3698b8e80941Smrg        /* the XXX_data_length() xcb function name is misleading, it returns the number */
3699b8e80941Smrg        /* of elements, not the length of the data part. A single element is embedded. */
3700848b8605Smrg        if (xcb_glx_get_tex_gendv_data_length(reply) == 1)
3701b8e80941Smrg            (void)memcpy(params, &reply->datum, sizeof(reply->datum));
3702848b8605Smrg        else
3703b8e80941Smrg            (void)memcpy(params, xcb_glx_get_tex_gendv_data(reply), xcb_glx_get_tex_gendv_data_length(reply) * sizeof(GLdouble));
3704848b8605Smrg        free(reply);
3705848b8605Smrg#else
3706b8e80941Smrg        GLubyte const * pc = __glXSetupSingleRequest(gc, X_GLsop_GetTexGendv, cmdlen);
3707b8e80941Smrg(void) memcpy((void *)(pc + 0), (void *)(&coord), 4);
3708b8e80941Smrg(void) memcpy((void *)(pc + 4), (void *)(&pname), 4);
3709848b8605Smrg        (void) __glXReadReply(dpy, 8, params, GL_FALSE);
3710b8e80941Smrg        UnlockDisplay(dpy); SyncHandle();
3711b8e80941Smrg#endif /* USE_XCB */
3712848b8605Smrg    }
3713848b8605Smrg    return;
3714848b8605Smrg}
3715848b8605Smrg
3716848b8605Smrg#define X_GLsop_GetTexGenfv 133
3717b8e80941Smrgvoid __indirect_glGetTexGenfv(GLenum coord, GLenum pname, GLfloat * params)
3718848b8605Smrg{
3719b8e80941Smrg    struct glx_context * const gc = __glXGetCurrentContext();
3720b8e80941Smrg    Display * const dpy = gc->currentDpy;
3721848b8605Smrg#ifndef USE_XCB
3722b8e80941Smrg    const GLuint cmdlen = 8;
3723848b8605Smrg#endif
3724848b8605Smrg    if (__builtin_expect(dpy != NULL, 1)) {
3725848b8605Smrg#ifdef USE_XCB
3726848b8605Smrg        xcb_connection_t *c = XGetXCBConnection(dpy);
3727848b8605Smrg        (void) __glXFlushRenderBuffer(gc, gc->pc);
3728848b8605Smrg        xcb_glx_get_tex_genfv_reply_t *reply = xcb_glx_get_tex_genfv_reply(c, xcb_glx_get_tex_genfv(c, gc->currentContextTag, coord, pname), NULL);
3729b8e80941Smrg        /* the XXX_data_length() xcb function name is misleading, it returns the number */
3730b8e80941Smrg        /* of elements, not the length of the data part. A single element is embedded. */
3731848b8605Smrg        if (xcb_glx_get_tex_genfv_data_length(reply) == 1)
3732b8e80941Smrg            (void)memcpy(params, &reply->datum, sizeof(reply->datum));
3733848b8605Smrg        else
3734b8e80941Smrg            (void)memcpy(params, xcb_glx_get_tex_genfv_data(reply), xcb_glx_get_tex_genfv_data_length(reply) * sizeof(GLfloat));
3735848b8605Smrg        free(reply);
3736848b8605Smrg#else
3737b8e80941Smrg        GLubyte const * pc = __glXSetupSingleRequest(gc, X_GLsop_GetTexGenfv, cmdlen);
3738b8e80941Smrg(void) memcpy((void *)(pc + 0), (void *)(&coord), 4);
3739b8e80941Smrg(void) memcpy((void *)(pc + 4), (void *)(&pname), 4);
3740848b8605Smrg        (void) __glXReadReply(dpy, 4, params, GL_FALSE);
3741b8e80941Smrg        UnlockDisplay(dpy); SyncHandle();
3742b8e80941Smrg#endif /* USE_XCB */
3743848b8605Smrg    }
3744848b8605Smrg    return;
3745848b8605Smrg}
3746848b8605Smrg
3747848b8605Smrg#define X_GLsop_GetTexGeniv 134
3748b8e80941Smrgvoid __indirect_glGetTexGeniv(GLenum coord, GLenum pname, GLint * params)
3749848b8605Smrg{
3750b8e80941Smrg    struct glx_context * const gc = __glXGetCurrentContext();
3751b8e80941Smrg    Display * const dpy = gc->currentDpy;
3752848b8605Smrg#ifndef USE_XCB
3753b8e80941Smrg    const GLuint cmdlen = 8;
3754848b8605Smrg#endif
3755848b8605Smrg    if (__builtin_expect(dpy != NULL, 1)) {
3756848b8605Smrg#ifdef USE_XCB
3757848b8605Smrg        xcb_connection_t *c = XGetXCBConnection(dpy);
3758848b8605Smrg        (void) __glXFlushRenderBuffer(gc, gc->pc);
3759848b8605Smrg        xcb_glx_get_tex_geniv_reply_t *reply = xcb_glx_get_tex_geniv_reply(c, xcb_glx_get_tex_geniv(c, gc->currentContextTag, coord, pname), NULL);
3760b8e80941Smrg        /* the XXX_data_length() xcb function name is misleading, it returns the number */
3761b8e80941Smrg        /* of elements, not the length of the data part. A single element is embedded. */
3762848b8605Smrg        if (xcb_glx_get_tex_geniv_data_length(reply) == 1)
3763b8e80941Smrg            (void)memcpy(params, &reply->datum, sizeof(reply->datum));
3764848b8605Smrg        else
3765b8e80941Smrg            (void)memcpy(params, xcb_glx_get_tex_geniv_data(reply), xcb_glx_get_tex_geniv_data_length(reply) * sizeof(GLint));
3766848b8605Smrg        free(reply);
3767848b8605Smrg#else
3768b8e80941Smrg        GLubyte const * pc = __glXSetupSingleRequest(gc, X_GLsop_GetTexGeniv, cmdlen);
3769b8e80941Smrg(void) memcpy((void *)(pc + 0), (void *)(&coord), 4);
3770b8e80941Smrg(void) memcpy((void *)(pc + 4), (void *)(&pname), 4);
3771848b8605Smrg        (void) __glXReadReply(dpy, 4, params, GL_FALSE);
3772b8e80941Smrg        UnlockDisplay(dpy); SyncHandle();
3773b8e80941Smrg#endif /* USE_XCB */
3774848b8605Smrg    }
3775848b8605Smrg    return;
3776848b8605Smrg}
3777848b8605Smrg
3778848b8605Smrg#define X_GLsop_GetTexImage 135
3779b8e80941Smrgvoid __indirect_glGetTexImage(GLenum target, GLint level, GLenum format, GLenum type, GLvoid * pixels)
3780848b8605Smrg{
3781b8e80941Smrg    struct glx_context * const gc = __glXGetCurrentContext();
3782b8e80941Smrg    const __GLXattribute * const state = gc->client_state_private;
3783b8e80941Smrg    Display * const dpy = gc->currentDpy;
3784848b8605Smrg#ifndef USE_XCB
3785b8e80941Smrg    const GLuint cmdlen = 20;
3786848b8605Smrg#endif
3787848b8605Smrg    if (__builtin_expect(dpy != NULL, 1)) {
3788848b8605Smrg#ifdef USE_XCB
3789848b8605Smrg        xcb_connection_t *c = XGetXCBConnection(dpy);
3790848b8605Smrg        (void) __glXFlushRenderBuffer(gc, gc->pc);
3791848b8605Smrg        xcb_glx_get_tex_image_reply_t *reply = xcb_glx_get_tex_image_reply(c, xcb_glx_get_tex_image(c, gc->currentContextTag, target, level, format, type, state->storePack.swapEndian), NULL);
3792b8e80941Smrg        if (reply->height == 0) { reply->height = 1; }
3793b8e80941Smrg        if (reply->depth == 0) { reply->depth = 1; }
3794848b8605Smrg        __glEmptyImage(gc, 3, reply->width, reply->height, reply->depth, format, type, xcb_glx_get_tex_image_data(reply), pixels);
3795848b8605Smrg        free(reply);
3796848b8605Smrg#else
3797b8e80941Smrg        GLubyte const * pc = __glXSetupSingleRequest(gc, X_GLsop_GetTexImage, cmdlen);
3798b8e80941Smrg(void) memcpy((void *)(pc + 0), (void *)(&target), 4);
3799b8e80941Smrg(void) memcpy((void *)(pc + 4), (void *)(&level), 4);
3800b8e80941Smrg(void) memcpy((void *)(pc + 8), (void *)(&format), 4);
3801b8e80941Smrg(void) memcpy((void *)(pc + 12), (void *)(&type), 4);
3802b8e80941Smrg        *(int32_t *)(pc + 16) = 0;
3803b8e80941Smrg        * (int8_t *)(pc + 16) = state->storePack.swapEndian;
3804848b8605Smrg        __glXReadPixelReply(dpy, gc, 3, 0, 0, 0, format, type, pixels, GL_TRUE);
3805b8e80941Smrg        UnlockDisplay(dpy); SyncHandle();
3806b8e80941Smrg#endif /* USE_XCB */
3807848b8605Smrg    }
3808848b8605Smrg    return;
3809848b8605Smrg}
3810848b8605Smrg
3811848b8605Smrg#define X_GLsop_GetTexParameterfv 136
3812b8e80941Smrgvoid __indirect_glGetTexParameterfv(GLenum target, GLenum pname, GLfloat * params)
3813848b8605Smrg{
3814b8e80941Smrg    struct glx_context * const gc = __glXGetCurrentContext();
3815b8e80941Smrg    Display * const dpy = gc->currentDpy;
3816848b8605Smrg#ifndef USE_XCB
3817b8e80941Smrg    const GLuint cmdlen = 8;
3818848b8605Smrg#endif
3819848b8605Smrg    if (__builtin_expect(dpy != NULL, 1)) {
3820848b8605Smrg#ifdef USE_XCB
3821848b8605Smrg        xcb_connection_t *c = XGetXCBConnection(dpy);
3822848b8605Smrg        (void) __glXFlushRenderBuffer(gc, gc->pc);
3823848b8605Smrg        xcb_glx_get_tex_parameterfv_reply_t *reply = xcb_glx_get_tex_parameterfv_reply(c, xcb_glx_get_tex_parameterfv(c, gc->currentContextTag, target, pname), NULL);
3824b8e80941Smrg        /* the XXX_data_length() xcb function name is misleading, it returns the number */
3825b8e80941Smrg        /* of elements, not the length of the data part. A single element is embedded. */
3826848b8605Smrg        if (xcb_glx_get_tex_parameterfv_data_length(reply) == 1)
3827b8e80941Smrg            (void)memcpy(params, &reply->datum, sizeof(reply->datum));
3828848b8605Smrg        else
3829b8e80941Smrg            (void)memcpy(params, xcb_glx_get_tex_parameterfv_data(reply), xcb_glx_get_tex_parameterfv_data_length(reply) * sizeof(GLfloat));
3830848b8605Smrg        free(reply);
3831848b8605Smrg#else
3832b8e80941Smrg        GLubyte const * pc = __glXSetupSingleRequest(gc, X_GLsop_GetTexParameterfv, cmdlen);
3833b8e80941Smrg(void) memcpy((void *)(pc + 0), (void *)(&target), 4);
3834b8e80941Smrg(void) memcpy((void *)(pc + 4), (void *)(&pname), 4);
3835848b8605Smrg        (void) __glXReadReply(dpy, 4, params, GL_FALSE);
3836b8e80941Smrg        UnlockDisplay(dpy); SyncHandle();
3837b8e80941Smrg#endif /* USE_XCB */
3838848b8605Smrg    }
3839848b8605Smrg    return;
3840848b8605Smrg}
3841848b8605Smrg
3842848b8605Smrg#define X_GLsop_GetTexParameteriv 137
3843b8e80941Smrgvoid __indirect_glGetTexParameteriv(GLenum target, GLenum pname, GLint * params)
3844848b8605Smrg{
3845b8e80941Smrg    struct glx_context * const gc = __glXGetCurrentContext();
3846b8e80941Smrg    Display * const dpy = gc->currentDpy;
3847848b8605Smrg#ifndef USE_XCB
3848b8e80941Smrg    const GLuint cmdlen = 8;
3849848b8605Smrg#endif
3850848b8605Smrg    if (__builtin_expect(dpy != NULL, 1)) {
3851848b8605Smrg#ifdef USE_XCB
3852848b8605Smrg        xcb_connection_t *c = XGetXCBConnection(dpy);
3853848b8605Smrg        (void) __glXFlushRenderBuffer(gc, gc->pc);
3854848b8605Smrg        xcb_glx_get_tex_parameteriv_reply_t *reply = xcb_glx_get_tex_parameteriv_reply(c, xcb_glx_get_tex_parameteriv(c, gc->currentContextTag, target, pname), NULL);
3855b8e80941Smrg        /* the XXX_data_length() xcb function name is misleading, it returns the number */
3856b8e80941Smrg        /* of elements, not the length of the data part. A single element is embedded. */
3857848b8605Smrg        if (xcb_glx_get_tex_parameteriv_data_length(reply) == 1)
3858b8e80941Smrg            (void)memcpy(params, &reply->datum, sizeof(reply->datum));
3859848b8605Smrg        else
3860b8e80941Smrg            (void)memcpy(params, xcb_glx_get_tex_parameteriv_data(reply), xcb_glx_get_tex_parameteriv_data_length(reply) * sizeof(GLint));
3861848b8605Smrg        free(reply);
3862848b8605Smrg#else
3863b8e80941Smrg        GLubyte const * pc = __glXSetupSingleRequest(gc, X_GLsop_GetTexParameteriv, cmdlen);
3864b8e80941Smrg(void) memcpy((void *)(pc + 0), (void *)(&target), 4);
3865b8e80941Smrg(void) memcpy((void *)(pc + 4), (void *)(&pname), 4);
3866848b8605Smrg        (void) __glXReadReply(dpy, 4, params, GL_FALSE);
3867b8e80941Smrg        UnlockDisplay(dpy); SyncHandle();
3868b8e80941Smrg#endif /* USE_XCB */
3869848b8605Smrg    }
3870848b8605Smrg    return;
3871848b8605Smrg}
3872848b8605Smrg
3873848b8605Smrg#define X_GLsop_GetTexLevelParameterfv 138
3874b8e80941Smrgvoid __indirect_glGetTexLevelParameterfv(GLenum target, GLint level, GLenum pname, GLfloat * params)
3875848b8605Smrg{
3876b8e80941Smrg    struct glx_context * const gc = __glXGetCurrentContext();
3877b8e80941Smrg    Display * const dpy = gc->currentDpy;
3878848b8605Smrg#ifndef USE_XCB
3879b8e80941Smrg    const GLuint cmdlen = 12;
3880848b8605Smrg#endif
3881848b8605Smrg    if (__builtin_expect(dpy != NULL, 1)) {
3882848b8605Smrg#ifdef USE_XCB
3883848b8605Smrg        xcb_connection_t *c = XGetXCBConnection(dpy);
3884848b8605Smrg        (void) __glXFlushRenderBuffer(gc, gc->pc);
3885848b8605Smrg        xcb_glx_get_tex_level_parameterfv_reply_t *reply = xcb_glx_get_tex_level_parameterfv_reply(c, xcb_glx_get_tex_level_parameterfv(c, gc->currentContextTag, target, level, pname), NULL);
3886b8e80941Smrg        /* the XXX_data_length() xcb function name is misleading, it returns the number */
3887b8e80941Smrg        /* of elements, not the length of the data part. A single element is embedded. */
3888848b8605Smrg        if (xcb_glx_get_tex_level_parameterfv_data_length(reply) == 1)
3889b8e80941Smrg            (void)memcpy(params, &reply->datum, sizeof(reply->datum));
3890848b8605Smrg        else
3891b8e80941Smrg            (void)memcpy(params, xcb_glx_get_tex_level_parameterfv_data(reply), xcb_glx_get_tex_level_parameterfv_data_length(reply) * sizeof(GLfloat));
3892848b8605Smrg        free(reply);
3893848b8605Smrg#else
3894b8e80941Smrg        GLubyte const * pc = __glXSetupSingleRequest(gc, X_GLsop_GetTexLevelParameterfv, cmdlen);
3895b8e80941Smrg(void) memcpy((void *)(pc + 0), (void *)(&target), 4);
3896b8e80941Smrg(void) memcpy((void *)(pc + 4), (void *)(&level), 4);
3897b8e80941Smrg(void) memcpy((void *)(pc + 8), (void *)(&pname), 4);
3898848b8605Smrg        (void) __glXReadReply(dpy, 4, params, GL_FALSE);
3899b8e80941Smrg        UnlockDisplay(dpy); SyncHandle();
3900b8e80941Smrg#endif /* USE_XCB */
3901848b8605Smrg    }
3902848b8605Smrg    return;
3903848b8605Smrg}
3904848b8605Smrg
3905848b8605Smrg#define X_GLsop_GetTexLevelParameteriv 139
3906b8e80941Smrgvoid __indirect_glGetTexLevelParameteriv(GLenum target, GLint level, GLenum pname, GLint * params)
3907848b8605Smrg{
3908b8e80941Smrg    struct glx_context * const gc = __glXGetCurrentContext();
3909b8e80941Smrg    Display * const dpy = gc->currentDpy;
3910848b8605Smrg#ifndef USE_XCB
3911b8e80941Smrg    const GLuint cmdlen = 12;
3912848b8605Smrg#endif
3913848b8605Smrg    if (__builtin_expect(dpy != NULL, 1)) {
3914848b8605Smrg#ifdef USE_XCB
3915848b8605Smrg        xcb_connection_t *c = XGetXCBConnection(dpy);
3916848b8605Smrg        (void) __glXFlushRenderBuffer(gc, gc->pc);
3917848b8605Smrg        xcb_glx_get_tex_level_parameteriv_reply_t *reply = xcb_glx_get_tex_level_parameteriv_reply(c, xcb_glx_get_tex_level_parameteriv(c, gc->currentContextTag, target, level, pname), NULL);
3918b8e80941Smrg        /* the XXX_data_length() xcb function name is misleading, it returns the number */
3919b8e80941Smrg        /* of elements, not the length of the data part. A single element is embedded. */
3920848b8605Smrg        if (xcb_glx_get_tex_level_parameteriv_data_length(reply) == 1)
3921b8e80941Smrg            (void)memcpy(params, &reply->datum, sizeof(reply->datum));
3922848b8605Smrg        else
3923b8e80941Smrg            (void)memcpy(params, xcb_glx_get_tex_level_parameteriv_data(reply), xcb_glx_get_tex_level_parameteriv_data_length(reply) * sizeof(GLint));
3924848b8605Smrg        free(reply);
3925848b8605Smrg#else
3926b8e80941Smrg        GLubyte const * pc = __glXSetupSingleRequest(gc, X_GLsop_GetTexLevelParameteriv, cmdlen);
3927b8e80941Smrg(void) memcpy((void *)(pc + 0), (void *)(&target), 4);
3928b8e80941Smrg(void) memcpy((void *)(pc + 4), (void *)(&level), 4);
3929b8e80941Smrg(void) memcpy((void *)(pc + 8), (void *)(&pname), 4);
3930848b8605Smrg        (void) __glXReadReply(dpy, 4, params, GL_FALSE);
3931b8e80941Smrg        UnlockDisplay(dpy); SyncHandle();
3932b8e80941Smrg#endif /* USE_XCB */
3933848b8605Smrg    }
3934848b8605Smrg    return;
3935848b8605Smrg}
3936848b8605Smrg
3937848b8605Smrg#define X_GLsop_IsList 141
3938b8e80941SmrgGLboolean __indirect_glIsList(GLuint list)
3939848b8605Smrg{
3940b8e80941Smrg    struct glx_context * const gc = __glXGetCurrentContext();
3941b8e80941Smrg    Display * const dpy = gc->currentDpy;
3942b8e80941Smrg    GLboolean retval = (GLboolean) 0;
3943848b8605Smrg#ifndef USE_XCB
3944b8e80941Smrg    const GLuint cmdlen = 4;
3945848b8605Smrg#endif
3946848b8605Smrg    if (__builtin_expect(dpy != NULL, 1)) {
3947848b8605Smrg#ifdef USE_XCB
3948848b8605Smrg        xcb_connection_t *c = XGetXCBConnection(dpy);
3949848b8605Smrg        (void) __glXFlushRenderBuffer(gc, gc->pc);
3950848b8605Smrg        xcb_glx_is_list_reply_t *reply = xcb_glx_is_list_reply(c, xcb_glx_is_list(c, gc->currentContextTag, list), NULL);
3951848b8605Smrg        retval = reply->ret_val;
3952848b8605Smrg        free(reply);
3953848b8605Smrg#else
3954b8e80941Smrg        GLubyte const * pc = __glXSetupSingleRequest(gc, X_GLsop_IsList, cmdlen);
3955b8e80941Smrg(void) memcpy((void *)(pc + 0), (void *)(&list), 4);
3956848b8605Smrg        retval = (GLboolean) __glXReadReply(dpy, 0, NULL, GL_FALSE);
3957b8e80941Smrg        UnlockDisplay(dpy); SyncHandle();
3958b8e80941Smrg#endif /* USE_XCB */
3959848b8605Smrg    }
3960848b8605Smrg    return retval;
3961848b8605Smrg}
3962848b8605Smrg
3963848b8605Smrg#define X_GLrop_DepthRange 174
3964b8e80941Smrgvoid __indirect_glDepthRange(GLclampd zNear, GLclampd zFar)
3965b8e80941Smrg{
3966b8e80941Smrg    struct glx_context * const gc = __glXGetCurrentContext();
3967b8e80941Smrg    const GLuint cmdlen = 20;
3968b8e80941Smrgemit_header(gc->pc, X_GLrop_DepthRange, cmdlen);
3969b8e80941Smrg(void) memcpy((void *)(gc->pc + 4), (void *)(&zNear), 8);
3970b8e80941Smrg(void) memcpy((void *)(gc->pc + 12), (void *)(&zFar), 8);
3971b8e80941Smrggc->pc += cmdlen;
3972b8e80941Smrgif (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); }
3973848b8605Smrg}
3974848b8605Smrg
3975848b8605Smrg#define X_GLrop_Frustum 175
3976b8e80941Smrgvoid __indirect_glFrustum(GLdouble left, GLdouble right, GLdouble bottom, GLdouble top, GLdouble zNear, GLdouble zFar)
3977b8e80941Smrg{
3978b8e80941Smrg    struct glx_context * const gc = __glXGetCurrentContext();
3979b8e80941Smrg    const GLuint cmdlen = 52;
3980b8e80941Smrgemit_header(gc->pc, X_GLrop_Frustum, cmdlen);
3981b8e80941Smrg(void) memcpy((void *)(gc->pc + 4), (void *)(&left), 8);
3982b8e80941Smrg(void) memcpy((void *)(gc->pc + 12), (void *)(&right), 8);
3983b8e80941Smrg(void) memcpy((void *)(gc->pc + 20), (void *)(&bottom), 8);
3984b8e80941Smrg(void) memcpy((void *)(gc->pc + 28), (void *)(&top), 8);
3985b8e80941Smrg(void) memcpy((void *)(gc->pc + 36), (void *)(&zNear), 8);
3986b8e80941Smrg(void) memcpy((void *)(gc->pc + 44), (void *)(&zFar), 8);
3987b8e80941Smrggc->pc += cmdlen;
3988b8e80941Smrgif (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); }
3989848b8605Smrg}
3990848b8605Smrg
3991848b8605Smrg#define X_GLrop_LoadIdentity 176
3992b8e80941Smrgvoid __indirect_glLoadIdentity(void)
3993848b8605Smrg{
3994b8e80941Smrg    struct glx_context * const gc = __glXGetCurrentContext();
3995b8e80941Smrg    const GLuint cmdlen = 4;
3996b8e80941Smrgemit_header(gc->pc, X_GLrop_LoadIdentity, cmdlen);
3997b8e80941Smrggc->pc += cmdlen;
3998b8e80941Smrgif (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); }
3999848b8605Smrg}
4000848b8605Smrg
4001848b8605Smrg#define X_GLrop_LoadMatrixf 177
4002b8e80941Smrgvoid __indirect_glLoadMatrixf(const GLfloat * m)
4003848b8605Smrg{
4004b8e80941Smrg    struct glx_context * const gc = __glXGetCurrentContext();
4005b8e80941Smrg    const GLuint cmdlen = 68;
4006b8e80941Smrgemit_header(gc->pc, X_GLrop_LoadMatrixf, cmdlen);
4007b8e80941Smrg(void) memcpy((void *)(gc->pc + 4), (void *)(m), 64);
4008b8e80941Smrggc->pc += cmdlen;
4009b8e80941Smrgif (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); }
4010848b8605Smrg}
4011848b8605Smrg
4012848b8605Smrg#define X_GLrop_LoadMatrixd 178
4013b8e80941Smrgvoid __indirect_glLoadMatrixd(const GLdouble * m)
4014848b8605Smrg{
4015b8e80941Smrg    struct glx_context * const gc = __glXGetCurrentContext();
4016b8e80941Smrg    const GLuint cmdlen = 132;
4017b8e80941Smrgemit_header(gc->pc, X_GLrop_LoadMatrixd, cmdlen);
4018b8e80941Smrg(void) memcpy((void *)(gc->pc + 4), (void *)(m), 128);
4019b8e80941Smrggc->pc += cmdlen;
4020b8e80941Smrgif (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); }
4021848b8605Smrg}
4022848b8605Smrg
4023848b8605Smrg#define X_GLrop_MatrixMode 179
4024b8e80941Smrgvoid __indirect_glMatrixMode(GLenum mode)
4025848b8605Smrg{
4026b8e80941Smrg    struct glx_context * const gc = __glXGetCurrentContext();
4027b8e80941Smrg    const GLuint cmdlen = 8;
4028b8e80941Smrgemit_header(gc->pc, X_GLrop_MatrixMode, cmdlen);
4029b8e80941Smrg(void) memcpy((void *)(gc->pc + 4), (void *)(&mode), 4);
4030b8e80941Smrggc->pc += cmdlen;
4031b8e80941Smrgif (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); }
4032848b8605Smrg}
4033848b8605Smrg
4034848b8605Smrg#define X_GLrop_MultMatrixf 180
4035b8e80941Smrgvoid __indirect_glMultMatrixf(const GLfloat * m)
4036848b8605Smrg{
4037b8e80941Smrg    struct glx_context * const gc = __glXGetCurrentContext();
4038b8e80941Smrg    const GLuint cmdlen = 68;
4039b8e80941Smrgemit_header(gc->pc, X_GLrop_MultMatrixf, cmdlen);
4040b8e80941Smrg(void) memcpy((void *)(gc->pc + 4), (void *)(m), 64);
4041b8e80941Smrggc->pc += cmdlen;
4042b8e80941Smrgif (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); }
4043848b8605Smrg}
4044848b8605Smrg
4045848b8605Smrg#define X_GLrop_MultMatrixd 181
4046b8e80941Smrgvoid __indirect_glMultMatrixd(const GLdouble * m)
4047848b8605Smrg{
4048b8e80941Smrg    struct glx_context * const gc = __glXGetCurrentContext();
4049b8e80941Smrg    const GLuint cmdlen = 132;
4050b8e80941Smrgemit_header(gc->pc, X_GLrop_MultMatrixd, cmdlen);
4051b8e80941Smrg(void) memcpy((void *)(gc->pc + 4), (void *)(m), 128);
4052b8e80941Smrggc->pc += cmdlen;
4053b8e80941Smrgif (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); }
4054848b8605Smrg}
4055848b8605Smrg
4056848b8605Smrg#define X_GLrop_Ortho 182
4057b8e80941Smrgvoid __indirect_glOrtho(GLdouble left, GLdouble right, GLdouble bottom, GLdouble top, GLdouble zNear, GLdouble zFar)
4058b8e80941Smrg{
4059b8e80941Smrg    struct glx_context * const gc = __glXGetCurrentContext();
4060b8e80941Smrg    const GLuint cmdlen = 52;
4061b8e80941Smrgemit_header(gc->pc, X_GLrop_Ortho, cmdlen);
4062b8e80941Smrg(void) memcpy((void *)(gc->pc + 4), (void *)(&left), 8);
4063b8e80941Smrg(void) memcpy((void *)(gc->pc + 12), (void *)(&right), 8);
4064b8e80941Smrg(void) memcpy((void *)(gc->pc + 20), (void *)(&bottom), 8);
4065b8e80941Smrg(void) memcpy((void *)(gc->pc + 28), (void *)(&top), 8);
4066b8e80941Smrg(void) memcpy((void *)(gc->pc + 36), (void *)(&zNear), 8);
4067b8e80941Smrg(void) memcpy((void *)(gc->pc + 44), (void *)(&zFar), 8);
4068b8e80941Smrggc->pc += cmdlen;
4069b8e80941Smrgif (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); }
4070848b8605Smrg}
4071848b8605Smrg
4072848b8605Smrg#define X_GLrop_PopMatrix 183
4073b8e80941Smrgvoid __indirect_glPopMatrix(void)
4074848b8605Smrg{
4075b8e80941Smrg    struct glx_context * const gc = __glXGetCurrentContext();
4076b8e80941Smrg    const GLuint cmdlen = 4;
4077b8e80941Smrgemit_header(gc->pc, X_GLrop_PopMatrix, cmdlen);
4078b8e80941Smrggc->pc += cmdlen;
4079b8e80941Smrgif (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); }
4080848b8605Smrg}
4081848b8605Smrg
4082848b8605Smrg#define X_GLrop_PushMatrix 184
4083b8e80941Smrgvoid __indirect_glPushMatrix(void)
4084848b8605Smrg{
4085b8e80941Smrg    struct glx_context * const gc = __glXGetCurrentContext();
4086b8e80941Smrg    const GLuint cmdlen = 4;
4087b8e80941Smrgemit_header(gc->pc, X_GLrop_PushMatrix, cmdlen);
4088b8e80941Smrggc->pc += cmdlen;
4089b8e80941Smrgif (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); }
4090848b8605Smrg}
4091848b8605Smrg
4092848b8605Smrg#define X_GLrop_Rotated 185
4093b8e80941Smrgvoid __indirect_glRotated(GLdouble angle, GLdouble x, GLdouble y, GLdouble z)
4094b8e80941Smrg{
4095b8e80941Smrg    struct glx_context * const gc = __glXGetCurrentContext();
4096b8e80941Smrg    const GLuint cmdlen = 36;
4097b8e80941Smrgemit_header(gc->pc, X_GLrop_Rotated, cmdlen);
4098b8e80941Smrg(void) memcpy((void *)(gc->pc + 4), (void *)(&angle), 8);
4099b8e80941Smrg(void) memcpy((void *)(gc->pc + 12), (void *)(&x), 8);
4100b8e80941Smrg(void) memcpy((void *)(gc->pc + 20), (void *)(&y), 8);
4101b8e80941Smrg(void) memcpy((void *)(gc->pc + 28), (void *)(&z), 8);
4102b8e80941Smrggc->pc += cmdlen;
4103b8e80941Smrgif (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); }
4104848b8605Smrg}
4105848b8605Smrg
4106848b8605Smrg#define X_GLrop_Rotatef 186
4107b8e80941Smrgvoid __indirect_glRotatef(GLfloat angle, GLfloat x, GLfloat y, GLfloat z)
4108b8e80941Smrg{
4109b8e80941Smrg    struct glx_context * const gc = __glXGetCurrentContext();
4110b8e80941Smrg    const GLuint cmdlen = 20;
4111b8e80941Smrgemit_header(gc->pc, X_GLrop_Rotatef, cmdlen);
4112b8e80941Smrg(void) memcpy((void *)(gc->pc + 4), (void *)(&angle), 4);
4113b8e80941Smrg(void) memcpy((void *)(gc->pc + 8), (void *)(&x), 4);
4114b8e80941Smrg(void) memcpy((void *)(gc->pc + 12), (void *)(&y), 4);
4115b8e80941Smrg(void) memcpy((void *)(gc->pc + 16), (void *)(&z), 4);
4116b8e80941Smrggc->pc += cmdlen;
4117b8e80941Smrgif (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); }
4118848b8605Smrg}
4119848b8605Smrg
4120848b8605Smrg#define X_GLrop_Scaled 187
4121b8e80941Smrgvoid __indirect_glScaled(GLdouble x, GLdouble y, GLdouble z)
4122b8e80941Smrg{
4123b8e80941Smrg    struct glx_context * const gc = __glXGetCurrentContext();
4124b8e80941Smrg    const GLuint cmdlen = 28;
4125b8e80941Smrgemit_header(gc->pc, X_GLrop_Scaled, cmdlen);
4126b8e80941Smrg(void) memcpy((void *)(gc->pc + 4), (void *)(&x), 8);
4127b8e80941Smrg(void) memcpy((void *)(gc->pc + 12), (void *)(&y), 8);
4128b8e80941Smrg(void) memcpy((void *)(gc->pc + 20), (void *)(&z), 8);
4129b8e80941Smrggc->pc += cmdlen;
4130b8e80941Smrgif (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); }
4131848b8605Smrg}
4132848b8605Smrg
4133848b8605Smrg#define X_GLrop_Scalef 188
4134b8e80941Smrgvoid __indirect_glScalef(GLfloat x, GLfloat y, GLfloat z)
4135b8e80941Smrg{
4136b8e80941Smrg    struct glx_context * const gc = __glXGetCurrentContext();
4137b8e80941Smrg    const GLuint cmdlen = 16;
4138b8e80941Smrgemit_header(gc->pc, X_GLrop_Scalef, cmdlen);
4139b8e80941Smrg(void) memcpy((void *)(gc->pc + 4), (void *)(&x), 4);
4140b8e80941Smrg(void) memcpy((void *)(gc->pc + 8), (void *)(&y), 4);
4141b8e80941Smrg(void) memcpy((void *)(gc->pc + 12), (void *)(&z), 4);
4142b8e80941Smrggc->pc += cmdlen;
4143b8e80941Smrgif (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); }
4144848b8605Smrg}
4145848b8605Smrg
4146848b8605Smrg#define X_GLrop_Translated 189
4147b8e80941Smrgvoid __indirect_glTranslated(GLdouble x, GLdouble y, GLdouble z)
4148b8e80941Smrg{
4149b8e80941Smrg    struct glx_context * const gc = __glXGetCurrentContext();
4150b8e80941Smrg    const GLuint cmdlen = 28;
4151b8e80941Smrgemit_header(gc->pc, X_GLrop_Translated, cmdlen);
4152b8e80941Smrg(void) memcpy((void *)(gc->pc + 4), (void *)(&x), 8);
4153b8e80941Smrg(void) memcpy((void *)(gc->pc + 12), (void *)(&y), 8);
4154b8e80941Smrg(void) memcpy((void *)(gc->pc + 20), (void *)(&z), 8);
4155b8e80941Smrggc->pc += cmdlen;
4156b8e80941Smrgif (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); }
4157848b8605Smrg}
4158848b8605Smrg
4159848b8605Smrg#define X_GLrop_Translatef 190
4160b8e80941Smrgvoid __indirect_glTranslatef(GLfloat x, GLfloat y, GLfloat z)
4161b8e80941Smrg{
4162b8e80941Smrg    struct glx_context * const gc = __glXGetCurrentContext();
4163b8e80941Smrg    const GLuint cmdlen = 16;
4164b8e80941Smrgemit_header(gc->pc, X_GLrop_Translatef, cmdlen);
4165b8e80941Smrg(void) memcpy((void *)(gc->pc + 4), (void *)(&x), 4);
4166b8e80941Smrg(void) memcpy((void *)(gc->pc + 8), (void *)(&y), 4);
4167b8e80941Smrg(void) memcpy((void *)(gc->pc + 12), (void *)(&z), 4);
4168b8e80941Smrggc->pc += cmdlen;
4169b8e80941Smrgif (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); }
4170848b8605Smrg}
4171848b8605Smrg
4172848b8605Smrg#define X_GLrop_Viewport 191
4173b8e80941Smrgvoid __indirect_glViewport(GLint x, GLint y, GLsizei width, GLsizei height)
4174b8e80941Smrg{
4175b8e80941Smrg    struct glx_context * const gc = __glXGetCurrentContext();
4176b8e80941Smrg    const GLuint cmdlen = 20;
4177b8e80941Smrgemit_header(gc->pc, X_GLrop_Viewport, cmdlen);
4178b8e80941Smrg(void) memcpy((void *)(gc->pc + 4), (void *)(&x), 4);
4179b8e80941Smrg(void) memcpy((void *)(gc->pc + 8), (void *)(&y), 4);
4180b8e80941Smrg(void) memcpy((void *)(gc->pc + 12), (void *)(&width), 4);
4181b8e80941Smrg(void) memcpy((void *)(gc->pc + 16), (void *)(&height), 4);
4182b8e80941Smrggc->pc += cmdlen;
4183b8e80941Smrgif (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); }
4184848b8605Smrg}
4185848b8605Smrg
4186848b8605Smrg#define X_GLrop_BindTexture 4117
4187b8e80941Smrgvoid __indirect_glBindTexture(GLenum target, GLuint texture)
4188b8e80941Smrg{
4189b8e80941Smrg    struct glx_context * const gc = __glXGetCurrentContext();
4190b8e80941Smrg    const GLuint cmdlen = 12;
4191b8e80941Smrgemit_header(gc->pc, X_GLrop_BindTexture, cmdlen);
4192b8e80941Smrg(void) memcpy((void *)(gc->pc + 4), (void *)(&target), 4);
4193b8e80941Smrg(void) memcpy((void *)(gc->pc + 8), (void *)(&texture), 4);
4194b8e80941Smrggc->pc += cmdlen;
4195b8e80941Smrgif (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); }
4196848b8605Smrg}
4197848b8605Smrg
4198848b8605Smrg#define X_GLrop_Indexubv 194
4199b8e80941Smrgvoid __indirect_glIndexub(GLubyte c)
4200848b8605Smrg{
4201b8e80941Smrg    struct glx_context * const gc = __glXGetCurrentContext();
4202b8e80941Smrg    const GLuint cmdlen = 8;
4203b8e80941Smrgemit_header(gc->pc, X_GLrop_Indexubv, cmdlen);
4204b8e80941Smrg(void) memcpy((void *)(gc->pc + 4), (void *)(&c), 1);
4205b8e80941Smrggc->pc += cmdlen;
4206b8e80941Smrgif (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); }
4207848b8605Smrg}
4208848b8605Smrg
4209848b8605Smrg#define X_GLrop_Indexubv 194
4210b8e80941Smrgvoid __indirect_glIndexubv(const GLubyte * c)
4211848b8605Smrg{
4212b8e80941Smrg    struct glx_context * const gc = __glXGetCurrentContext();
4213b8e80941Smrg    const GLuint cmdlen = 8;
4214b8e80941Smrgemit_header(gc->pc, X_GLrop_Indexubv, cmdlen);
4215b8e80941Smrg(void) memcpy((void *)(gc->pc + 4), (void *)(c), 1);
4216b8e80941Smrggc->pc += cmdlen;
4217b8e80941Smrgif (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); }
4218848b8605Smrg}
4219848b8605Smrg
4220848b8605Smrg#define X_GLrop_PolygonOffset 192
4221b8e80941Smrgvoid __indirect_glPolygonOffset(GLfloat factor, GLfloat units)
4222b8e80941Smrg{
4223b8e80941Smrg    struct glx_context * const gc = __glXGetCurrentContext();
4224b8e80941Smrg    const GLuint cmdlen = 12;
4225b8e80941Smrgemit_header(gc->pc, X_GLrop_PolygonOffset, cmdlen);
4226b8e80941Smrg(void) memcpy((void *)(gc->pc + 4), (void *)(&factor), 4);
4227b8e80941Smrg(void) memcpy((void *)(gc->pc + 8), (void *)(&units), 4);
4228b8e80941Smrggc->pc += cmdlen;
4229b8e80941Smrgif (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); }
4230848b8605Smrg}
4231848b8605Smrg
4232848b8605Smrg#define X_GLrop_CopyTexImage1D 4119
4233b8e80941Smrgvoid __indirect_glCopyTexImage1D(GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLint border)
4234b8e80941Smrg{
4235b8e80941Smrg    struct glx_context * const gc = __glXGetCurrentContext();
4236b8e80941Smrg    const GLuint cmdlen = 32;
4237b8e80941Smrgemit_header(gc->pc, X_GLrop_CopyTexImage1D, cmdlen);
4238b8e80941Smrg(void) memcpy((void *)(gc->pc + 4), (void *)(&target), 4);
4239b8e80941Smrg(void) memcpy((void *)(gc->pc + 8), (void *)(&level), 4);
4240b8e80941Smrg(void) memcpy((void *)(gc->pc + 12), (void *)(&internalformat), 4);
4241b8e80941Smrg(void) memcpy((void *)(gc->pc + 16), (void *)(&x), 4);
4242b8e80941Smrg(void) memcpy((void *)(gc->pc + 20), (void *)(&y), 4);
4243b8e80941Smrg(void) memcpy((void *)(gc->pc + 24), (void *)(&width), 4);
4244b8e80941Smrg(void) memcpy((void *)(gc->pc + 28), (void *)(&border), 4);
4245b8e80941Smrggc->pc += cmdlen;
4246b8e80941Smrgif (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); }
4247848b8605Smrg}
4248848b8605Smrg
4249848b8605Smrg#define X_GLrop_CopyTexImage2D 4120
4250b8e80941Smrgvoid __indirect_glCopyTexImage2D(GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLsizei height, GLint border)
4251b8e80941Smrg{
4252b8e80941Smrg    struct glx_context * const gc = __glXGetCurrentContext();
4253b8e80941Smrg    const GLuint cmdlen = 36;
4254b8e80941Smrgemit_header(gc->pc, X_GLrop_CopyTexImage2D, cmdlen);
4255b8e80941Smrg(void) memcpy((void *)(gc->pc + 4), (void *)(&target), 4);
4256b8e80941Smrg(void) memcpy((void *)(gc->pc + 8), (void *)(&level), 4);
4257b8e80941Smrg(void) memcpy((void *)(gc->pc + 12), (void *)(&internalformat), 4);
4258b8e80941Smrg(void) memcpy((void *)(gc->pc + 16), (void *)(&x), 4);
4259b8e80941Smrg(void) memcpy((void *)(gc->pc + 20), (void *)(&y), 4);
4260b8e80941Smrg(void) memcpy((void *)(gc->pc + 24), (void *)(&width), 4);
4261b8e80941Smrg(void) memcpy((void *)(gc->pc + 28), (void *)(&height), 4);
4262b8e80941Smrg(void) memcpy((void *)(gc->pc + 32), (void *)(&border), 4);
4263b8e80941Smrggc->pc += cmdlen;
4264b8e80941Smrgif (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); }
4265848b8605Smrg}
4266848b8605Smrg
4267848b8605Smrg#define X_GLrop_CopyTexSubImage1D 4121
4268b8e80941Smrgvoid __indirect_glCopyTexSubImage1D(GLenum target, GLint level, GLint xoffset, GLint x, GLint y, GLsizei width)
4269b8e80941Smrg{
4270b8e80941Smrg    struct glx_context * const gc = __glXGetCurrentContext();
4271b8e80941Smrg    const GLuint cmdlen = 28;
4272b8e80941Smrgemit_header(gc->pc, X_GLrop_CopyTexSubImage1D, cmdlen);
4273b8e80941Smrg(void) memcpy((void *)(gc->pc + 4), (void *)(&target), 4);
4274b8e80941Smrg(void) memcpy((void *)(gc->pc + 8), (void *)(&level), 4);
4275b8e80941Smrg(void) memcpy((void *)(gc->pc + 12), (void *)(&xoffset), 4);
4276b8e80941Smrg(void) memcpy((void *)(gc->pc + 16), (void *)(&x), 4);
4277b8e80941Smrg(void) memcpy((void *)(gc->pc + 20), (void *)(&y), 4);
4278b8e80941Smrg(void) memcpy((void *)(gc->pc + 24), (void *)(&width), 4);
4279b8e80941Smrggc->pc += cmdlen;
4280b8e80941Smrgif (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); }
4281848b8605Smrg}
4282848b8605Smrg
4283848b8605Smrg#define X_GLrop_CopyTexSubImage2D 4122
4284b8e80941Smrgvoid __indirect_glCopyTexSubImage2D(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint x, GLint y, GLsizei width, GLsizei height)
4285b8e80941Smrg{
4286b8e80941Smrg    struct glx_context * const gc = __glXGetCurrentContext();
4287b8e80941Smrg    const GLuint cmdlen = 36;
4288b8e80941Smrgemit_header(gc->pc, X_GLrop_CopyTexSubImage2D, cmdlen);
4289b8e80941Smrg(void) memcpy((void *)(gc->pc + 4), (void *)(&target), 4);
4290b8e80941Smrg(void) memcpy((void *)(gc->pc + 8), (void *)(&level), 4);
4291b8e80941Smrg(void) memcpy((void *)(gc->pc + 12), (void *)(&xoffset), 4);
4292b8e80941Smrg(void) memcpy((void *)(gc->pc + 16), (void *)(&yoffset), 4);
4293b8e80941Smrg(void) memcpy((void *)(gc->pc + 20), (void *)(&x), 4);
4294b8e80941Smrg(void) memcpy((void *)(gc->pc + 24), (void *)(&y), 4);
4295b8e80941Smrg(void) memcpy((void *)(gc->pc + 28), (void *)(&width), 4);
4296b8e80941Smrg(void) memcpy((void *)(gc->pc + 32), (void *)(&height), 4);
4297b8e80941Smrggc->pc += cmdlen;
4298b8e80941Smrgif (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); }
4299848b8605Smrg}
4300848b8605Smrg
4301848b8605Smrg#define X_GLsop_DeleteTextures 144
4302b8e80941Smrgvoid __indirect_glDeleteTextures(GLsizei n, const GLuint * textures)
4303848b8605Smrg{
4304b8e80941Smrg    struct glx_context * const gc = __glXGetCurrentContext();
4305b8e80941Smrg    Display * const dpy = gc->currentDpy;
4306848b8605Smrg#ifndef USE_XCB
4307b8e80941Smrg    const GLuint cmdlen = 4 + safe_pad(safe_mul(n, 4));
4308848b8605Smrg#endif
4309b8e80941Smrg    if (0 + safe_pad(safe_mul(n, 4)) < 0) {
4310b8e80941Smrg        __glXSetError(gc, GL_INVALID_VALUE);
4311b8e80941Smrg        return;
4312b8e80941Smrg    }
4313848b8605Smrg    if (n < 0) {
4314848b8605Smrg        __glXSetError(gc, GL_INVALID_VALUE);
4315848b8605Smrg        return;
4316848b8605Smrg    }
4317848b8605Smrg    if (__builtin_expect((n >= 0) && (dpy != NULL), 1)) {
4318848b8605Smrg#ifdef USE_XCB
4319848b8605Smrg        xcb_connection_t *c = XGetXCBConnection(dpy);
4320848b8605Smrg        (void) __glXFlushRenderBuffer(gc, gc->pc);
4321848b8605Smrg        xcb_glx_delete_textures(c, gc->currentContextTag, n, textures);
4322848b8605Smrg#else
4323b8e80941Smrg        GLubyte const * pc = __glXSetupSingleRequest(gc, X_GLsop_DeleteTextures, cmdlen);
4324b8e80941Smrg(void) memcpy((void *)(pc + 0), (void *)(&n), 4);
4325b8e80941Smrg(void) memcpy((void *)(pc + 4), (void *)(textures), safe_mul(n, 4));
4326b8e80941Smrg        UnlockDisplay(dpy); SyncHandle();
4327b8e80941Smrg#endif /* USE_XCB */
4328848b8605Smrg    }
4329848b8605Smrg    return;
4330848b8605Smrg}
4331848b8605Smrg
4332848b8605Smrg#define X_GLvop_DeleteTexturesEXT 12
4333b8e80941Smrgvoid glDeleteTexturesEXT(GLsizei n, const GLuint * textures)
4334848b8605Smrg{
4335b8e80941Smrg    struct glx_context * const gc = __glXGetCurrentContext();
4336848b8605Smrg
4337848b8605Smrg#if defined(GLX_DIRECT_RENDERING) && !defined(GLX_USE_APPLEGL)
4338848b8605Smrg    if (gc->isDirect) {
4339b8e80941Smrg        const _glapi_proc *const disp_table = (_glapi_proc *)GET_DISPATCH();
4340848b8605Smrg        PFNGLDELETETEXTURESEXTPROC p =
4341b8e80941Smrg            (PFNGLDELETETEXTURESEXTPROC) disp_table[327];
4342b8e80941Smrg    p(n, textures);
4343848b8605Smrg    } else
4344848b8605Smrg#endif
4345848b8605Smrg    {
4346b8e80941Smrg    struct glx_context * const gc = __glXGetCurrentContext();
4347b8e80941Smrg    Display * const dpy = gc->currentDpy;
4348b8e80941Smrg    const GLuint cmdlen = 4 + safe_pad(safe_mul(n, 4));
4349b8e80941Smrg    if (0 + safe_pad(safe_mul(n, 4)) < 0) {
4350b8e80941Smrg        __glXSetError(gc, GL_INVALID_VALUE);
4351b8e80941Smrg        return;
4352b8e80941Smrg    }
4353b8e80941Smrg    if (n < 0) {
4354b8e80941Smrg        __glXSetError(gc, GL_INVALID_VALUE);
4355848b8605Smrg        return;
4356848b8605Smrg    }
4357b8e80941Smrg    if (__builtin_expect((n >= 0) && (dpy != NULL), 1)) {
4358b8e80941Smrg        GLubyte const * pc = __glXSetupVendorRequest(gc, X_GLXVendorPrivate, X_GLvop_DeleteTexturesEXT, cmdlen);
4359b8e80941Smrg(void) memcpy((void *)(pc + 0), (void *)(&n), 4);
4360b8e80941Smrg(void) memcpy((void *)(pc + 4), (void *)(textures), safe_mul(n, 4));
4361b8e80941Smrg        UnlockDisplay(dpy); SyncHandle();
4362b8e80941Smrg    }
4363b8e80941Smrg    return;
4364b8e80941Smrg}
4365848b8605Smrg}
4366848b8605Smrg
4367848b8605Smrg#define X_GLsop_GenTextures 145
4368b8e80941Smrgvoid __indirect_glGenTextures(GLsizei n, GLuint * textures)
4369848b8605Smrg{
4370b8e80941Smrg    struct glx_context * const gc = __glXGetCurrentContext();
4371b8e80941Smrg    Display * const dpy = gc->currentDpy;
4372848b8605Smrg#ifndef USE_XCB
4373b8e80941Smrg    const GLuint cmdlen = 4;
4374848b8605Smrg#endif
4375848b8605Smrg    if (n < 0) {
4376848b8605Smrg        __glXSetError(gc, GL_INVALID_VALUE);
4377848b8605Smrg        return;
4378848b8605Smrg    }
4379848b8605Smrg    if (__builtin_expect((n >= 0) && (dpy != NULL), 1)) {
4380848b8605Smrg#ifdef USE_XCB
4381848b8605Smrg        xcb_connection_t *c = XGetXCBConnection(dpy);
4382848b8605Smrg        (void) __glXFlushRenderBuffer(gc, gc->pc);
4383848b8605Smrg        xcb_glx_gen_textures_reply_t *reply = xcb_glx_gen_textures_reply(c, xcb_glx_gen_textures(c, gc->currentContextTag, n), NULL);
4384b8e80941Smrg        (void)memcpy(textures, xcb_glx_gen_textures_data(reply), xcb_glx_gen_textures_data_length(reply) * sizeof(GLuint));
4385848b8605Smrg        free(reply);
4386848b8605Smrg#else
4387b8e80941Smrg        GLubyte const * pc = __glXSetupSingleRequest(gc, X_GLsop_GenTextures, cmdlen);
4388b8e80941Smrg(void) memcpy((void *)(pc + 0), (void *)(&n), 4);
4389848b8605Smrg        (void) __glXReadReply(dpy, 4, textures, GL_TRUE);
4390b8e80941Smrg        UnlockDisplay(dpy); SyncHandle();
4391b8e80941Smrg#endif /* USE_XCB */
4392848b8605Smrg    }
4393848b8605Smrg    return;
4394848b8605Smrg}
4395848b8605Smrg
4396848b8605Smrg#define X_GLvop_GenTexturesEXT 13
4397b8e80941Smrgvoid glGenTexturesEXT(GLsizei n, GLuint * textures)
4398848b8605Smrg{
4399b8e80941Smrg    struct glx_context * const gc = __glXGetCurrentContext();
4400848b8605Smrg
4401848b8605Smrg#if defined(GLX_DIRECT_RENDERING) && !defined(GLX_USE_APPLEGL)
4402848b8605Smrg    if (gc->isDirect) {
4403b8e80941Smrg        const _glapi_proc *const disp_table = (_glapi_proc *)GET_DISPATCH();
4404848b8605Smrg        PFNGLGENTEXTURESEXTPROC p =
4405b8e80941Smrg            (PFNGLGENTEXTURESEXTPROC) disp_table[328];
4406b8e80941Smrg    p(n, textures);
4407848b8605Smrg    } else
4408848b8605Smrg#endif
4409848b8605Smrg    {
4410b8e80941Smrg    struct glx_context * const gc = __glXGetCurrentContext();
4411b8e80941Smrg    Display * const dpy = gc->currentDpy;
4412b8e80941Smrg    const GLuint cmdlen = 4;
4413b8e80941Smrg    if (n < 0) {
4414b8e80941Smrg        __glXSetError(gc, GL_INVALID_VALUE);
4415848b8605Smrg        return;
4416848b8605Smrg    }
4417b8e80941Smrg    if (__builtin_expect((n >= 0) && (dpy != NULL), 1)) {
4418b8e80941Smrg        GLubyte const * pc = __glXSetupVendorRequest(gc, X_GLXVendorPrivateWithReply, X_GLvop_GenTexturesEXT, cmdlen);
4419b8e80941Smrg(void) memcpy((void *)(pc + 0), (void *)(&n), 4);
4420b8e80941Smrg        (void) __glXReadReply(dpy, 4, textures, GL_TRUE);
4421b8e80941Smrg        UnlockDisplay(dpy); SyncHandle();
4422b8e80941Smrg    }
4423b8e80941Smrg    return;
4424b8e80941Smrg}
4425848b8605Smrg}
4426848b8605Smrg
4427848b8605Smrg#define X_GLsop_IsTexture 146
4428b8e80941SmrgGLboolean __indirect_glIsTexture(GLuint texture)
4429848b8605Smrg{
4430b8e80941Smrg    struct glx_context * const gc = __glXGetCurrentContext();
4431b8e80941Smrg    Display * const dpy = gc->currentDpy;
4432b8e80941Smrg    GLboolean retval = (GLboolean) 0;
4433848b8605Smrg#ifndef USE_XCB
4434b8e80941Smrg    const GLuint cmdlen = 4;
4435848b8605Smrg#endif
4436848b8605Smrg    if (__builtin_expect(dpy != NULL, 1)) {
4437848b8605Smrg#ifdef USE_XCB
4438848b8605Smrg        xcb_connection_t *c = XGetXCBConnection(dpy);
4439848b8605Smrg        (void) __glXFlushRenderBuffer(gc, gc->pc);
4440848b8605Smrg        xcb_glx_is_texture_reply_t *reply = xcb_glx_is_texture_reply(c, xcb_glx_is_texture(c, gc->currentContextTag, texture), NULL);
4441848b8605Smrg        retval = reply->ret_val;
4442848b8605Smrg        free(reply);
4443848b8605Smrg#else
4444b8e80941Smrg        GLubyte const * pc = __glXSetupSingleRequest(gc, X_GLsop_IsTexture, cmdlen);
4445b8e80941Smrg(void) memcpy((void *)(pc + 0), (void *)(&texture), 4);
4446848b8605Smrg        retval = (GLboolean) __glXReadReply(dpy, 0, NULL, GL_FALSE);
4447b8e80941Smrg        UnlockDisplay(dpy); SyncHandle();
4448b8e80941Smrg#endif /* USE_XCB */
4449848b8605Smrg    }
4450848b8605Smrg    return retval;
4451848b8605Smrg}
4452848b8605Smrg
4453848b8605Smrg#define X_GLvop_IsTextureEXT 14
4454b8e80941SmrgGLboolean glIsTextureEXT(GLuint texture)
4455848b8605Smrg{
4456b8e80941Smrg    struct glx_context * const gc = __glXGetCurrentContext();
4457848b8605Smrg
4458848b8605Smrg#if defined(GLX_DIRECT_RENDERING) && !defined(GLX_USE_APPLEGL)
4459848b8605Smrg    if (gc->isDirect) {
4460b8e80941Smrg        const _glapi_proc *const disp_table = (_glapi_proc *)GET_DISPATCH();
4461848b8605Smrg        PFNGLISTEXTUREEXTPROC p =
4462b8e80941Smrg            (PFNGLISTEXTUREEXTPROC) disp_table[330];
4463b8e80941Smrg    return p(texture);
4464848b8605Smrg    } else
4465848b8605Smrg#endif
4466848b8605Smrg    {
4467b8e80941Smrg    struct glx_context * const gc = __glXGetCurrentContext();
4468b8e80941Smrg    Display * const dpy = gc->currentDpy;
4469b8e80941Smrg    GLboolean retval = (GLboolean) 0;
4470b8e80941Smrg    const GLuint cmdlen = 4;
4471b8e80941Smrg    if (__builtin_expect(dpy != NULL, 1)) {
4472b8e80941Smrg        GLubyte const * pc = __glXSetupVendorRequest(gc, X_GLXVendorPrivateWithReply, X_GLvop_IsTextureEXT, cmdlen);
4473b8e80941Smrg(void) memcpy((void *)(pc + 0), (void *)(&texture), 4);
4474b8e80941Smrg        retval = (GLboolean) __glXReadReply(dpy, 0, NULL, GL_FALSE);
4475b8e80941Smrg        UnlockDisplay(dpy); SyncHandle();
4476848b8605Smrg    }
4477b8e80941Smrg    return retval;
4478b8e80941Smrg}
4479848b8605Smrg}
4480848b8605Smrg
4481848b8605Smrg#define X_GLrop_PrioritizeTextures 4118
4482b8e80941Smrgvoid __indirect_glPrioritizeTextures(GLsizei n, const GLuint * textures, const GLclampf * priorities)
4483848b8605Smrg{
4484b8e80941Smrg    struct glx_context * const gc = __glXGetCurrentContext();
4485b8e80941Smrg    const GLuint cmdlen = 8 + safe_pad(safe_mul(n, 4)) + safe_pad(safe_mul(n, 4));
4486b8e80941Smrg    if (0 + safe_pad(safe_mul(n, 4)) + safe_pad(safe_mul(n, 4)) < 0) {
4487b8e80941Smrg        __glXSetError(gc, GL_INVALID_VALUE);
4488b8e80941Smrg        return;
4489b8e80941Smrg    }
4490848b8605Smrg    if (n < 0) {
4491848b8605Smrg        __glXSetError(gc, GL_INVALID_VALUE);
4492848b8605Smrg        return;
4493848b8605Smrg    }
4494848b8605Smrg    if (__builtin_expect(n >= 0, 1)) {
4495b8e80941Smrgemit_header(gc->pc, X_GLrop_PrioritizeTextures, cmdlen);
4496b8e80941Smrg(void) memcpy((void *)(gc->pc + 4), (void *)(&n), 4);
4497b8e80941Smrg(void) memcpy((void *)(gc->pc + 8), (void *)(textures), safe_mul(n, 4));
4498b8e80941Smrg(void) memcpy((void *)(gc->pc + 8 + safe_mul(n, 4)), (void *)(priorities), safe_mul(n, 4));
4499b8e80941Smrggc->pc += cmdlen;
4500b8e80941Smrgif (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); }
4501848b8605Smrg    }
4502848b8605Smrg}
4503848b8605Smrg
4504848b8605Smrgstatic void
4505b8e80941Smrg__glx_TexSubImage_1D2D( unsigned opcode, unsigned dim, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid * pixels )
4506848b8605Smrg{
4507b8e80941Smrg    struct glx_context * const gc = __glXGetCurrentContext();
4508b8e80941Smrg    const GLuint compsize = (pixels != NULL) ? __glImageSize(width, height, 1, format, type, target) : 0;
4509b8e80941Smrg    const GLuint cmdlen = 60 + safe_pad(compsize);
4510b8e80941Smrg    if (0 + safe_pad(compsize) < 0) {
4511b8e80941Smrg        __glXSetError(gc, GL_INVALID_VALUE);
4512b8e80941Smrg        return;
4513b8e80941Smrg    }
4514848b8605Smrg    if (__builtin_expect(gc->currentDpy != NULL, 1)) {
4515b8e80941Smrgif (cmdlen <= gc->maxSmallRenderCommandSize) {
4516b8e80941Smrg    if ( (gc->pc + cmdlen) > gc->bufEnd ) {
4517b8e80941Smrg        (void) __glXFlushRenderBuffer(gc, gc->pc);
4518b8e80941Smrg    }
4519b8e80941Smrgemit_header(gc->pc, opcode, cmdlen);
4520b8e80941Smrg(void) memcpy((void *)(gc->pc + 24), (void *)(&target), 4);
4521b8e80941Smrg(void) memcpy((void *)(gc->pc + 28), (void *)(&level), 4);
4522b8e80941Smrg(void) memcpy((void *)(gc->pc + 32), (void *)(&xoffset), 4);
4523b8e80941Smrg(void) memcpy((void *)(gc->pc + 36), (void *)(&yoffset), 4);
4524b8e80941Smrg(void) memcpy((void *)(gc->pc + 40), (void *)(&width), 4);
4525b8e80941Smrg(void) memcpy((void *)(gc->pc + 44), (void *)(&height), 4);
4526b8e80941Smrg(void) memcpy((void *)(gc->pc + 48), (void *)(&format), 4);
4527b8e80941Smrg(void) memcpy((void *)(gc->pc + 52), (void *)(&type), 4);
4528b8e80941Smrg(void) memset((void *)(gc->pc + 56), 0, 4);
4529b8e80941Smrgif (compsize > 0) {
4530b8e80941Smrg    gc->fillImage(gc, dim, width, height, 1, format, type, pixels, gc->pc + 60, gc->pc + 4);
4531b8e80941Smrg} else {
4532b8e80941Smrg    (void) memcpy( gc->pc + 4, default_pixel_store_2D, default_pixel_store_2D_size );
4533b8e80941Smrg}
4534b8e80941Smrggc->pc += cmdlen;
4535b8e80941Smrgif (gc->pc > gc->limit) { (void) __glXFlushRenderBuffer(gc, gc->pc); }
4536b8e80941Smrg}
4537b8e80941Smrgelse {
4538b8e80941Smrgconst GLint op = opcode;
4539b8e80941Smrgconst GLuint cmdlenLarge = cmdlen + 4;
4540b8e80941SmrgGLubyte * const pc = __glXFlushRenderBuffer(gc, gc->pc);
4541b8e80941Smrg(void) memcpy((void *)(pc + 0), (void *)(&cmdlenLarge), 4);
4542b8e80941Smrg(void) memcpy((void *)(pc + 4), (void *)(&op), 4);
4543b8e80941Smrg(void) memcpy((void *)(pc + 28), (void *)(&target), 4);
4544b8e80941Smrg(void) memcpy((void *)(pc + 32), (void *)(&level), 4);
4545b8e80941Smrg(void) memcpy((void *)(pc + 36), (void *)(&xoffset), 4);
4546b8e80941Smrg(void) memcpy((void *)(pc + 40), (void *)(&yoffset), 4);
4547b8e80941Smrg(void) memcpy((void *)(pc + 44), (void *)(&width), 4);
4548b8e80941Smrg(void) memcpy((void *)(pc + 48), (void *)(&height), 4);
4549b8e80941Smrg(void) memcpy((void *)(pc + 52), (void *)(&format), 4);
4550b8e80941Smrg(void) memcpy((void *)(pc + 56), (void *)(&type), 4);
4551b8e80941Smrg(void) memset((void *)(pc + 60), 0, 4);
4552b8e80941Smrg__glXSendLargeImage(gc, compsize, dim, width, height, 1, format, type, pixels, pc + 64, pc + 8);
4553b8e80941Smrg}
4554848b8605Smrg    }
4555848b8605Smrg}
4556848b8605Smrg
4557848b8605Smrg#define X_GLrop_TexSubImage1D 4099
4558b8e80941Smrgvoid __indirect_glTexSubImage1D(GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, GLenum type, const GLvoid * pixels)
4559848b8605Smrg{
4560b8e80941Smrg    __glx_TexSubImage_1D2D(X_GLrop_TexSubImage1D, 1, target, level, xoffset, 1, width, 1, format, type, pixels );
4561848b8605Smrg}
4562848b8605Smrg
4563848b8605Smrg#define X_GLrop_TexSubImage2D 4100
4564b8e80941Smrgvoid __indirect_glTexSubImage2D(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid * pixels)
4565848b8605Smrg{
4566b8e80941Smrg    __glx_TexSubImage_1D2D(X_GLrop_TexSubImage2D, 2, target, level, xoffset, yoffset, width, height, format, type, pixels );
4567848b8605Smrg}
4568848b8605Smrg
4569848b8605Smrg#define X_GLrop_BlendColor 4096
4570b8e80941Smrgvoid __indirect_glBlendColor(GLclampf red, GLclampf green, GLclampf blue, GLclampf alpha)
4571b8e80941Smrg{
4572b8e80941Smrg    struct glx_context * const gc = __glXGetCurrentContext();
4573b8e80941Smrg    const GLuint cmdlen = 20;
4574b8e80941Smrgemit_header(gc->pc, X_GLrop_BlendColor, cmdlen);
4575b8e80941Smrg(void) memcpy((void *)(gc->pc + 4), (void *)(&red), 4);
4576b8e80941Smrg(void) memcpy((void *)(gc->pc + 8), (void *)(&green), 4);
4577b8e80941Smrg(void) memcpy((void *)(gc->pc + 12), (void *)(&blue), 4);
4578b8e80941Smrg(void) memcpy((void *)(gc->pc + 16), (void *)(&alpha), 4);
4579b8e80941Smrggc->pc += cmdlen;
4580b8e80941Smrgif (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); }
4581848b8605Smrg}
4582848b8605Smrg
4583848b8605Smrg#define X_GLrop_BlendEquation 4097
4584b8e80941Smrgvoid __indirect_glBlendEquation(GLenum mode)
4585848b8605Smrg{
4586b8e80941Smrg    struct glx_context * const gc = __glXGetCurrentContext();
4587b8e80941Smrg    const GLuint cmdlen = 8;
4588b8e80941Smrgemit_header(gc->pc, X_GLrop_BlendEquation, cmdlen);
4589b8e80941Smrg(void) memcpy((void *)(gc->pc + 4), (void *)(&mode), 4);
4590b8e80941Smrggc->pc += cmdlen;
4591b8e80941Smrgif (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); }
4592848b8605Smrg}
4593848b8605Smrg
4594848b8605Smrg#define X_GLrop_ColorTable 2053
4595b8e80941Smrgvoid __indirect_glColorTable(GLenum target, GLenum internalformat, GLsizei width, GLenum format, GLenum type, const GLvoid * table)
4596848b8605Smrg{
4597b8e80941Smrg    struct glx_context * const gc = __glXGetCurrentContext();
4598b8e80941Smrg    const GLuint compsize = (table != NULL) ? __glImageSize(width, 1, 1, format, type, target) : 0;
4599b8e80941Smrg    const GLuint cmdlen = 44 + safe_pad(compsize);
4600b8e80941Smrg    if (0 + safe_pad(compsize) < 0) {
4601b8e80941Smrg        __glXSetError(gc, GL_INVALID_VALUE);
4602b8e80941Smrg        return;
4603b8e80941Smrg    }
4604848b8605Smrg    if (__builtin_expect(gc->currentDpy != NULL, 1)) {
4605b8e80941Smrgif (cmdlen <= gc->maxSmallRenderCommandSize) {
4606b8e80941Smrg    if ( (gc->pc + cmdlen) > gc->bufEnd ) {
4607b8e80941Smrg        (void) __glXFlushRenderBuffer(gc, gc->pc);
4608b8e80941Smrg    }
4609b8e80941Smrgemit_header(gc->pc, X_GLrop_ColorTable, cmdlen);
4610b8e80941Smrg(void) memcpy((void *)(gc->pc + 24), (void *)(&target), 4);
4611b8e80941Smrg(void) memcpy((void *)(gc->pc + 28), (void *)(&internalformat), 4);
4612b8e80941Smrg(void) memcpy((void *)(gc->pc + 32), (void *)(&width), 4);
4613b8e80941Smrg(void) memcpy((void *)(gc->pc + 36), (void *)(&format), 4);
4614b8e80941Smrg(void) memcpy((void *)(gc->pc + 40), (void *)(&type), 4);
4615b8e80941Smrgif (compsize > 0) {
4616b8e80941Smrg    gc->fillImage(gc, 1, width, 1, 1, format, type, table, gc->pc + 44, gc->pc + 4);
4617b8e80941Smrg} else {
4618b8e80941Smrg    (void) memcpy( gc->pc + 4, default_pixel_store_1D, default_pixel_store_1D_size );
4619b8e80941Smrg}
4620b8e80941Smrggc->pc += cmdlen;
4621b8e80941Smrgif (gc->pc > gc->limit) { (void) __glXFlushRenderBuffer(gc, gc->pc); }
4622b8e80941Smrg}
4623b8e80941Smrgelse {
4624b8e80941Smrgconst GLint op = X_GLrop_ColorTable;
4625b8e80941Smrgconst GLuint cmdlenLarge = cmdlen + 4;
4626b8e80941SmrgGLubyte * const pc = __glXFlushRenderBuffer(gc, gc->pc);
4627b8e80941Smrg(void) memcpy((void *)(pc + 0), (void *)(&cmdlenLarge), 4);
4628b8e80941Smrg(void) memcpy((void *)(pc + 4), (void *)(&op), 4);
4629b8e80941Smrg(void) memcpy((void *)(pc + 28), (void *)(&target), 4);
4630b8e80941Smrg(void) memcpy((void *)(pc + 32), (void *)(&internalformat), 4);
4631b8e80941Smrg(void) memcpy((void *)(pc + 36), (void *)(&width), 4);
4632b8e80941Smrg(void) memcpy((void *)(pc + 40), (void *)(&format), 4);
4633b8e80941Smrg(void) memcpy((void *)(pc + 44), (void *)(&type), 4);
4634b8e80941Smrg__glXSendLargeImage(gc, compsize, 1, width, 1, 1, format, type, table, pc + 48, pc + 8);
4635b8e80941Smrg}
4636848b8605Smrg    }
4637848b8605Smrg}
4638848b8605Smrg
4639848b8605Smrg#define X_GLrop_ColorTableParameterfv 2054
4640b8e80941Smrgvoid __indirect_glColorTableParameterfv(GLenum target, GLenum pname, const GLfloat * params)
4641b8e80941Smrg{
4642b8e80941Smrg    struct glx_context * const gc = __glXGetCurrentContext();
4643b8e80941Smrg    const GLuint compsize = __glColorTableParameterfv_size(pname);
4644b8e80941Smrg    const GLuint cmdlen = 12 + safe_pad(safe_mul(compsize, 4));
4645b8e80941Smrg    if (0 + safe_pad(safe_mul(compsize, 4)) < 0) {
4646b8e80941Smrg        __glXSetError(gc, GL_INVALID_VALUE);
4647b8e80941Smrg        return;
4648848b8605Smrg    }
4649b8e80941Smrgemit_header(gc->pc, X_GLrop_ColorTableParameterfv, cmdlen);
4650b8e80941Smrg(void) memcpy((void *)(gc->pc + 4), (void *)(&target), 4);
4651b8e80941Smrg(void) memcpy((void *)(gc->pc + 8), (void *)(&pname), 4);
4652b8e80941Smrg(void) memcpy((void *)(gc->pc + 12), (void *)(params), safe_mul(compsize, 4));
4653b8e80941Smrggc->pc += cmdlen;
4654b8e80941Smrgif (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); }
4655848b8605Smrg}
4656848b8605Smrg
4657848b8605Smrg#define X_GLrop_ColorTableParameteriv 2055
4658b8e80941Smrgvoid __indirect_glColorTableParameteriv(GLenum target, GLenum pname, const GLint * params)
4659b8e80941Smrg{
4660b8e80941Smrg    struct glx_context * const gc = __glXGetCurrentContext();
4661b8e80941Smrg    const GLuint compsize = __glColorTableParameteriv_size(pname);
4662b8e80941Smrg    const GLuint cmdlen = 12 + safe_pad(safe_mul(compsize, 4));
4663b8e80941Smrg    if (0 + safe_pad(safe_mul(compsize, 4)) < 0) {
4664b8e80941Smrg        __glXSetError(gc, GL_INVALID_VALUE);
4665b8e80941Smrg        return;
4666848b8605Smrg    }
4667b8e80941Smrgemit_header(gc->pc, X_GLrop_ColorTableParameteriv, cmdlen);
4668b8e80941Smrg(void) memcpy((void *)(gc->pc + 4), (void *)(&target), 4);
4669b8e80941Smrg(void) memcpy((void *)(gc->pc + 8), (void *)(&pname), 4);
4670b8e80941Smrg(void) memcpy((void *)(gc->pc + 12), (void *)(params), safe_mul(compsize, 4));
4671b8e80941Smrggc->pc += cmdlen;
4672b8e80941Smrgif (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); }
4673848b8605Smrg}
4674848b8605Smrg
4675848b8605Smrg#define X_GLrop_CopyColorTable 2056
4676b8e80941Smrgvoid __indirect_glCopyColorTable(GLenum target, GLenum internalformat, GLint x, GLint y, GLsizei width)
4677b8e80941Smrg{
4678b8e80941Smrg    struct glx_context * const gc = __glXGetCurrentContext();
4679b8e80941Smrg    const GLuint cmdlen = 24;
4680b8e80941Smrgemit_header(gc->pc, X_GLrop_CopyColorTable, cmdlen);
4681b8e80941Smrg(void) memcpy((void *)(gc->pc + 4), (void *)(&target), 4);
4682b8e80941Smrg(void) memcpy((void *)(gc->pc + 8), (void *)(&internalformat), 4);
4683b8e80941Smrg(void) memcpy((void *)(gc->pc + 12), (void *)(&x), 4);
4684b8e80941Smrg(void) memcpy((void *)(gc->pc + 16), (void *)(&y), 4);
4685b8e80941Smrg(void) memcpy((void *)(gc->pc + 20), (void *)(&width), 4);
4686b8e80941Smrggc->pc += cmdlen;
4687b8e80941Smrgif (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); }
4688848b8605Smrg}
4689848b8605Smrg
4690848b8605Smrg#define X_GLsop_GetColorTable 147
4691b8e80941Smrgvoid __indirect_glGetColorTable(GLenum target, GLenum format, GLenum type, GLvoid * table)
4692848b8605Smrg{
4693b8e80941Smrg    struct glx_context * const gc = __glXGetCurrentContext();
4694b8e80941Smrg    const __GLXattribute * const state = gc->client_state_private;
4695b8e80941Smrg    Display * const dpy = gc->currentDpy;
4696848b8605Smrg#ifndef USE_XCB
4697b8e80941Smrg    const GLuint cmdlen = 16;
4698848b8605Smrg#endif
4699848b8605Smrg    if (__builtin_expect(dpy != NULL, 1)) {
4700848b8605Smrg#ifdef USE_XCB
4701848b8605Smrg        xcb_connection_t *c = XGetXCBConnection(dpy);
4702848b8605Smrg        (void) __glXFlushRenderBuffer(gc, gc->pc);
4703848b8605Smrg        xcb_glx_get_color_table_reply_t *reply = xcb_glx_get_color_table_reply(c, xcb_glx_get_color_table(c, gc->currentContextTag, target, format, type, state->storePack.swapEndian), NULL);
4704848b8605Smrg        __glEmptyImage(gc, 3, reply->width, 1, 1, format, type, xcb_glx_get_color_table_data(reply), table);
4705848b8605Smrg        free(reply);
4706848b8605Smrg#else
4707b8e80941Smrg        GLubyte const * pc = __glXSetupSingleRequest(gc, X_GLsop_GetColorTable, cmdlen);
4708b8e80941Smrg(void) memcpy((void *)(pc + 0), (void *)(&target), 4);
4709b8e80941Smrg(void) memcpy((void *)(pc + 4), (void *)(&format), 4);
4710b8e80941Smrg(void) memcpy((void *)(pc + 8), (void *)(&type), 4);
4711b8e80941Smrg        *(int32_t *)(pc + 12) = 0;
4712b8e80941Smrg        * (int8_t *)(pc + 12) = state->storePack.swapEndian;
4713848b8605Smrg        __glXReadPixelReply(dpy, gc, 1, 0, 0, 0, format, type, table, GL_TRUE);
4714b8e80941Smrg        UnlockDisplay(dpy); SyncHandle();
4715b8e80941Smrg#endif /* USE_XCB */
4716848b8605Smrg    }
4717848b8605Smrg    return;
4718848b8605Smrg}
4719848b8605Smrg
4720848b8605Smrg#define X_GLvop_GetColorTableSGI 4098
4721b8e80941Smrgvoid gl_dispatch_stub_343(GLenum target, GLenum format, GLenum type, GLvoid * table)
4722848b8605Smrg{
4723b8e80941Smrg    struct glx_context * const gc = __glXGetCurrentContext();
4724848b8605Smrg
4725848b8605Smrg#if defined(GLX_DIRECT_RENDERING) && !defined(GLX_USE_APPLEGL)
4726848b8605Smrg    if (gc->isDirect) {
4727b8e80941Smrg        const _glapi_proc *const disp_table = (_glapi_proc *)GET_DISPATCH();
4728848b8605Smrg        PFNGLGETCOLORTABLESGIPROC p =
4729b8e80941Smrg            (PFNGLGETCOLORTABLESGIPROC) disp_table[343];
4730b8e80941Smrg    p(target, format, type, table);
4731848b8605Smrg    } else
4732848b8605Smrg#endif
4733848b8605Smrg    {
4734b8e80941Smrg    struct glx_context * const gc = __glXGetCurrentContext();
4735b8e80941Smrg    const __GLXattribute * const state = gc->client_state_private;
4736b8e80941Smrg    Display * const dpy = gc->currentDpy;
4737b8e80941Smrg    const GLuint cmdlen = 16;
4738b8e80941Smrg    if (__builtin_expect(dpy != NULL, 1)) {
4739b8e80941Smrg        GLubyte const * pc = __glXSetupVendorRequest(gc, X_GLXVendorPrivateWithReply, X_GLvop_GetColorTableSGI, cmdlen);
4740b8e80941Smrg(void) memcpy((void *)(pc + 0), (void *)(&target), 4);
4741b8e80941Smrg(void) memcpy((void *)(pc + 4), (void *)(&format), 4);
4742b8e80941Smrg(void) memcpy((void *)(pc + 8), (void *)(&type), 4);
4743b8e80941Smrg        *(int32_t *)(pc + 12) = 0;
4744b8e80941Smrg        * (int8_t *)(pc + 12) = state->storePack.swapEndian;
4745b8e80941Smrg        __glXReadPixelReply(dpy, gc, 1, 0, 0, 0, format, type, table, GL_TRUE);
4746b8e80941Smrg        UnlockDisplay(dpy); SyncHandle();
4747848b8605Smrg    }
4748b8e80941Smrg    return;
4749b8e80941Smrg}
4750848b8605Smrg}
4751848b8605Smrg
4752848b8605Smrg#define X_GLsop_GetColorTableParameterfv 148
4753b8e80941Smrgvoid __indirect_glGetColorTableParameterfv(GLenum target, GLenum pname, GLfloat * params)
4754848b8605Smrg{
4755b8e80941Smrg    struct glx_context * const gc = __glXGetCurrentContext();
4756b8e80941Smrg    Display * const dpy = gc->currentDpy;
4757848b8605Smrg#ifndef USE_XCB
4758b8e80941Smrg    const GLuint cmdlen = 8;
4759848b8605Smrg#endif
4760848b8605Smrg    if (__builtin_expect(dpy != NULL, 1)) {
4761848b8605Smrg#ifdef USE_XCB
4762848b8605Smrg        xcb_connection_t *c = XGetXCBConnection(dpy);
4763848b8605Smrg        (void) __glXFlushRenderBuffer(gc, gc->pc);
4764848b8605Smrg        xcb_glx_get_color_table_parameterfv_reply_t *reply = xcb_glx_get_color_table_parameterfv_reply(c, xcb_glx_get_color_table_parameterfv(c, gc->currentContextTag, target, pname), NULL);
4765b8e80941Smrg        /* the XXX_data_length() xcb function name is misleading, it returns the number */
4766b8e80941Smrg        /* of elements, not the length of the data part. A single element is embedded. */
4767848b8605Smrg        if (xcb_glx_get_color_table_parameterfv_data_length(reply) == 1)
4768b8e80941Smrg            (void)memcpy(params, &reply->datum, sizeof(reply->datum));
4769848b8605Smrg        else
4770b8e80941Smrg            (void)memcpy(params, xcb_glx_get_color_table_parameterfv_data(reply), xcb_glx_get_color_table_parameterfv_data_length(reply) * sizeof(GLfloat));
4771848b8605Smrg        free(reply);
4772848b8605Smrg#else
4773b8e80941Smrg        GLubyte const * pc = __glXSetupSingleRequest(gc, X_GLsop_GetColorTableParameterfv, cmdlen);
4774b8e80941Smrg(void) memcpy((void *)(pc + 0), (void *)(&target), 4);
4775b8e80941Smrg(void) memcpy((void *)(pc + 4), (void *)(&pname), 4);
4776848b8605Smrg        (void) __glXReadReply(dpy, 4, params, GL_FALSE);
4777b8e80941Smrg        UnlockDisplay(dpy); SyncHandle();
4778b8e80941Smrg#endif /* USE_XCB */
4779848b8605Smrg    }
4780848b8605Smrg    return;
4781848b8605Smrg}
4782848b8605Smrg
4783848b8605Smrg#define X_GLvop_GetColorTableParameterfvSGI 4099
4784b8e80941Smrgvoid gl_dispatch_stub_344(GLenum target, GLenum pname, GLfloat * params)
4785848b8605Smrg{
4786b8e80941Smrg    struct glx_context * const gc = __glXGetCurrentContext();
4787848b8605Smrg
4788848b8605Smrg#if defined(GLX_DIRECT_RENDERING) && !defined(GLX_USE_APPLEGL)
4789848b8605Smrg    if (gc->isDirect) {
4790b8e80941Smrg        const _glapi_proc *const disp_table = (_glapi_proc *)GET_DISPATCH();
4791848b8605Smrg        PFNGLGETCOLORTABLEPARAMETERFVSGIPROC p =
4792b8e80941Smrg            (PFNGLGETCOLORTABLEPARAMETERFVSGIPROC) disp_table[344];
4793b8e80941Smrg    p(target, pname, params);
4794848b8605Smrg    } else
4795848b8605Smrg#endif
4796848b8605Smrg    {
4797b8e80941Smrg    struct glx_context * const gc = __glXGetCurrentContext();
4798b8e80941Smrg    Display * const dpy = gc->currentDpy;
4799b8e80941Smrg    const GLuint cmdlen = 8;
4800b8e80941Smrg    if (__builtin_expect(dpy != NULL, 1)) {
4801b8e80941Smrg        GLubyte const * pc = __glXSetupVendorRequest(gc, X_GLXVendorPrivateWithReply, X_GLvop_GetColorTableParameterfvSGI, cmdlen);
4802b8e80941Smrg(void) memcpy((void *)(pc + 0), (void *)(&target), 4);
4803b8e80941Smrg(void) memcpy((void *)(pc + 4), (void *)(&pname), 4);
4804b8e80941Smrg        (void) __glXReadReply(dpy, 4, params, GL_FALSE);
4805b8e80941Smrg        UnlockDisplay(dpy); SyncHandle();
4806848b8605Smrg    }
4807b8e80941Smrg    return;
4808b8e80941Smrg}
4809848b8605Smrg}
4810848b8605Smrg
4811848b8605Smrg#define X_GLsop_GetColorTableParameteriv 149
4812b8e80941Smrgvoid __indirect_glGetColorTableParameteriv(GLenum target, GLenum pname, GLint * params)
4813848b8605Smrg{
4814b8e80941Smrg    struct glx_context * const gc = __glXGetCurrentContext();
4815b8e80941Smrg    Display * const dpy = gc->currentDpy;
4816848b8605Smrg#ifndef USE_XCB
4817b8e80941Smrg    const GLuint cmdlen = 8;
4818848b8605Smrg#endif
4819848b8605Smrg    if (__builtin_expect(dpy != NULL, 1)) {
4820848b8605Smrg#ifdef USE_XCB
4821848b8605Smrg        xcb_connection_t *c = XGetXCBConnection(dpy);
4822848b8605Smrg        (void) __glXFlushRenderBuffer(gc, gc->pc);
4823848b8605Smrg        xcb_glx_get_color_table_parameteriv_reply_t *reply = xcb_glx_get_color_table_parameteriv_reply(c, xcb_glx_get_color_table_parameteriv(c, gc->currentContextTag, target, pname), NULL);
4824b8e80941Smrg        /* the XXX_data_length() xcb function name is misleading, it returns the number */
4825b8e80941Smrg        /* of elements, not the length of the data part. A single element is embedded. */
4826848b8605Smrg        if (xcb_glx_get_color_table_parameteriv_data_length(reply) == 1)
4827b8e80941Smrg            (void)memcpy(params, &reply->datum, sizeof(reply->datum));
4828848b8605Smrg        else
4829b8e80941Smrg            (void)memcpy(params, xcb_glx_get_color_table_parameteriv_data(reply), xcb_glx_get_color_table_parameteriv_data_length(reply) * sizeof(GLint));
4830848b8605Smrg        free(reply);
4831848b8605Smrg#else
4832b8e80941Smrg        GLubyte const * pc = __glXSetupSingleRequest(gc, X_GLsop_GetColorTableParameteriv, cmdlen);
4833b8e80941Smrg(void) memcpy((void *)(pc + 0), (void *)(&target), 4);
4834b8e80941Smrg(void) memcpy((void *)(pc + 4), (void *)(&pname), 4);
4835848b8605Smrg        (void) __glXReadReply(dpy, 4, params, GL_FALSE);
4836b8e80941Smrg        UnlockDisplay(dpy); SyncHandle();
4837b8e80941Smrg#endif /* USE_XCB */
4838848b8605Smrg    }
4839848b8605Smrg    return;
4840848b8605Smrg}
4841848b8605Smrg
4842848b8605Smrg#define X_GLvop_GetColorTableParameterivSGI 4100
4843b8e80941Smrgvoid gl_dispatch_stub_345(GLenum target, GLenum pname, GLint * params)
4844848b8605Smrg{
4845b8e80941Smrg    struct glx_context * const gc = __glXGetCurrentContext();
4846848b8605Smrg
4847848b8605Smrg#if defined(GLX_DIRECT_RENDERING) && !defined(GLX_USE_APPLEGL)
4848848b8605Smrg    if (gc->isDirect) {
4849b8e80941Smrg        const _glapi_proc *const disp_table = (_glapi_proc *)GET_DISPATCH();
4850848b8605Smrg        PFNGLGETCOLORTABLEPARAMETERIVSGIPROC p =
4851b8e80941Smrg            (PFNGLGETCOLORTABLEPARAMETERIVSGIPROC) disp_table[345];
4852b8e80941Smrg    p(target, pname, params);
4853848b8605Smrg    } else
4854848b8605Smrg#endif
4855848b8605Smrg    {
4856b8e80941Smrg    struct glx_context * const gc = __glXGetCurrentContext();
4857b8e80941Smrg    Display * const dpy = gc->currentDpy;
4858b8e80941Smrg    const GLuint cmdlen = 8;
4859b8e80941Smrg    if (__builtin_expect(dpy != NULL, 1)) {
4860b8e80941Smrg        GLubyte const * pc = __glXSetupVendorRequest(gc, X_GLXVendorPrivateWithReply, X_GLvop_GetColorTableParameterivSGI, cmdlen);
4861b8e80941Smrg(void) memcpy((void *)(pc + 0), (void *)(&target), 4);
4862b8e80941Smrg(void) memcpy((void *)(pc + 4), (void *)(&pname), 4);
4863b8e80941Smrg        (void) __glXReadReply(dpy, 4, params, GL_FALSE);
4864b8e80941Smrg        UnlockDisplay(dpy); SyncHandle();
4865848b8605Smrg    }
4866b8e80941Smrg    return;
4867b8e80941Smrg}
4868848b8605Smrg}
4869848b8605Smrg
4870848b8605Smrg#define X_GLrop_ColorSubTable 195
4871b8e80941Smrgvoid __indirect_glColorSubTable(GLenum target, GLsizei start, GLsizei count, GLenum format, GLenum type, const GLvoid * data)
4872848b8605Smrg{
4873b8e80941Smrg    struct glx_context * const gc = __glXGetCurrentContext();
4874b8e80941Smrg    const GLuint compsize = (data != NULL) ? __glImageSize(count, 1, 1, format, type, target) : 0;
4875b8e80941Smrg    const GLuint cmdlen = 44 + safe_pad(compsize);
4876b8e80941Smrg    if (0 + safe_pad(compsize) < 0) {
4877b8e80941Smrg        __glXSetError(gc, GL_INVALID_VALUE);
4878b8e80941Smrg        return;
4879b8e80941Smrg    }
4880848b8605Smrg    if (__builtin_expect(gc->currentDpy != NULL, 1)) {
4881b8e80941Smrgif (cmdlen <= gc->maxSmallRenderCommandSize) {
4882b8e80941Smrg    if ( (gc->pc + cmdlen) > gc->bufEnd ) {
4883b8e80941Smrg        (void) __glXFlushRenderBuffer(gc, gc->pc);
4884b8e80941Smrg    }
4885b8e80941Smrgemit_header(gc->pc, X_GLrop_ColorSubTable, cmdlen);
4886b8e80941Smrg(void) memcpy((void *)(gc->pc + 24), (void *)(&target), 4);
4887b8e80941Smrg(void) memcpy((void *)(gc->pc + 28), (void *)(&start), 4);
4888b8e80941Smrg(void) memcpy((void *)(gc->pc + 32), (void *)(&count), 4);
4889b8e80941Smrg(void) memcpy((void *)(gc->pc + 36), (void *)(&format), 4);
4890b8e80941Smrg(void) memcpy((void *)(gc->pc + 40), (void *)(&type), 4);
4891b8e80941Smrgif (compsize > 0) {
4892b8e80941Smrg    gc->fillImage(gc, 1, count, 1, 1, format, type, data, gc->pc + 44, gc->pc + 4);
4893b8e80941Smrg} else {
4894b8e80941Smrg    (void) memcpy( gc->pc + 4, default_pixel_store_1D, default_pixel_store_1D_size );
4895b8e80941Smrg}
4896b8e80941Smrggc->pc += cmdlen;
4897b8e80941Smrgif (gc->pc > gc->limit) { (void) __glXFlushRenderBuffer(gc, gc->pc); }
4898b8e80941Smrg}
4899b8e80941Smrgelse {
4900b8e80941Smrgconst GLint op = X_GLrop_ColorSubTable;
4901b8e80941Smrgconst GLuint cmdlenLarge = cmdlen + 4;
4902b8e80941SmrgGLubyte * const pc = __glXFlushRenderBuffer(gc, gc->pc);
4903b8e80941Smrg(void) memcpy((void *)(pc + 0), (void *)(&cmdlenLarge), 4);
4904b8e80941Smrg(void) memcpy((void *)(pc + 4), (void *)(&op), 4);
4905b8e80941Smrg(void) memcpy((void *)(pc + 28), (void *)(&target), 4);
4906b8e80941Smrg(void) memcpy((void *)(pc + 32), (void *)(&start), 4);
4907b8e80941Smrg(void) memcpy((void *)(pc + 36), (void *)(&count), 4);
4908b8e80941Smrg(void) memcpy((void *)(pc + 40), (void *)(&format), 4);
4909b8e80941Smrg(void) memcpy((void *)(pc + 44), (void *)(&type), 4);
4910b8e80941Smrg__glXSendLargeImage(gc, compsize, 1, count, 1, 1, format, type, data, pc + 48, pc + 8);
4911b8e80941Smrg}
4912848b8605Smrg    }
4913848b8605Smrg}
4914848b8605Smrg
4915848b8605Smrg#define X_GLrop_CopyColorSubTable 196
4916b8e80941Smrgvoid __indirect_glCopyColorSubTable(GLenum target, GLsizei start, GLint x, GLint y, GLsizei width)
4917b8e80941Smrg{
4918b8e80941Smrg    struct glx_context * const gc = __glXGetCurrentContext();
4919b8e80941Smrg    const GLuint cmdlen = 24;
4920b8e80941Smrgemit_header(gc->pc, X_GLrop_CopyColorSubTable, cmdlen);
4921b8e80941Smrg(void) memcpy((void *)(gc->pc + 4), (void *)(&target), 4);
4922b8e80941Smrg(void) memcpy((void *)(gc->pc + 8), (void *)(&start), 4);
4923b8e80941Smrg(void) memcpy((void *)(gc->pc + 12), (void *)(&x), 4);
4924b8e80941Smrg(void) memcpy((void *)(gc->pc + 16), (void *)(&y), 4);
4925b8e80941Smrg(void) memcpy((void *)(gc->pc + 20), (void *)(&width), 4);
4926b8e80941Smrggc->pc += cmdlen;
4927b8e80941Smrgif (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); }
4928848b8605Smrg}
4929848b8605Smrg
4930848b8605Smrgstatic void
4931b8e80941Smrg__glx_ConvolutionFilter_1D2D( unsigned opcode, unsigned dim, GLenum target, GLenum internalformat, GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid * image )
4932848b8605Smrg{
4933b8e80941Smrg    struct glx_context * const gc = __glXGetCurrentContext();
4934b8e80941Smrg    const GLuint compsize = (image != NULL) ? __glImageSize(width, height, 1, format, type, target) : 0;
4935b8e80941Smrg    const GLuint cmdlen = 48 + safe_pad(compsize);
4936b8e80941Smrg    if (0 + safe_pad(compsize) < 0) {
4937b8e80941Smrg        __glXSetError(gc, GL_INVALID_VALUE);
4938b8e80941Smrg        return;
4939b8e80941Smrg    }
4940848b8605Smrg    if (__builtin_expect(gc->currentDpy != NULL, 1)) {
4941b8e80941Smrgif (cmdlen <= gc->maxSmallRenderCommandSize) {
4942b8e80941Smrg    if ( (gc->pc + cmdlen) > gc->bufEnd ) {
4943b8e80941Smrg        (void) __glXFlushRenderBuffer(gc, gc->pc);
4944b8e80941Smrg    }
4945b8e80941Smrgemit_header(gc->pc, opcode, cmdlen);
4946b8e80941Smrg(void) memcpy((void *)(gc->pc + 24), (void *)(&target), 4);
4947b8e80941Smrg(void) memcpy((void *)(gc->pc + 28), (void *)(&internalformat), 4);
4948b8e80941Smrg(void) memcpy((void *)(gc->pc + 32), (void *)(&width), 4);
4949b8e80941Smrg(void) memcpy((void *)(gc->pc + 36), (void *)(&height), 4);
4950b8e80941Smrg(void) memcpy((void *)(gc->pc + 40), (void *)(&format), 4);
4951b8e80941Smrg(void) memcpy((void *)(gc->pc + 44), (void *)(&type), 4);
4952b8e80941Smrgif (compsize > 0) {
4953b8e80941Smrg    gc->fillImage(gc, dim, width, height, 1, format, type, image, gc->pc + 48, gc->pc + 4);
4954b8e80941Smrg} else {
4955b8e80941Smrg    (void) memcpy( gc->pc + 4, default_pixel_store_2D, default_pixel_store_2D_size );
4956b8e80941Smrg}
4957b8e80941Smrggc->pc += cmdlen;
4958b8e80941Smrgif (gc->pc > gc->limit) { (void) __glXFlushRenderBuffer(gc, gc->pc); }
4959b8e80941Smrg}
4960b8e80941Smrgelse {
4961b8e80941Smrgconst GLint op = opcode;
4962b8e80941Smrgconst GLuint cmdlenLarge = cmdlen + 4;
4963b8e80941SmrgGLubyte * const pc = __glXFlushRenderBuffer(gc, gc->pc);
4964b8e80941Smrg(void) memcpy((void *)(pc + 0), (void *)(&cmdlenLarge), 4);
4965b8e80941Smrg(void) memcpy((void *)(pc + 4), (void *)(&op), 4);
4966b8e80941Smrg(void) memcpy((void *)(pc + 28), (void *)(&target), 4);
4967b8e80941Smrg(void) memcpy((void *)(pc + 32), (void *)(&internalformat), 4);
4968b8e80941Smrg(void) memcpy((void *)(pc + 36), (void *)(&width), 4);
4969b8e80941Smrg(void) memcpy((void *)(pc + 40), (void *)(&height), 4);
4970b8e80941Smrg(void) memcpy((void *)(pc + 44), (void *)(&format), 4);
4971b8e80941Smrg(void) memcpy((void *)(pc + 48), (void *)(&type), 4);
4972b8e80941Smrg__glXSendLargeImage(gc, compsize, dim, width, height, 1, format, type, image, pc + 52, pc + 8);
4973b8e80941Smrg}
4974848b8605Smrg    }
4975848b8605Smrg}
4976848b8605Smrg
4977848b8605Smrg#define X_GLrop_ConvolutionFilter1D 4101
4978b8e80941Smrgvoid __indirect_glConvolutionFilter1D(GLenum target, GLenum internalformat, GLsizei width, GLenum format, GLenum type, const GLvoid * image)
4979848b8605Smrg{
4980b8e80941Smrg    __glx_ConvolutionFilter_1D2D(X_GLrop_ConvolutionFilter1D, 1, target, internalformat, width, 1, format, type, image );
4981848b8605Smrg}
4982848b8605Smrg
4983848b8605Smrg#define X_GLrop_ConvolutionFilter2D 4102
4984b8e80941Smrgvoid __indirect_glConvolutionFilter2D(GLenum target, GLenum internalformat, GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid * image)
4985848b8605Smrg{
4986b8e80941Smrg    __glx_ConvolutionFilter_1D2D(X_GLrop_ConvolutionFilter2D, 2, target, internalformat, width, height, format, type, image );
4987848b8605Smrg}
4988848b8605Smrg
4989848b8605Smrg#define X_GLrop_ConvolutionParameterf 4103
4990b8e80941Smrgvoid __indirect_glConvolutionParameterf(GLenum target, GLenum pname, GLfloat params)
4991b8e80941Smrg{
4992b8e80941Smrg    struct glx_context * const gc = __glXGetCurrentContext();
4993b8e80941Smrg    const GLuint cmdlen = 16;
4994b8e80941Smrgemit_header(gc->pc, X_GLrop_ConvolutionParameterf, cmdlen);
4995b8e80941Smrg(void) memcpy((void *)(gc->pc + 4), (void *)(&target), 4);
4996b8e80941Smrg(void) memcpy((void *)(gc->pc + 8), (void *)(&pname), 4);
4997b8e80941Smrg(void) memcpy((void *)(gc->pc + 12), (void *)(&params), 4);
4998b8e80941Smrggc->pc += cmdlen;
4999b8e80941Smrgif (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); }
5000848b8605Smrg}
5001848b8605Smrg
5002848b8605Smrg#define X_GLrop_ConvolutionParameterfv 4104
5003b8e80941Smrgvoid __indirect_glConvolutionParameterfv(GLenum target, GLenum pname, const GLfloat * params)
5004b8e80941Smrg{
5005b8e80941Smrg    struct glx_context * const gc = __glXGetCurrentContext();
5006b8e80941Smrg    const GLuint compsize = __glConvolutionParameterfv_size(pname);
5007b8e80941Smrg    const GLuint cmdlen = 12 + safe_pad(safe_mul(compsize, 4));
5008b8e80941Smrg    if (0 + safe_pad(safe_mul(compsize, 4)) < 0) {
5009b8e80941Smrg        __glXSetError(gc, GL_INVALID_VALUE);
5010b8e80941Smrg        return;
5011848b8605Smrg    }
5012b8e80941Smrgemit_header(gc->pc, X_GLrop_ConvolutionParameterfv, cmdlen);
5013b8e80941Smrg(void) memcpy((void *)(gc->pc + 4), (void *)(&target), 4);
5014b8e80941Smrg(void) memcpy((void *)(gc->pc + 8), (void *)(&pname), 4);
5015b8e80941Smrg(void) memcpy((void *)(gc->pc + 12), (void *)(params), safe_mul(compsize, 4));
5016b8e80941Smrggc->pc += cmdlen;
5017b8e80941Smrgif (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); }
5018848b8605Smrg}
5019848b8605Smrg
5020848b8605Smrg#define X_GLrop_ConvolutionParameteri 4105
5021b8e80941Smrgvoid __indirect_glConvolutionParameteri(GLenum target, GLenum pname, GLint params)
5022b8e80941Smrg{
5023b8e80941Smrg    struct glx_context * const gc = __glXGetCurrentContext();
5024b8e80941Smrg    const GLuint cmdlen = 16;
5025b8e80941Smrgemit_header(gc->pc, X_GLrop_ConvolutionParameteri, cmdlen);
5026b8e80941Smrg(void) memcpy((void *)(gc->pc + 4), (void *)(&target), 4);
5027b8e80941Smrg(void) memcpy((void *)(gc->pc + 8), (void *)(&pname), 4);
5028b8e80941Smrg(void) memcpy((void *)(gc->pc + 12), (void *)(&params), 4);
5029b8e80941Smrggc->pc += cmdlen;
5030b8e80941Smrgif (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); }
5031848b8605Smrg}
5032848b8605Smrg
5033848b8605Smrg#define X_GLrop_ConvolutionParameteriv 4106
5034b8e80941Smrgvoid __indirect_glConvolutionParameteriv(GLenum target, GLenum pname, const GLint * params)
5035b8e80941Smrg{
5036b8e80941Smrg    struct glx_context * const gc = __glXGetCurrentContext();
5037b8e80941Smrg    const GLuint compsize = __glConvolutionParameteriv_size(pname);
5038b8e80941Smrg    const GLuint cmdlen = 12 + safe_pad(safe_mul(compsize, 4));
5039b8e80941Smrg    if (0 + safe_pad(safe_mul(compsize, 4)) < 0) {
5040b8e80941Smrg        __glXSetError(gc, GL_INVALID_VALUE);
5041b8e80941Smrg        return;
5042848b8605Smrg    }
5043b8e80941Smrgemit_header(gc->pc, X_GLrop_ConvolutionParameteriv, cmdlen);
5044b8e80941Smrg(void) memcpy((void *)(gc->pc + 4), (void *)(&target), 4);
5045b8e80941Smrg(void) memcpy((void *)(gc->pc + 8), (void *)(&pname), 4);
5046b8e80941Smrg(void) memcpy((void *)(gc->pc + 12), (void *)(params), safe_mul(compsize, 4));
5047b8e80941Smrggc->pc += cmdlen;
5048b8e80941Smrgif (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); }
5049848b8605Smrg}
5050848b8605Smrg
5051848b8605Smrg#define X_GLrop_CopyConvolutionFilter1D 4107
5052b8e80941Smrgvoid __indirect_glCopyConvolutionFilter1D(GLenum target, GLenum internalformat, GLint x, GLint y, GLsizei width)
5053b8e80941Smrg{
5054b8e80941Smrg    struct glx_context * const gc = __glXGetCurrentContext();
5055b8e80941Smrg    const GLuint cmdlen = 24;
5056b8e80941Smrgemit_header(gc->pc, X_GLrop_CopyConvolutionFilter1D, cmdlen);
5057b8e80941Smrg(void) memcpy((void *)(gc->pc + 4), (void *)(&target), 4);
5058b8e80941Smrg(void) memcpy((void *)(gc->pc + 8), (void *)(&internalformat), 4);
5059b8e80941Smrg(void) memcpy((void *)(gc->pc + 12), (void *)(&x), 4);
5060b8e80941Smrg(void) memcpy((void *)(gc->pc + 16), (void *)(&y), 4);
5061b8e80941Smrg(void) memcpy((void *)(gc->pc + 20), (void *)(&width), 4);
5062b8e80941Smrggc->pc += cmdlen;
5063b8e80941Smrgif (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); }
5064848b8605Smrg}
5065848b8605Smrg
5066848b8605Smrg#define X_GLrop_CopyConvolutionFilter2D 4108
5067b8e80941Smrgvoid __indirect_glCopyConvolutionFilter2D(GLenum target, GLenum internalformat, GLint x, GLint y, GLsizei width, GLsizei height)
5068b8e80941Smrg{
5069b8e80941Smrg    struct glx_context * const gc = __glXGetCurrentContext();
5070b8e80941Smrg    const GLuint cmdlen = 28;
5071b8e80941Smrgemit_header(gc->pc, X_GLrop_CopyConvolutionFilter2D, cmdlen);
5072b8e80941Smrg(void) memcpy((void *)(gc->pc + 4), (void *)(&target), 4);
5073b8e80941Smrg(void) memcpy((void *)(gc->pc + 8), (void *)(&internalformat), 4);
5074b8e80941Smrg(void) memcpy((void *)(gc->pc + 12), (void *)(&x), 4);
5075b8e80941Smrg(void) memcpy((void *)(gc->pc + 16), (void *)(&y), 4);
5076b8e80941Smrg(void) memcpy((void *)(gc->pc + 20), (void *)(&width), 4);
5077b8e80941Smrg(void) memcpy((void *)(gc->pc + 24), (void *)(&height), 4);
5078b8e80941Smrggc->pc += cmdlen;
5079b8e80941Smrgif (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); }
5080848b8605Smrg}
5081848b8605Smrg
5082848b8605Smrg#define X_GLsop_GetConvolutionFilter 150
5083b8e80941Smrgvoid __indirect_glGetConvolutionFilter(GLenum target, GLenum format, GLenum type, GLvoid * image)
5084848b8605Smrg{
5085b8e80941Smrg    struct glx_context * const gc = __glXGetCurrentContext();
5086b8e80941Smrg    const __GLXattribute * const state = gc->client_state_private;
5087b8e80941Smrg    Display * const dpy = gc->currentDpy;
5088848b8605Smrg#ifndef USE_XCB
5089b8e80941Smrg    const GLuint cmdlen = 16;
5090848b8605Smrg#endif
5091848b8605Smrg    if (__builtin_expect(dpy != NULL, 1)) {
5092848b8605Smrg#ifdef USE_XCB
5093848b8605Smrg        xcb_connection_t *c = XGetXCBConnection(dpy);
5094848b8605Smrg        (void) __glXFlushRenderBuffer(gc, gc->pc);
5095848b8605Smrg        xcb_glx_get_convolution_filter_reply_t *reply = xcb_glx_get_convolution_filter_reply(c, xcb_glx_get_convolution_filter(c, gc->currentContextTag, target, format, type, state->storePack.swapEndian), NULL);
5096b8e80941Smrg        if (reply->height == 0) { reply->height = 1; }
5097848b8605Smrg        __glEmptyImage(gc, 3, reply->width, reply->height, 1, format, type, xcb_glx_get_convolution_filter_data(reply), image);
5098848b8605Smrg        free(reply);
5099848b8605Smrg#else
5100b8e80941Smrg        GLubyte const * pc = __glXSetupSingleRequest(gc, X_GLsop_GetConvolutionFilter, cmdlen);
5101b8e80941Smrg(void) memcpy((void *)(pc + 0), (void *)(&target), 4);
5102b8e80941Smrg(void) memcpy((void *)(pc + 4), (void *)(&format), 4);
5103b8e80941Smrg(void) memcpy((void *)(pc + 8), (void *)(&type), 4);
5104b8e80941Smrg        *(int32_t *)(pc + 12) = 0;
5105b8e80941Smrg        * (int8_t *)(pc + 12) = state->storePack.swapEndian;
5106848b8605Smrg        __glXReadPixelReply(dpy, gc, 2, 0, 0, 0, format, type, image, GL_TRUE);
5107b8e80941Smrg        UnlockDisplay(dpy); SyncHandle();
5108b8e80941Smrg#endif /* USE_XCB */
5109848b8605Smrg    }
5110848b8605Smrg    return;
5111848b8605Smrg}
5112848b8605Smrg
5113848b8605Smrg#define X_GLvop_GetConvolutionFilterEXT 1
5114b8e80941Smrgvoid gl_dispatch_stub_356(GLenum target, GLenum format, GLenum type, GLvoid * image)
5115848b8605Smrg{
5116b8e80941Smrg    struct glx_context * const gc = __glXGetCurrentContext();
5117848b8605Smrg
5118848b8605Smrg#if defined(GLX_DIRECT_RENDERING) && !defined(GLX_USE_APPLEGL)
5119848b8605Smrg    if (gc->isDirect) {
5120b8e80941Smrg        const _glapi_proc *const disp_table = (_glapi_proc *)GET_DISPATCH();
5121848b8605Smrg        PFNGLGETCONVOLUTIONFILTEREXTPROC p =
5122b8e80941Smrg            (PFNGLGETCONVOLUTIONFILTEREXTPROC) disp_table[356];
5123b8e80941Smrg    p(target, format, type, image);
5124848b8605Smrg    } else
5125848b8605Smrg#endif
5126848b8605Smrg    {
5127b8e80941Smrg    struct glx_context * const gc = __glXGetCurrentContext();
5128b8e80941Smrg    const __GLXattribute * const state = gc->client_state_private;
5129b8e80941Smrg    Display * const dpy = gc->currentDpy;
5130b8e80941Smrg    const GLuint cmdlen = 16;
5131b8e80941Smrg    if (__builtin_expect(dpy != NULL, 1)) {
5132b8e80941Smrg        GLubyte const * pc = __glXSetupVendorRequest(gc, X_GLXVendorPrivateWithReply, X_GLvop_GetConvolutionFilterEXT, cmdlen);
5133b8e80941Smrg(void) memcpy((void *)(pc + 0), (void *)(&target), 4);
5134b8e80941Smrg(void) memcpy((void *)(pc + 4), (void *)(&format), 4);
5135b8e80941Smrg(void) memcpy((void *)(pc + 8), (void *)(&type), 4);
5136b8e80941Smrg        *(int32_t *)(pc + 12) = 0;
5137b8e80941Smrg        * (int8_t *)(pc + 12) = state->storePack.swapEndian;
5138b8e80941Smrg        __glXReadPixelReply(dpy, gc, 2, 0, 0, 0, format, type, image, GL_TRUE);
5139b8e80941Smrg        UnlockDisplay(dpy); SyncHandle();
5140848b8605Smrg    }
5141b8e80941Smrg    return;
5142b8e80941Smrg}
5143848b8605Smrg}
5144848b8605Smrg
5145848b8605Smrg#define X_GLsop_GetConvolutionParameterfv 151
5146b8e80941Smrgvoid __indirect_glGetConvolutionParameterfv(GLenum target, GLenum pname, GLfloat * params)
5147848b8605Smrg{
5148b8e80941Smrg    struct glx_context * const gc = __glXGetCurrentContext();
5149b8e80941Smrg    Display * const dpy = gc->currentDpy;
5150848b8605Smrg#ifndef USE_XCB
5151b8e80941Smrg    const GLuint cmdlen = 8;
5152848b8605Smrg#endif
5153848b8605Smrg    if (__builtin_expect(dpy != NULL, 1)) {
5154848b8605Smrg#ifdef USE_XCB
5155848b8605Smrg        xcb_connection_t *c = XGetXCBConnection(dpy);
5156848b8605Smrg        (void) __glXFlushRenderBuffer(gc, gc->pc);
5157848b8605Smrg        xcb_glx_get_convolution_parameterfv_reply_t *reply = xcb_glx_get_convolution_parameterfv_reply(c, xcb_glx_get_convolution_parameterfv(c, gc->currentContextTag, target, pname), NULL);
5158b8e80941Smrg        /* the XXX_data_length() xcb function name is misleading, it returns the number */
5159b8e80941Smrg        /* of elements, not the length of the data part. A single element is embedded. */
5160848b8605Smrg        if (xcb_glx_get_convolution_parameterfv_data_length(reply) == 1)
5161b8e80941Smrg            (void)memcpy(params, &reply->datum, sizeof(reply->datum));
5162848b8605Smrg        else
5163b8e80941Smrg            (void)memcpy(params, xcb_glx_get_convolution_parameterfv_data(reply), xcb_glx_get_convolution_parameterfv_data_length(reply) * sizeof(GLfloat));
5164848b8605Smrg        free(reply);
5165848b8605Smrg#else
5166b8e80941Smrg        GLubyte const * pc = __glXSetupSingleRequest(gc, X_GLsop_GetConvolutionParameterfv, cmdlen);
5167b8e80941Smrg(void) memcpy((void *)(pc + 0), (void *)(&target), 4);
5168b8e80941Smrg(void) memcpy((void *)(pc + 4), (void *)(&pname), 4);
5169848b8605Smrg        (void) __glXReadReply(dpy, 4, params, GL_FALSE);
5170b8e80941Smrg        UnlockDisplay(dpy); SyncHandle();
5171b8e80941Smrg#endif /* USE_XCB */
5172848b8605Smrg    }
5173848b8605Smrg    return;
5174848b8605Smrg}
5175848b8605Smrg
5176848b8605Smrg#define X_GLvop_GetConvolutionParameterfvEXT 2
5177b8e80941Smrgvoid gl_dispatch_stub_357(GLenum target, GLenum pname, GLfloat * params)
5178848b8605Smrg{
5179b8e80941Smrg    struct glx_context * const gc = __glXGetCurrentContext();
5180848b8605Smrg
5181848b8605Smrg#if defined(GLX_DIRECT_RENDERING) && !defined(GLX_USE_APPLEGL)
5182848b8605Smrg    if (gc->isDirect) {
5183b8e80941Smrg        const _glapi_proc *const disp_table = (_glapi_proc *)GET_DISPATCH();
5184848b8605Smrg        PFNGLGETCONVOLUTIONPARAMETERFVEXTPROC p =
5185b8e80941Smrg            (PFNGLGETCONVOLUTIONPARAMETERFVEXTPROC) disp_table[357];
5186b8e80941Smrg    p(target, pname, params);
5187848b8605Smrg    } else
5188848b8605Smrg#endif
5189848b8605Smrg    {
5190b8e80941Smrg    struct glx_context * const gc = __glXGetCurrentContext();
5191b8e80941Smrg    Display * const dpy = gc->currentDpy;
5192b8e80941Smrg    const GLuint cmdlen = 8;
5193b8e80941Smrg    if (__builtin_expect(dpy != NULL, 1)) {
5194b8e80941Smrg        GLubyte const * pc = __glXSetupVendorRequest(gc, X_GLXVendorPrivateWithReply, X_GLvop_GetConvolutionParameterfvEXT, cmdlen);
5195b8e80941Smrg(void) memcpy((void *)(pc + 0), (void *)(&target), 4);
5196b8e80941Smrg(void) memcpy((void *)(pc + 4), (void *)(&pname), 4);
5197b8e80941Smrg        (void) __glXReadReply(dpy, 4, params, GL_FALSE);
5198b8e80941Smrg        UnlockDisplay(dpy); SyncHandle();
5199848b8605Smrg    }
5200b8e80941Smrg    return;
5201b8e80941Smrg}
5202848b8605Smrg}
5203848b8605Smrg
5204848b8605Smrg#define X_GLsop_GetConvolutionParameteriv 152
5205b8e80941Smrgvoid __indirect_glGetConvolutionParameteriv(GLenum target, GLenum pname, GLint * params)
5206848b8605Smrg{
5207b8e80941Smrg    struct glx_context * const gc = __glXGetCurrentContext();
5208b8e80941Smrg    Display * const dpy = gc->currentDpy;
5209848b8605Smrg#ifndef USE_XCB
5210b8e80941Smrg    const GLuint cmdlen = 8;
5211848b8605Smrg#endif
5212848b8605Smrg    if (__builtin_expect(dpy != NULL, 1)) {
5213848b8605Smrg#ifdef USE_XCB
5214848b8605Smrg        xcb_connection_t *c = XGetXCBConnection(dpy);
5215848b8605Smrg        (void) __glXFlushRenderBuffer(gc, gc->pc);
5216848b8605Smrg        xcb_glx_get_convolution_parameteriv_reply_t *reply = xcb_glx_get_convolution_parameteriv_reply(c, xcb_glx_get_convolution_parameteriv(c, gc->currentContextTag, target, pname), NULL);
5217b8e80941Smrg        /* the XXX_data_length() xcb function name is misleading, it returns the number */
5218b8e80941Smrg        /* of elements, not the length of the data part. A single element is embedded. */
5219848b8605Smrg        if (xcb_glx_get_convolution_parameteriv_data_length(reply) == 1)
5220b8e80941Smrg            (void)memcpy(params, &reply->datum, sizeof(reply->datum));
5221848b8605Smrg        else
5222b8e80941Smrg            (void)memcpy(params, xcb_glx_get_convolution_parameteriv_data(reply), xcb_glx_get_convolution_parameteriv_data_length(reply) * sizeof(GLint));
5223848b8605Smrg        free(reply);
5224848b8605Smrg#else
5225b8e80941Smrg        GLubyte const * pc = __glXSetupSingleRequest(gc, X_GLsop_GetConvolutionParameteriv, cmdlen);
5226b8e80941Smrg(void) memcpy((void *)(pc + 0), (void *)(&target), 4);
5227b8e80941Smrg(void) memcpy((void *)(pc + 4), (void *)(&pname), 4);
5228848b8605Smrg        (void) __glXReadReply(dpy, 4, params, GL_FALSE);
5229b8e80941Smrg        UnlockDisplay(dpy); SyncHandle();
5230b8e80941Smrg#endif /* USE_XCB */
5231848b8605Smrg    }
5232848b8605Smrg    return;
5233848b8605Smrg}
5234848b8605Smrg
5235848b8605Smrg#define X_GLvop_GetConvolutionParameterivEXT 3
5236b8e80941Smrgvoid gl_dispatch_stub_358(GLenum target, GLenum pname, GLint * params)
5237848b8605Smrg{
5238b8e80941Smrg    struct glx_context * const gc = __glXGetCurrentContext();
5239848b8605Smrg
5240848b8605Smrg#if defined(GLX_DIRECT_RENDERING) && !defined(GLX_USE_APPLEGL)
5241848b8605Smrg    if (gc->isDirect) {
5242b8e80941Smrg        const _glapi_proc *const disp_table = (_glapi_proc *)GET_DISPATCH();
5243848b8605Smrg        PFNGLGETCONVOLUTIONPARAMETERIVEXTPROC p =
5244b8e80941Smrg            (PFNGLGETCONVOLUTIONPARAMETERIVEXTPROC) disp_table[358];
5245b8e80941Smrg    p(target, pname, params);
5246848b8605Smrg    } else
5247848b8605Smrg#endif
5248848b8605Smrg    {
5249b8e80941Smrg    struct glx_context * const gc = __glXGetCurrentContext();
5250b8e80941Smrg    Display * const dpy = gc->currentDpy;
5251b8e80941Smrg    const GLuint cmdlen = 8;
5252b8e80941Smrg    if (__builtin_expect(dpy != NULL, 1)) {
5253b8e80941Smrg        GLubyte const * pc = __glXSetupVendorRequest(gc, X_GLXVendorPrivateWithReply, X_GLvop_GetConvolutionParameterivEXT, cmdlen);
5254b8e80941Smrg(void) memcpy((void *)(pc + 0), (void *)(&target), 4);
5255b8e80941Smrg(void) memcpy((void *)(pc + 4), (void *)(&pname), 4);
5256b8e80941Smrg        (void) __glXReadReply(dpy, 4, params, GL_FALSE);
5257b8e80941Smrg        UnlockDisplay(dpy); SyncHandle();
5258848b8605Smrg    }
5259b8e80941Smrg    return;
5260b8e80941Smrg}
5261848b8605Smrg}
5262848b8605Smrg
5263848b8605Smrg#define X_GLsop_GetHistogram 154
5264b8e80941Smrgvoid __indirect_glGetHistogram(GLenum target, GLboolean reset, GLenum format, GLenum type, GLvoid * values)
5265848b8605Smrg{
5266b8e80941Smrg    struct glx_context * const gc = __glXGetCurrentContext();
5267b8e80941Smrg    const __GLXattribute * const state = gc->client_state_private;
5268b8e80941Smrg    Display * const dpy = gc->currentDpy;
5269848b8605Smrg#ifndef USE_XCB
5270b8e80941Smrg    const GLuint cmdlen = 16;
5271848b8605Smrg#endif
5272848b8605Smrg    if (__builtin_expect(dpy != NULL, 1)) {
5273848b8605Smrg#ifdef USE_XCB
5274848b8605Smrg        xcb_connection_t *c = XGetXCBConnection(dpy);
5275848b8605Smrg        (void) __glXFlushRenderBuffer(gc, gc->pc);
5276848b8605Smrg        xcb_glx_get_histogram_reply_t *reply = xcb_glx_get_histogram_reply(c, xcb_glx_get_histogram(c, gc->currentContextTag, target, reset, format, type, state->storePack.swapEndian), NULL);
5277848b8605Smrg        __glEmptyImage(gc, 3, reply->width, 1, 1, format, type, xcb_glx_get_histogram_data(reply), values);
5278848b8605Smrg        free(reply);
5279848b8605Smrg#else
5280b8e80941Smrg        GLubyte const * pc = __glXSetupSingleRequest(gc, X_GLsop_GetHistogram, cmdlen);
5281b8e80941Smrg(void) memcpy((void *)(pc + 0), (void *)(&target), 4);
5282b8e80941Smrg(void) memcpy((void *)(pc + 4), (void *)(&format), 4);
5283b8e80941Smrg(void) memcpy((void *)(pc + 8), (void *)(&type), 4);
5284b8e80941Smrg        *(int32_t *)(pc + 12) = 0;
5285b8e80941Smrg        * (int8_t *)(pc + 12) = state->storePack.swapEndian;
5286b8e80941Smrg        * (int8_t *)(pc + 13) = reset;
5287848b8605Smrg        __glXReadPixelReply(dpy, gc, 1, 0, 0, 0, format, type, values, GL_TRUE);
5288b8e80941Smrg        UnlockDisplay(dpy); SyncHandle();
5289b8e80941Smrg#endif /* USE_XCB */
5290848b8605Smrg    }
5291848b8605Smrg    return;
5292848b8605Smrg}
5293848b8605Smrg
5294848b8605Smrg#define X_GLvop_GetHistogramEXT 5
5295b8e80941Smrgvoid gl_dispatch_stub_361(GLenum target, GLboolean reset, GLenum format, GLenum type, GLvoid * values)
5296848b8605Smrg{
5297b8e80941Smrg    struct glx_context * const gc = __glXGetCurrentContext();
5298848b8605Smrg
5299848b8605Smrg#if defined(GLX_DIRECT_RENDERING) && !defined(GLX_USE_APPLEGL)
5300848b8605Smrg    if (gc->isDirect) {
5301b8e80941Smrg        const _glapi_proc *const disp_table = (_glapi_proc *)GET_DISPATCH();
5302848b8605Smrg        PFNGLGETHISTOGRAMEXTPROC p =
5303b8e80941Smrg            (PFNGLGETHISTOGRAMEXTPROC) disp_table[361];
5304b8e80941Smrg    p(target, reset, format, type, values);
5305848b8605Smrg    } else
5306848b8605Smrg#endif
5307848b8605Smrg    {
5308b8e80941Smrg    struct glx_context * const gc = __glXGetCurrentContext();
5309b8e80941Smrg    const __GLXattribute * const state = gc->client_state_private;
5310b8e80941Smrg    Display * const dpy = gc->currentDpy;
5311b8e80941Smrg    const GLuint cmdlen = 16;
5312b8e80941Smrg    if (__builtin_expect(dpy != NULL, 1)) {
5313b8e80941Smrg        GLubyte const * pc = __glXSetupVendorRequest(gc, X_GLXVendorPrivateWithReply, X_GLvop_GetHistogramEXT, cmdlen);
5314b8e80941Smrg(void) memcpy((void *)(pc + 0), (void *)(&target), 4);
5315b8e80941Smrg(void) memcpy((void *)(pc + 4), (void *)(&format), 4);
5316b8e80941Smrg(void) memcpy((void *)(pc + 8), (void *)(&type), 4);
5317b8e80941Smrg        *(int32_t *)(pc + 12) = 0;
5318b8e80941Smrg        * (int8_t *)(pc + 12) = state->storePack.swapEndian;
5319b8e80941Smrg        * (int8_t *)(pc + 13) = reset;
5320b8e80941Smrg        __glXReadPixelReply(dpy, gc, 1, 0, 0, 0, format, type, values, GL_TRUE);
5321b8e80941Smrg        UnlockDisplay(dpy); SyncHandle();
5322848b8605Smrg    }
5323b8e80941Smrg    return;
5324b8e80941Smrg}
5325848b8605Smrg}
5326848b8605Smrg
5327848b8605Smrg#define X_GLsop_GetHistogramParameterfv 155
5328b8e80941Smrgvoid __indirect_glGetHistogramParameterfv(GLenum target, GLenum pname, GLfloat * params)
5329848b8605Smrg{
5330b8e80941Smrg    struct glx_context * const gc = __glXGetCurrentContext();
5331b8e80941Smrg    Display * const dpy = gc->currentDpy;
5332848b8605Smrg#ifndef USE_XCB
5333b8e80941Smrg    const GLuint cmdlen = 8;
5334848b8605Smrg#endif
5335848b8605Smrg    if (__builtin_expect(dpy != NULL, 1)) {
5336848b8605Smrg#ifdef USE_XCB
5337848b8605Smrg        xcb_connection_t *c = XGetXCBConnection(dpy);
5338848b8605Smrg        (void) __glXFlushRenderBuffer(gc, gc->pc);
5339848b8605Smrg        xcb_glx_get_histogram_parameterfv_reply_t *reply = xcb_glx_get_histogram_parameterfv_reply(c, xcb_glx_get_histogram_parameterfv(c, gc->currentContextTag, target, pname), NULL);
5340b8e80941Smrg        /* the XXX_data_length() xcb function name is misleading, it returns the number */
5341b8e80941Smrg        /* of elements, not the length of the data part. A single element is embedded. */
5342848b8605Smrg        if (xcb_glx_get_histogram_parameterfv_data_length(reply) == 1)
5343b8e80941Smrg            (void)memcpy(params, &reply->datum, sizeof(reply->datum));
5344848b8605Smrg        else
5345b8e80941Smrg            (void)memcpy(params, xcb_glx_get_histogram_parameterfv_data(reply), xcb_glx_get_histogram_parameterfv_data_length(reply) * sizeof(GLfloat));
5346848b8605Smrg        free(reply);
5347848b8605Smrg#else
5348b8e80941Smrg        GLubyte const * pc = __glXSetupSingleRequest(gc, X_GLsop_GetHistogramParameterfv, cmdlen);
5349b8e80941Smrg(void) memcpy((void *)(pc + 0), (void *)(&target), 4);
5350b8e80941Smrg(void) memcpy((void *)(pc + 4), (void *)(&pname), 4);
5351848b8605Smrg        (void) __glXReadReply(dpy, 4, params, GL_FALSE);
5352b8e80941Smrg        UnlockDisplay(dpy); SyncHandle();
5353b8e80941Smrg#endif /* USE_XCB */
5354848b8605Smrg    }
5355848b8605Smrg    return;
5356848b8605Smrg}
5357848b8605Smrg
5358848b8605Smrg#define X_GLvop_GetHistogramParameterfvEXT 6
5359b8e80941Smrgvoid gl_dispatch_stub_362(GLenum target, GLenum pname, GLfloat * params)
5360848b8605Smrg{
5361b8e80941Smrg    struct glx_context * const gc = __glXGetCurrentContext();
5362848b8605Smrg
5363848b8605Smrg#if defined(GLX_DIRECT_RENDERING) && !defined(GLX_USE_APPLEGL)
5364848b8605Smrg    if (gc->isDirect) {
5365b8e80941Smrg        const _glapi_proc *const disp_table = (_glapi_proc *)GET_DISPATCH();
5366848b8605Smrg        PFNGLGETHISTOGRAMPARAMETERFVEXTPROC p =
5367b8e80941Smrg            (PFNGLGETHISTOGRAMPARAMETERFVEXTPROC) disp_table[362];
5368b8e80941Smrg    p(target, pname, params);
5369848b8605Smrg    } else
5370848b8605Smrg#endif
5371848b8605Smrg    {
5372b8e80941Smrg    struct glx_context * const gc = __glXGetCurrentContext();
5373b8e80941Smrg    Display * const dpy = gc->currentDpy;
5374b8e80941Smrg    const GLuint cmdlen = 8;
5375b8e80941Smrg    if (__builtin_expect(dpy != NULL, 1)) {
5376b8e80941Smrg        GLubyte const * pc = __glXSetupVendorRequest(gc, X_GLXVendorPrivateWithReply, X_GLvop_GetHistogramParameterfvEXT, cmdlen);
5377b8e80941Smrg(void) memcpy((void *)(pc + 0), (void *)(&target), 4);
5378b8e80941Smrg(void) memcpy((void *)(pc + 4), (void *)(&pname), 4);
5379b8e80941Smrg        (void) __glXReadReply(dpy, 4, params, GL_FALSE);
5380b8e80941Smrg        UnlockDisplay(dpy); SyncHandle();
5381848b8605Smrg    }
5382b8e80941Smrg    return;
5383b8e80941Smrg}
5384848b8605Smrg}
5385848b8605Smrg
5386848b8605Smrg#define X_GLsop_GetHistogramParameteriv 156
5387b8e80941Smrgvoid __indirect_glGetHistogramParameteriv(GLenum target, GLenum pname, GLint * params)
5388848b8605Smrg{
5389b8e80941Smrg    struct glx_context * const gc = __glXGetCurrentContext();
5390b8e80941Smrg    Display * const dpy = gc->currentDpy;
5391848b8605Smrg#ifndef USE_XCB
5392b8e80941Smrg    const GLuint cmdlen = 8;
5393848b8605Smrg#endif
5394848b8605Smrg    if (__builtin_expect(dpy != NULL, 1)) {
5395848b8605Smrg#ifdef USE_XCB
5396848b8605Smrg        xcb_connection_t *c = XGetXCBConnection(dpy);
5397848b8605Smrg        (void) __glXFlushRenderBuffer(gc, gc->pc);
5398848b8605Smrg        xcb_glx_get_histogram_parameteriv_reply_t *reply = xcb_glx_get_histogram_parameteriv_reply(c, xcb_glx_get_histogram_parameteriv(c, gc->currentContextTag, target, pname), NULL);
5399b8e80941Smrg        /* the XXX_data_length() xcb function name is misleading, it returns the number */
5400b8e80941Smrg        /* of elements, not the length of the data part. A single element is embedded. */
5401848b8605Smrg        if (xcb_glx_get_histogram_parameteriv_data_length(reply) == 1)
5402b8e80941Smrg            (void)memcpy(params, &reply->datum, sizeof(reply->datum));
5403848b8605Smrg        else
5404b8e80941Smrg            (void)memcpy(params, xcb_glx_get_histogram_parameteriv_data(reply), xcb_glx_get_histogram_parameteriv_data_length(reply) * sizeof(GLint));
5405848b8605Smrg        free(reply);
5406848b8605Smrg#else
5407b8e80941Smrg        GLubyte const * pc = __glXSetupSingleRequest(gc, X_GLsop_GetHistogramParameteriv, cmdlen);
5408b8e80941Smrg(void) memcpy((void *)(pc + 0), (void *)(&target), 4);
5409b8e80941Smrg(void) memcpy((void *)(pc + 4), (void *)(&pname), 4);
5410848b8605Smrg        (void) __glXReadReply(dpy, 4, params, GL_FALSE);
5411b8e80941Smrg        UnlockDisplay(dpy); SyncHandle();
5412b8e80941Smrg#endif /* USE_XCB */
5413848b8605Smrg    }
5414848b8605Smrg    return;
5415848b8605Smrg}
5416848b8605Smrg
5417848b8605Smrg#define X_GLvop_GetHistogramParameterivEXT 7
5418b8e80941Smrgvoid gl_dispatch_stub_363(GLenum target, GLenum pname, GLint * params)
5419848b8605Smrg{
5420b8e80941Smrg    struct glx_context * const gc = __glXGetCurrentContext();
5421848b8605Smrg
5422848b8605Smrg#if defined(GLX_DIRECT_RENDERING) && !defined(GLX_USE_APPLEGL)
5423848b8605Smrg    if (gc->isDirect) {
5424b8e80941Smrg        const _glapi_proc *const disp_table = (_glapi_proc *)GET_DISPATCH();
5425848b8605Smrg        PFNGLGETHISTOGRAMPARAMETERIVEXTPROC p =
5426b8e80941Smrg            (PFNGLGETHISTOGRAMPARAMETERIVEXTPROC) disp_table[363];
5427b8e80941Smrg    p(target, pname, params);
5428848b8605Smrg    } else
5429848b8605Smrg#endif
5430848b8605Smrg    {
5431b8e80941Smrg    struct glx_context * const gc = __glXGetCurrentContext();
5432b8e80941Smrg    Display * const dpy = gc->currentDpy;
5433b8e80941Smrg    const GLuint cmdlen = 8;
5434b8e80941Smrg    if (__builtin_expect(dpy != NULL, 1)) {
5435b8e80941Smrg        GLubyte const * pc = __glXSetupVendorRequest(gc, X_GLXVendorPrivateWithReply, X_GLvop_GetHistogramParameterivEXT, cmdlen);
5436b8e80941Smrg(void) memcpy((void *)(pc + 0), (void *)(&target), 4);
5437b8e80941Smrg(void) memcpy((void *)(pc + 4), (void *)(&pname), 4);
5438b8e80941Smrg        (void) __glXReadReply(dpy, 4, params, GL_FALSE);
5439b8e80941Smrg        UnlockDisplay(dpy); SyncHandle();
5440848b8605Smrg    }
5441b8e80941Smrg    return;
5442b8e80941Smrg}
5443848b8605Smrg}
5444848b8605Smrg
5445848b8605Smrg#define X_GLsop_GetMinmax 157
5446b8e80941Smrgvoid __indirect_glGetMinmax(GLenum target, GLboolean reset, GLenum format, GLenum type, GLvoid * values)
5447848b8605Smrg{
5448b8e80941Smrg    struct glx_context * const gc = __glXGetCurrentContext();
5449b8e80941Smrg    const __GLXattribute * const state = gc->client_state_private;
5450b8e80941Smrg    Display * const dpy = gc->currentDpy;
5451848b8605Smrg#ifndef USE_XCB
5452b8e80941Smrg    const GLuint cmdlen = 16;
5453848b8605Smrg#endif
5454848b8605Smrg    if (__builtin_expect(dpy != NULL, 1)) {
5455848b8605Smrg#ifdef USE_XCB
5456848b8605Smrg        xcb_connection_t *c = XGetXCBConnection(dpy);
5457848b8605Smrg        (void) __glXFlushRenderBuffer(gc, gc->pc);
5458848b8605Smrg        xcb_glx_get_minmax_reply_t *reply = xcb_glx_get_minmax_reply(c, xcb_glx_get_minmax(c, gc->currentContextTag, target, reset, format, type, state->storePack.swapEndian), NULL);
5459848b8605Smrg        __glEmptyImage(gc, 3, 2, 1, 1, format, type, xcb_glx_get_minmax_data(reply), values);
5460848b8605Smrg        free(reply);
5461848b8605Smrg#else
5462b8e80941Smrg        GLubyte const * pc = __glXSetupSingleRequest(gc, X_GLsop_GetMinmax, cmdlen);
5463b8e80941Smrg(void) memcpy((void *)(pc + 0), (void *)(&target), 4);
5464b8e80941Smrg(void) memcpy((void *)(pc + 4), (void *)(&format), 4);
5465b8e80941Smrg(void) memcpy((void *)(pc + 8), (void *)(&type), 4);
5466b8e80941Smrg        *(int32_t *)(pc + 12) = 0;
5467b8e80941Smrg        * (int8_t *)(pc + 12) = state->storePack.swapEndian;
5468b8e80941Smrg        * (int8_t *)(pc + 13) = reset;
5469848b8605Smrg        __glXReadPixelReply(dpy, gc, 1, 2, 1, 1, format, type, values, GL_FALSE);
5470b8e80941Smrg        UnlockDisplay(dpy); SyncHandle();
5471b8e80941Smrg#endif /* USE_XCB */
5472848b8605Smrg    }
5473848b8605Smrg    return;
5474848b8605Smrg}
5475848b8605Smrg
5476848b8605Smrg#define X_GLvop_GetMinmaxEXT 8
5477b8e80941Smrgvoid gl_dispatch_stub_364(GLenum target, GLboolean reset, GLenum format, GLenum type, GLvoid * values)
5478848b8605Smrg{
5479b8e80941Smrg    struct glx_context * const gc = __glXGetCurrentContext();
5480848b8605Smrg
5481848b8605Smrg#if defined(GLX_DIRECT_RENDERING) && !defined(GLX_USE_APPLEGL)
5482848b8605Smrg    if (gc->isDirect) {
5483b8e80941Smrg        const _glapi_proc *const disp_table = (_glapi_proc *)GET_DISPATCH();
5484848b8605Smrg        PFNGLGETMINMAXEXTPROC p =
5485b8e80941Smrg            (PFNGLGETMINMAXEXTPROC) disp_table[364];
5486b8e80941Smrg    p(target, reset, format, type, values);
5487848b8605Smrg    } else
5488848b8605Smrg#endif
5489848b8605Smrg    {
5490b8e80941Smrg    struct glx_context * const gc = __glXGetCurrentContext();
5491b8e80941Smrg    const __GLXattribute * const state = gc->client_state_private;
5492b8e80941Smrg    Display * const dpy = gc->currentDpy;
5493b8e80941Smrg    const GLuint cmdlen = 16;
5494b8e80941Smrg    if (__builtin_expect(dpy != NULL, 1)) {
5495b8e80941Smrg        GLubyte const * pc = __glXSetupVendorRequest(gc, X_GLXVendorPrivateWithReply, X_GLvop_GetMinmaxEXT, cmdlen);
5496b8e80941Smrg(void) memcpy((void *)(pc + 0), (void *)(&target), 4);
5497b8e80941Smrg(void) memcpy((void *)(pc + 4), (void *)(&format), 4);
5498b8e80941Smrg(void) memcpy((void *)(pc + 8), (void *)(&type), 4);
5499b8e80941Smrg        *(int32_t *)(pc + 12) = 0;
5500b8e80941Smrg        * (int8_t *)(pc + 12) = state->storePack.swapEndian;
5501b8e80941Smrg        * (int8_t *)(pc + 13) = reset;
5502b8e80941Smrg        __glXReadPixelReply(dpy, gc, 1, 2, 1, 1, format, type, values, GL_FALSE);
5503b8e80941Smrg        UnlockDisplay(dpy); SyncHandle();
5504848b8605Smrg    }
5505b8e80941Smrg    return;
5506b8e80941Smrg}
5507848b8605Smrg}
5508848b8605Smrg
5509848b8605Smrg#define X_GLsop_GetMinmaxParameterfv 158
5510b8e80941Smrgvoid __indirect_glGetMinmaxParameterfv(GLenum target, GLenum pname, GLfloat * params)
5511848b8605Smrg{
5512b8e80941Smrg    struct glx_context * const gc = __glXGetCurrentContext();
5513b8e80941Smrg    Display * const dpy = gc->currentDpy;
5514848b8605Smrg#ifndef USE_XCB
5515b8e80941Smrg    const GLuint cmdlen = 8;
5516848b8605Smrg#endif
5517848b8605Smrg    if (__builtin_expect(dpy != NULL, 1)) {
5518848b8605Smrg#ifdef USE_XCB
5519848b8605Smrg        xcb_connection_t *c = XGetXCBConnection(dpy);
5520848b8605Smrg        (void) __glXFlushRenderBuffer(gc, gc->pc);
5521848b8605Smrg        xcb_glx_get_minmax_parameterfv_reply_t *reply = xcb_glx_get_minmax_parameterfv_reply(c, xcb_glx_get_minmax_parameterfv(c, gc->currentContextTag, target, pname), NULL);
5522b8e80941Smrg        /* the XXX_data_length() xcb function name is misleading, it returns the number */
5523b8e80941Smrg        /* of elements, not the length of the data part. A single element is embedded. */
5524848b8605Smrg        if (xcb_glx_get_minmax_parameterfv_data_length(reply) == 1)
5525b8e80941Smrg            (void)memcpy(params, &reply->datum, sizeof(reply->datum));
5526848b8605Smrg        else
5527b8e80941Smrg            (void)memcpy(params, xcb_glx_get_minmax_parameterfv_data(reply), xcb_glx_get_minmax_parameterfv_data_length(reply) * sizeof(GLfloat));
5528848b8605Smrg        free(reply);
5529848b8605Smrg#else
5530b8e80941Smrg        GLubyte const * pc = __glXSetupSingleRequest(gc, X_GLsop_GetMinmaxParameterfv, cmdlen);
5531b8e80941Smrg(void) memcpy((void *)(pc + 0), (void *)(&target), 4);
5532b8e80941Smrg(void) memcpy((void *)(pc + 4), (void *)(&pname), 4);
5533848b8605Smrg        (void) __glXReadReply(dpy, 4, params, GL_FALSE);
5534b8e80941Smrg        UnlockDisplay(dpy); SyncHandle();
5535b8e80941Smrg#endif /* USE_XCB */
5536848b8605Smrg    }
5537848b8605Smrg    return;
5538848b8605Smrg}
5539848b8605Smrg
5540848b8605Smrg#define X_GLvop_GetMinmaxParameterfvEXT 9
5541b8e80941Smrgvoid gl_dispatch_stub_365(GLenum target, GLenum pname, GLfloat * params)
5542848b8605Smrg{
5543b8e80941Smrg    struct glx_context * const gc = __glXGetCurrentContext();
5544848b8605Smrg
5545848b8605Smrg#if defined(GLX_DIRECT_RENDERING) && !defined(GLX_USE_APPLEGL)
5546848b8605Smrg    if (gc->isDirect) {
5547b8e80941Smrg        const _glapi_proc *const disp_table = (_glapi_proc *)GET_DISPATCH();
5548848b8605Smrg        PFNGLGETMINMAXPARAMETERFVEXTPROC p =
5549b8e80941Smrg            (PFNGLGETMINMAXPARAMETERFVEXTPROC) disp_table[365];
5550b8e80941Smrg    p(target, pname, params);
5551848b8605Smrg    } else
5552848b8605Smrg#endif
5553848b8605Smrg    {
5554b8e80941Smrg    struct glx_context * const gc = __glXGetCurrentContext();
5555b8e80941Smrg    Display * const dpy = gc->currentDpy;
5556b8e80941Smrg    const GLuint cmdlen = 8;
5557b8e80941Smrg    if (__builtin_expect(dpy != NULL, 1)) {
5558b8e80941Smrg        GLubyte const * pc = __glXSetupVendorRequest(gc, X_GLXVendorPrivateWithReply, X_GLvop_GetMinmaxParameterfvEXT, cmdlen);
5559b8e80941Smrg(void) memcpy((void *)(pc + 0), (void *)(&target), 4);
5560b8e80941Smrg(void) memcpy((void *)(pc + 4), (void *)(&pname), 4);
5561b8e80941Smrg        (void) __glXReadReply(dpy, 4, params, GL_FALSE);
5562b8e80941Smrg        UnlockDisplay(dpy); SyncHandle();
5563848b8605Smrg    }
5564b8e80941Smrg    return;
5565b8e80941Smrg}
5566848b8605Smrg}
5567848b8605Smrg
5568848b8605Smrg#define X_GLsop_GetMinmaxParameteriv 159
5569b8e80941Smrgvoid __indirect_glGetMinmaxParameteriv(GLenum target, GLenum pname, GLint * params)
5570848b8605Smrg{
5571b8e80941Smrg    struct glx_context * const gc = __glXGetCurrentContext();
5572b8e80941Smrg    Display * const dpy = gc->currentDpy;
5573848b8605Smrg#ifndef USE_XCB
5574b8e80941Smrg    const GLuint cmdlen = 8;
5575848b8605Smrg#endif
5576848b8605Smrg    if (__builtin_expect(dpy != NULL, 1)) {
5577848b8605Smrg#ifdef USE_XCB
5578848b8605Smrg        xcb_connection_t *c = XGetXCBConnection(dpy);
5579848b8605Smrg        (void) __glXFlushRenderBuffer(gc, gc->pc);
5580848b8605Smrg        xcb_glx_get_minmax_parameteriv_reply_t *reply = xcb_glx_get_minmax_parameteriv_reply(c, xcb_glx_get_minmax_parameteriv(c, gc->currentContextTag, target, pname), NULL);
5581b8e80941Smrg        /* the XXX_data_length() xcb function name is misleading, it returns the number */
5582b8e80941Smrg        /* of elements, not the length of the data part. A single element is embedded. */
5583848b8605Smrg        if (xcb_glx_get_minmax_parameteriv_data_length(reply) == 1)
5584b8e80941Smrg            (void)memcpy(params, &reply->datum, sizeof(reply->datum));
5585848b8605Smrg        else
5586b8e80941Smrg            (void)memcpy(params, xcb_glx_get_minmax_parameteriv_data(reply), xcb_glx_get_minmax_parameteriv_data_length(reply) * sizeof(GLint));
5587848b8605Smrg        free(reply);
5588848b8605Smrg#else
5589b8e80941Smrg        GLubyte const * pc = __glXSetupSingleRequest(gc, X_GLsop_GetMinmaxParameteriv, cmdlen);
5590b8e80941Smrg(void) memcpy((void *)(pc + 0), (void *)(&target), 4);
5591b8e80941Smrg(void) memcpy((void *)(pc + 4), (void *)(&pname), 4);
5592848b8605Smrg        (void) __glXReadReply(dpy, 4, params, GL_FALSE);
5593b8e80941Smrg        UnlockDisplay(dpy); SyncHandle();
5594b8e80941Smrg#endif /* USE_XCB */
5595848b8605Smrg    }
5596848b8605Smrg    return;
5597848b8605Smrg}
5598848b8605Smrg
5599848b8605Smrg#define X_GLvop_GetMinmaxParameterivEXT 10
5600b8e80941Smrgvoid gl_dispatch_stub_366(GLenum target, GLenum pname, GLint * params)
5601848b8605Smrg{
5602b8e80941Smrg    struct glx_context * const gc = __glXGetCurrentContext();
5603848b8605Smrg
5604848b8605Smrg#if defined(GLX_DIRECT_RENDERING) && !defined(GLX_USE_APPLEGL)
5605848b8605Smrg    if (gc->isDirect) {
5606b8e80941Smrg        const _glapi_proc *const disp_table = (_glapi_proc *)GET_DISPATCH();
5607848b8605Smrg        PFNGLGETMINMAXPARAMETERIVEXTPROC p =
5608b8e80941Smrg            (PFNGLGETMINMAXPARAMETERIVEXTPROC) disp_table[366];
5609b8e80941Smrg    p(target, pname, params);
5610848b8605Smrg    } else
5611848b8605Smrg#endif
5612848b8605Smrg    {
5613b8e80941Smrg    struct glx_context * const gc = __glXGetCurrentContext();
5614b8e80941Smrg    Display * const dpy = gc->currentDpy;
5615b8e80941Smrg    const GLuint cmdlen = 8;
5616b8e80941Smrg    if (__builtin_expect(dpy != NULL, 1)) {
5617b8e80941Smrg        GLubyte const * pc = __glXSetupVendorRequest(gc, X_GLXVendorPrivateWithReply, X_GLvop_GetMinmaxParameterivEXT, cmdlen);
5618b8e80941Smrg(void) memcpy((void *)(pc + 0), (void *)(&target), 4);
5619b8e80941Smrg(void) memcpy((void *)(pc + 4), (void *)(&pname), 4);
5620b8e80941Smrg        (void) __glXReadReply(dpy, 4, params, GL_FALSE);
5621b8e80941Smrg        UnlockDisplay(dpy); SyncHandle();
5622848b8605Smrg    }
5623b8e80941Smrg    return;
5624b8e80941Smrg}
5625848b8605Smrg}
5626848b8605Smrg
5627848b8605Smrg#define X_GLrop_Histogram 4110
5628b8e80941Smrgvoid __indirect_glHistogram(GLenum target, GLsizei width, GLenum internalformat, GLboolean sink)
5629b8e80941Smrg{
5630b8e80941Smrg    struct glx_context * const gc = __glXGetCurrentContext();
5631b8e80941Smrg    const GLuint cmdlen = 20;
5632b8e80941Smrgemit_header(gc->pc, X_GLrop_Histogram, cmdlen);
5633b8e80941Smrg(void) memcpy((void *)(gc->pc + 4), (void *)(&target), 4);
5634b8e80941Smrg(void) memcpy((void *)(gc->pc + 8), (void *)(&width), 4);
5635b8e80941Smrg(void) memcpy((void *)(gc->pc + 12), (void *)(&internalformat), 4);
5636b8e80941Smrg(void) memcpy((void *)(gc->pc + 16), (void *)(&sink), 1);
5637b8e80941Smrggc->pc += cmdlen;
5638b8e80941Smrgif (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); }
5639848b8605Smrg}
5640848b8605Smrg
5641848b8605Smrg#define X_GLrop_Minmax 4111
5642b8e80941Smrgvoid __indirect_glMinmax(GLenum target, GLenum internalformat, GLboolean sink)
5643b8e80941Smrg{
5644b8e80941Smrg    struct glx_context * const gc = __glXGetCurrentContext();
5645b8e80941Smrg    const GLuint cmdlen = 16;
5646b8e80941Smrgemit_header(gc->pc, X_GLrop_Minmax, cmdlen);
5647b8e80941Smrg(void) memcpy((void *)(gc->pc + 4), (void *)(&target), 4);
5648b8e80941Smrg(void) memcpy((void *)(gc->pc + 8), (void *)(&internalformat), 4);
5649b8e80941Smrg(void) memcpy((void *)(gc->pc + 12), (void *)(&sink), 1);
5650b8e80941Smrggc->pc += cmdlen;
5651b8e80941Smrgif (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); }
5652848b8605Smrg}
5653848b8605Smrg
5654848b8605Smrg#define X_GLrop_ResetHistogram 4112
5655b8e80941Smrgvoid __indirect_glResetHistogram(GLenum target)
5656848b8605Smrg{
5657b8e80941Smrg    struct glx_context * const gc = __glXGetCurrentContext();
5658b8e80941Smrg    const GLuint cmdlen = 8;
5659b8e80941Smrgemit_header(gc->pc, X_GLrop_ResetHistogram, cmdlen);
5660b8e80941Smrg(void) memcpy((void *)(gc->pc + 4), (void *)(&target), 4);
5661b8e80941Smrggc->pc += cmdlen;
5662b8e80941Smrgif (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); }
5663848b8605Smrg}
5664848b8605Smrg
5665848b8605Smrg#define X_GLrop_ResetMinmax 4113
5666b8e80941Smrgvoid __indirect_glResetMinmax(GLenum target)
5667848b8605Smrg{
5668b8e80941Smrg    struct glx_context * const gc = __glXGetCurrentContext();
5669b8e80941Smrg    const GLuint cmdlen = 8;
5670b8e80941Smrgemit_header(gc->pc, X_GLrop_ResetMinmax, cmdlen);
5671b8e80941Smrg(void) memcpy((void *)(gc->pc + 4), (void *)(&target), 4);
5672b8e80941Smrggc->pc += cmdlen;
5673b8e80941Smrgif (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); }
5674848b8605Smrg}
5675848b8605Smrg
5676848b8605Smrgstatic void
5677b8e80941Smrg__glx_TexImage_3D4D( unsigned opcode, unsigned dim, GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLsizei depth, GLsizei extent, GLint border, GLenum format, GLenum type, const GLvoid * pixels )
5678848b8605Smrg{
5679b8e80941Smrg    struct glx_context * const gc = __glXGetCurrentContext();
5680b8e80941Smrg    const GLuint compsize = (pixels != NULL) ? __glImageSize(width, height, depth, format, type, target) : 0;
5681b8e80941Smrg    const GLuint cmdlen = 84 + safe_pad(compsize);
5682b8e80941Smrg    if (0 + safe_pad(compsize) < 0) {
5683b8e80941Smrg        __glXSetError(gc, GL_INVALID_VALUE);
5684b8e80941Smrg        return;
5685b8e80941Smrg    }
5686848b8605Smrg    if (__builtin_expect(gc->currentDpy != NULL, 1)) {
5687b8e80941Smrgif (cmdlen <= gc->maxSmallRenderCommandSize) {
5688b8e80941Smrg    if ( (gc->pc + cmdlen) > gc->bufEnd ) {
5689b8e80941Smrg        (void) __glXFlushRenderBuffer(gc, gc->pc);
5690b8e80941Smrg    }
5691b8e80941Smrgemit_header(gc->pc, opcode, cmdlen);
5692b8e80941Smrg(void) memcpy((void *)(gc->pc + 40), (void *)(&target), 4);
5693b8e80941Smrg(void) memcpy((void *)(gc->pc + 44), (void *)(&level), 4);
5694b8e80941Smrg(void) memcpy((void *)(gc->pc + 48), (void *)(&internalformat), 4);
5695b8e80941Smrg(void) memcpy((void *)(gc->pc + 52), (void *)(&width), 4);
5696b8e80941Smrg(void) memcpy((void *)(gc->pc + 56), (void *)(&height), 4);
5697b8e80941Smrg(void) memcpy((void *)(gc->pc + 60), (void *)(&depth), 4);
5698b8e80941Smrg(void) memcpy((void *)(gc->pc + 64), (void *)(&extent), 4);
5699b8e80941Smrg(void) memcpy((void *)(gc->pc + 68), (void *)(&border), 4);
5700b8e80941Smrg(void) memcpy((void *)(gc->pc + 72), (void *)(&format), 4);
5701b8e80941Smrg(void) memcpy((void *)(gc->pc + 76), (void *)(&type), 4);
5702b8e80941Smrg(void) memcpy((void *)(gc->pc + 80), (void *)((pixels == NULL) ? one : zero), 4);
5703b8e80941Smrgif (compsize > 0) {
5704b8e80941Smrg    gc->fillImage(gc, dim, width, height, depth, format, type, pixels, gc->pc + 84, gc->pc + 4);
5705b8e80941Smrg} else {
5706b8e80941Smrg    (void) memcpy( gc->pc + 4, default_pixel_store_4D, default_pixel_store_4D_size );
5707b8e80941Smrg}
5708b8e80941Smrggc->pc += cmdlen;
5709b8e80941Smrgif (gc->pc > gc->limit) { (void) __glXFlushRenderBuffer(gc, gc->pc); }
5710b8e80941Smrg}
5711b8e80941Smrgelse {
5712b8e80941Smrgconst GLint op = opcode;
5713b8e80941Smrgconst GLuint cmdlenLarge = cmdlen + 4;
5714b8e80941SmrgGLubyte * const pc = __glXFlushRenderBuffer(gc, gc->pc);
5715b8e80941Smrg(void) memcpy((void *)(pc + 0), (void *)(&cmdlenLarge), 4);
5716b8e80941Smrg(void) memcpy((void *)(pc + 4), (void *)(&op), 4);
5717b8e80941Smrg(void) memcpy((void *)(pc + 44), (void *)(&target), 4);
5718b8e80941Smrg(void) memcpy((void *)(pc + 48), (void *)(&level), 4);
5719b8e80941Smrg(void) memcpy((void *)(pc + 52), (void *)(&internalformat), 4);
5720b8e80941Smrg(void) memcpy((void *)(pc + 56), (void *)(&width), 4);
5721b8e80941Smrg(void) memcpy((void *)(pc + 60), (void *)(&height), 4);
5722b8e80941Smrg(void) memcpy((void *)(pc + 64), (void *)(&depth), 4);
5723b8e80941Smrg(void) memcpy((void *)(pc + 68), (void *)(&extent), 4);
5724b8e80941Smrg(void) memcpy((void *)(pc + 72), (void *)(&border), 4);
5725b8e80941Smrg(void) memcpy((void *)(pc + 76), (void *)(&format), 4);
5726b8e80941Smrg(void) memcpy((void *)(pc + 80), (void *)(&type), 4);
5727b8e80941Smrg(void) memcpy((void *)(pc + 84), zero, 4);
5728b8e80941Smrg__glXSendLargeImage(gc, compsize, dim, width, height, depth, format, type, pixels, pc + 88, pc + 8);
5729b8e80941Smrg}
5730848b8605Smrg    }
5731848b8605Smrg}
5732848b8605Smrg
5733848b8605Smrg#define X_GLrop_TexImage3D 4114
5734b8e80941Smrgvoid __indirect_glTexImage3D(GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLenum format, GLenum type, const GLvoid * pixels)
5735848b8605Smrg{
5736b8e80941Smrg    __glx_TexImage_3D4D(X_GLrop_TexImage3D, 3, target, level, internalformat, width, height, depth, 1, border, format, type, pixels );
5737848b8605Smrg}
5738848b8605Smrg
5739848b8605Smrgstatic void
5740b8e80941Smrg__glx_TexSubImage_3D4D( unsigned opcode, unsigned dim, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLint woffset, GLsizei width, GLsizei height, GLsizei depth, GLsizei extent, GLenum format, GLenum type, const GLvoid * pixels )
5741848b8605Smrg{
5742b8e80941Smrg    struct glx_context * const gc = __glXGetCurrentContext();
5743b8e80941Smrg    const GLuint compsize = (pixels != NULL) ? __glImageSize(width, height, depth, format, type, target) : 0;
5744b8e80941Smrg    const GLuint cmdlen = 92 + safe_pad(compsize);
5745b8e80941Smrg    if (0 + safe_pad(compsize) < 0) {
5746b8e80941Smrg        __glXSetError(gc, GL_INVALID_VALUE);
5747b8e80941Smrg        return;
5748b8e80941Smrg    }
5749848b8605Smrg    if (__builtin_expect(gc->currentDpy != NULL, 1)) {
5750b8e80941Smrgif (cmdlen <= gc->maxSmallRenderCommandSize) {
5751b8e80941Smrg    if ( (gc->pc + cmdlen) > gc->bufEnd ) {
5752b8e80941Smrg        (void) __glXFlushRenderBuffer(gc, gc->pc);
5753b8e80941Smrg    }
5754b8e80941Smrgemit_header(gc->pc, opcode, cmdlen);
5755b8e80941Smrg(void) memcpy((void *)(gc->pc + 40), (void *)(&target), 4);
5756b8e80941Smrg(void) memcpy((void *)(gc->pc + 44), (void *)(&level), 4);
5757b8e80941Smrg(void) memcpy((void *)(gc->pc + 48), (void *)(&xoffset), 4);
5758b8e80941Smrg(void) memcpy((void *)(gc->pc + 52), (void *)(&yoffset), 4);
5759b8e80941Smrg(void) memcpy((void *)(gc->pc + 56), (void *)(&zoffset), 4);
5760b8e80941Smrg(void) memcpy((void *)(gc->pc + 60), (void *)(&woffset), 4);
5761b8e80941Smrg(void) memcpy((void *)(gc->pc + 64), (void *)(&width), 4);
5762b8e80941Smrg(void) memcpy((void *)(gc->pc + 68), (void *)(&height), 4);
5763b8e80941Smrg(void) memcpy((void *)(gc->pc + 72), (void *)(&depth), 4);
5764b8e80941Smrg(void) memcpy((void *)(gc->pc + 76), (void *)(&extent), 4);
5765b8e80941Smrg(void) memcpy((void *)(gc->pc + 80), (void *)(&format), 4);
5766b8e80941Smrg(void) memcpy((void *)(gc->pc + 84), (void *)(&type), 4);
5767b8e80941Smrg(void) memset((void *)(gc->pc + 88), 0, 4);
5768b8e80941Smrgif (compsize > 0) {
5769b8e80941Smrg    gc->fillImage(gc, dim, width, height, depth, format, type, pixels, gc->pc + 92, gc->pc + 4);
5770b8e80941Smrg} else {
5771b8e80941Smrg    (void) memcpy( gc->pc + 4, default_pixel_store_4D, default_pixel_store_4D_size );
5772b8e80941Smrg}
5773b8e80941Smrggc->pc += cmdlen;
5774b8e80941Smrgif (gc->pc > gc->limit) { (void) __glXFlushRenderBuffer(gc, gc->pc); }
5775b8e80941Smrg}
5776b8e80941Smrgelse {
5777b8e80941Smrgconst GLint op = opcode;
5778b8e80941Smrgconst GLuint cmdlenLarge = cmdlen + 4;
5779b8e80941SmrgGLubyte * const pc = __glXFlushRenderBuffer(gc, gc->pc);
5780b8e80941Smrg(void) memcpy((void *)(pc + 0), (void *)(&cmdlenLarge), 4);
5781b8e80941Smrg(void) memcpy((void *)(pc + 4), (void *)(&op), 4);
5782b8e80941Smrg(void) memcpy((void *)(pc + 44), (void *)(&target), 4);
5783b8e80941Smrg(void) memcpy((void *)(pc + 48), (void *)(&level), 4);
5784b8e80941Smrg(void) memcpy((void *)(pc + 52), (void *)(&xoffset), 4);
5785b8e80941Smrg(void) memcpy((void *)(pc + 56), (void *)(&yoffset), 4);
5786b8e80941Smrg(void) memcpy((void *)(pc + 60), (void *)(&zoffset), 4);
5787b8e80941Smrg(void) memcpy((void *)(pc + 64), (void *)(&woffset), 4);
5788b8e80941Smrg(void) memcpy((void *)(pc + 68), (void *)(&width), 4);
5789b8e80941Smrg(void) memcpy((void *)(pc + 72), (void *)(&height), 4);
5790b8e80941Smrg(void) memcpy((void *)(pc + 76), (void *)(&depth), 4);
5791b8e80941Smrg(void) memcpy((void *)(pc + 80), (void *)(&extent), 4);
5792b8e80941Smrg(void) memcpy((void *)(pc + 84), (void *)(&format), 4);
5793b8e80941Smrg(void) memcpy((void *)(pc + 88), (void *)(&type), 4);
5794b8e80941Smrg(void) memset((void *)(pc + 92), 0, 4);
5795b8e80941Smrg__glXSendLargeImage(gc, compsize, dim, width, height, depth, format, type, pixels, pc + 96, pc + 8);
5796b8e80941Smrg}
5797848b8605Smrg    }
5798848b8605Smrg}
5799848b8605Smrg
5800848b8605Smrg#define X_GLrop_TexSubImage3D 4115
5801b8e80941Smrgvoid __indirect_glTexSubImage3D(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, const GLvoid * pixels)
5802848b8605Smrg{
5803b8e80941Smrg    __glx_TexSubImage_3D4D(X_GLrop_TexSubImage3D, 3, target, level, xoffset, yoffset, zoffset, 1, width, height, depth, 1, format, type, pixels );
5804848b8605Smrg}
5805848b8605Smrg
5806848b8605Smrg#define X_GLrop_CopyTexSubImage3D 4123
5807b8e80941Smrgvoid __indirect_glCopyTexSubImage3D(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLint x, GLint y, GLsizei width, GLsizei height)
5808b8e80941Smrg{
5809b8e80941Smrg    struct glx_context * const gc = __glXGetCurrentContext();
5810b8e80941Smrg    const GLuint cmdlen = 40;
5811b8e80941Smrgemit_header(gc->pc, X_GLrop_CopyTexSubImage3D, cmdlen);
5812b8e80941Smrg(void) memcpy((void *)(gc->pc + 4), (void *)(&target), 4);
5813b8e80941Smrg(void) memcpy((void *)(gc->pc + 8), (void *)(&level), 4);
5814b8e80941Smrg(void) memcpy((void *)(gc->pc + 12), (void *)(&xoffset), 4);
5815b8e80941Smrg(void) memcpy((void *)(gc->pc + 16), (void *)(&yoffset), 4);
5816b8e80941Smrg(void) memcpy((void *)(gc->pc + 20), (void *)(&zoffset), 4);
5817b8e80941Smrg(void) memcpy((void *)(gc->pc + 24), (void *)(&x), 4);
5818b8e80941Smrg(void) memcpy((void *)(gc->pc + 28), (void *)(&y), 4);
5819b8e80941Smrg(void) memcpy((void *)(gc->pc + 32), (void *)(&width), 4);
5820b8e80941Smrg(void) memcpy((void *)(gc->pc + 36), (void *)(&height), 4);
5821b8e80941Smrggc->pc += cmdlen;
5822b8e80941Smrgif (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); }
5823848b8605Smrg}
5824848b8605Smrg
5825848b8605Smrg#define X_GLrop_ActiveTexture 197
5826b8e80941Smrgvoid __indirect_glActiveTexture(GLenum texture)
5827848b8605Smrg{
5828b8e80941Smrg    struct glx_context * const gc = __glXGetCurrentContext();
5829b8e80941Smrg    const GLuint cmdlen = 8;
5830b8e80941Smrgemit_header(gc->pc, X_GLrop_ActiveTexture, cmdlen);
5831b8e80941Smrg(void) memcpy((void *)(gc->pc + 4), (void *)(&texture), 4);
5832b8e80941Smrggc->pc += cmdlen;
5833b8e80941Smrgif (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); }
5834848b8605Smrg}
5835848b8605Smrg
5836848b8605Smrg#define X_GLrop_MultiTexCoord1dv 198
5837b8e80941Smrgvoid __indirect_glMultiTexCoord1d(GLenum target, GLdouble s)
5838b8e80941Smrg{
5839b8e80941Smrg    struct glx_context * const gc = __glXGetCurrentContext();
5840b8e80941Smrg    const GLuint cmdlen = 16;
5841b8e80941Smrgemit_header(gc->pc, X_GLrop_MultiTexCoord1dv, cmdlen);
5842b8e80941Smrg(void) memcpy((void *)(gc->pc + 4), (void *)(&s), 8);
5843b8e80941Smrg(void) memcpy((void *)(gc->pc + 12), (void *)(&target), 4);
5844b8e80941Smrggc->pc += cmdlen;
5845b8e80941Smrgif (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); }
5846848b8605Smrg}
5847848b8605Smrg
5848848b8605Smrg#define X_GLrop_MultiTexCoord1dv 198
5849b8e80941Smrgvoid __indirect_glMultiTexCoord1dv(GLenum target, const GLdouble * v)
5850b8e80941Smrg{
5851b8e80941Smrg    struct glx_context * const gc = __glXGetCurrentContext();
5852b8e80941Smrg    const GLuint cmdlen = 16;
5853b8e80941Smrgemit_header(gc->pc, X_GLrop_MultiTexCoord1dv, cmdlen);
5854b8e80941Smrg(void) memcpy((void *)(gc->pc + 4), (void *)(v), 8);
5855b8e80941Smrg(void) memcpy((void *)(gc->pc + 12), (void *)(&target), 4);
5856b8e80941Smrggc->pc += cmdlen;
5857b8e80941Smrgif (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); }
5858848b8605Smrg}
5859848b8605Smrg
5860848b8605Smrg#define X_GLrop_MultiTexCoord1fvARB 199
5861b8e80941Smrgvoid __indirect_glMultiTexCoord1fARB(GLenum target, GLfloat s)
5862b8e80941Smrg{
5863b8e80941Smrg    struct glx_context * const gc = __glXGetCurrentContext();
5864b8e80941Smrg    const GLuint cmdlen = 12;
5865b8e80941Smrgemit_header(gc->pc, X_GLrop_MultiTexCoord1fvARB, cmdlen);
5866b8e80941Smrg(void) memcpy((void *)(gc->pc + 4), (void *)(&target), 4);
5867b8e80941Smrg(void) memcpy((void *)(gc->pc + 8), (void *)(&s), 4);
5868b8e80941Smrggc->pc += cmdlen;
5869b8e80941Smrgif (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); }
5870848b8605Smrg}
5871848b8605Smrg
5872848b8605Smrg#define X_GLrop_MultiTexCoord1fvARB 199
5873b8e80941Smrgvoid __indirect_glMultiTexCoord1fvARB(GLenum target, const GLfloat * v)
5874b8e80941Smrg{
5875b8e80941Smrg    struct glx_context * const gc = __glXGetCurrentContext();
5876b8e80941Smrg    const GLuint cmdlen = 12;
5877b8e80941Smrgemit_header(gc->pc, X_GLrop_MultiTexCoord1fvARB, cmdlen);
5878b8e80941Smrg(void) memcpy((void *)(gc->pc + 4), (void *)(&target), 4);
5879b8e80941Smrg(void) memcpy((void *)(gc->pc + 8), (void *)(v), 4);
5880b8e80941Smrggc->pc += cmdlen;
5881b8e80941Smrgif (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); }
5882848b8605Smrg}
5883848b8605Smrg
5884848b8605Smrg#define X_GLrop_MultiTexCoord1iv 200
5885b8e80941Smrgvoid __indirect_glMultiTexCoord1i(GLenum target, GLint s)
5886b8e80941Smrg{
5887b8e80941Smrg    struct glx_context * const gc = __glXGetCurrentContext();
5888b8e80941Smrg    const GLuint cmdlen = 12;
5889b8e80941Smrgemit_header(gc->pc, X_GLrop_MultiTexCoord1iv, cmdlen);
5890b8e80941Smrg(void) memcpy((void *)(gc->pc + 4), (void *)(&target), 4);
5891b8e80941Smrg(void) memcpy((void *)(gc->pc + 8), (void *)(&s), 4);
5892b8e80941Smrggc->pc += cmdlen;
5893b8e80941Smrgif (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); }
5894848b8605Smrg}
5895848b8605Smrg
5896848b8605Smrg#define X_GLrop_MultiTexCoord1iv 200
5897b8e80941Smrgvoid __indirect_glMultiTexCoord1iv(GLenum target, const GLint * v)
5898b8e80941Smrg{
5899b8e80941Smrg    struct glx_context * const gc = __glXGetCurrentContext();
5900b8e80941Smrg    const GLuint cmdlen = 12;
5901b8e80941Smrgemit_header(gc->pc, X_GLrop_MultiTexCoord1iv, cmdlen);
5902b8e80941Smrg(void) memcpy((void *)(gc->pc + 4), (void *)(&target), 4);
5903b8e80941Smrg(void) memcpy((void *)(gc->pc + 8), (void *)(v), 4);
5904b8e80941Smrggc->pc += cmdlen;
5905b8e80941Smrgif (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); }
5906848b8605Smrg}
5907848b8605Smrg
5908848b8605Smrg#define X_GLrop_MultiTexCoord1sv 201
5909b8e80941Smrgvoid __indirect_glMultiTexCoord1s(GLenum target, GLshort s)
5910b8e80941Smrg{
5911b8e80941Smrg    struct glx_context * const gc = __glXGetCurrentContext();
5912b8e80941Smrg    const GLuint cmdlen = 12;
5913b8e80941Smrgemit_header(gc->pc, X_GLrop_MultiTexCoord1sv, cmdlen);
5914b8e80941Smrg(void) memcpy((void *)(gc->pc + 4), (void *)(&target), 4);
5915b8e80941Smrg(void) memcpy((void *)(gc->pc + 8), (void *)(&s), 2);
5916b8e80941Smrggc->pc += cmdlen;
5917b8e80941Smrgif (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); }
5918848b8605Smrg}
5919848b8605Smrg
5920848b8605Smrg#define X_GLrop_MultiTexCoord1sv 201
5921b8e80941Smrgvoid __indirect_glMultiTexCoord1sv(GLenum target, const GLshort * v)
5922b8e80941Smrg{
5923b8e80941Smrg    struct glx_context * const gc = __glXGetCurrentContext();
5924b8e80941Smrg    const GLuint cmdlen = 12;
5925b8e80941Smrgemit_header(gc->pc, X_GLrop_MultiTexCoord1sv, cmdlen);
5926b8e80941Smrg(void) memcpy((void *)(gc->pc + 4), (void *)(&target), 4);
5927b8e80941Smrg(void) memcpy((void *)(gc->pc + 8), (void *)(v), 2);
5928b8e80941Smrggc->pc += cmdlen;
5929b8e80941Smrgif (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); }
5930848b8605Smrg}
5931848b8605Smrg
5932848b8605Smrg#define X_GLrop_MultiTexCoord2dv 202
5933b8e80941Smrgvoid __indirect_glMultiTexCoord2d(GLenum target, GLdouble s, GLdouble t)
5934b8e80941Smrg{
5935b8e80941Smrg    struct glx_context * const gc = __glXGetCurrentContext();
5936b8e80941Smrg    const GLuint cmdlen = 24;
5937b8e80941Smrgemit_header(gc->pc, X_GLrop_MultiTexCoord2dv, cmdlen);
5938b8e80941Smrg(void) memcpy((void *)(gc->pc + 4), (void *)(&s), 8);
5939b8e80941Smrg(void) memcpy((void *)(gc->pc + 12), (void *)(&t), 8);
5940b8e80941Smrg(void) memcpy((void *)(gc->pc + 20), (void *)(&target), 4);
5941b8e80941Smrggc->pc += cmdlen;
5942b8e80941Smrgif (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); }
5943848b8605Smrg}
5944848b8605Smrg
5945848b8605Smrg#define X_GLrop_MultiTexCoord2dv 202
5946b8e80941Smrgvoid __indirect_glMultiTexCoord2dv(GLenum target, const GLdouble * v)
5947b8e80941Smrg{
5948b8e80941Smrg    struct glx_context * const gc = __glXGetCurrentContext();
5949b8e80941Smrg    const GLuint cmdlen = 24;
5950b8e80941Smrgemit_header(gc->pc, X_GLrop_MultiTexCoord2dv, cmdlen);
5951b8e80941Smrg(void) memcpy((void *)(gc->pc + 4), (void *)(v), 16);
5952b8e80941Smrg(void) memcpy((void *)(gc->pc + 20), (void *)(&target), 4);
5953b8e80941Smrggc->pc += cmdlen;
5954b8e80941Smrgif (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); }
5955848b8605Smrg}
5956848b8605Smrg
5957848b8605Smrg#define X_GLrop_MultiTexCoord2fvARB 203
5958b8e80941Smrgvoid __indirect_glMultiTexCoord2fARB(GLenum target, GLfloat s, GLfloat t)
5959b8e80941Smrg{
5960b8e80941Smrg    struct glx_context * const gc = __glXGetCurrentContext();
5961b8e80941Smrg    const GLuint cmdlen = 16;
5962b8e80941Smrgemit_header(gc->pc, X_GLrop_MultiTexCoord2fvARB, cmdlen);
5963b8e80941Smrg(void) memcpy((void *)(gc->pc + 4), (void *)(&target), 4);
5964b8e80941Smrg(void) memcpy((void *)(gc->pc + 8), (void *)(&s), 4);
5965b8e80941Smrg(void) memcpy((void *)(gc->pc + 12), (void *)(&t), 4);
5966b8e80941Smrggc->pc += cmdlen;
5967b8e80941Smrgif (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); }
5968848b8605Smrg}
5969848b8605Smrg
5970848b8605Smrg#define X_GLrop_MultiTexCoord2fvARB 203
5971b8e80941Smrgvoid __indirect_glMultiTexCoord2fvARB(GLenum target, const GLfloat * v)
5972b8e80941Smrg{
5973b8e80941Smrg    struct glx_context * const gc = __glXGetCurrentContext();
5974b8e80941Smrg    const GLuint cmdlen = 16;
5975b8e80941Smrgemit_header(gc->pc, X_GLrop_MultiTexCoord2fvARB, cmdlen);
5976b8e80941Smrg(void) memcpy((void *)(gc->pc + 4), (void *)(&target), 4);
5977b8e80941Smrg(void) memcpy((void *)(gc->pc + 8), (void *)(v), 8);
5978b8e80941Smrggc->pc += cmdlen;
5979b8e80941Smrgif (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); }
5980848b8605Smrg}
5981848b8605Smrg
5982848b8605Smrg#define X_GLrop_MultiTexCoord2iv 204
5983b8e80941Smrgvoid __indirect_glMultiTexCoord2i(GLenum target, GLint s, GLint t)
5984b8e80941Smrg{
5985b8e80941Smrg    struct glx_context * const gc = __glXGetCurrentContext();
5986b8e80941Smrg    const GLuint cmdlen = 16;
5987b8e80941Smrgemit_header(gc->pc, X_GLrop_MultiTexCoord2iv, cmdlen);
5988b8e80941Smrg(void) memcpy((void *)(gc->pc + 4), (void *)(&target), 4);
5989b8e80941Smrg(void) memcpy((void *)(gc->pc + 8), (void *)(&s), 4);
5990b8e80941Smrg(void) memcpy((void *)(gc->pc + 12), (void *)(&t), 4);
5991b8e80941Smrggc->pc += cmdlen;
5992b8e80941Smrgif (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); }
5993848b8605Smrg}
5994848b8605Smrg
5995848b8605Smrg#define X_GLrop_MultiTexCoord2iv 204
5996b8e80941Smrgvoid __indirect_glMultiTexCoord2iv(GLenum target, const GLint * v)
5997b8e80941Smrg{
5998b8e80941Smrg    struct glx_context * const gc = __glXGetCurrentContext();
5999b8e80941Smrg    const GLuint cmdlen = 16;
6000b8e80941Smrgemit_header(gc->pc, X_GLrop_MultiTexCoord2iv, cmdlen);
6001b8e80941Smrg(void) memcpy((void *)(gc->pc + 4), (void *)(&target), 4);
6002b8e80941Smrg(void) memcpy((void *)(gc->pc + 8), (void *)(v), 8);
6003b8e80941Smrggc->pc += cmdlen;
6004b8e80941Smrgif (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); }
6005848b8605Smrg}
6006848b8605Smrg
6007848b8605Smrg#define X_GLrop_MultiTexCoord2sv 205
6008b8e80941Smrgvoid __indirect_glMultiTexCoord2s(GLenum target, GLshort s, GLshort t)
6009b8e80941Smrg{
6010b8e80941Smrg    struct glx_context * const gc = __glXGetCurrentContext();
6011b8e80941Smrg    const GLuint cmdlen = 12;
6012b8e80941Smrgemit_header(gc->pc, X_GLrop_MultiTexCoord2sv, cmdlen);
6013b8e80941Smrg(void) memcpy((void *)(gc->pc + 4), (void *)(&target), 4);
6014b8e80941Smrg(void) memcpy((void *)(gc->pc + 8), (void *)(&s), 2);
6015b8e80941Smrg(void) memcpy((void *)(gc->pc + 10), (void *)(&t), 2);
6016b8e80941Smrggc->pc += cmdlen;
6017b8e80941Smrgif (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); }
6018848b8605Smrg}
6019848b8605Smrg
6020848b8605Smrg#define X_GLrop_MultiTexCoord2sv 205
6021b8e80941Smrgvoid __indirect_glMultiTexCoord2sv(GLenum target, const GLshort * v)
6022b8e80941Smrg{
6023b8e80941Smrg    struct glx_context * const gc = __glXGetCurrentContext();
6024b8e80941Smrg    const GLuint cmdlen = 12;
6025b8e80941Smrgemit_header(gc->pc, X_GLrop_MultiTexCoord2sv, cmdlen);
6026b8e80941Smrg(void) memcpy((void *)(gc->pc + 4), (void *)(&target), 4);
6027b8e80941Smrg(void) memcpy((void *)(gc->pc + 8), (void *)(v), 4);
6028b8e80941Smrggc->pc += cmdlen;
6029b8e80941Smrgif (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); }
6030848b8605Smrg}
6031848b8605Smrg
6032848b8605Smrg#define X_GLrop_MultiTexCoord3dv 206
6033b8e80941Smrgvoid __indirect_glMultiTexCoord3d(GLenum target, GLdouble s, GLdouble t, GLdouble r)
6034b8e80941Smrg{
6035b8e80941Smrg    struct glx_context * const gc = __glXGetCurrentContext();
6036b8e80941Smrg    const GLuint cmdlen = 32;
6037b8e80941Smrgemit_header(gc->pc, X_GLrop_MultiTexCoord3dv, cmdlen);
6038b8e80941Smrg(void) memcpy((void *)(gc->pc + 4), (void *)(&s), 8);
6039b8e80941Smrg(void) memcpy((void *)(gc->pc + 12), (void *)(&t), 8);
6040b8e80941Smrg(void) memcpy((void *)(gc->pc + 20), (void *)(&r), 8);
6041b8e80941Smrg(void) memcpy((void *)(gc->pc + 28), (void *)(&target), 4);
6042b8e80941Smrggc->pc += cmdlen;
6043b8e80941Smrgif (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); }
6044848b8605Smrg}
6045848b8605Smrg
6046848b8605Smrg#define X_GLrop_MultiTexCoord3dv 206
6047b8e80941Smrgvoid __indirect_glMultiTexCoord3dv(GLenum target, const GLdouble * v)
6048b8e80941Smrg{
6049b8e80941Smrg    struct glx_context * const gc = __glXGetCurrentContext();
6050b8e80941Smrg    const GLuint cmdlen = 32;
6051b8e80941Smrgemit_header(gc->pc, X_GLrop_MultiTexCoord3dv, cmdlen);
6052b8e80941Smrg(void) memcpy((void *)(gc->pc + 4), (void *)(v), 24);
6053b8e80941Smrg(void) memcpy((void *)(gc->pc + 28), (void *)(&target), 4);
6054b8e80941Smrggc->pc += cmdlen;
6055b8e80941Smrgif (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); }
6056848b8605Smrg}
6057848b8605Smrg
6058848b8605Smrg#define X_GLrop_MultiTexCoord3fvARB 207
6059b8e80941Smrgvoid __indirect_glMultiTexCoord3fARB(GLenum target, GLfloat s, GLfloat t, GLfloat r)
6060b8e80941Smrg{
6061b8e80941Smrg    struct glx_context * const gc = __glXGetCurrentContext();
6062b8e80941Smrg    const GLuint cmdlen = 20;
6063b8e80941Smrgemit_header(gc->pc, X_GLrop_MultiTexCoord3fvARB, cmdlen);
6064b8e80941Smrg(void) memcpy((void *)(gc->pc + 4), (void *)(&target), 4);
6065b8e80941Smrg(void) memcpy((void *)(gc->pc + 8), (void *)(&s), 4);
6066b8e80941Smrg(void) memcpy((void *)(gc->pc + 12), (void *)(&t), 4);
6067b8e80941Smrg(void) memcpy((void *)(gc->pc + 16), (void *)(&r), 4);
6068b8e80941Smrggc->pc += cmdlen;
6069b8e80941Smrgif (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); }
6070848b8605Smrg}
6071848b8605Smrg
6072848b8605Smrg#define X_GLrop_MultiTexCoord3fvARB 207
6073b8e80941Smrgvoid __indirect_glMultiTexCoord3fvARB(GLenum target, const GLfloat * v)
6074b8e80941Smrg{
6075b8e80941Smrg    struct glx_context * const gc = __glXGetCurrentContext();
6076b8e80941Smrg    const GLuint cmdlen = 20;
6077b8e80941Smrgemit_header(gc->pc, X_GLrop_MultiTexCoord3fvARB, cmdlen);
6078b8e80941Smrg(void) memcpy((void *)(gc->pc + 4), (void *)(&target), 4);
6079b8e80941Smrg(void) memcpy((void *)(gc->pc + 8), (void *)(v), 12);
6080b8e80941Smrggc->pc += cmdlen;
6081b8e80941Smrgif (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); }
6082848b8605Smrg}
6083848b8605Smrg
6084848b8605Smrg#define X_GLrop_MultiTexCoord3iv 208
6085b8e80941Smrgvoid __indirect_glMultiTexCoord3i(GLenum target, GLint s, GLint t, GLint r)
6086b8e80941Smrg{
6087b8e80941Smrg    struct glx_context * const gc = __glXGetCurrentContext();
6088b8e80941Smrg    const GLuint cmdlen = 20;
6089b8e80941Smrgemit_header(gc->pc, X_GLrop_MultiTexCoord3iv, cmdlen);
6090b8e80941Smrg(void) memcpy((void *)(gc->pc + 4), (void *)(&target), 4);
6091b8e80941Smrg(void) memcpy((void *)(gc->pc + 8), (void *)(&s), 4);
6092b8e80941Smrg(void) memcpy((void *)(gc->pc + 12), (void *)(&t), 4);
6093b8e80941Smrg(void) memcpy((void *)(gc->pc + 16), (void *)(&r), 4);
6094b8e80941Smrggc->pc += cmdlen;
6095b8e80941Smrgif (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); }
6096848b8605Smrg}
6097848b8605Smrg
6098848b8605Smrg#define X_GLrop_MultiTexCoord3iv 208
6099b8e80941Smrgvoid __indirect_glMultiTexCoord3iv(GLenum target, const GLint * v)
6100b8e80941Smrg{
6101b8e80941Smrg    struct glx_context * const gc = __glXGetCurrentContext();
6102b8e80941Smrg    const GLuint cmdlen = 20;
6103b8e80941Smrgemit_header(gc->pc, X_GLrop_MultiTexCoord3iv, cmdlen);
6104b8e80941Smrg(void) memcpy((void *)(gc->pc + 4), (void *)(&target), 4);
6105b8e80941Smrg(void) memcpy((void *)(gc->pc + 8), (void *)(v), 12);
6106b8e80941Smrggc->pc += cmdlen;
6107b8e80941Smrgif (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); }
6108848b8605Smrg}
6109848b8605Smrg
6110848b8605Smrg#define X_GLrop_MultiTexCoord3sv 209
6111b8e80941Smrgvoid __indirect_glMultiTexCoord3s(GLenum target, GLshort s, GLshort t, GLshort r)
6112b8e80941Smrg{
6113b8e80941Smrg    struct glx_context * const gc = __glXGetCurrentContext();
6114b8e80941Smrg    const GLuint cmdlen = 16;
6115b8e80941Smrgemit_header(gc->pc, X_GLrop_MultiTexCoord3sv, cmdlen);
6116b8e80941Smrg(void) memcpy((void *)(gc->pc + 4), (void *)(&target), 4);
6117b8e80941Smrg(void) memcpy((void *)(gc->pc + 8), (void *)(&s), 2);
6118b8e80941Smrg(void) memcpy((void *)(gc->pc + 10), (void *)(&t), 2);
6119b8e80941Smrg(void) memcpy((void *)(gc->pc + 12), (void *)(&r), 2);
6120b8e80941Smrggc->pc += cmdlen;
6121b8e80941Smrgif (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); }
6122848b8605Smrg}
6123848b8605Smrg
6124848b8605Smrg#define X_GLrop_MultiTexCoord3sv 209
6125b8e80941Smrgvoid __indirect_glMultiTexCoord3sv(GLenum target, const GLshort * v)
6126b8e80941Smrg{
6127b8e80941Smrg    struct glx_context * const gc = __glXGetCurrentContext();
6128b8e80941Smrg    const GLuint cmdlen = 16;
6129b8e80941Smrgemit_header(gc->pc, X_GLrop_MultiTexCoord3sv, cmdlen);
6130b8e80941Smrg(void) memcpy((void *)(gc->pc + 4), (void *)(&target), 4);
6131b8e80941Smrg(void) memcpy((void *)(gc->pc + 8), (void *)(v), 6);
6132b8e80941Smrggc->pc += cmdlen;
6133b8e80941Smrgif (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); }
6134848b8605Smrg}
6135848b8605Smrg
6136848b8605Smrg#define X_GLrop_MultiTexCoord4dv 210
6137b8e80941Smrgvoid __indirect_glMultiTexCoord4d(GLenum target, GLdouble s, GLdouble t, GLdouble r, GLdouble q)
6138b8e80941Smrg{
6139b8e80941Smrg    struct glx_context * const gc = __glXGetCurrentContext();
6140b8e80941Smrg    const GLuint cmdlen = 40;
6141b8e80941Smrgemit_header(gc->pc, X_GLrop_MultiTexCoord4dv, cmdlen);
6142b8e80941Smrg(void) memcpy((void *)(gc->pc + 4), (void *)(&s), 8);
6143b8e80941Smrg(void) memcpy((void *)(gc->pc + 12), (void *)(&t), 8);
6144b8e80941Smrg(void) memcpy((void *)(gc->pc + 20), (void *)(&r), 8);
6145b8e80941Smrg(void) memcpy((void *)(gc->pc + 28), (void *)(&q), 8);
6146b8e80941Smrg(void) memcpy((void *)(gc->pc + 36), (void *)(&target), 4);
6147b8e80941Smrggc->pc += cmdlen;
6148b8e80941Smrgif (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); }
6149848b8605Smrg}
6150848b8605Smrg
6151848b8605Smrg#define X_GLrop_MultiTexCoord4dv 210
6152b8e80941Smrgvoid __indirect_glMultiTexCoord4dv(GLenum target, const GLdouble * v)
6153b8e80941Smrg{
6154b8e80941Smrg    struct glx_context * const gc = __glXGetCurrentContext();
6155b8e80941Smrg    const GLuint cmdlen = 40;
6156b8e80941Smrgemit_header(gc->pc, X_GLrop_MultiTexCoord4dv, cmdlen);
6157b8e80941Smrg(void) memcpy((void *)(gc->pc + 4), (void *)(v), 32);
6158b8e80941Smrg(void) memcpy((void *)(gc->pc + 36), (void *)(&target), 4);
6159b8e80941Smrggc->pc += cmdlen;
6160b8e80941Smrgif (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); }
6161848b8605Smrg}
6162848b8605Smrg
6163848b8605Smrg#define X_GLrop_MultiTexCoord4fvARB 211
6164b8e80941Smrgvoid __indirect_glMultiTexCoord4fARB(GLenum target, GLfloat s, GLfloat t, GLfloat r, GLfloat q)
6165b8e80941Smrg{
6166b8e80941Smrg    struct glx_context * const gc = __glXGetCurrentContext();
6167b8e80941Smrg    const GLuint cmdlen = 24;
6168b8e80941Smrgemit_header(gc->pc, X_GLrop_MultiTexCoord4fvARB, cmdlen);
6169b8e80941Smrg(void) memcpy((void *)(gc->pc + 4), (void *)(&target), 4);
6170b8e80941Smrg(void) memcpy((void *)(gc->pc + 8), (void *)(&s), 4);
6171b8e80941Smrg(void) memcpy((void *)(gc->pc + 12), (void *)(&t), 4);
6172b8e80941Smrg(void) memcpy((void *)(gc->pc + 16), (void *)(&r), 4);
6173b8e80941Smrg(void) memcpy((void *)(gc->pc + 20), (void *)(&q), 4);
6174b8e80941Smrggc->pc += cmdlen;
6175b8e80941Smrgif (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); }
6176848b8605Smrg}
6177848b8605Smrg
6178848b8605Smrg#define X_GLrop_MultiTexCoord4fvARB 211
6179b8e80941Smrgvoid __indirect_glMultiTexCoord4fvARB(GLenum target, const GLfloat * v)
6180b8e80941Smrg{
6181b8e80941Smrg    struct glx_context * const gc = __glXGetCurrentContext();
6182b8e80941Smrg    const GLuint cmdlen = 24;
6183b8e80941Smrgemit_header(gc->pc, X_GLrop_MultiTexCoord4fvARB, cmdlen);
6184b8e80941Smrg(void) memcpy((void *)(gc->pc + 4), (void *)(&target), 4);
6185b8e80941Smrg(void) memcpy((void *)(gc->pc + 8), (void *)(v), 16);
6186b8e80941Smrggc->pc += cmdlen;
6187b8e80941Smrgif (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); }
6188848b8605Smrg}
6189848b8605Smrg
6190848b8605Smrg#define X_GLrop_MultiTexCoord4iv 212
6191b8e80941Smrgvoid __indirect_glMultiTexCoord4i(GLenum target, GLint s, GLint t, GLint r, GLint q)
6192b8e80941Smrg{
6193b8e80941Smrg    struct glx_context * const gc = __glXGetCurrentContext();
6194b8e80941Smrg    const GLuint cmdlen = 24;
6195b8e80941Smrgemit_header(gc->pc, X_GLrop_MultiTexCoord4iv, cmdlen);
6196b8e80941Smrg(void) memcpy((void *)(gc->pc + 4), (void *)(&target), 4);
6197b8e80941Smrg(void) memcpy((void *)(gc->pc + 8), (void *)(&s), 4);
6198b8e80941Smrg(void) memcpy((void *)(gc->pc + 12), (void *)(&t), 4);
6199b8e80941Smrg(void) memcpy((void *)(gc->pc + 16), (void *)(&r), 4);
6200b8e80941Smrg(void) memcpy((void *)(gc->pc + 20), (void *)(&q), 4);
6201b8e80941Smrggc->pc += cmdlen;
6202b8e80941Smrgif (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); }
6203848b8605Smrg}
6204848b8605Smrg
6205848b8605Smrg#define X_GLrop_MultiTexCoord4iv 212
6206b8e80941Smrgvoid __indirect_glMultiTexCoord4iv(GLenum target, const GLint * v)
6207b8e80941Smrg{
6208b8e80941Smrg    struct glx_context * const gc = __glXGetCurrentContext();
6209b8e80941Smrg    const GLuint cmdlen = 24;
6210b8e80941Smrgemit_header(gc->pc, X_GLrop_MultiTexCoord4iv, cmdlen);
6211b8e80941Smrg(void) memcpy((void *)(gc->pc + 4), (void *)(&target), 4);
6212b8e80941Smrg(void) memcpy((void *)(gc->pc + 8), (void *)(v), 16);
6213b8e80941Smrggc->pc += cmdlen;
6214b8e80941Smrgif (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); }
6215848b8605Smrg}
6216848b8605Smrg
6217848b8605Smrg#define X_GLrop_MultiTexCoord4sv 213
6218b8e80941Smrgvoid __indirect_glMultiTexCoord4s(GLenum target, GLshort s, GLshort t, GLshort r, GLshort q)
6219b8e80941Smrg{
6220b8e80941Smrg    struct glx_context * const gc = __glXGetCurrentContext();
6221b8e80941Smrg    const GLuint cmdlen = 16;
6222b8e80941Smrgemit_header(gc->pc, X_GLrop_MultiTexCoord4sv, cmdlen);
6223b8e80941Smrg(void) memcpy((void *)(gc->pc + 4), (void *)(&target), 4);
6224b8e80941Smrg(void) memcpy((void *)(gc->pc + 8), (void *)(&s), 2);
6225b8e80941Smrg(void) memcpy((void *)(gc->pc + 10), (void *)(&t), 2);
6226b8e80941Smrg(void) memcpy((void *)(gc->pc + 12), (void *)(&r), 2);
6227b8e80941Smrg(void) memcpy((void *)(gc->pc + 14), (void *)(&q), 2);
6228b8e80941Smrggc->pc += cmdlen;
6229b8e80941Smrgif (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); }
6230848b8605Smrg}
6231848b8605Smrg
6232848b8605Smrg#define X_GLrop_MultiTexCoord4sv 213
6233b8e80941Smrgvoid __indirect_glMultiTexCoord4sv(GLenum target, const GLshort * v)
6234b8e80941Smrg{
6235b8e80941Smrg    struct glx_context * const gc = __glXGetCurrentContext();
6236b8e80941Smrg    const GLuint cmdlen = 16;
6237b8e80941Smrgemit_header(gc->pc, X_GLrop_MultiTexCoord4sv, cmdlen);
6238b8e80941Smrg(void) memcpy((void *)(gc->pc + 4), (void *)(&target), 4);
6239b8e80941Smrg(void) memcpy((void *)(gc->pc + 8), (void *)(v), 8);
6240b8e80941Smrggc->pc += cmdlen;
6241b8e80941Smrgif (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); }
6242848b8605Smrg}
6243848b8605Smrg
6244848b8605Smrg#define X_GLrop_SampleCoverage 229
6245b8e80941Smrgvoid __indirect_glSampleCoverage(GLclampf value, GLboolean invert)
6246b8e80941Smrg{
6247b8e80941Smrg    struct glx_context * const gc = __glXGetCurrentContext();
6248b8e80941Smrg    const GLuint cmdlen = 12;
6249b8e80941Smrgemit_header(gc->pc, X_GLrop_SampleCoverage, cmdlen);
6250b8e80941Smrg(void) memcpy((void *)(gc->pc + 4), (void *)(&value), 4);
6251b8e80941Smrg(void) memcpy((void *)(gc->pc + 8), (void *)(&invert), 1);
6252b8e80941Smrggc->pc += cmdlen;
6253b8e80941Smrgif (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); }
6254848b8605Smrg}
6255848b8605Smrg
6256848b8605Smrg#define X_GLrop_BlendFuncSeparate 4134
6257b8e80941Smrgvoid __indirect_glBlendFuncSeparate(GLenum sfactorRGB, GLenum dfactorRGB, GLenum sfactorAlpha, GLenum dfactorAlpha)
6258b8e80941Smrg{
6259b8e80941Smrg    struct glx_context * const gc = __glXGetCurrentContext();
6260b8e80941Smrg    const GLuint cmdlen = 20;
6261b8e80941Smrgemit_header(gc->pc, X_GLrop_BlendFuncSeparate, cmdlen);
6262b8e80941Smrg(void) memcpy((void *)(gc->pc + 4), (void *)(&sfactorRGB), 4);
6263b8e80941Smrg(void) memcpy((void *)(gc->pc + 8), (void *)(&dfactorRGB), 4);
6264b8e80941Smrg(void) memcpy((void *)(gc->pc + 12), (void *)(&sfactorAlpha), 4);
6265b8e80941Smrg(void) memcpy((void *)(gc->pc + 16), (void *)(&dfactorAlpha), 4);
6266b8e80941Smrggc->pc += cmdlen;
6267b8e80941Smrgif (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); }
6268848b8605Smrg}
6269848b8605Smrg
6270848b8605Smrg#define X_GLrop_FogCoorddv 4125
6271b8e80941Smrgvoid __indirect_glFogCoordd(GLdouble coord)
6272848b8605Smrg{
6273b8e80941Smrg    struct glx_context * const gc = __glXGetCurrentContext();
6274b8e80941Smrg    const GLuint cmdlen = 12;
6275b8e80941Smrgemit_header(gc->pc, X_GLrop_FogCoorddv, cmdlen);
6276b8e80941Smrg(void) memcpy((void *)(gc->pc + 4), (void *)(&coord), 8);
6277b8e80941Smrggc->pc += cmdlen;
6278b8e80941Smrgif (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); }
6279848b8605Smrg}
6280848b8605Smrg
6281848b8605Smrg#define X_GLrop_FogCoorddv 4125
6282b8e80941Smrgvoid __indirect_glFogCoorddv(const GLdouble * coord)
6283848b8605Smrg{
6284b8e80941Smrg    generic_8_byte( X_GLrop_FogCoorddv, coord );
6285848b8605Smrg}
6286848b8605Smrg
6287848b8605Smrg#define X_GLrop_PointParameterf 2065
6288b8e80941Smrgvoid __indirect_glPointParameterf(GLenum pname, GLfloat param)
6289b8e80941Smrg{
6290b8e80941Smrg    struct glx_context * const gc = __glXGetCurrentContext();
6291b8e80941Smrg    const GLuint cmdlen = 12;
6292b8e80941Smrgemit_header(gc->pc, X_GLrop_PointParameterf, cmdlen);
6293b8e80941Smrg(void) memcpy((void *)(gc->pc + 4), (void *)(&pname), 4);
6294b8e80941Smrg(void) memcpy((void *)(gc->pc + 8), (void *)(&param), 4);
6295b8e80941Smrggc->pc += cmdlen;
6296b8e80941Smrgif (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); }
6297848b8605Smrg}
6298848b8605Smrg
6299848b8605Smrg#define X_GLrop_PointParameterfv 2066
6300b8e80941Smrgvoid __indirect_glPointParameterfv(GLenum pname, const GLfloat * params)
6301b8e80941Smrg{
6302b8e80941Smrg    struct glx_context * const gc = __glXGetCurrentContext();
6303b8e80941Smrg    const GLuint compsize = __glPointParameterfv_size(pname);
6304b8e80941Smrg    const GLuint cmdlen = 8 + safe_pad(safe_mul(compsize, 4));
6305b8e80941Smrg    if (0 + safe_pad(safe_mul(compsize, 4)) < 0) {
6306b8e80941Smrg        __glXSetError(gc, GL_INVALID_VALUE);
6307b8e80941Smrg        return;
6308848b8605Smrg    }
6309b8e80941Smrgemit_header(gc->pc, X_GLrop_PointParameterfv, cmdlen);
6310b8e80941Smrg(void) memcpy((void *)(gc->pc + 4), (void *)(&pname), 4);
6311b8e80941Smrg(void) memcpy((void *)(gc->pc + 8), (void *)(params), safe_mul(compsize, 4));
6312b8e80941Smrggc->pc += cmdlen;
6313b8e80941Smrgif (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); }
6314848b8605Smrg}
6315848b8605Smrg
6316848b8605Smrg#define X_GLrop_PointParameteri 4221
6317b8e80941Smrgvoid __indirect_glPointParameteri(GLenum pname, GLint param)
6318b8e80941Smrg{
6319b8e80941Smrg    struct glx_context * const gc = __glXGetCurrentContext();
6320b8e80941Smrg    const GLuint cmdlen = 12;
6321b8e80941Smrgemit_header(gc->pc, X_GLrop_PointParameteri, cmdlen);
6322b8e80941Smrg(void) memcpy((void *)(gc->pc + 4), (void *)(&pname), 4);
6323b8e80941Smrg(void) memcpy((void *)(gc->pc + 8), (void *)(&param), 4);
6324b8e80941Smrggc->pc += cmdlen;
6325b8e80941Smrgif (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); }
6326848b8605Smrg}
6327848b8605Smrg
6328848b8605Smrg#define X_GLrop_PointParameteriv 4222
6329b8e80941Smrgvoid __indirect_glPointParameteriv(GLenum pname, const GLint * params)
6330b8e80941Smrg{
6331b8e80941Smrg    struct glx_context * const gc = __glXGetCurrentContext();
6332b8e80941Smrg    const GLuint compsize = __glPointParameteriv_size(pname);
6333b8e80941Smrg    const GLuint cmdlen = 8 + safe_pad(safe_mul(compsize, 4));
6334b8e80941Smrg    if (0 + safe_pad(safe_mul(compsize, 4)) < 0) {
6335b8e80941Smrg        __glXSetError(gc, GL_INVALID_VALUE);
6336b8e80941Smrg        return;
6337848b8605Smrg    }
6338b8e80941Smrgemit_header(gc->pc, X_GLrop_PointParameteriv, cmdlen);
6339b8e80941Smrg(void) memcpy((void *)(gc->pc + 4), (void *)(&pname), 4);
6340b8e80941Smrg(void) memcpy((void *)(gc->pc + 8), (void *)(params), safe_mul(compsize, 4));
6341b8e80941Smrggc->pc += cmdlen;
6342b8e80941Smrgif (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); }
6343848b8605Smrg}
6344848b8605Smrg
6345848b8605Smrg#define X_GLrop_SecondaryColor3bv 4126
6346b8e80941Smrgvoid __indirect_glSecondaryColor3b(GLbyte red, GLbyte green, GLbyte blue)
6347b8e80941Smrg{
6348b8e80941Smrg    struct glx_context * const gc = __glXGetCurrentContext();
6349b8e80941Smrg    const GLuint cmdlen = 8;
6350b8e80941Smrgemit_header(gc->pc, X_GLrop_SecondaryColor3bv, cmdlen);
6351b8e80941Smrg(void) memcpy((void *)(gc->pc + 4), (void *)(&red), 1);
6352b8e80941Smrg(void) memcpy((void *)(gc->pc + 5), (void *)(&green), 1);
6353b8e80941Smrg(void) memcpy((void *)(gc->pc + 6), (void *)(&blue), 1);
6354b8e80941Smrggc->pc += cmdlen;
6355b8e80941Smrgif (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); }
6356848b8605Smrg}
6357848b8605Smrg
6358848b8605Smrg#define X_GLrop_SecondaryColor3bv 4126
6359b8e80941Smrgvoid __indirect_glSecondaryColor3bv(const GLbyte * v)
6360848b8605Smrg{
6361b8e80941Smrg    generic_3_byte( X_GLrop_SecondaryColor3bv, v );
6362848b8605Smrg}
6363848b8605Smrg
6364848b8605Smrg#define X_GLrop_SecondaryColor3dv 4130
6365b8e80941Smrgvoid __indirect_glSecondaryColor3d(GLdouble red, GLdouble green, GLdouble blue)
6366b8e80941Smrg{
6367b8e80941Smrg    struct glx_context * const gc = __glXGetCurrentContext();
6368b8e80941Smrg    const GLuint cmdlen = 28;
6369b8e80941Smrgemit_header(gc->pc, X_GLrop_SecondaryColor3dv, cmdlen);
6370b8e80941Smrg(void) memcpy((void *)(gc->pc + 4), (void *)(&red), 8);
6371b8e80941Smrg(void) memcpy((void *)(gc->pc + 12), (void *)(&green), 8);
6372b8e80941Smrg(void) memcpy((void *)(gc->pc + 20), (void *)(&blue), 8);
6373b8e80941Smrggc->pc += cmdlen;
6374b8e80941Smrgif (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); }
6375848b8605Smrg}
6376848b8605Smrg
6377848b8605Smrg#define X_GLrop_SecondaryColor3dv 4130
6378b8e80941Smrgvoid __indirect_glSecondaryColor3dv(const GLdouble * v)
6379848b8605Smrg{
6380b8e80941Smrg    generic_24_byte( X_GLrop_SecondaryColor3dv, v );
6381848b8605Smrg}
6382848b8605Smrg
6383848b8605Smrg#define X_GLrop_SecondaryColor3iv 4128
6384b8e80941Smrgvoid __indirect_glSecondaryColor3i(GLint red, GLint green, GLint blue)
6385b8e80941Smrg{
6386b8e80941Smrg    struct glx_context * const gc = __glXGetCurrentContext();
6387b8e80941Smrg    const GLuint cmdlen = 16;
6388b8e80941Smrgemit_header(gc->pc, X_GLrop_SecondaryColor3iv, cmdlen);
6389b8e80941Smrg(void) memcpy((void *)(gc->pc + 4), (void *)(&red), 4);
6390b8e80941Smrg(void) memcpy((void *)(gc->pc + 8), (void *)(&green), 4);
6391b8e80941Smrg(void) memcpy((void *)(gc->pc + 12), (void *)(&blue), 4);
6392b8e80941Smrggc->pc += cmdlen;
6393b8e80941Smrgif (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); }
6394848b8605Smrg}
6395848b8605Smrg
6396848b8605Smrg#define X_GLrop_SecondaryColor3iv 4128
6397b8e80941Smrgvoid __indirect_glSecondaryColor3iv(const GLint * v)
6398848b8605Smrg{
6399b8e80941Smrg    generic_12_byte( X_GLrop_SecondaryColor3iv, v );
6400848b8605Smrg}
6401848b8605Smrg
6402848b8605Smrg#define X_GLrop_SecondaryColor3sv 4127
6403b8e80941Smrgvoid __indirect_glSecondaryColor3s(GLshort red, GLshort green, GLshort blue)
6404b8e80941Smrg{
6405b8e80941Smrg    struct glx_context * const gc = __glXGetCurrentContext();
6406b8e80941Smrg    const GLuint cmdlen = 12;
6407b8e80941Smrgemit_header(gc->pc, X_GLrop_SecondaryColor3sv, cmdlen);
6408b8e80941Smrg(void) memcpy((void *)(gc->pc + 4), (void *)(&red), 2);
6409b8e80941Smrg(void) memcpy((void *)(gc->pc + 6), (void *)(&green), 2);
6410b8e80941Smrg(void) memcpy((void *)(gc->pc + 8), (void *)(&blue), 2);
6411b8e80941Smrggc->pc += cmdlen;
6412b8e80941Smrgif (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); }
6413848b8605Smrg}
6414848b8605Smrg
6415848b8605Smrg#define X_GLrop_SecondaryColor3sv 4127
6416b8e80941Smrgvoid __indirect_glSecondaryColor3sv(const GLshort * v)
6417848b8605Smrg{
6418b8e80941Smrg    generic_6_byte( X_GLrop_SecondaryColor3sv, v );
6419848b8605Smrg}
6420848b8605Smrg
6421848b8605Smrg#define X_GLrop_SecondaryColor3ubv 4131
6422b8e80941Smrgvoid __indirect_glSecondaryColor3ub(GLubyte red, GLubyte green, GLubyte blue)
6423b8e80941Smrg{
6424b8e80941Smrg    struct glx_context * const gc = __glXGetCurrentContext();
6425b8e80941Smrg    const GLuint cmdlen = 8;
6426b8e80941Smrgemit_header(gc->pc, X_GLrop_SecondaryColor3ubv, cmdlen);
6427b8e80941Smrg(void) memcpy((void *)(gc->pc + 4), (void *)(&red), 1);
6428b8e80941Smrg(void) memcpy((void *)(gc->pc + 5), (void *)(&green), 1);
6429b8e80941Smrg(void) memcpy((void *)(gc->pc + 6), (void *)(&blue), 1);
6430b8e80941Smrggc->pc += cmdlen;
6431b8e80941Smrgif (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); }
6432848b8605Smrg}
6433848b8605Smrg
6434848b8605Smrg#define X_GLrop_SecondaryColor3ubv 4131
6435b8e80941Smrgvoid __indirect_glSecondaryColor3ubv(const GLubyte * v)
6436848b8605Smrg{
6437b8e80941Smrg    generic_3_byte( X_GLrop_SecondaryColor3ubv, v );
6438848b8605Smrg}
6439848b8605Smrg
6440848b8605Smrg#define X_GLrop_SecondaryColor3uiv 4133
6441b8e80941Smrgvoid __indirect_glSecondaryColor3ui(GLuint red, GLuint green, GLuint blue)
6442b8e80941Smrg{
6443b8e80941Smrg    struct glx_context * const gc = __glXGetCurrentContext();
6444b8e80941Smrg    const GLuint cmdlen = 16;
6445b8e80941Smrgemit_header(gc->pc, X_GLrop_SecondaryColor3uiv, cmdlen);
6446b8e80941Smrg(void) memcpy((void *)(gc->pc + 4), (void *)(&red), 4);
6447b8e80941Smrg(void) memcpy((void *)(gc->pc + 8), (void *)(&green), 4);
6448b8e80941Smrg(void) memcpy((void *)(gc->pc + 12), (void *)(&blue), 4);
6449b8e80941Smrggc->pc += cmdlen;
6450b8e80941Smrgif (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); }
6451848b8605Smrg}
6452848b8605Smrg
6453848b8605Smrg#define X_GLrop_SecondaryColor3uiv 4133
6454b8e80941Smrgvoid __indirect_glSecondaryColor3uiv(const GLuint * v)
6455848b8605Smrg{
6456b8e80941Smrg    generic_12_byte( X_GLrop_SecondaryColor3uiv, v );
6457848b8605Smrg}
6458848b8605Smrg
6459848b8605Smrg#define X_GLrop_SecondaryColor3usv 4132
6460b8e80941Smrgvoid __indirect_glSecondaryColor3us(GLushort red, GLushort green, GLushort blue)
6461b8e80941Smrg{
6462b8e80941Smrg    struct glx_context * const gc = __glXGetCurrentContext();
6463b8e80941Smrg    const GLuint cmdlen = 12;
6464b8e80941Smrgemit_header(gc->pc, X_GLrop_SecondaryColor3usv, cmdlen);
6465b8e80941Smrg(void) memcpy((void *)(gc->pc + 4), (void *)(&red), 2);
6466b8e80941Smrg(void) memcpy((void *)(gc->pc + 6), (void *)(&green), 2);
6467b8e80941Smrg(void) memcpy((void *)(gc->pc + 8), (void *)(&blue), 2);
6468b8e80941Smrggc->pc += cmdlen;
6469b8e80941Smrgif (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); }
6470848b8605Smrg}
6471848b8605Smrg
6472848b8605Smrg#define X_GLrop_SecondaryColor3usv 4132
6473b8e80941Smrgvoid __indirect_glSecondaryColor3usv(const GLushort * v)
6474848b8605Smrg{
6475b8e80941Smrg    generic_6_byte( X_GLrop_SecondaryColor3usv, v );
6476848b8605Smrg}
6477848b8605Smrg
6478848b8605Smrg#define X_GLrop_WindowPos3fv 230
6479b8e80941Smrgvoid __indirect_glWindowPos3f(GLfloat x, GLfloat y, GLfloat z)
6480b8e80941Smrg{
6481b8e80941Smrg    struct glx_context * const gc = __glXGetCurrentContext();
6482b8e80941Smrg    const GLuint cmdlen = 16;
6483b8e80941Smrgemit_header(gc->pc, X_GLrop_WindowPos3fv, cmdlen);
6484b8e80941Smrg(void) memcpy((void *)(gc->pc + 4), (void *)(&x), 4);
6485b8e80941Smrg(void) memcpy((void *)(gc->pc + 8), (void *)(&y), 4);
6486b8e80941Smrg(void) memcpy((void *)(gc->pc + 12), (void *)(&z), 4);
6487b8e80941Smrggc->pc += cmdlen;
6488b8e80941Smrgif (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); }
6489848b8605Smrg}
6490848b8605Smrg
6491848b8605Smrg#define X_GLrop_WindowPos3fv 230
6492b8e80941Smrgvoid __indirect_glWindowPos3fv(const GLfloat * v)
6493848b8605Smrg{
6494b8e80941Smrg    generic_12_byte( X_GLrop_WindowPos3fv, v );
6495848b8605Smrg}
6496848b8605Smrg
6497848b8605Smrg#define X_GLrop_BeginQuery 231
6498b8e80941Smrgvoid __indirect_glBeginQuery(GLenum target, GLuint id)
6499b8e80941Smrg{
6500b8e80941Smrg    struct glx_context * const gc = __glXGetCurrentContext();
6501b8e80941Smrg    const GLuint cmdlen = 12;
6502b8e80941Smrgemit_header(gc->pc, X_GLrop_BeginQuery, cmdlen);
6503b8e80941Smrg(void) memcpy((void *)(gc->pc + 4), (void *)(&target), 4);
6504b8e80941Smrg(void) memcpy((void *)(gc->pc + 8), (void *)(&id), 4);
6505b8e80941Smrggc->pc += cmdlen;
6506b8e80941Smrgif (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); }
6507848b8605Smrg}
6508848b8605Smrg
6509848b8605Smrg#define X_GLsop_DeleteQueries 161
6510b8e80941Smrgvoid __indirect_glDeleteQueries(GLsizei n, const GLuint * ids)
6511848b8605Smrg{
6512b8e80941Smrg    struct glx_context * const gc = __glXGetCurrentContext();
6513b8e80941Smrg    Display * const dpy = gc->currentDpy;
6514848b8605Smrg#ifndef USE_XCB
6515b8e80941Smrg    const GLuint cmdlen = 4 + safe_pad(safe_mul(n, 4));
6516848b8605Smrg#endif
6517b8e80941Smrg    if (0 + safe_pad(safe_mul(n, 4)) < 0) {
6518b8e80941Smrg        __glXSetError(gc, GL_INVALID_VALUE);
6519b8e80941Smrg        return;
6520b8e80941Smrg    }
6521848b8605Smrg    if (n < 0) {
6522848b8605Smrg        __glXSetError(gc, GL_INVALID_VALUE);
6523848b8605Smrg        return;
6524848b8605Smrg    }
6525848b8605Smrg    if (__builtin_expect((n >= 0) && (dpy != NULL), 1)) {
6526848b8605Smrg#ifdef USE_XCB
6527848b8605Smrg        xcb_connection_t *c = XGetXCBConnection(dpy);
6528848b8605Smrg        (void) __glXFlushRenderBuffer(gc, gc->pc);
6529848b8605Smrg        xcb_glx_delete_queries(c, gc->currentContextTag, n, ids);
6530848b8605Smrg#else
6531b8e80941Smrg        GLubyte const * pc = __glXSetupSingleRequest(gc, X_GLsop_DeleteQueries, cmdlen);
6532b8e80941Smrg(void) memcpy((void *)(pc + 0), (void *)(&n), 4);
6533b8e80941Smrg(void) memcpy((void *)(pc + 4), (void *)(ids), safe_mul(n, 4));
6534b8e80941Smrg        UnlockDisplay(dpy); SyncHandle();
6535b8e80941Smrg#endif /* USE_XCB */
6536848b8605Smrg    }
6537848b8605Smrg    return;
6538848b8605Smrg}
6539848b8605Smrg
6540848b8605Smrg#define X_GLrop_EndQuery 232
6541b8e80941Smrgvoid __indirect_glEndQuery(GLenum target)
6542848b8605Smrg{
6543b8e80941Smrg    struct glx_context * const gc = __glXGetCurrentContext();
6544b8e80941Smrg    const GLuint cmdlen = 8;
6545b8e80941Smrgemit_header(gc->pc, X_GLrop_EndQuery, cmdlen);
6546b8e80941Smrg(void) memcpy((void *)(gc->pc + 4), (void *)(&target), 4);
6547b8e80941Smrggc->pc += cmdlen;
6548b8e80941Smrgif (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); }
6549848b8605Smrg}
6550848b8605Smrg
6551848b8605Smrg#define X_GLsop_GenQueries 162
6552b8e80941Smrgvoid __indirect_glGenQueries(GLsizei n, GLuint * ids)
6553848b8605Smrg{
6554b8e80941Smrg    struct glx_context * const gc = __glXGetCurrentContext();
6555b8e80941Smrg    Display * const dpy = gc->currentDpy;
6556848b8605Smrg#ifndef USE_XCB
6557b8e80941Smrg    const GLuint cmdlen = 4;
6558848b8605Smrg#endif
6559848b8605Smrg    if (n < 0) {
6560848b8605Smrg        __glXSetError(gc, GL_INVALID_VALUE);
6561848b8605Smrg        return;
6562848b8605Smrg    }
6563848b8605Smrg    if (__builtin_expect((n >= 0) && (dpy != NULL), 1)) {
6564848b8605Smrg#ifdef USE_XCB
6565848b8605Smrg        xcb_connection_t *c = XGetXCBConnection(dpy);
6566848b8605Smrg        (void) __glXFlushRenderBuffer(gc, gc->pc);
6567848b8605Smrg        xcb_glx_gen_queries_reply_t *reply = xcb_glx_gen_queries_reply(c, xcb_glx_gen_queries(c, gc->currentContextTag, n), NULL);
6568b8e80941Smrg        (void)memcpy(ids, xcb_glx_gen_queries_data(reply), xcb_glx_gen_queries_data_length(reply) * sizeof(GLuint));
6569848b8605Smrg        free(reply);
6570848b8605Smrg#else
6571b8e80941Smrg        GLubyte const * pc = __glXSetupSingleRequest(gc, X_GLsop_GenQueries, cmdlen);
6572b8e80941Smrg(void) memcpy((void *)(pc + 0), (void *)(&n), 4);
6573848b8605Smrg        (void) __glXReadReply(dpy, 4, ids, GL_TRUE);
6574b8e80941Smrg        UnlockDisplay(dpy); SyncHandle();
6575b8e80941Smrg#endif /* USE_XCB */
6576848b8605Smrg    }
6577848b8605Smrg    return;
6578848b8605Smrg}
6579848b8605Smrg
6580848b8605Smrg#define X_GLsop_GetQueryObjectiv 165
6581b8e80941Smrgvoid __indirect_glGetQueryObjectiv(GLuint id, GLenum pname, GLint * params)
6582848b8605Smrg{
6583b8e80941Smrg    struct glx_context * const gc = __glXGetCurrentContext();
6584b8e80941Smrg    Display * const dpy = gc->currentDpy;
6585848b8605Smrg#ifndef USE_XCB
6586b8e80941Smrg    const GLuint cmdlen = 8;
6587848b8605Smrg#endif
6588848b8605Smrg    if (__builtin_expect(dpy != NULL, 1)) {
6589848b8605Smrg#ifdef USE_XCB
6590848b8605Smrg        xcb_connection_t *c = XGetXCBConnection(dpy);
6591848b8605Smrg        (void) __glXFlushRenderBuffer(gc, gc->pc);
6592848b8605Smrg        xcb_glx_get_query_objectiv_reply_t *reply = xcb_glx_get_query_objectiv_reply(c, xcb_glx_get_query_objectiv(c, gc->currentContextTag, id, pname), NULL);
6593b8e80941Smrg        /* the XXX_data_length() xcb function name is misleading, it returns the number */
6594b8e80941Smrg        /* of elements, not the length of the data part. A single element is embedded. */
6595848b8605Smrg        if (xcb_glx_get_query_objectiv_data_length(reply) == 1)
6596b8e80941Smrg            (void)memcpy(params, &reply->datum, sizeof(reply->datum));
6597848b8605Smrg        else
6598b8e80941Smrg            (void)memcpy(params, xcb_glx_get_query_objectiv_data(reply), xcb_glx_get_query_objectiv_data_length(reply) * sizeof(GLint));
6599848b8605Smrg        free(reply);
6600848b8605Smrg#else
6601b8e80941Smrg        GLubyte const * pc = __glXSetupSingleRequest(gc, X_GLsop_GetQueryObjectiv, cmdlen);
6602b8e80941Smrg(void) memcpy((void *)(pc + 0), (void *)(&id), 4);
6603b8e80941Smrg(void) memcpy((void *)(pc + 4), (void *)(&pname), 4);
6604848b8605Smrg        (void) __glXReadReply(dpy, 4, params, GL_FALSE);
6605b8e80941Smrg        UnlockDisplay(dpy); SyncHandle();
6606b8e80941Smrg#endif /* USE_XCB */
6607848b8605Smrg    }
6608848b8605Smrg    return;
6609848b8605Smrg}
6610848b8605Smrg
6611848b8605Smrg#define X_GLsop_GetQueryObjectuiv 166
6612b8e80941Smrgvoid __indirect_glGetQueryObjectuiv(GLuint id, GLenum pname, GLuint * params)
6613848b8605Smrg{
6614b8e80941Smrg    struct glx_context * const gc = __glXGetCurrentContext();
6615b8e80941Smrg    Display * const dpy = gc->currentDpy;
6616848b8605Smrg#ifndef USE_XCB
6617b8e80941Smrg    const GLuint cmdlen = 8;
6618848b8605Smrg#endif
6619848b8605Smrg    if (__builtin_expect(dpy != NULL, 1)) {
6620848b8605Smrg#ifdef USE_XCB
6621848b8605Smrg        xcb_connection_t *c = XGetXCBConnection(dpy);
6622848b8605Smrg        (void) __glXFlushRenderBuffer(gc, gc->pc);
6623848b8605Smrg        xcb_glx_get_query_objectuiv_reply_t *reply = xcb_glx_get_query_objectuiv_reply(c, xcb_glx_get_query_objectuiv(c, gc->currentContextTag, id, pname), NULL);
6624b8e80941Smrg        /* the XXX_data_length() xcb function name is misleading, it returns the number */
6625b8e80941Smrg        /* of elements, not the length of the data part. A single element is embedded. */
6626848b8605Smrg        if (xcb_glx_get_query_objectuiv_data_length(reply) == 1)
6627b8e80941Smrg            (void)memcpy(params, &reply->datum, sizeof(reply->datum));
6628848b8605Smrg        else
6629b8e80941Smrg            (void)memcpy(params, xcb_glx_get_query_objectuiv_data(reply), xcb_glx_get_query_objectuiv_data_length(reply) * sizeof(GLuint));
6630848b8605Smrg        free(reply);
6631848b8605Smrg#else
6632b8e80941Smrg        GLubyte const * pc = __glXSetupSingleRequest(gc, X_GLsop_GetQueryObjectuiv, cmdlen);
6633b8e80941Smrg(void) memcpy((void *)(pc + 0), (void *)(&id), 4);
6634b8e80941Smrg(void) memcpy((void *)(pc + 4), (void *)(&pname), 4);
6635848b8605Smrg        (void) __glXReadReply(dpy, 4, params, GL_FALSE);
6636b8e80941Smrg        UnlockDisplay(dpy); SyncHandle();
6637b8e80941Smrg#endif /* USE_XCB */
6638848b8605Smrg    }
6639848b8605Smrg    return;
6640848b8605Smrg}
6641848b8605Smrg
6642848b8605Smrg#define X_GLsop_GetQueryiv 164
6643b8e80941Smrgvoid __indirect_glGetQueryiv(GLenum target, GLenum pname, GLint * params)
6644848b8605Smrg{
6645b8e80941Smrg    struct glx_context * const gc = __glXGetCurrentContext();
6646b8e80941Smrg    Display * const dpy = gc->currentDpy;
6647848b8605Smrg#ifndef USE_XCB
6648b8e80941Smrg    const GLuint cmdlen = 8;
6649848b8605Smrg#endif
6650848b8605Smrg    if (__builtin_expect(dpy != NULL, 1)) {
6651848b8605Smrg#ifdef USE_XCB
6652848b8605Smrg        xcb_connection_t *c = XGetXCBConnection(dpy);
6653848b8605Smrg        (void) __glXFlushRenderBuffer(gc, gc->pc);
6654848b8605Smrg        xcb_glx_get_queryiv_reply_t *reply = xcb_glx_get_queryiv_reply(c, xcb_glx_get_queryiv(c, gc->currentContextTag, target, pname), NULL);
6655b8e80941Smrg        /* the XXX_data_length() xcb function name is misleading, it returns the number */
6656b8e80941Smrg        /* of elements, not the length of the data part. A single element is embedded. */
6657848b8605Smrg        if (xcb_glx_get_queryiv_data_length(reply) == 1)
6658b8e80941Smrg            (void)memcpy(params, &reply->datum, sizeof(reply->datum));
6659848b8605Smrg        else
6660b8e80941Smrg            (void)memcpy(params, xcb_glx_get_queryiv_data(reply), xcb_glx_get_queryiv_data_length(reply) * sizeof(GLint));
6661848b8605Smrg        free(reply);
6662848b8605Smrg#else
6663b8e80941Smrg        GLubyte const * pc = __glXSetupSingleRequest(gc, X_GLsop_GetQueryiv, cmdlen);
6664b8e80941Smrg(void) memcpy((void *)(pc + 0), (void *)(&target), 4);
6665b8e80941Smrg(void) memcpy((void *)(pc + 4), (void *)(&pname), 4);
6666848b8605Smrg        (void) __glXReadReply(dpy, 4, params, GL_FALSE);
6667b8e80941Smrg        UnlockDisplay(dpy); SyncHandle();
6668b8e80941Smrg#endif /* USE_XCB */
6669848b8605Smrg    }
6670848b8605Smrg    return;
6671848b8605Smrg}
6672848b8605Smrg
6673848b8605Smrg#define X_GLsop_IsQuery 163
6674b8e80941SmrgGLboolean __indirect_glIsQuery(GLuint id)
6675848b8605Smrg{
6676b8e80941Smrg    struct glx_context * const gc = __glXGetCurrentContext();
6677b8e80941Smrg    Display * const dpy = gc->currentDpy;
6678b8e80941Smrg    GLboolean retval = (GLboolean) 0;
6679848b8605Smrg#ifndef USE_XCB
6680b8e80941Smrg    const GLuint cmdlen = 4;
6681848b8605Smrg#endif
6682848b8605Smrg    if (__builtin_expect(dpy != NULL, 1)) {
6683848b8605Smrg#ifdef USE_XCB
6684848b8605Smrg        xcb_connection_t *c = XGetXCBConnection(dpy);
6685848b8605Smrg        (void) __glXFlushRenderBuffer(gc, gc->pc);
6686848b8605Smrg        xcb_glx_is_query_reply_t *reply = xcb_glx_is_query_reply(c, xcb_glx_is_query(c, gc->currentContextTag, id), NULL);
6687848b8605Smrg        retval = reply->ret_val;
6688848b8605Smrg        free(reply);
6689848b8605Smrg#else
6690b8e80941Smrg        GLubyte const * pc = __glXSetupSingleRequest(gc, X_GLsop_IsQuery, cmdlen);
6691b8e80941Smrg(void) memcpy((void *)(pc + 0), (void *)(&id), 4);
6692848b8605Smrg        retval = (GLboolean) __glXReadReply(dpy, 0, NULL, GL_FALSE);
6693b8e80941Smrg        UnlockDisplay(dpy); SyncHandle();
6694b8e80941Smrg#endif /* USE_XCB */
6695848b8605Smrg    }
6696848b8605Smrg    return retval;
6697848b8605Smrg}
6698848b8605Smrg
6699848b8605Smrg#define X_GLrop_BlendEquationSeparate 4228
6700b8e80941Smrgvoid __indirect_glBlendEquationSeparate(GLenum modeRGB, GLenum modeA)
6701b8e80941Smrg{
6702b8e80941Smrg    struct glx_context * const gc = __glXGetCurrentContext();
6703b8e80941Smrg    const GLuint cmdlen = 12;
6704b8e80941Smrgemit_header(gc->pc, X_GLrop_BlendEquationSeparate, cmdlen);
6705b8e80941Smrg(void) memcpy((void *)(gc->pc + 4), (void *)(&modeRGB), 4);
6706b8e80941Smrg(void) memcpy((void *)(gc->pc + 8), (void *)(&modeA), 4);
6707b8e80941Smrggc->pc += cmdlen;
6708b8e80941Smrgif (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); }
6709848b8605Smrg}
6710848b8605Smrg
6711848b8605Smrg#define X_GLrop_DrawBuffers 233
6712b8e80941Smrgvoid __indirect_glDrawBuffers(GLsizei n, const GLenum * bufs)
6713848b8605Smrg{
6714b8e80941Smrg    struct glx_context * const gc = __glXGetCurrentContext();
6715b8e80941Smrg    const GLuint cmdlen = 8 + safe_pad(safe_mul(n, 4));
6716b8e80941Smrg    if (0 + safe_pad(safe_mul(n, 4)) < 0) {
6717b8e80941Smrg        __glXSetError(gc, GL_INVALID_VALUE);
6718b8e80941Smrg        return;
6719b8e80941Smrg    }
6720848b8605Smrg    if (n < 0) {
6721848b8605Smrg        __glXSetError(gc, GL_INVALID_VALUE);
6722848b8605Smrg        return;
6723848b8605Smrg    }
6724848b8605Smrg    if (__builtin_expect((n >= 0) && (gc->currentDpy != NULL), 1)) {
6725b8e80941Smrgif (cmdlen <= gc->maxSmallRenderCommandSize) {
6726b8e80941Smrg    if ( (gc->pc + cmdlen) > gc->bufEnd ) {
6727b8e80941Smrg        (void) __glXFlushRenderBuffer(gc, gc->pc);
6728b8e80941Smrg    }
6729b8e80941Smrgemit_header(gc->pc, X_GLrop_DrawBuffers, cmdlen);
6730b8e80941Smrg(void) memcpy((void *)(gc->pc + 4), (void *)(&n), 4);
6731b8e80941Smrg(void) memcpy((void *)(gc->pc + 8), (void *)(bufs), safe_mul(n, 4));
6732b8e80941Smrggc->pc += cmdlen;
6733b8e80941Smrgif (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); }
6734b8e80941Smrg}
6735b8e80941Smrgelse {
6736b8e80941Smrgconst GLint op = X_GLrop_DrawBuffers;
6737b8e80941Smrgconst GLuint cmdlenLarge = cmdlen + 4;
6738b8e80941SmrgGLubyte * const pc = __glXFlushRenderBuffer(gc, gc->pc);
6739b8e80941Smrg(void) memcpy((void *)(pc + 0), (void *)(&cmdlenLarge), 4);
6740b8e80941Smrg(void) memcpy((void *)(pc + 4), (void *)(&op), 4);
6741b8e80941Smrg(void) memcpy((void *)(pc + 8), (void *)(&n), 4);
6742b8e80941Smrg    __glXSendLargeCommand(gc, pc, 12, bufs, safe_mul(n, 4));
6743b8e80941Smrg}
6744848b8605Smrg    }
6745848b8605Smrg}
6746848b8605Smrg
6747848b8605Smrg#define X_GLrop_VertexAttrib1dv 4197
6748b8e80941Smrgvoid __indirect_glVertexAttrib1d(GLuint index, GLdouble x)
6749b8e80941Smrg{
6750b8e80941Smrg    struct glx_context * const gc = __glXGetCurrentContext();
6751b8e80941Smrg    const GLuint cmdlen = 16;
6752b8e80941Smrgemit_header(gc->pc, X_GLrop_VertexAttrib1dv, cmdlen);
6753b8e80941Smrg(void) memcpy((void *)(gc->pc + 4), (void *)(&index), 4);
6754b8e80941Smrg(void) memcpy((void *)(gc->pc + 8), (void *)(&x), 8);
6755b8e80941Smrggc->pc += cmdlen;
6756b8e80941Smrgif (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); }
6757848b8605Smrg}
6758848b8605Smrg
6759848b8605Smrg#define X_GLrop_VertexAttrib1dv 4197
6760b8e80941Smrgvoid __indirect_glVertexAttrib1dv(GLuint index, const GLdouble * v)
6761b8e80941Smrg{
6762b8e80941Smrg    struct glx_context * const gc = __glXGetCurrentContext();
6763b8e80941Smrg    const GLuint cmdlen = 16;
6764b8e80941Smrgemit_header(gc->pc, X_GLrop_VertexAttrib1dv, cmdlen);
6765b8e80941Smrg(void) memcpy((void *)(gc->pc + 4), (void *)(&index), 4);
6766b8e80941Smrg(void) memcpy((void *)(gc->pc + 8), (void *)(v), 8);
6767b8e80941Smrggc->pc += cmdlen;
6768b8e80941Smrgif (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); }
6769848b8605Smrg}
6770848b8605Smrg
6771848b8605Smrg#define X_GLrop_VertexAttrib1sv 4189
6772b8e80941Smrgvoid __indirect_glVertexAttrib1s(GLuint index, GLshort x)
6773b8e80941Smrg{
6774b8e80941Smrg    struct glx_context * const gc = __glXGetCurrentContext();
6775b8e80941Smrg    const GLuint cmdlen = 12;
6776b8e80941Smrgemit_header(gc->pc, X_GLrop_VertexAttrib1sv, cmdlen);
6777b8e80941Smrg(void) memcpy((void *)(gc->pc + 4), (void *)(&index), 4);
6778b8e80941Smrg(void) memcpy((void *)(gc->pc + 8), (void *)(&x), 2);
6779b8e80941Smrggc->pc += cmdlen;
6780b8e80941Smrgif (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); }
6781848b8605Smrg}
6782848b8605Smrg
6783848b8605Smrg#define X_GLrop_VertexAttrib1sv 4189
6784b8e80941Smrgvoid __indirect_glVertexAttrib1sv(GLuint index, const GLshort * v)
6785b8e80941Smrg{
6786b8e80941Smrg    struct glx_context * const gc = __glXGetCurrentContext();
6787b8e80941Smrg    const GLuint cmdlen = 12;
6788b8e80941Smrgemit_header(gc->pc, X_GLrop_VertexAttrib1sv, cmdlen);
6789b8e80941Smrg(void) memcpy((void *)(gc->pc + 4), (void *)(&index), 4);
6790b8e80941Smrg(void) memcpy((void *)(gc->pc + 8), (void *)(v), 2);
6791b8e80941Smrggc->pc += cmdlen;
6792b8e80941Smrgif (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); }
6793848b8605Smrg}
6794848b8605Smrg
6795848b8605Smrg#define X_GLrop_VertexAttrib2dv 4198
6796b8e80941Smrgvoid __indirect_glVertexAttrib2d(GLuint index, GLdouble x, GLdouble y)
6797b8e80941Smrg{
6798b8e80941Smrg    struct glx_context * const gc = __glXGetCurrentContext();
6799b8e80941Smrg    const GLuint cmdlen = 24;
6800b8e80941Smrgemit_header(gc->pc, X_GLrop_VertexAttrib2dv, cmdlen);
6801b8e80941Smrg(void) memcpy((void *)(gc->pc + 4), (void *)(&index), 4);
6802b8e80941Smrg(void) memcpy((void *)(gc->pc + 8), (void *)(&x), 8);
6803b8e80941Smrg(void) memcpy((void *)(gc->pc + 16), (void *)(&y), 8);
6804b8e80941Smrggc->pc += cmdlen;
6805b8e80941Smrgif (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); }
6806848b8605Smrg}
6807848b8605Smrg
6808848b8605Smrg#define X_GLrop_VertexAttrib2dv 4198
6809b8e80941Smrgvoid __indirect_glVertexAttrib2dv(GLuint index, const GLdouble * v)
6810b8e80941Smrg{
6811b8e80941Smrg    struct glx_context * const gc = __glXGetCurrentContext();
6812b8e80941Smrg    const GLuint cmdlen = 24;
6813b8e80941Smrgemit_header(gc->pc, X_GLrop_VertexAttrib2dv, cmdlen);
6814b8e80941Smrg(void) memcpy((void *)(gc->pc + 4), (void *)(&index), 4);
6815b8e80941Smrg(void) memcpy((void *)(gc->pc + 8), (void *)(v), 16);
6816b8e80941Smrggc->pc += cmdlen;
6817b8e80941Smrgif (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); }
6818848b8605Smrg}
6819848b8605Smrg
6820848b8605Smrg#define X_GLrop_VertexAttrib2sv 4190
6821b8e80941Smrgvoid __indirect_glVertexAttrib2s(GLuint index, GLshort x, GLshort y)
6822b8e80941Smrg{
6823b8e80941Smrg    struct glx_context * const gc = __glXGetCurrentContext();
6824b8e80941Smrg    const GLuint cmdlen = 12;
6825b8e80941Smrgemit_header(gc->pc, X_GLrop_VertexAttrib2sv, cmdlen);
6826b8e80941Smrg(void) memcpy((void *)(gc->pc + 4), (void *)(&index), 4);
6827b8e80941Smrg(void) memcpy((void *)(gc->pc + 8), (void *)(&x), 2);
6828b8e80941Smrg(void) memcpy((void *)(gc->pc + 10), (void *)(&y), 2);
6829b8e80941Smrggc->pc += cmdlen;
6830b8e80941Smrgif (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); }
6831848b8605Smrg}
6832848b8605Smrg
6833848b8605Smrg#define X_GLrop_VertexAttrib2sv 4190
6834b8e80941Smrgvoid __indirect_glVertexAttrib2sv(GLuint index, const GLshort * v)
6835b8e80941Smrg{
6836b8e80941Smrg    struct glx_context * const gc = __glXGetCurrentContext();
6837b8e80941Smrg    const GLuint cmdlen = 12;
6838b8e80941Smrgemit_header(gc->pc, X_GLrop_VertexAttrib2sv, cmdlen);
6839b8e80941Smrg(void) memcpy((void *)(gc->pc + 4), (void *)(&index), 4);
6840b8e80941Smrg(void) memcpy((void *)(gc->pc + 8), (void *)(v), 4);
6841b8e80941Smrggc->pc += cmdlen;
6842b8e80941Smrgif (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); }
6843848b8605Smrg}
6844848b8605Smrg
6845848b8605Smrg#define X_GLrop_VertexAttrib3dv 4199
6846b8e80941Smrgvoid __indirect_glVertexAttrib3d(GLuint index, GLdouble x, GLdouble y, GLdouble z)
6847b8e80941Smrg{
6848b8e80941Smrg    struct glx_context * const gc = __glXGetCurrentContext();
6849b8e80941Smrg    const GLuint cmdlen = 32;
6850b8e80941Smrgemit_header(gc->pc, X_GLrop_VertexAttrib3dv, cmdlen);
6851b8e80941Smrg(void) memcpy((void *)(gc->pc + 4), (void *)(&index), 4);
6852b8e80941Smrg(void) memcpy((void *)(gc->pc + 8), (void *)(&x), 8);
6853b8e80941Smrg(void) memcpy((void *)(gc->pc + 16), (void *)(&y), 8);
6854b8e80941Smrg(void) memcpy((void *)(gc->pc + 24), (void *)(&z), 8);
6855b8e80941Smrggc->pc += cmdlen;
6856b8e80941Smrgif (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); }
6857848b8605Smrg}
6858848b8605Smrg
6859848b8605Smrg#define X_GLrop_VertexAttrib3dv 4199
6860b8e80941Smrgvoid __indirect_glVertexAttrib3dv(GLuint index, const GLdouble * v)
6861b8e80941Smrg{
6862b8e80941Smrg    struct glx_context * const gc = __glXGetCurrentContext();
6863b8e80941Smrg    const GLuint cmdlen = 32;
6864b8e80941Smrgemit_header(gc->pc, X_GLrop_VertexAttrib3dv, cmdlen);
6865b8e80941Smrg(void) memcpy((void *)(gc->pc + 4), (void *)(&index), 4);
6866b8e80941Smrg(void) memcpy((void *)(gc->pc + 8), (void *)(v), 24);
6867b8e80941Smrggc->pc += cmdlen;
6868b8e80941Smrgif (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); }
6869848b8605Smrg}
6870848b8605Smrg
6871848b8605Smrg#define X_GLrop_VertexAttrib3sv 4191
6872b8e80941Smrgvoid __indirect_glVertexAttrib3s(GLuint index, GLshort x, GLshort y, GLshort z)
6873b8e80941Smrg{
6874b8e80941Smrg    struct glx_context * const gc = __glXGetCurrentContext();
6875b8e80941Smrg    const GLuint cmdlen = 16;
6876b8e80941Smrgemit_header(gc->pc, X_GLrop_VertexAttrib3sv, cmdlen);
6877b8e80941Smrg(void) memcpy((void *)(gc->pc + 4), (void *)(&index), 4);
6878b8e80941Smrg(void) memcpy((void *)(gc->pc + 8), (void *)(&x), 2);
6879b8e80941Smrg(void) memcpy((void *)(gc->pc + 10), (void *)(&y), 2);
6880b8e80941Smrg(void) memcpy((void *)(gc->pc + 12), (void *)(&z), 2);
6881b8e80941Smrggc->pc += cmdlen;
6882b8e80941Smrgif (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); }
6883848b8605Smrg}
6884848b8605Smrg
6885848b8605Smrg#define X_GLrop_VertexAttrib3sv 4191
6886b8e80941Smrgvoid __indirect_glVertexAttrib3sv(GLuint index, const GLshort * v)
6887b8e80941Smrg{
6888b8e80941Smrg    struct glx_context * const gc = __glXGetCurrentContext();
6889b8e80941Smrg    const GLuint cmdlen = 16;
6890b8e80941Smrgemit_header(gc->pc, X_GLrop_VertexAttrib3sv, cmdlen);
6891b8e80941Smrg(void) memcpy((void *)(gc->pc + 4), (void *)(&index), 4);
6892b8e80941Smrg(void) memcpy((void *)(gc->pc + 8), (void *)(v), 6);
6893b8e80941Smrggc->pc += cmdlen;
6894b8e80941Smrgif (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); }
6895848b8605Smrg}
6896848b8605Smrg
6897848b8605Smrg#define X_GLrop_VertexAttrib4Nbv 4235
6898b8e80941Smrgvoid __indirect_glVertexAttrib4Nbv(GLuint index, const GLbyte * v)
6899b8e80941Smrg{
6900b8e80941Smrg    struct glx_context * const gc = __glXGetCurrentContext();
6901b8e80941Smrg    const GLuint cmdlen = 12;
6902b8e80941Smrgemit_header(gc->pc, X_GLrop_VertexAttrib4Nbv, cmdlen);
6903b8e80941Smrg(void) memcpy((void *)(gc->pc + 4), (void *)(&index), 4);
6904b8e80941Smrg(void) memcpy((void *)(gc->pc + 8), (void *)(v), 4);
6905b8e80941Smrggc->pc += cmdlen;
6906b8e80941Smrgif (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); }
6907848b8605Smrg}
6908848b8605Smrg
6909848b8605Smrg#define X_GLrop_VertexAttrib4Niv 4237
6910b8e80941Smrgvoid __indirect_glVertexAttrib4Niv(GLuint index, const GLint * v)
6911b8e80941Smrg{
6912b8e80941Smrg    struct glx_context * const gc = __glXGetCurrentContext();
6913b8e80941Smrg    const GLuint cmdlen = 24;
6914b8e80941Smrgemit_header(gc->pc, X_GLrop_VertexAttrib4Niv, cmdlen);
6915b8e80941Smrg(void) memcpy((void *)(gc->pc + 4), (void *)(&index), 4);
6916b8e80941Smrg(void) memcpy((void *)(gc->pc + 8), (void *)(v), 16);
6917b8e80941Smrggc->pc += cmdlen;
6918b8e80941Smrgif (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); }
6919848b8605Smrg}
6920848b8605Smrg
6921848b8605Smrg#define X_GLrop_VertexAttrib4Nsv 4236
6922b8e80941Smrgvoid __indirect_glVertexAttrib4Nsv(GLuint index, const GLshort * v)
6923b8e80941Smrg{
6924b8e80941Smrg    struct glx_context * const gc = __glXGetCurrentContext();
6925b8e80941Smrg    const GLuint cmdlen = 16;
6926b8e80941Smrgemit_header(gc->pc, X_GLrop_VertexAttrib4Nsv, cmdlen);
6927b8e80941Smrg(void) memcpy((void *)(gc->pc + 4), (void *)(&index), 4);
6928b8e80941Smrg(void) memcpy((void *)(gc->pc + 8), (void *)(v), 8);
6929b8e80941Smrggc->pc += cmdlen;
6930b8e80941Smrgif (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); }
6931848b8605Smrg}
6932848b8605Smrg
6933848b8605Smrg#define X_GLrop_VertexAttrib4Nubv 4201
6934b8e80941Smrgvoid __indirect_glVertexAttrib4Nub(GLuint index, GLubyte x, GLubyte y, GLubyte z, GLubyte w)
6935b8e80941Smrg{
6936b8e80941Smrg    struct glx_context * const gc = __glXGetCurrentContext();
6937b8e80941Smrg    const GLuint cmdlen = 12;
6938b8e80941Smrgemit_header(gc->pc, X_GLrop_VertexAttrib4Nubv, cmdlen);
6939b8e80941Smrg(void) memcpy((void *)(gc->pc + 4), (void *)(&index), 4);
6940b8e80941Smrg(void) memcpy((void *)(gc->pc + 8), (void *)(&x), 1);
6941b8e80941Smrg(void) memcpy((void *)(gc->pc + 9), (void *)(&y), 1);
6942b8e80941Smrg(void) memcpy((void *)(gc->pc + 10), (void *)(&z), 1);
6943b8e80941Smrg(void) memcpy((void *)(gc->pc + 11), (void *)(&w), 1);
6944b8e80941Smrggc->pc += cmdlen;
6945b8e80941Smrgif (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); }
6946848b8605Smrg}
6947848b8605Smrg
6948848b8605Smrg#define X_GLrop_VertexAttrib4Nubv 4201
6949b8e80941Smrgvoid __indirect_glVertexAttrib4Nubv(GLuint index, const GLubyte * v)
6950b8e80941Smrg{
6951b8e80941Smrg    struct glx_context * const gc = __glXGetCurrentContext();
6952b8e80941Smrg    const GLuint cmdlen = 12;
6953b8e80941Smrgemit_header(gc->pc, X_GLrop_VertexAttrib4Nubv, cmdlen);
6954b8e80941Smrg(void) memcpy((void *)(gc->pc + 4), (void *)(&index), 4);
6955b8e80941Smrg(void) memcpy((void *)(gc->pc + 8), (void *)(v), 4);
6956b8e80941Smrggc->pc += cmdlen;
6957b8e80941Smrgif (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); }
6958848b8605Smrg}
6959848b8605Smrg
6960848b8605Smrg#define X_GLrop_VertexAttrib4Nuiv 4239
6961b8e80941Smrgvoid __indirect_glVertexAttrib4Nuiv(GLuint index, const GLuint * v)
6962b8e80941Smrg{
6963b8e80941Smrg    struct glx_context * const gc = __glXGetCurrentContext();
6964b8e80941Smrg    const GLuint cmdlen = 24;
6965b8e80941Smrgemit_header(gc->pc, X_GLrop_VertexAttrib4Nuiv, cmdlen);
6966b8e80941Smrg(void) memcpy((void *)(gc->pc + 4), (void *)(&index), 4);
6967b8e80941Smrg(void) memcpy((void *)(gc->pc + 8), (void *)(v), 16);
6968b8e80941Smrggc->pc += cmdlen;
6969b8e80941Smrgif (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); }
6970848b8605Smrg}
6971848b8605Smrg
6972848b8605Smrg#define X_GLrop_VertexAttrib4Nusv 4238
6973b8e80941Smrgvoid __indirect_glVertexAttrib4Nusv(GLuint index, const GLushort * v)
6974b8e80941Smrg{
6975b8e80941Smrg    struct glx_context * const gc = __glXGetCurrentContext();
6976b8e80941Smrg    const GLuint cmdlen = 16;
6977b8e80941Smrgemit_header(gc->pc, X_GLrop_VertexAttrib4Nusv, cmdlen);
6978b8e80941Smrg(void) memcpy((void *)(gc->pc + 4), (void *)(&index), 4);
6979b8e80941Smrg(void) memcpy((void *)(gc->pc + 8), (void *)(v), 8);
6980b8e80941Smrggc->pc += cmdlen;
6981b8e80941Smrgif (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); }
6982848b8605Smrg}
6983848b8605Smrg
6984848b8605Smrg#define X_GLrop_VertexAttrib4bv 4230
6985b8e80941Smrgvoid __indirect_glVertexAttrib4bv(GLuint index, const GLbyte * v)
6986b8e80941Smrg{
6987b8e80941Smrg    struct glx_context * const gc = __glXGetCurrentContext();
6988b8e80941Smrg    const GLuint cmdlen = 12;
6989b8e80941Smrgemit_header(gc->pc, X_GLrop_VertexAttrib4bv, cmdlen);
6990b8e80941Smrg(void) memcpy((void *)(gc->pc + 4), (void *)(&index), 4);
6991b8e80941Smrg(void) memcpy((void *)(gc->pc + 8), (void *)(v), 4);
6992b8e80941Smrggc->pc += cmdlen;
6993b8e80941Smrgif (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); }
6994848b8605Smrg}
6995848b8605Smrg
6996848b8605Smrg#define X_GLrop_VertexAttrib4dv 4200
6997b8e80941Smrgvoid __indirect_glVertexAttrib4d(GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w)
6998b8e80941Smrg{
6999b8e80941Smrg    struct glx_context * const gc = __glXGetCurrentContext();
7000b8e80941Smrg    const GLuint cmdlen = 40;
7001b8e80941Smrgemit_header(gc->pc, X_GLrop_VertexAttrib4dv, cmdlen);
7002b8e80941Smrg(void) memcpy((void *)(gc->pc + 4), (void *)(&index), 4);
7003b8e80941Smrg(void) memcpy((void *)(gc->pc + 8), (void *)(&x), 8);
7004b8e80941Smrg(void) memcpy((void *)(gc->pc + 16), (void *)(&y), 8);
7005b8e80941Smrg(void) memcpy((void *)(gc->pc + 24), (void *)(&z), 8);
7006b8e80941Smrg(void) memcpy((void *)(gc->pc + 32), (void *)(&w), 8);
7007b8e80941Smrggc->pc += cmdlen;
7008b8e80941Smrgif (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); }
7009848b8605Smrg}
7010848b8605Smrg
7011848b8605Smrg#define X_GLrop_VertexAttrib4dv 4200
7012b8e80941Smrgvoid __indirect_glVertexAttrib4dv(GLuint index, const GLdouble * v)
7013b8e80941Smrg{
7014b8e80941Smrg    struct glx_context * const gc = __glXGetCurrentContext();
7015b8e80941Smrg    const GLuint cmdlen = 40;
7016b8e80941Smrgemit_header(gc->pc, X_GLrop_VertexAttrib4dv, cmdlen);
7017b8e80941Smrg(void) memcpy((void *)(gc->pc + 4), (void *)(&index), 4);
7018b8e80941Smrg(void) memcpy((void *)(gc->pc + 8), (void *)(v), 32);
7019b8e80941Smrggc->pc += cmdlen;
7020b8e80941Smrgif (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); }
7021848b8605Smrg}
7022848b8605Smrg
7023848b8605Smrg#define X_GLrop_VertexAttrib4iv 4231
7024b8e80941Smrgvoid __indirect_glVertexAttrib4iv(GLuint index, const GLint * v)
7025b8e80941Smrg{
7026b8e80941Smrg    struct glx_context * const gc = __glXGetCurrentContext();
7027b8e80941Smrg    const GLuint cmdlen = 24;
7028b8e80941Smrgemit_header(gc->pc, X_GLrop_VertexAttrib4iv, cmdlen);
7029b8e80941Smrg(void) memcpy((void *)(gc->pc + 4), (void *)(&index), 4);
7030b8e80941Smrg(void) memcpy((void *)(gc->pc + 8), (void *)(v), 16);
7031b8e80941Smrggc->pc += cmdlen;
7032b8e80941Smrgif (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); }
7033848b8605Smrg}
7034848b8605Smrg
7035848b8605Smrg#define X_GLrop_VertexAttrib4sv 4192
7036b8e80941Smrgvoid __indirect_glVertexAttrib4s(GLuint index, GLshort x, GLshort y, GLshort z, GLshort w)
7037b8e80941Smrg{
7038b8e80941Smrg    struct glx_context * const gc = __glXGetCurrentContext();
7039b8e80941Smrg    const GLuint cmdlen = 16;
7040b8e80941Smrgemit_header(gc->pc, X_GLrop_VertexAttrib4sv, cmdlen);
7041b8e80941Smrg(void) memcpy((void *)(gc->pc + 4), (void *)(&index), 4);
7042b8e80941Smrg(void) memcpy((void *)(gc->pc + 8), (void *)(&x), 2);
7043b8e80941Smrg(void) memcpy((void *)(gc->pc + 10), (void *)(&y), 2);
7044b8e80941Smrg(void) memcpy((void *)(gc->pc + 12), (void *)(&z), 2);
7045b8e80941Smrg(void) memcpy((void *)(gc->pc + 14), (void *)(&w), 2);
7046b8e80941Smrggc->pc += cmdlen;
7047b8e80941Smrgif (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); }
7048848b8605Smrg}
7049848b8605Smrg
7050848b8605Smrg#define X_GLrop_VertexAttrib4sv 4192
7051b8e80941Smrgvoid __indirect_glVertexAttrib4sv(GLuint index, const GLshort * v)
7052b8e80941Smrg{
7053b8e80941Smrg    struct glx_context * const gc = __glXGetCurrentContext();
7054b8e80941Smrg    const GLuint cmdlen = 16;
7055b8e80941Smrgemit_header(gc->pc, X_GLrop_VertexAttrib4sv, cmdlen);
7056b8e80941Smrg(void) memcpy((void *)(gc->pc + 4), (void *)(&index), 4);
7057b8e80941Smrg(void) memcpy((void *)(gc->pc + 8), (void *)(v), 8);
7058b8e80941Smrggc->pc += cmdlen;
7059b8e80941Smrgif (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); }
7060848b8605Smrg}
7061848b8605Smrg
7062848b8605Smrg#define X_GLrop_VertexAttrib4ubv 4232
7063b8e80941Smrgvoid __indirect_glVertexAttrib4ubv(GLuint index, const GLubyte * v)
7064b8e80941Smrg{
7065b8e80941Smrg    struct glx_context * const gc = __glXGetCurrentContext();
7066b8e80941Smrg    const GLuint cmdlen = 12;
7067b8e80941Smrgemit_header(gc->pc, X_GLrop_VertexAttrib4ubv, cmdlen);
7068b8e80941Smrg(void) memcpy((void *)(gc->pc + 4), (void *)(&index), 4);
7069b8e80941Smrg(void) memcpy((void *)(gc->pc + 8), (void *)(v), 4);
7070b8e80941Smrggc->pc += cmdlen;
7071b8e80941Smrgif (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); }
7072848b8605Smrg}
7073848b8605Smrg
7074848b8605Smrg#define X_GLrop_VertexAttrib4uiv 4234
7075b8e80941Smrgvoid __indirect_glVertexAttrib4uiv(GLuint index, const GLuint * v)
7076b8e80941Smrg{
7077b8e80941Smrg    struct glx_context * const gc = __glXGetCurrentContext();
7078b8e80941Smrg    const GLuint cmdlen = 24;
7079b8e80941Smrgemit_header(gc->pc, X_GLrop_VertexAttrib4uiv, cmdlen);
7080b8e80941Smrg(void) memcpy((void *)(gc->pc + 4), (void *)(&index), 4);
7081b8e80941Smrg(void) memcpy((void *)(gc->pc + 8), (void *)(v), 16);
7082b8e80941Smrggc->pc += cmdlen;
7083b8e80941Smrgif (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); }
7084848b8605Smrg}
7085848b8605Smrg
7086848b8605Smrg#define X_GLrop_VertexAttrib4usv 4233
7087b8e80941Smrgvoid __indirect_glVertexAttrib4usv(GLuint index, const GLushort * v)
7088b8e80941Smrg{
7089b8e80941Smrg    struct glx_context * const gc = __glXGetCurrentContext();
7090b8e80941Smrg    const GLuint cmdlen = 16;
7091b8e80941Smrgemit_header(gc->pc, X_GLrop_VertexAttrib4usv, cmdlen);
7092b8e80941Smrg(void) memcpy((void *)(gc->pc + 4), (void *)(&index), 4);
7093b8e80941Smrg(void) memcpy((void *)(gc->pc + 8), (void *)(v), 8);
7094b8e80941Smrggc->pc += cmdlen;
7095b8e80941Smrgif (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); }
7096848b8605Smrg}
7097848b8605Smrg
7098848b8605Smrg#define X_GLrop_ClampColor 234
7099b8e80941Smrgvoid __indirect_glClampColor(GLenum target, GLenum clamp)
7100b8e80941Smrg{
7101b8e80941Smrg    struct glx_context * const gc = __glXGetCurrentContext();
7102b8e80941Smrg    const GLuint cmdlen = 12;
7103b8e80941Smrgemit_header(gc->pc, X_GLrop_ClampColor, cmdlen);
7104b8e80941Smrg(void) memcpy((void *)(gc->pc + 4), (void *)(&target), 4);
7105b8e80941Smrg(void) memcpy((void *)(gc->pc + 8), (void *)(&clamp), 4);
7106b8e80941Smrggc->pc += cmdlen;
7107b8e80941Smrgif (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); }
7108848b8605Smrg}
7109848b8605Smrg
7110848b8605Smrg#define X_GLrop_BindProgramARB 4180
7111b8e80941Smrgvoid __indirect_glBindProgramARB(GLenum target, GLuint program)
7112b8e80941Smrg{
7113b8e80941Smrg    struct glx_context * const gc = __glXGetCurrentContext();
7114b8e80941Smrg    const GLuint cmdlen = 12;
7115b8e80941Smrgemit_header(gc->pc, X_GLrop_BindProgramARB, cmdlen);
7116b8e80941Smrg(void) memcpy((void *)(gc->pc + 4), (void *)(&target), 4);
7117b8e80941Smrg(void) memcpy((void *)(gc->pc + 8), (void *)(&program), 4);
7118b8e80941Smrggc->pc += cmdlen;
7119b8e80941Smrgif (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); }
7120848b8605Smrg}
7121848b8605Smrg
7122848b8605Smrg#define X_GLvop_DeleteProgramsARB 1294
7123b8e80941Smrgvoid __indirect_glDeleteProgramsARB(GLsizei n, const GLuint * programs)
7124848b8605Smrg{
7125b8e80941Smrg    struct glx_context * const gc = __glXGetCurrentContext();
7126b8e80941Smrg    Display * const dpy = gc->currentDpy;
7127b8e80941Smrg    const GLuint cmdlen = 4 + safe_pad(safe_mul(n, 4));
7128b8e80941Smrg    if (0 + safe_pad(safe_mul(n, 4)) < 0) {
7129b8e80941Smrg        __glXSetError(gc, GL_INVALID_VALUE);
7130b8e80941Smrg        return;
7131b8e80941Smrg    }
7132848b8605Smrg    if (n < 0) {
7133848b8605Smrg        __glXSetError(gc, GL_INVALID_VALUE);
7134848b8605Smrg        return;
7135848b8605Smrg    }
7136848b8605Smrg    if (__builtin_expect((n >= 0) && (dpy != NULL), 1)) {
7137b8e80941Smrg        GLubyte const * pc = __glXSetupVendorRequest(gc, X_GLXVendorPrivate, X_GLvop_DeleteProgramsARB, cmdlen);
7138b8e80941Smrg(void) memcpy((void *)(pc + 0), (void *)(&n), 4);
7139b8e80941Smrg(void) memcpy((void *)(pc + 4), (void *)(programs), safe_mul(n, 4));
7140b8e80941Smrg        UnlockDisplay(dpy); SyncHandle();
7141848b8605Smrg    }
7142848b8605Smrg    return;
7143848b8605Smrg}
7144848b8605Smrg
7145848b8605Smrg#define X_GLvop_GenProgramsARB 1295
7146b8e80941Smrgvoid __indirect_glGenProgramsARB(GLsizei n, GLuint * programs)
7147848b8605Smrg{
7148b8e80941Smrg    struct glx_context * const gc = __glXGetCurrentContext();
7149b8e80941Smrg    Display * const dpy = gc->currentDpy;
7150b8e80941Smrg    const GLuint cmdlen = 4;
7151848b8605Smrg    if (n < 0) {
7152848b8605Smrg        __glXSetError(gc, GL_INVALID_VALUE);
7153848b8605Smrg        return;
7154848b8605Smrg    }
7155848b8605Smrg    if (__builtin_expect((n >= 0) && (dpy != NULL), 1)) {
7156b8e80941Smrg        GLubyte const * pc = __glXSetupVendorRequest(gc, X_GLXVendorPrivateWithReply, X_GLvop_GenProgramsARB, cmdlen);
7157b8e80941Smrg(void) memcpy((void *)(pc + 0), (void *)(&n), 4);
7158848b8605Smrg        (void) __glXReadReply(dpy, 4, programs, GL_TRUE);
7159b8e80941Smrg        UnlockDisplay(dpy); SyncHandle();
7160848b8605Smrg    }
7161848b8605Smrg    return;
7162848b8605Smrg}
7163848b8605Smrg
7164848b8605Smrg#define X_GLvop_GetProgramStringARB 1308
7165b8e80941Smrgvoid __indirect_glGetProgramStringARB(GLenum target, GLenum pname, GLvoid * string)
7166848b8605Smrg{
7167b8e80941Smrg    struct glx_context * const gc = __glXGetCurrentContext();
7168b8e80941Smrg    Display * const dpy = gc->currentDpy;
7169b8e80941Smrg    const GLuint cmdlen = 8;
7170848b8605Smrg    if (__builtin_expect(dpy != NULL, 1)) {
7171b8e80941Smrg        GLubyte const * pc = __glXSetupVendorRequest(gc, X_GLXVendorPrivateWithReply, X_GLvop_GetProgramStringARB, cmdlen);
7172b8e80941Smrg(void) memcpy((void *)(pc + 0), (void *)(&target), 4);
7173b8e80941Smrg(void) memcpy((void *)(pc + 4), (void *)(&pname), 4);
7174848b8605Smrg        (void) __glXReadReply(dpy, 1, string, GL_TRUE);
7175b8e80941Smrg        UnlockDisplay(dpy); SyncHandle();
7176848b8605Smrg    }
7177848b8605Smrg    return;
7178848b8605Smrg}
7179848b8605Smrg
7180848b8605Smrg#define X_GLvop_GetProgramivARB 1307
7181b8e80941Smrgvoid __indirect_glGetProgramivARB(GLenum target, GLenum pname, GLint * params)
7182848b8605Smrg{
7183b8e80941Smrg    struct glx_context * const gc = __glXGetCurrentContext();
7184b8e80941Smrg    Display * const dpy = gc->currentDpy;
7185b8e80941Smrg    const GLuint cmdlen = 8;
7186848b8605Smrg    if (__builtin_expect(dpy != NULL, 1)) {
7187b8e80941Smrg        GLubyte const * pc = __glXSetupVendorRequest(gc, X_GLXVendorPrivateWithReply, X_GLvop_GetProgramivARB, cmdlen);
7188b8e80941Smrg(void) memcpy((void *)(pc + 0), (void *)(&target), 4);
7189b8e80941Smrg(void) memcpy((void *)(pc + 4), (void *)(&pname), 4);
7190848b8605Smrg        (void) __glXReadReply(dpy, 4, params, GL_FALSE);
7191b8e80941Smrg        UnlockDisplay(dpy); SyncHandle();
7192848b8605Smrg    }
7193848b8605Smrg    return;
7194848b8605Smrg}
7195848b8605Smrg
7196848b8605Smrg#define X_GLvop_IsProgramARB 1304
7197b8e80941SmrgGLboolean __indirect_glIsProgramARB(GLuint program)
7198848b8605Smrg{
7199b8e80941Smrg    struct glx_context * const gc = __glXGetCurrentContext();
7200b8e80941Smrg    Display * const dpy = gc->currentDpy;
7201b8e80941Smrg    GLboolean retval = (GLboolean) 0;
7202b8e80941Smrg    const GLuint cmdlen = 4;
7203848b8605Smrg    if (__builtin_expect(dpy != NULL, 1)) {
7204b8e80941Smrg        GLubyte const * pc = __glXSetupVendorRequest(gc, X_GLXVendorPrivateWithReply, X_GLvop_IsProgramARB, cmdlen);
7205b8e80941Smrg(void) memcpy((void *)(pc + 0), (void *)(&program), 4);
7206848b8605Smrg        retval = (GLboolean) __glXReadReply(dpy, 0, NULL, GL_FALSE);
7207b8e80941Smrg        UnlockDisplay(dpy); SyncHandle();
7208848b8605Smrg    }
7209848b8605Smrg    return retval;
7210848b8605Smrg}
7211848b8605Smrg
7212848b8605Smrg#define X_GLrop_ProgramEnvParameter4dvARB 4185
7213b8e80941Smrgvoid __indirect_glProgramEnvParameter4dARB(GLenum target, GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w)
7214b8e80941Smrg{
7215b8e80941Smrg    struct glx_context * const gc = __glXGetCurrentContext();
7216b8e80941Smrg    const GLuint cmdlen = 44;
7217b8e80941Smrgemit_header(gc->pc, X_GLrop_ProgramEnvParameter4dvARB, cmdlen);
7218b8e80941Smrg(void) memcpy((void *)(gc->pc + 4), (void *)(&target), 4);
7219b8e80941Smrg(void) memcpy((void *)(gc->pc + 8), (void *)(&index), 4);
7220b8e80941Smrg(void) memcpy((void *)(gc->pc + 12), (void *)(&x), 8);
7221b8e80941Smrg(void) memcpy((void *)(gc->pc + 20), (void *)(&y), 8);
7222b8e80941Smrg(void) memcpy((void *)(gc->pc + 28), (void *)(&z), 8);
7223b8e80941Smrg(void) memcpy((void *)(gc->pc + 36), (void *)(&w), 8);
7224b8e80941Smrggc->pc += cmdlen;
7225b8e80941Smrgif (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); }
7226848b8605Smrg}
7227848b8605Smrg
7228848b8605Smrg#define X_GLrop_ProgramEnvParameter4dvARB 4185
7229b8e80941Smrgvoid __indirect_glProgramEnvParameter4dvARB(GLenum target, GLuint index, const GLdouble * params)
7230b8e80941Smrg{
7231b8e80941Smrg    struct glx_context * const gc = __glXGetCurrentContext();
7232b8e80941Smrg    const GLuint cmdlen = 44;
7233b8e80941Smrgemit_header(gc->pc, X_GLrop_ProgramEnvParameter4dvARB, cmdlen);
7234b8e80941Smrg(void) memcpy((void *)(gc->pc + 4), (void *)(&target), 4);
7235b8e80941Smrg(void) memcpy((void *)(gc->pc + 8), (void *)(&index), 4);
7236b8e80941Smrg(void) memcpy((void *)(gc->pc + 12), (void *)(params), 32);
7237b8e80941Smrggc->pc += cmdlen;
7238b8e80941Smrgif (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); }
7239848b8605Smrg}
7240848b8605Smrg
7241848b8605Smrg#define X_GLrop_ProgramEnvParameter4fvARB 4184
7242b8e80941Smrgvoid __indirect_glProgramEnvParameter4fARB(GLenum target, GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w)
7243b8e80941Smrg{
7244b8e80941Smrg    struct glx_context * const gc = __glXGetCurrentContext();
7245b8e80941Smrg    const GLuint cmdlen = 28;
7246b8e80941Smrgemit_header(gc->pc, X_GLrop_ProgramEnvParameter4fvARB, cmdlen);
7247b8e80941Smrg(void) memcpy((void *)(gc->pc + 4), (void *)(&target), 4);
7248b8e80941Smrg(void) memcpy((void *)(gc->pc + 8), (void *)(&index), 4);
7249b8e80941Smrg(void) memcpy((void *)(gc->pc + 12), (void *)(&x), 4);
7250b8e80941Smrg(void) memcpy((void *)(gc->pc + 16), (void *)(&y), 4);
7251b8e80941Smrg(void) memcpy((void *)(gc->pc + 20), (void *)(&z), 4);
7252b8e80941Smrg(void) memcpy((void *)(gc->pc + 24), (void *)(&w), 4);
7253b8e80941Smrggc->pc += cmdlen;
7254b8e80941Smrgif (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); }
7255848b8605Smrg}
7256848b8605Smrg
7257848b8605Smrg#define X_GLrop_ProgramEnvParameter4fvARB 4184
7258b8e80941Smrgvoid __indirect_glProgramEnvParameter4fvARB(GLenum target, GLuint index, const GLfloat * params)
7259b8e80941Smrg{
7260b8e80941Smrg    struct glx_context * const gc = __glXGetCurrentContext();
7261b8e80941Smrg    const GLuint cmdlen = 28;
7262b8e80941Smrgemit_header(gc->pc, X_GLrop_ProgramEnvParameter4fvARB, cmdlen);
7263b8e80941Smrg(void) memcpy((void *)(gc->pc + 4), (void *)(&target), 4);
7264b8e80941Smrg(void) memcpy((void *)(gc->pc + 8), (void *)(&index), 4);
7265b8e80941Smrg(void) memcpy((void *)(gc->pc + 12), (void *)(params), 16);
7266b8e80941Smrggc->pc += cmdlen;
7267b8e80941Smrgif (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); }
7268848b8605Smrg}
7269848b8605Smrg
7270848b8605Smrg#define X_GLrop_ProgramLocalParameter4dvARB 4216
7271b8e80941Smrgvoid __indirect_glProgramLocalParameter4dARB(GLenum target, GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w)
7272b8e80941Smrg{
7273b8e80941Smrg    struct glx_context * const gc = __glXGetCurrentContext();
7274b8e80941Smrg    const GLuint cmdlen = 44;
7275b8e80941Smrgemit_header(gc->pc, X_GLrop_ProgramLocalParameter4dvARB, cmdlen);
7276b8e80941Smrg(void) memcpy((void *)(gc->pc + 4), (void *)(&target), 4);
7277b8e80941Smrg(void) memcpy((void *)(gc->pc + 8), (void *)(&index), 4);
7278b8e80941Smrg(void) memcpy((void *)(gc->pc + 12), (void *)(&x), 8);
7279b8e80941Smrg(void) memcpy((void *)(gc->pc + 20), (void *)(&y), 8);
7280b8e80941Smrg(void) memcpy((void *)(gc->pc + 28), (void *)(&z), 8);
7281b8e80941Smrg(void) memcpy((void *)(gc->pc + 36), (void *)(&w), 8);
7282b8e80941Smrggc->pc += cmdlen;
7283b8e80941Smrgif (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); }
7284848b8605Smrg}
7285848b8605Smrg
7286848b8605Smrg#define X_GLrop_ProgramLocalParameter4dvARB 4216
7287b8e80941Smrgvoid __indirect_glProgramLocalParameter4dvARB(GLenum target, GLuint index, const GLdouble * params)
7288b8e80941Smrg{
7289b8e80941Smrg    struct glx_context * const gc = __glXGetCurrentContext();
7290b8e80941Smrg    const GLuint cmdlen = 44;
7291b8e80941Smrgemit_header(gc->pc, X_GLrop_ProgramLocalParameter4dvARB, cmdlen);
7292b8e80941Smrg(void) memcpy((void *)(gc->pc + 4), (void *)(&target), 4);
7293b8e80941Smrg(void) memcpy((void *)(gc->pc + 8), (void *)(&index), 4);
7294b8e80941Smrg(void) memcpy((void *)(gc->pc + 12), (void *)(params), 32);
7295b8e80941Smrggc->pc += cmdlen;
7296b8e80941Smrgif (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); }
7297848b8605Smrg}
7298848b8605Smrg
7299848b8605Smrg#define X_GLrop_ProgramLocalParameter4fvARB 4215
7300b8e80941Smrgvoid __indirect_glProgramLocalParameter4fARB(GLenum target, GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w)
7301b8e80941Smrg{
7302b8e80941Smrg    struct glx_context * const gc = __glXGetCurrentContext();
7303b8e80941Smrg    const GLuint cmdlen = 28;
7304b8e80941Smrgemit_header(gc->pc, X_GLrop_ProgramLocalParameter4fvARB, cmdlen);
7305b8e80941Smrg(void) memcpy((void *)(gc->pc + 4), (void *)(&target), 4);
7306b8e80941Smrg(void) memcpy((void *)(gc->pc + 8), (void *)(&index), 4);
7307b8e80941Smrg(void) memcpy((void *)(gc->pc + 12), (void *)(&x), 4);
7308b8e80941Smrg(void) memcpy((void *)(gc->pc + 16), (void *)(&y), 4);
7309b8e80941Smrg(void) memcpy((void *)(gc->pc + 20), (void *)(&z), 4);
7310b8e80941Smrg(void) memcpy((void *)(gc->pc + 24), (void *)(&w), 4);
7311b8e80941Smrggc->pc += cmdlen;
7312b8e80941Smrgif (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); }
7313848b8605Smrg}
7314848b8605Smrg
7315848b8605Smrg#define X_GLrop_ProgramLocalParameter4fvARB 4215
7316b8e80941Smrgvoid __indirect_glProgramLocalParameter4fvARB(GLenum target, GLuint index, const GLfloat * params)
7317b8e80941Smrg{
7318b8e80941Smrg    struct glx_context * const gc = __glXGetCurrentContext();
7319b8e80941Smrg    const GLuint cmdlen = 28;
7320b8e80941Smrgemit_header(gc->pc, X_GLrop_ProgramLocalParameter4fvARB, cmdlen);
7321b8e80941Smrg(void) memcpy((void *)(gc->pc + 4), (void *)(&target), 4);
7322b8e80941Smrg(void) memcpy((void *)(gc->pc + 8), (void *)(&index), 4);
7323b8e80941Smrg(void) memcpy((void *)(gc->pc + 12), (void *)(params), 16);
7324b8e80941Smrggc->pc += cmdlen;
7325b8e80941Smrgif (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); }
7326848b8605Smrg}
7327848b8605Smrg
7328848b8605Smrg#define X_GLrop_ProgramStringARB 4217
7329b8e80941Smrgvoid __indirect_glProgramStringARB(GLenum target, GLenum format, GLsizei len, const GLvoid * string)
7330848b8605Smrg{
7331b8e80941Smrg    struct glx_context * const gc = __glXGetCurrentContext();
7332b8e80941Smrg    const GLuint cmdlen = 16 + safe_pad(len);
7333b8e80941Smrg    if (0 + safe_pad(len) < 0) {
7334b8e80941Smrg        __glXSetError(gc, GL_INVALID_VALUE);
7335b8e80941Smrg        return;
7336b8e80941Smrg    }
7337848b8605Smrg    if (len < 0) {
7338848b8605Smrg        __glXSetError(gc, GL_INVALID_VALUE);
7339848b8605Smrg        return;
7340848b8605Smrg    }
7341848b8605Smrg    if (__builtin_expect((len >= 0) && (gc->currentDpy != NULL), 1)) {
7342b8e80941Smrgif (cmdlen <= gc->maxSmallRenderCommandSize) {
7343b8e80941Smrg    if ( (gc->pc + cmdlen) > gc->bufEnd ) {
7344b8e80941Smrg        (void) __glXFlushRenderBuffer(gc, gc->pc);
7345b8e80941Smrg    }
7346b8e80941Smrgemit_header(gc->pc, X_GLrop_ProgramStringARB, cmdlen);
7347b8e80941Smrg(void) memcpy((void *)(gc->pc + 4), (void *)(&target), 4);
7348b8e80941Smrg(void) memcpy((void *)(gc->pc + 8), (void *)(&format), 4);
7349b8e80941Smrg(void) memcpy((void *)(gc->pc + 12), (void *)(&len), 4);
7350b8e80941Smrg(void) memcpy((void *)(gc->pc + 16), (void *)(string), len);
7351b8e80941Smrggc->pc += cmdlen;
7352b8e80941Smrgif (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); }
7353b8e80941Smrg}
7354b8e80941Smrgelse {
7355b8e80941Smrgconst GLint op = X_GLrop_ProgramStringARB;
7356b8e80941Smrgconst GLuint cmdlenLarge = cmdlen + 4;
7357b8e80941SmrgGLubyte * const pc = __glXFlushRenderBuffer(gc, gc->pc);
7358b8e80941Smrg(void) memcpy((void *)(pc + 0), (void *)(&cmdlenLarge), 4);
7359b8e80941Smrg(void) memcpy((void *)(pc + 4), (void *)(&op), 4);
7360b8e80941Smrg(void) memcpy((void *)(pc + 8), (void *)(&target), 4);
7361b8e80941Smrg(void) memcpy((void *)(pc + 12), (void *)(&format), 4);
7362b8e80941Smrg(void) memcpy((void *)(pc + 16), (void *)(&len), 4);
7363b8e80941Smrg    __glXSendLargeCommand(gc, pc, 20, string, len);
7364b8e80941Smrg}
7365848b8605Smrg    }
7366848b8605Smrg}
7367848b8605Smrg
7368848b8605Smrg#define X_GLrop_VertexAttrib1fvARB 4193
7369b8e80941Smrgvoid __indirect_glVertexAttrib1fARB(GLuint index, GLfloat x)
7370b8e80941Smrg{
7371b8e80941Smrg    struct glx_context * const gc = __glXGetCurrentContext();
7372b8e80941Smrg    const GLuint cmdlen = 12;
7373b8e80941Smrgemit_header(gc->pc, X_GLrop_VertexAttrib1fvARB, cmdlen);
7374b8e80941Smrg(void) memcpy((void *)(gc->pc + 4), (void *)(&index), 4);
7375b8e80941Smrg(void) memcpy((void *)(gc->pc + 8), (void *)(&x), 4);
7376b8e80941Smrggc->pc += cmdlen;
7377b8e80941Smrgif (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); }
7378848b8605Smrg}
7379848b8605Smrg
7380848b8605Smrg#define X_GLrop_VertexAttrib1fvARB 4193
7381b8e80941Smrgvoid __indirect_glVertexAttrib1fvARB(GLuint index, const GLfloat * v)
7382b8e80941Smrg{
7383b8e80941Smrg    struct glx_context * const gc = __glXGetCurrentContext();
7384b8e80941Smrg    const GLuint cmdlen = 12;
7385b8e80941Smrgemit_header(gc->pc, X_GLrop_VertexAttrib1fvARB, cmdlen);
7386b8e80941Smrg(void) memcpy((void *)(gc->pc + 4), (void *)(&index), 4);
7387b8e80941Smrg(void) memcpy((void *)(gc->pc + 8), (void *)(v), 4);
7388b8e80941Smrggc->pc += cmdlen;
7389b8e80941Smrgif (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); }
7390848b8605Smrg}
7391848b8605Smrg
7392848b8605Smrg#define X_GLrop_VertexAttrib2fvARB 4194
7393b8e80941Smrgvoid __indirect_glVertexAttrib2fARB(GLuint index, GLfloat x, GLfloat y)
7394b8e80941Smrg{
7395b8e80941Smrg    struct glx_context * const gc = __glXGetCurrentContext();
7396b8e80941Smrg    const GLuint cmdlen = 16;
7397b8e80941Smrgemit_header(gc->pc, X_GLrop_VertexAttrib2fvARB, cmdlen);
7398b8e80941Smrg(void) memcpy((void *)(gc->pc + 4), (void *)(&index), 4);
7399b8e80941Smrg(void) memcpy((void *)(gc->pc + 8), (void *)(&x), 4);
7400b8e80941Smrg(void) memcpy((void *)(gc->pc + 12), (void *)(&y), 4);
7401b8e80941Smrggc->pc += cmdlen;
7402b8e80941Smrgif (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); }
7403848b8605Smrg}
7404848b8605Smrg
7405848b8605Smrg#define X_GLrop_VertexAttrib2fvARB 4194
7406b8e80941Smrgvoid __indirect_glVertexAttrib2fvARB(GLuint index, const GLfloat * v)
7407b8e80941Smrg{
7408b8e80941Smrg    struct glx_context * const gc = __glXGetCurrentContext();
7409b8e80941Smrg    const GLuint cmdlen = 16;
7410b8e80941Smrgemit_header(gc->pc, X_GLrop_VertexAttrib2fvARB, cmdlen);
7411b8e80941Smrg(void) memcpy((void *)(gc->pc + 4), (void *)(&index), 4);
7412b8e80941Smrg(void) memcpy((void *)(gc->pc + 8), (void *)(v), 8);
7413b8e80941Smrggc->pc += cmdlen;
7414b8e80941Smrgif (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); }
7415848b8605Smrg}
7416848b8605Smrg
7417848b8605Smrg#define X_GLrop_VertexAttrib3fvARB 4195
7418b8e80941Smrgvoid __indirect_glVertexAttrib3fARB(GLuint index, GLfloat x, GLfloat y, GLfloat z)
7419b8e80941Smrg{
7420b8e80941Smrg    struct glx_context * const gc = __glXGetCurrentContext();
7421b8e80941Smrg    const GLuint cmdlen = 20;
7422b8e80941Smrgemit_header(gc->pc, X_GLrop_VertexAttrib3fvARB, cmdlen);
7423b8e80941Smrg(void) memcpy((void *)(gc->pc + 4), (void *)(&index), 4);
7424b8e80941Smrg(void) memcpy((void *)(gc->pc + 8), (void *)(&x), 4);
7425b8e80941Smrg(void) memcpy((void *)(gc->pc + 12), (void *)(&y), 4);
7426b8e80941Smrg(void) memcpy((void *)(gc->pc + 16), (void *)(&z), 4);
7427b8e80941Smrggc->pc += cmdlen;
7428b8e80941Smrgif (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); }
7429848b8605Smrg}
7430848b8605Smrg
7431848b8605Smrg#define X_GLrop_VertexAttrib3fvARB 4195
7432b8e80941Smrgvoid __indirect_glVertexAttrib3fvARB(GLuint index, const GLfloat * v)
7433b8e80941Smrg{
7434b8e80941Smrg    struct glx_context * const gc = __glXGetCurrentContext();
7435b8e80941Smrg    const GLuint cmdlen = 20;
7436b8e80941Smrgemit_header(gc->pc, X_GLrop_VertexAttrib3fvARB, cmdlen);
7437b8e80941Smrg(void) memcpy((void *)(gc->pc + 4), (void *)(&index), 4);
7438b8e80941Smrg(void) memcpy((void *)(gc->pc + 8), (void *)(v), 12);
7439b8e80941Smrggc->pc += cmdlen;
7440b8e80941Smrgif (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); }
7441848b8605Smrg}
7442848b8605Smrg
7443848b8605Smrg#define X_GLrop_VertexAttrib4fvARB 4196
7444b8e80941Smrgvoid __indirect_glVertexAttrib4fARB(GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w)
7445b8e80941Smrg{
7446b8e80941Smrg    struct glx_context * const gc = __glXGetCurrentContext();
7447b8e80941Smrg    const GLuint cmdlen = 24;
7448b8e80941Smrgemit_header(gc->pc, X_GLrop_VertexAttrib4fvARB, cmdlen);
7449b8e80941Smrg(void) memcpy((void *)(gc->pc + 4), (void *)(&index), 4);
7450b8e80941Smrg(void) memcpy((void *)(gc->pc + 8), (void *)(&x), 4);
7451b8e80941Smrg(void) memcpy((void *)(gc->pc + 12), (void *)(&y), 4);
7452b8e80941Smrg(void) memcpy((void *)(gc->pc + 16), (void *)(&z), 4);
7453b8e80941Smrg(void) memcpy((void *)(gc->pc + 20), (void *)(&w), 4);
7454b8e80941Smrggc->pc += cmdlen;
7455b8e80941Smrgif (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); }
7456848b8605Smrg}
7457848b8605Smrg
7458848b8605Smrg#define X_GLrop_VertexAttrib4fvARB 4196
7459b8e80941Smrgvoid __indirect_glVertexAttrib4fvARB(GLuint index, const GLfloat * v)
7460b8e80941Smrg{
7461b8e80941Smrg    struct glx_context * const gc = __glXGetCurrentContext();
7462b8e80941Smrg    const GLuint cmdlen = 24;
7463b8e80941Smrgemit_header(gc->pc, X_GLrop_VertexAttrib4fvARB, cmdlen);
7464b8e80941Smrg(void) memcpy((void *)(gc->pc + 4), (void *)(&index), 4);
7465b8e80941Smrg(void) memcpy((void *)(gc->pc + 8), (void *)(v), 16);
7466b8e80941Smrggc->pc += cmdlen;
7467b8e80941Smrgif (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); }
7468848b8605Smrg}
7469848b8605Smrg
7470848b8605Smrg#define X_GLrop_BindFramebuffer 236
7471b8e80941Smrgvoid __indirect_glBindFramebuffer(GLenum target, GLuint framebuffer)
7472b8e80941Smrg{
7473b8e80941Smrg    struct glx_context * const gc = __glXGetCurrentContext();
7474b8e80941Smrg    const GLuint cmdlen = 12;
7475b8e80941Smrgemit_header(gc->pc, X_GLrop_BindFramebuffer, cmdlen);
7476b8e80941Smrg(void) memcpy((void *)(gc->pc + 4), (void *)(&target), 4);
7477b8e80941Smrg(void) memcpy((void *)(gc->pc + 8), (void *)(&framebuffer), 4);
7478b8e80941Smrggc->pc += cmdlen;
7479b8e80941Smrgif (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); }
7480848b8605Smrg}
7481848b8605Smrg
7482848b8605Smrg#define X_GLrop_BindRenderbuffer 235
7483b8e80941Smrgvoid __indirect_glBindRenderbuffer(GLenum target, GLuint renderbuffer)
7484b8e80941Smrg{
7485b8e80941Smrg    struct glx_context * const gc = __glXGetCurrentContext();
7486b8e80941Smrg    const GLuint cmdlen = 12;
7487b8e80941Smrgemit_header(gc->pc, X_GLrop_BindRenderbuffer, cmdlen);
7488b8e80941Smrg(void) memcpy((void *)(gc->pc + 4), (void *)(&target), 4);
7489b8e80941Smrg(void) memcpy((void *)(gc->pc + 8), (void *)(&renderbuffer), 4);
7490b8e80941Smrggc->pc += cmdlen;
7491b8e80941Smrgif (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); }
7492848b8605Smrg}
7493848b8605Smrg
7494848b8605Smrg#define X_GLrop_BlitFramebuffer 4330
7495b8e80941Smrgvoid __indirect_glBlitFramebuffer(GLint srcX0, GLint srcY0, GLint srcX1, GLint srcY1, GLint dstX0, GLint dstY0, GLint dstX1, GLint dstY1, GLbitfield mask, GLenum filter)
7496b8e80941Smrg{
7497b8e80941Smrg    struct glx_context * const gc = __glXGetCurrentContext();
7498b8e80941Smrg    const GLuint cmdlen = 44;
7499b8e80941Smrgemit_header(gc->pc, X_GLrop_BlitFramebuffer, cmdlen);
7500b8e80941Smrg(void) memcpy((void *)(gc->pc + 4), (void *)(&srcX0), 4);
7501b8e80941Smrg(void) memcpy((void *)(gc->pc + 8), (void *)(&srcY0), 4);
7502b8e80941Smrg(void) memcpy((void *)(gc->pc + 12), (void *)(&srcX1), 4);
7503b8e80941Smrg(void) memcpy((void *)(gc->pc + 16), (void *)(&srcY1), 4);
7504b8e80941Smrg(void) memcpy((void *)(gc->pc + 20), (void *)(&dstX0), 4);
7505b8e80941Smrg(void) memcpy((void *)(gc->pc + 24), (void *)(&dstY0), 4);
7506b8e80941Smrg(void) memcpy((void *)(gc->pc + 28), (void *)(&dstX1), 4);
7507b8e80941Smrg(void) memcpy((void *)(gc->pc + 32), (void *)(&dstY1), 4);
7508b8e80941Smrg(void) memcpy((void *)(gc->pc + 36), (void *)(&mask), 4);
7509b8e80941Smrg(void) memcpy((void *)(gc->pc + 40), (void *)(&filter), 4);
7510b8e80941Smrggc->pc += cmdlen;
7511b8e80941Smrgif (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); }
7512848b8605Smrg}
7513848b8605Smrg
7514848b8605Smrg#define X_GLvop_CheckFramebufferStatus 1427
7515b8e80941SmrgGLenum __indirect_glCheckFramebufferStatus(GLenum target)
7516848b8605Smrg{
7517b8e80941Smrg    struct glx_context * const gc = __glXGetCurrentContext();
7518b8e80941Smrg    Display * const dpy = gc->currentDpy;
7519b8e80941Smrg    GLenum retval = (GLenum) 0;
7520b8e80941Smrg    const GLuint cmdlen = 4;
7521848b8605Smrg    if (__builtin_expect(dpy != NULL, 1)) {
7522b8e80941Smrg        GLubyte const * pc = __glXSetupVendorRequest(gc, X_GLXVendorPrivateWithReply, X_GLvop_CheckFramebufferStatus, cmdlen);
7523b8e80941Smrg(void) memcpy((void *)(pc + 0), (void *)(&target), 4);
7524848b8605Smrg        retval = (GLenum) __glXReadReply(dpy, 0, NULL, GL_FALSE);
7525b8e80941Smrg        UnlockDisplay(dpy); SyncHandle();
7526848b8605Smrg    }
7527848b8605Smrg    return retval;
7528848b8605Smrg}
7529848b8605Smrg
7530848b8605Smrg#define X_GLrop_DeleteFramebuffers 4320
7531b8e80941Smrgvoid __indirect_glDeleteFramebuffers(GLsizei n, const GLuint * framebuffers)
7532848b8605Smrg{
7533b8e80941Smrg    struct glx_context * const gc = __glXGetCurrentContext();
7534b8e80941Smrg    const GLuint cmdlen = 8 + safe_pad(safe_mul(n, 4));
7535b8e80941Smrg    if (0 + safe_pad(safe_mul(n, 4)) < 0) {
7536b8e80941Smrg        __glXSetError(gc, GL_INVALID_VALUE);
7537b8e80941Smrg        return;
7538b8e80941Smrg    }
7539848b8605Smrg    if (n < 0) {
7540848b8605Smrg        __glXSetError(gc, GL_INVALID_VALUE);
7541848b8605Smrg        return;
7542848b8605Smrg    }
7543848b8605Smrg    if (__builtin_expect(n >= 0, 1)) {
7544b8e80941Smrgemit_header(gc->pc, X_GLrop_DeleteFramebuffers, cmdlen);
7545b8e80941Smrg(void) memcpy((void *)(gc->pc + 4), (void *)(&n), 4);
7546b8e80941Smrg(void) memcpy((void *)(gc->pc + 8), (void *)(framebuffers), safe_mul(n, 4));
7547b8e80941Smrggc->pc += cmdlen;
7548b8e80941Smrgif (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); }
7549848b8605Smrg    }
7550848b8605Smrg}
7551848b8605Smrg
7552848b8605Smrg#define X_GLrop_DeleteRenderbuffers 4317
7553b8e80941Smrgvoid __indirect_glDeleteRenderbuffers(GLsizei n, const GLuint * renderbuffers)
7554848b8605Smrg{
7555b8e80941Smrg    struct glx_context * const gc = __glXGetCurrentContext();
7556b8e80941Smrg    const GLuint cmdlen = 8 + safe_pad(safe_mul(n, 4));
7557b8e80941Smrg    if (0 + safe_pad(safe_mul(n, 4)) < 0) {
7558b8e80941Smrg        __glXSetError(gc, GL_INVALID_VALUE);
7559b8e80941Smrg        return;
7560b8e80941Smrg    }
7561848b8605Smrg    if (n < 0) {
7562848b8605Smrg        __glXSetError(gc, GL_INVALID_VALUE);
7563848b8605Smrg        return;
7564848b8605Smrg    }
7565848b8605Smrg    if (__builtin_expect(n >= 0, 1)) {
7566b8e80941Smrgemit_header(gc->pc, X_GLrop_DeleteRenderbuffers, cmdlen);
7567b8e80941Smrg(void) memcpy((void *)(gc->pc + 4), (void *)(&n), 4);
7568b8e80941Smrg(void) memcpy((void *)(gc->pc + 8), (void *)(renderbuffers), safe_mul(n, 4));
7569b8e80941Smrggc->pc += cmdlen;
7570b8e80941Smrgif (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); }
7571848b8605Smrg    }
7572848b8605Smrg}
7573848b8605Smrg
7574848b8605Smrg#define X_GLrop_FramebufferRenderbuffer 4324
7575b8e80941Smrgvoid __indirect_glFramebufferRenderbuffer(GLenum target, GLenum attachment, GLenum renderbuffertarget, GLuint renderbuffer)
7576b8e80941Smrg{
7577b8e80941Smrg    struct glx_context * const gc = __glXGetCurrentContext();
7578b8e80941Smrg    const GLuint cmdlen = 20;
7579b8e80941Smrgemit_header(gc->pc, X_GLrop_FramebufferRenderbuffer, cmdlen);
7580b8e80941Smrg(void) memcpy((void *)(gc->pc + 4), (void *)(&target), 4);
7581b8e80941Smrg(void) memcpy((void *)(gc->pc + 8), (void *)(&attachment), 4);
7582b8e80941Smrg(void) memcpy((void *)(gc->pc + 12), (void *)(&renderbuffertarget), 4);
7583b8e80941Smrg(void) memcpy((void *)(gc->pc + 16), (void *)(&renderbuffer), 4);
7584b8e80941Smrggc->pc += cmdlen;
7585b8e80941Smrgif (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); }
7586848b8605Smrg}
7587848b8605Smrg
7588848b8605Smrg#define X_GLrop_FramebufferTexture1D 4321
7589b8e80941Smrgvoid __indirect_glFramebufferTexture1D(GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level)
7590b8e80941Smrg{
7591b8e80941Smrg    struct glx_context * const gc = __glXGetCurrentContext();
7592b8e80941Smrg    const GLuint cmdlen = 24;
7593b8e80941Smrgemit_header(gc->pc, X_GLrop_FramebufferTexture1D, cmdlen);
7594b8e80941Smrg(void) memcpy((void *)(gc->pc + 4), (void *)(&target), 4);
7595b8e80941Smrg(void) memcpy((void *)(gc->pc + 8), (void *)(&attachment), 4);
7596b8e80941Smrg(void) memcpy((void *)(gc->pc + 12), (void *)(&textarget), 4);
7597b8e80941Smrg(void) memcpy((void *)(gc->pc + 16), (void *)(&texture), 4);
7598b8e80941Smrg(void) memcpy((void *)(gc->pc + 20), (void *)(&level), 4);
7599b8e80941Smrggc->pc += cmdlen;
7600b8e80941Smrgif (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); }
7601848b8605Smrg}
7602848b8605Smrg
7603848b8605Smrg#define X_GLrop_FramebufferTexture2D 4322
7604b8e80941Smrgvoid __indirect_glFramebufferTexture2D(GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level)
7605b8e80941Smrg{
7606b8e80941Smrg    struct glx_context * const gc = __glXGetCurrentContext();
7607b8e80941Smrg    const GLuint cmdlen = 24;
7608b8e80941Smrgemit_header(gc->pc, X_GLrop_FramebufferTexture2D, cmdlen);
7609b8e80941Smrg(void) memcpy((void *)(gc->pc + 4), (void *)(&target), 4);
7610b8e80941Smrg(void) memcpy((void *)(gc->pc + 8), (void *)(&attachment), 4);
7611b8e80941Smrg(void) memcpy((void *)(gc->pc + 12), (void *)(&textarget), 4);
7612b8e80941Smrg(void) memcpy((void *)(gc->pc + 16), (void *)(&texture), 4);
7613b8e80941Smrg(void) memcpy((void *)(gc->pc + 20), (void *)(&level), 4);
7614b8e80941Smrggc->pc += cmdlen;
7615b8e80941Smrgif (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); }
7616848b8605Smrg}
7617848b8605Smrg
7618848b8605Smrg#define X_GLrop_FramebufferTexture3D 4323
7619b8e80941Smrgvoid __indirect_glFramebufferTexture3D(GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level, GLint layer)
7620b8e80941Smrg{
7621b8e80941Smrg    struct glx_context * const gc = __glXGetCurrentContext();
7622b8e80941Smrg    const GLuint cmdlen = 28;
7623b8e80941Smrgemit_header(gc->pc, X_GLrop_FramebufferTexture3D, cmdlen);
7624b8e80941Smrg(void) memcpy((void *)(gc->pc + 4), (void *)(&target), 4);
7625b8e80941Smrg(void) memcpy((void *)(gc->pc + 8), (void *)(&attachment), 4);
7626b8e80941Smrg(void) memcpy((void *)(gc->pc + 12), (void *)(&textarget), 4);
7627b8e80941Smrg(void) memcpy((void *)(gc->pc + 16), (void *)(&texture), 4);
7628b8e80941Smrg(void) memcpy((void *)(gc->pc + 20), (void *)(&level), 4);
7629b8e80941Smrg(void) memcpy((void *)(gc->pc + 24), (void *)(&layer), 4);
7630b8e80941Smrggc->pc += cmdlen;
7631b8e80941Smrgif (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); }
7632848b8605Smrg}
7633848b8605Smrg
7634848b8605Smrg#define X_GLrop_FramebufferTextureLayer 237
7635b8e80941Smrgvoid __indirect_glFramebufferTextureLayer(GLenum target, GLenum attachment, GLuint texture, GLint level, GLint layer)
7636b8e80941Smrg{
7637b8e80941Smrg    struct glx_context * const gc = __glXGetCurrentContext();
7638b8e80941Smrg    const GLuint cmdlen = 24;
7639b8e80941Smrgemit_header(gc->pc, X_GLrop_FramebufferTextureLayer, cmdlen);
7640b8e80941Smrg(void) memcpy((void *)(gc->pc + 4), (void *)(&target), 4);
7641b8e80941Smrg(void) memcpy((void *)(gc->pc + 8), (void *)(&attachment), 4);
7642b8e80941Smrg(void) memcpy((void *)(gc->pc + 12), (void *)(&texture), 4);
7643b8e80941Smrg(void) memcpy((void *)(gc->pc + 16), (void *)(&level), 4);
7644b8e80941Smrg(void) memcpy((void *)(gc->pc + 20), (void *)(&layer), 4);
7645b8e80941Smrggc->pc += cmdlen;
7646b8e80941Smrgif (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); }
7647848b8605Smrg}
7648848b8605Smrg
7649848b8605Smrg#define X_GLvop_GenFramebuffers 1426
7650b8e80941Smrgvoid __indirect_glGenFramebuffers(GLsizei n, GLuint * framebuffers)
7651848b8605Smrg{
7652b8e80941Smrg    struct glx_context * const gc = __glXGetCurrentContext();
7653b8e80941Smrg    Display * const dpy = gc->currentDpy;
7654b8e80941Smrg    const GLuint cmdlen = 4;
7655848b8605Smrg    if (n < 0) {
7656848b8605Smrg        __glXSetError(gc, GL_INVALID_VALUE);
7657848b8605Smrg        return;
7658848b8605Smrg    }
7659848b8605Smrg    if (__builtin_expect((n >= 0) && (dpy != NULL), 1)) {
7660b8e80941Smrg        GLubyte const * pc = __glXSetupVendorRequest(gc, X_GLXVendorPrivateWithReply, X_GLvop_GenFramebuffers, cmdlen);
7661b8e80941Smrg(void) memcpy((void *)(pc + 0), (void *)(&n), 4);
7662848b8605Smrg        (void) __glXReadReply(dpy, 4, framebuffers, GL_TRUE);
7663b8e80941Smrg        UnlockDisplay(dpy); SyncHandle();
7664848b8605Smrg    }
7665848b8605Smrg    return;
7666848b8605Smrg}
7667848b8605Smrg
7668848b8605Smrg#define X_GLvop_GenRenderbuffers 1423
7669b8e80941Smrgvoid __indirect_glGenRenderbuffers(GLsizei n, GLuint * renderbuffers)
7670848b8605Smrg{
7671b8e80941Smrg    struct glx_context * const gc = __glXGetCurrentContext();
7672b8e80941Smrg    Display * const dpy = gc->currentDpy;
7673b8e80941Smrg    const GLuint cmdlen = 4;
7674848b8605Smrg    if (n < 0) {
7675848b8605Smrg        __glXSetError(gc, GL_INVALID_VALUE);
7676848b8605Smrg        return;
7677848b8605Smrg    }
7678848b8605Smrg    if (__builtin_expect((n >= 0) && (dpy != NULL), 1)) {
7679b8e80941Smrg        GLubyte const * pc = __glXSetupVendorRequest(gc, X_GLXVendorPrivateWithReply, X_GLvop_GenRenderbuffers, cmdlen);
7680b8e80941Smrg(void) memcpy((void *)(pc + 0), (void *)(&n), 4);
7681848b8605Smrg        (void) __glXReadReply(dpy, 4, renderbuffers, GL_TRUE);
7682b8e80941Smrg        UnlockDisplay(dpy); SyncHandle();
7683848b8605Smrg    }
7684848b8605Smrg    return;
7685848b8605Smrg}
7686848b8605Smrg
7687848b8605Smrg#define X_GLrop_GenerateMipmap 4325
7688b8e80941Smrgvoid __indirect_glGenerateMipmap(GLenum target)
7689848b8605Smrg{
7690b8e80941Smrg    struct glx_context * const gc = __glXGetCurrentContext();
7691b8e80941Smrg    const GLuint cmdlen = 8;
7692b8e80941Smrgemit_header(gc->pc, X_GLrop_GenerateMipmap, cmdlen);
7693b8e80941Smrg(void) memcpy((void *)(gc->pc + 4), (void *)(&target), 4);
7694b8e80941Smrggc->pc += cmdlen;
7695b8e80941Smrgif (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); }
7696848b8605Smrg}
7697848b8605Smrg
7698848b8605Smrg#define X_GLvop_GetFramebufferAttachmentParameteriv 1428
7699b8e80941Smrgvoid __indirect_glGetFramebufferAttachmentParameteriv(GLenum target, GLenum attachment, GLenum pname, GLint * params)
7700848b8605Smrg{
7701b8e80941Smrg    struct glx_context * const gc = __glXGetCurrentContext();
7702b8e80941Smrg    Display * const dpy = gc->currentDpy;
7703b8e80941Smrg    const GLuint cmdlen = 12;
7704848b8605Smrg    if (__builtin_expect(dpy != NULL, 1)) {
7705b8e80941Smrg        GLubyte const * pc = __glXSetupVendorRequest(gc, X_GLXVendorPrivateWithReply, X_GLvop_GetFramebufferAttachmentParameteriv, cmdlen);
7706b8e80941Smrg(void) memcpy((void *)(pc + 0), (void *)(&target), 4);
7707b8e80941Smrg(void) memcpy((void *)(pc + 4), (void *)(&attachment), 4);
7708b8e80941Smrg(void) memcpy((void *)(pc + 8), (void *)(&pname), 4);
7709848b8605Smrg        (void) __glXReadReply(dpy, 4, params, GL_FALSE);
7710b8e80941Smrg        UnlockDisplay(dpy); SyncHandle();
7711848b8605Smrg    }
7712848b8605Smrg    return;
7713848b8605Smrg}
7714848b8605Smrg
7715848b8605Smrg#define X_GLvop_GetRenderbufferParameteriv 1424
7716b8e80941Smrgvoid __indirect_glGetRenderbufferParameteriv(GLenum target, GLenum pname, GLint * params)
7717848b8605Smrg{
7718b8e80941Smrg    struct glx_context * const gc = __glXGetCurrentContext();
7719b8e80941Smrg    Display * const dpy = gc->currentDpy;
7720b8e80941Smrg    const GLuint cmdlen = 8;
7721848b8605Smrg    if (__builtin_expect(dpy != NULL, 1)) {
7722b8e80941Smrg        GLubyte const * pc = __glXSetupVendorRequest(gc, X_GLXVendorPrivateWithReply, X_GLvop_GetRenderbufferParameteriv, cmdlen);
7723b8e80941Smrg(void) memcpy((void *)(pc + 0), (void *)(&target), 4);
7724b8e80941Smrg(void) memcpy((void *)(pc + 4), (void *)(&pname), 4);
7725848b8605Smrg        (void) __glXReadReply(dpy, 4, params, GL_FALSE);
7726b8e80941Smrg        UnlockDisplay(dpy); SyncHandle();
7727848b8605Smrg    }
7728848b8605Smrg    return;
7729848b8605Smrg}
7730848b8605Smrg
7731848b8605Smrg#define X_GLvop_IsFramebuffer 1425
7732b8e80941SmrgGLboolean __indirect_glIsFramebuffer(GLuint framebuffer)
7733848b8605Smrg{
7734b8e80941Smrg    struct glx_context * const gc = __glXGetCurrentContext();
7735b8e80941Smrg    Display * const dpy = gc->currentDpy;
7736b8e80941Smrg    GLboolean retval = (GLboolean) 0;
7737b8e80941Smrg    const GLuint cmdlen = 4;
7738848b8605Smrg    if (__builtin_expect(dpy != NULL, 1)) {
7739b8e80941Smrg        GLubyte const * pc = __glXSetupVendorRequest(gc, X_GLXVendorPrivateWithReply, X_GLvop_IsFramebuffer, cmdlen);
7740b8e80941Smrg(void) memcpy((void *)(pc + 0), (void *)(&framebuffer), 4);
7741848b8605Smrg        retval = (GLboolean) __glXReadReply(dpy, 0, NULL, GL_FALSE);
7742b8e80941Smrg        UnlockDisplay(dpy); SyncHandle();
7743848b8605Smrg    }
7744848b8605Smrg    return retval;
7745848b8605Smrg}
7746848b8605Smrg
7747848b8605Smrg#define X_GLvop_IsRenderbuffer 1422
7748b8e80941SmrgGLboolean __indirect_glIsRenderbuffer(GLuint renderbuffer)
7749848b8605Smrg{
7750b8e80941Smrg    struct glx_context * const gc = __glXGetCurrentContext();
7751b8e80941Smrg    Display * const dpy = gc->currentDpy;
7752b8e80941Smrg    GLboolean retval = (GLboolean) 0;
7753b8e80941Smrg    const GLuint cmdlen = 4;
7754848b8605Smrg    if (__builtin_expect(dpy != NULL, 1)) {
7755b8e80941Smrg        GLubyte const * pc = __glXSetupVendorRequest(gc, X_GLXVendorPrivateWithReply, X_GLvop_IsRenderbuffer, cmdlen);
7756b8e80941Smrg(void) memcpy((void *)(pc + 0), (void *)(&renderbuffer), 4);
7757848b8605Smrg        retval = (GLboolean) __glXReadReply(dpy, 0, NULL, GL_FALSE);
7758b8e80941Smrg        UnlockDisplay(dpy); SyncHandle();
7759848b8605Smrg    }
7760848b8605Smrg    return retval;
7761848b8605Smrg}
7762848b8605Smrg
7763848b8605Smrg#define X_GLrop_RenderbufferStorage 4318
7764b8e80941Smrgvoid __indirect_glRenderbufferStorage(GLenum target, GLenum internalformat, GLsizei width, GLsizei height)
7765b8e80941Smrg{
7766b8e80941Smrg    struct glx_context * const gc = __glXGetCurrentContext();
7767b8e80941Smrg    const GLuint cmdlen = 20;
7768b8e80941Smrgemit_header(gc->pc, X_GLrop_RenderbufferStorage, cmdlen);
7769b8e80941Smrg(void) memcpy((void *)(gc->pc + 4), (void *)(&target), 4);
7770b8e80941Smrg(void) memcpy((void *)(gc->pc + 8), (void *)(&internalformat), 4);
7771b8e80941Smrg(void) memcpy((void *)(gc->pc + 12), (void *)(&width), 4);
7772b8e80941Smrg(void) memcpy((void *)(gc->pc + 16), (void *)(&height), 4);
7773b8e80941Smrggc->pc += cmdlen;
7774b8e80941Smrgif (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); }
7775848b8605Smrg}
7776848b8605Smrg
7777848b8605Smrg#define X_GLrop_RenderbufferStorageMultisample 4331
7778b8e80941Smrgvoid __indirect_glRenderbufferStorageMultisample(GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height)
7779b8e80941Smrg{
7780b8e80941Smrg    struct glx_context * const gc = __glXGetCurrentContext();
7781b8e80941Smrg    const GLuint cmdlen = 24;
7782b8e80941Smrgemit_header(gc->pc, X_GLrop_RenderbufferStorageMultisample, cmdlen);
7783b8e80941Smrg(void) memcpy((void *)(gc->pc + 4), (void *)(&target), 4);
7784b8e80941Smrg(void) memcpy((void *)(gc->pc + 8), (void *)(&samples), 4);
7785b8e80941Smrg(void) memcpy((void *)(gc->pc + 12), (void *)(&internalformat), 4);
7786b8e80941Smrg(void) memcpy((void *)(gc->pc + 16), (void *)(&width), 4);
7787b8e80941Smrg(void) memcpy((void *)(gc->pc + 20), (void *)(&height), 4);
7788b8e80941Smrggc->pc += cmdlen;
7789b8e80941Smrgif (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); }
7790848b8605Smrg}
7791848b8605Smrg
7792848b8605Smrg#define X_GLrop_SampleMaskSGIS 2048
7793b8e80941Smrgvoid __indirect_glSampleMaskSGIS(GLclampf value, GLboolean invert)
7794b8e80941Smrg{
7795b8e80941Smrg    struct glx_context * const gc = __glXGetCurrentContext();
7796b8e80941Smrg    const GLuint cmdlen = 12;
7797b8e80941Smrgemit_header(gc->pc, X_GLrop_SampleMaskSGIS, cmdlen);
7798b8e80941Smrg(void) memcpy((void *)(gc->pc + 4), (void *)(&value), 4);
7799b8e80941Smrg(void) memcpy((void *)(gc->pc + 8), (void *)(&invert), 1);
7800b8e80941Smrggc->pc += cmdlen;
7801b8e80941Smrgif (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); }
7802848b8605Smrg}
7803848b8605Smrg
7804848b8605Smrg#define X_GLrop_SamplePatternSGIS 2049
7805b8e80941Smrgvoid __indirect_glSamplePatternSGIS(GLenum pattern)
7806848b8605Smrg{
7807b8e80941Smrg    struct glx_context * const gc = __glXGetCurrentContext();
7808b8e80941Smrg    const GLuint cmdlen = 8;
7809b8e80941Smrgemit_header(gc->pc, X_GLrop_SamplePatternSGIS, cmdlen);
7810b8e80941Smrg(void) memcpy((void *)(gc->pc + 4), (void *)(&pattern), 4);
7811b8e80941Smrggc->pc += cmdlen;
7812b8e80941Smrgif (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); }
7813848b8605Smrg}
7814848b8605Smrg
7815848b8605Smrg#define X_GLrop_SecondaryColor3fvEXT 4129
7816b8e80941Smrgvoid __indirect_glSecondaryColor3fEXT(GLfloat red, GLfloat green, GLfloat blue)
7817b8e80941Smrg{
7818b8e80941Smrg    struct glx_context * const gc = __glXGetCurrentContext();
7819b8e80941Smrg    const GLuint cmdlen = 16;
7820b8e80941Smrgemit_header(gc->pc, X_GLrop_SecondaryColor3fvEXT, cmdlen);
7821b8e80941Smrg(void) memcpy((void *)(gc->pc + 4), (void *)(&red), 4);
7822b8e80941Smrg(void) memcpy((void *)(gc->pc + 8), (void *)(&green), 4);
7823b8e80941Smrg(void) memcpy((void *)(gc->pc + 12), (void *)(&blue), 4);
7824b8e80941Smrggc->pc += cmdlen;
7825b8e80941Smrgif (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); }
7826848b8605Smrg}
7827848b8605Smrg
7828848b8605Smrg#define X_GLrop_SecondaryColor3fvEXT 4129
7829b8e80941Smrgvoid __indirect_glSecondaryColor3fvEXT(const GLfloat * v)
7830848b8605Smrg{
7831b8e80941Smrg    generic_12_byte( X_GLrop_SecondaryColor3fvEXT, v );
7832848b8605Smrg}
7833848b8605Smrg
7834848b8605Smrg#define X_GLrop_FogCoordfvEXT 4124
7835b8e80941Smrgvoid __indirect_glFogCoordfEXT(GLfloat coord)
7836848b8605Smrg{
7837b8e80941Smrg    struct glx_context * const gc = __glXGetCurrentContext();
7838b8e80941Smrg    const GLuint cmdlen = 8;
7839b8e80941Smrgemit_header(gc->pc, X_GLrop_FogCoordfvEXT, cmdlen);
7840b8e80941Smrg(void) memcpy((void *)(gc->pc + 4), (void *)(&coord), 4);
7841b8e80941Smrggc->pc += cmdlen;
7842b8e80941Smrgif (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); }
7843848b8605Smrg}
7844848b8605Smrg
7845848b8605Smrg#define X_GLrop_FogCoordfvEXT 4124
7846b8e80941Smrgvoid __indirect_glFogCoordfvEXT(const GLfloat * coord)
7847848b8605Smrg{
7848b8e80941Smrg    generic_4_byte( X_GLrop_FogCoordfvEXT, coord );
7849848b8605Smrg}
7850848b8605Smrg
7851848b8605Smrg#define X_GLvop_AreProgramsResidentNV 1293
7852b8e80941SmrgGLboolean __indirect_glAreProgramsResidentNV(GLsizei n, const GLuint * ids, GLboolean * residences)
7853848b8605Smrg{
7854b8e80941Smrg    struct glx_context * const gc = __glXGetCurrentContext();
7855b8e80941Smrg    Display * const dpy = gc->currentDpy;
7856b8e80941Smrg    GLboolean retval = (GLboolean) 0;
7857b8e80941Smrg    const GLuint cmdlen = 4 + safe_pad(safe_mul(n, 4));
7858b8e80941Smrg    if (0 + safe_pad(safe_mul(n, 4)) < 0) {
7859b8e80941Smrg        __glXSetError(gc, GL_INVALID_VALUE);
7860b8e80941Smrg        return 0;
7861b8e80941Smrg    }
7862848b8605Smrg    if (n < 0) {
7863848b8605Smrg        __glXSetError(gc, GL_INVALID_VALUE);
7864848b8605Smrg        return 0;
7865848b8605Smrg    }
7866848b8605Smrg    if (__builtin_expect((n >= 0) && (dpy != NULL), 1)) {
7867b8e80941Smrg        GLubyte const * pc = __glXSetupVendorRequest(gc, X_GLXVendorPrivateWithReply, X_GLvop_AreProgramsResidentNV, cmdlen);
7868b8e80941Smrg(void) memcpy((void *)(pc + 0), (void *)(&n), 4);
7869b8e80941Smrg(void) memcpy((void *)(pc + 4), (void *)(ids), safe_mul(n, 4));
7870848b8605Smrg        retval = (GLboolean) __glXReadReply(dpy, 1, residences, GL_FALSE);
7871b8e80941Smrg        UnlockDisplay(dpy); SyncHandle();
7872848b8605Smrg    }
7873848b8605Smrg    return retval;
7874848b8605Smrg}
7875848b8605Smrg
7876848b8605Smrg#define X_GLrop_ExecuteProgramNV 4181
7877b8e80941Smrgvoid __indirect_glExecuteProgramNV(GLenum target, GLuint id, const GLfloat * params)
7878b8e80941Smrg{
7879b8e80941Smrg    struct glx_context * const gc = __glXGetCurrentContext();
7880b8e80941Smrg    const GLuint cmdlen = 28;
7881b8e80941Smrgemit_header(gc->pc, X_GLrop_ExecuteProgramNV, cmdlen);
7882b8e80941Smrg(void) memcpy((void *)(gc->pc + 4), (void *)(&target), 4);
7883b8e80941Smrg(void) memcpy((void *)(gc->pc + 8), (void *)(&id), 4);
7884b8e80941Smrg(void) memcpy((void *)(gc->pc + 12), (void *)(params), 16);
7885b8e80941Smrggc->pc += cmdlen;
7886b8e80941Smrgif (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); }
7887848b8605Smrg}
7888848b8605Smrg
7889848b8605Smrg#define X_GLvop_GetProgramParameterdvNV 1297
7890b8e80941Smrgvoid __indirect_glGetProgramParameterdvNV(GLenum target, GLuint index, GLenum pname, GLdouble * params)
7891848b8605Smrg{
7892b8e80941Smrg    struct glx_context * const gc = __glXGetCurrentContext();
7893b8e80941Smrg    Display * const dpy = gc->currentDpy;
7894b8e80941Smrg    const GLuint cmdlen = 12;
7895848b8605Smrg    if (__builtin_expect(dpy != NULL, 1)) {
7896b8e80941Smrg        GLubyte const * pc = __glXSetupVendorRequest(gc, X_GLXVendorPrivateWithReply, X_GLvop_GetProgramParameterdvNV, cmdlen);
7897b8e80941Smrg(void) memcpy((void *)(pc + 0), (void *)(&target), 4);
7898b8e80941Smrg(void) memcpy((void *)(pc + 4), (void *)(&index), 4);
7899b8e80941Smrg(void) memcpy((void *)(pc + 8), (void *)(&pname), 4);
7900848b8605Smrg        (void) __glXReadReply(dpy, 8, params, GL_FALSE);
7901b8e80941Smrg        UnlockDisplay(dpy); SyncHandle();
7902848b8605Smrg    }
7903848b8605Smrg    return;
7904848b8605Smrg}
7905848b8605Smrg
7906848b8605Smrg#define X_GLvop_GetProgramParameterfvNV 1296
7907b8e80941Smrgvoid __indirect_glGetProgramParameterfvNV(GLenum target, GLuint index, GLenum pname, GLfloat * params)
7908848b8605Smrg{
7909b8e80941Smrg    struct glx_context * const gc = __glXGetCurrentContext();
7910b8e80941Smrg    Display * const dpy = gc->currentDpy;
7911b8e80941Smrg    const GLuint cmdlen = 12;
7912848b8605Smrg    if (__builtin_expect(dpy != NULL, 1)) {
7913b8e80941Smrg        GLubyte const * pc = __glXSetupVendorRequest(gc, X_GLXVendorPrivateWithReply, X_GLvop_GetProgramParameterfvNV, cmdlen);
7914b8e80941Smrg(void) memcpy((void *)(pc + 0), (void *)(&target), 4);
7915b8e80941Smrg(void) memcpy((void *)(pc + 4), (void *)(&index), 4);
7916b8e80941Smrg(void) memcpy((void *)(pc + 8), (void *)(&pname), 4);
7917848b8605Smrg        (void) __glXReadReply(dpy, 4, params, GL_FALSE);
7918b8e80941Smrg        UnlockDisplay(dpy); SyncHandle();
7919848b8605Smrg    }
7920848b8605Smrg    return;
7921848b8605Smrg}
7922848b8605Smrg
7923848b8605Smrg#define X_GLvop_GetProgramStringNV 1299
7924b8e80941Smrgvoid __indirect_glGetProgramStringNV(GLuint id, GLenum pname, GLubyte * program)
7925848b8605Smrg{
7926b8e80941Smrg    struct glx_context * const gc = __glXGetCurrentContext();
7927b8e80941Smrg    Display * const dpy = gc->currentDpy;
7928b8e80941Smrg    const GLuint cmdlen = 8;
7929848b8605Smrg    if (__builtin_expect(dpy != NULL, 1)) {
7930b8e80941Smrg        GLubyte const * pc = __glXSetupVendorRequest(gc, X_GLXVendorPrivateWithReply, X_GLvop_GetProgramStringNV, cmdlen);
7931b8e80941Smrg(void) memcpy((void *)(pc + 0), (void *)(&id), 4);
7932b8e80941Smrg(void) memcpy((void *)(pc + 4), (void *)(&pname), 4);
7933848b8605Smrg        (void) __glXReadReply(dpy, 1, program, GL_TRUE);
7934b8e80941Smrg        UnlockDisplay(dpy); SyncHandle();
7935848b8605Smrg    }
7936848b8605Smrg    return;
7937848b8605Smrg}
7938848b8605Smrg
7939848b8605Smrg#define X_GLvop_GetProgramivNV 1298
7940b8e80941Smrgvoid __indirect_glGetProgramivNV(GLuint id, GLenum pname, GLint * params)
7941848b8605Smrg{
7942b8e80941Smrg    struct glx_context * const gc = __glXGetCurrentContext();
7943b8e80941Smrg    Display * const dpy = gc->currentDpy;
7944b8e80941Smrg    const GLuint cmdlen = 8;
7945848b8605Smrg    if (__builtin_expect(dpy != NULL, 1)) {
7946b8e80941Smrg        GLubyte const * pc = __glXSetupVendorRequest(gc, X_GLXVendorPrivateWithReply, X_GLvop_GetProgramivNV, cmdlen);
7947b8e80941Smrg(void) memcpy((void *)(pc + 0), (void *)(&id), 4);
7948b8e80941Smrg(void) memcpy((void *)(pc + 4), (void *)(&pname), 4);
7949848b8605Smrg        (void) __glXReadReply(dpy, 4, params, GL_FALSE);
7950b8e80941Smrg        UnlockDisplay(dpy); SyncHandle();
7951848b8605Smrg    }
7952848b8605Smrg    return;
7953848b8605Smrg}
7954848b8605Smrg
7955848b8605Smrg#define X_GLvop_GetTrackMatrixivNV 1300
7956b8e80941Smrgvoid __indirect_glGetTrackMatrixivNV(GLenum target, GLuint address, GLenum pname, GLint * params)
7957848b8605Smrg{
7958b8e80941Smrg    struct glx_context * const gc = __glXGetCurrentContext();
7959b8e80941Smrg    Display * const dpy = gc->currentDpy;
7960b8e80941Smrg    const GLuint cmdlen = 12;
7961848b8605Smrg    if (__builtin_expect(dpy != NULL, 1)) {
7962b8e80941Smrg        GLubyte const * pc = __glXSetupVendorRequest(gc, X_GLXVendorPrivateWithReply, X_GLvop_GetTrackMatrixivNV, cmdlen);
7963b8e80941Smrg(void) memcpy((void *)(pc + 0), (void *)(&target), 4);
7964b8e80941Smrg(void) memcpy((void *)(pc + 4), (void *)(&address), 4);
7965b8e80941Smrg(void) memcpy((void *)(pc + 8), (void *)(&pname), 4);
7966848b8605Smrg        (void) __glXReadReply(dpy, 4, params, GL_FALSE);
7967b8e80941Smrg        UnlockDisplay(dpy); SyncHandle();
7968848b8605Smrg    }
7969848b8605Smrg    return;
7970848b8605Smrg}
7971848b8605Smrg
7972848b8605Smrg#define X_GLvop_GetVertexAttribdvNV 1301
7973b8e80941Smrgvoid __indirect_glGetVertexAttribdvNV(GLuint index, GLenum pname, GLdouble * params)
7974848b8605Smrg{
7975b8e80941Smrg    struct glx_context * const gc = __glXGetCurrentContext();
7976b8e80941Smrg    Display * const dpy = gc->currentDpy;
7977b8e80941Smrg    const GLuint cmdlen = 8;
7978848b8605Smrg    if (__builtin_expect(dpy != NULL, 1)) {
7979b8e80941Smrg        GLubyte const * pc = __glXSetupVendorRequest(gc, X_GLXVendorPrivateWithReply, X_GLvop_GetVertexAttribdvNV, cmdlen);
7980b8e80941Smrg(void) memcpy((void *)(pc + 0), (void *)(&index), 4);
7981b8e80941Smrg(void) memcpy((void *)(pc + 4), (void *)(&pname), 4);
7982848b8605Smrg        (void) __glXReadReply(dpy, 8, params, GL_FALSE);
7983b8e80941Smrg        UnlockDisplay(dpy); SyncHandle();
7984848b8605Smrg    }
7985848b8605Smrg    return;
7986848b8605Smrg}
7987848b8605Smrg
7988848b8605Smrg#define X_GLvop_GetVertexAttribfvNV 1302
7989b8e80941Smrgvoid __indirect_glGetVertexAttribfvNV(GLuint index, GLenum pname, GLfloat * params)
7990848b8605Smrg{
7991b8e80941Smrg    struct glx_context * const gc = __glXGetCurrentContext();
7992b8e80941Smrg    Display * const dpy = gc->currentDpy;
7993b8e80941Smrg    const GLuint cmdlen = 8;
7994848b8605Smrg    if (__builtin_expect(dpy != NULL, 1)) {
7995b8e80941Smrg        GLubyte const * pc = __glXSetupVendorRequest(gc, X_GLXVendorPrivateWithReply, X_GLvop_GetVertexAttribfvNV, cmdlen);
7996b8e80941Smrg(void) memcpy((void *)(pc + 0), (void *)(&index), 4);
7997b8e80941Smrg(void) memcpy((void *)(pc + 4), (void *)(&pname), 4);
7998848b8605Smrg        (void) __glXReadReply(dpy, 4, params, GL_FALSE);
7999b8e80941Smrg        UnlockDisplay(dpy); SyncHandle();
8000848b8605Smrg    }
8001848b8605Smrg    return;
8002848b8605Smrg}
8003848b8605Smrg
8004848b8605Smrg#define X_GLvop_GetVertexAttribivNV 1303
8005b8e80941Smrgvoid __indirect_glGetVertexAttribivNV(GLuint index, GLenum pname, GLint * params)
8006848b8605Smrg{
8007b8e80941Smrg    struct glx_context * const gc = __glXGetCurrentContext();
8008b8e80941Smrg    Display * const dpy = gc->currentDpy;
8009b8e80941Smrg    const GLuint cmdlen = 8;
8010848b8605Smrg    if (__builtin_expect(dpy != NULL, 1)) {
8011b8e80941Smrg        GLubyte const * pc = __glXSetupVendorRequest(gc, X_GLXVendorPrivateWithReply, X_GLvop_GetVertexAttribivNV, cmdlen);
8012b8e80941Smrg(void) memcpy((void *)(pc + 0), (void *)(&index), 4);
8013b8e80941Smrg(void) memcpy((void *)(pc + 4), (void *)(&pname), 4);
8014848b8605Smrg        (void) __glXReadReply(dpy, 4, params, GL_FALSE);
8015b8e80941Smrg        UnlockDisplay(dpy); SyncHandle();
8016848b8605Smrg    }
8017848b8605Smrg    return;
8018848b8605Smrg}
8019848b8605Smrg
8020848b8605Smrg#define X_GLrop_LoadProgramNV 4183
8021b8e80941Smrgvoid __indirect_glLoadProgramNV(GLenum target, GLuint id, GLsizei len, const GLubyte * program)
8022848b8605Smrg{
8023b8e80941Smrg    struct glx_context * const gc = __glXGetCurrentContext();
8024b8e80941Smrg    const GLuint cmdlen = 16 + safe_pad(len);
8025b8e80941Smrg    if (0 + safe_pad(len) < 0) {
8026b8e80941Smrg        __glXSetError(gc, GL_INVALID_VALUE);
8027b8e80941Smrg        return;
8028b8e80941Smrg    }
8029848b8605Smrg    if (len < 0) {
8030848b8605Smrg        __glXSetError(gc, GL_INVALID_VALUE);
8031848b8605Smrg        return;
8032848b8605Smrg    }
8033848b8605Smrg    if (__builtin_expect(len >= 0, 1)) {
8034b8e80941Smrgemit_header(gc->pc, X_GLrop_LoadProgramNV, cmdlen);
8035b8e80941Smrg(void) memcpy((void *)(gc->pc + 4), (void *)(&target), 4);
8036b8e80941Smrg(void) memcpy((void *)(gc->pc + 8), (void *)(&id), 4);
8037b8e80941Smrg(void) memcpy((void *)(gc->pc + 12), (void *)(&len), 4);
8038b8e80941Smrg(void) memcpy((void *)(gc->pc + 16), (void *)(program), len);
8039b8e80941Smrggc->pc += cmdlen;
8040b8e80941Smrgif (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); }
8041848b8605Smrg    }
8042848b8605Smrg}
8043848b8605Smrg
8044848b8605Smrg#define X_GLrop_ProgramParameters4dvNV 4187
8045b8e80941Smrgvoid __indirect_glProgramParameters4dvNV(GLenum target, GLuint index, GLsizei num, const GLdouble * params)
8046848b8605Smrg{
8047b8e80941Smrg    struct glx_context * const gc = __glXGetCurrentContext();
8048b8e80941Smrg    const GLuint cmdlen = 16 + safe_pad(safe_mul(num, 32));
8049b8e80941Smrg    if (0 + safe_pad(safe_mul(num, 32)) < 0) {
8050b8e80941Smrg        __glXSetError(gc, GL_INVALID_VALUE);
8051b8e80941Smrg        return;
8052b8e80941Smrg    }
8053848b8605Smrg    if (num < 0) {
8054848b8605Smrg        __glXSetError(gc, GL_INVALID_VALUE);
8055848b8605Smrg        return;
8056848b8605Smrg    }
8057848b8605Smrg    if (__builtin_expect(num >= 0, 1)) {
8058b8e80941Smrgemit_header(gc->pc, X_GLrop_ProgramParameters4dvNV, cmdlen);
8059b8e80941Smrg(void) memcpy((void *)(gc->pc + 4), (void *)(&target), 4);
8060b8e80941Smrg(void) memcpy((void *)(gc->pc + 8), (void *)(&index), 4);
8061b8e80941Smrg(void) memcpy((void *)(gc->pc + 12), (void *)(&num), 4);
8062b8e80941Smrg(void) memcpy((void *)(gc->pc + 16), (void *)(params), safe_mul(num, 32));
8063b8e80941Smrggc->pc += cmdlen;
8064b8e80941Smrgif (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); }
8065848b8605Smrg    }
8066848b8605Smrg}
8067848b8605Smrg
8068848b8605Smrg#define X_GLrop_ProgramParameters4fvNV 4186
8069b8e80941Smrgvoid __indirect_glProgramParameters4fvNV(GLenum target, GLuint index, GLsizei num, const GLfloat * params)
8070848b8605Smrg{
8071b8e80941Smrg    struct glx_context * const gc = __glXGetCurrentContext();
8072b8e80941Smrg    const GLuint cmdlen = 16 + safe_pad(safe_mul(num, 16));
8073b8e80941Smrg    if (0 + safe_pad(safe_mul(num, 16)) < 0) {
8074b8e80941Smrg        __glXSetError(gc, GL_INVALID_VALUE);
8075b8e80941Smrg        return;
8076b8e80941Smrg    }
8077848b8605Smrg    if (num < 0) {
8078848b8605Smrg        __glXSetError(gc, GL_INVALID_VALUE);
8079848b8605Smrg        return;
8080848b8605Smrg    }
8081848b8605Smrg    if (__builtin_expect(num >= 0, 1)) {
8082b8e80941Smrgemit_header(gc->pc, X_GLrop_ProgramParameters4fvNV, cmdlen);
8083b8e80941Smrg(void) memcpy((void *)(gc->pc + 4), (void *)(&target), 4);
8084b8e80941Smrg(void) memcpy((void *)(gc->pc + 8), (void *)(&index), 4);
8085b8e80941Smrg(void) memcpy((void *)(gc->pc + 12), (void *)(&num), 4);
8086b8e80941Smrg(void) memcpy((void *)(gc->pc + 16), (void *)(params), safe_mul(num, 16));
8087b8e80941Smrggc->pc += cmdlen;
8088b8e80941Smrgif (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); }
8089848b8605Smrg    }
8090848b8605Smrg}
8091848b8605Smrg
8092848b8605Smrg#define X_GLrop_RequestResidentProgramsNV 4182
8093b8e80941Smrgvoid __indirect_glRequestResidentProgramsNV(GLsizei n, const GLuint * ids)
8094848b8605Smrg{
8095b8e80941Smrg    struct glx_context * const gc = __glXGetCurrentContext();
8096b8e80941Smrg    const GLuint cmdlen = 8 + safe_pad(safe_mul(n, 4));
8097b8e80941Smrg    if (0 + safe_pad(safe_mul(n, 4)) < 0) {
8098b8e80941Smrg        __glXSetError(gc, GL_INVALID_VALUE);
8099b8e80941Smrg        return;
8100b8e80941Smrg    }
8101848b8605Smrg    if (n < 0) {
8102848b8605Smrg        __glXSetError(gc, GL_INVALID_VALUE);
8103848b8605Smrg        return;
8104848b8605Smrg    }
8105848b8605Smrg    if (__builtin_expect(n >= 0, 1)) {
8106b8e80941Smrgemit_header(gc->pc, X_GLrop_RequestResidentProgramsNV, cmdlen);
8107b8e80941Smrg(void) memcpy((void *)(gc->pc + 4), (void *)(&n), 4);
8108b8e80941Smrg(void) memcpy((void *)(gc->pc + 8), (void *)(ids), safe_mul(n, 4));
8109b8e80941Smrggc->pc += cmdlen;
8110b8e80941Smrgif (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); }
8111848b8605Smrg    }
8112848b8605Smrg}
8113848b8605Smrg
8114848b8605Smrg#define X_GLrop_TrackMatrixNV 4188
8115b8e80941Smrgvoid __indirect_glTrackMatrixNV(GLenum target, GLuint address, GLenum matrix, GLenum transform)
8116b8e80941Smrg{
8117b8e80941Smrg    struct glx_context * const gc = __glXGetCurrentContext();
8118b8e80941Smrg    const GLuint cmdlen = 20;
8119b8e80941Smrgemit_header(gc->pc, X_GLrop_TrackMatrixNV, cmdlen);
8120b8e80941Smrg(void) memcpy((void *)(gc->pc + 4), (void *)(&target), 4);
8121b8e80941Smrg(void) memcpy((void *)(gc->pc + 8), (void *)(&address), 4);
8122b8e80941Smrg(void) memcpy((void *)(gc->pc + 12), (void *)(&matrix), 4);
8123b8e80941Smrg(void) memcpy((void *)(gc->pc + 16), (void *)(&transform), 4);
8124b8e80941Smrggc->pc += cmdlen;
8125b8e80941Smrgif (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); }
8126848b8605Smrg}
8127848b8605Smrg
8128848b8605Smrg#define X_GLrop_VertexAttrib1dvNV 4273
8129b8e80941Smrgvoid __indirect_glVertexAttrib1dNV(GLuint index, GLdouble x)
8130b8e80941Smrg{
8131b8e80941Smrg    struct glx_context * const gc = __glXGetCurrentContext();
8132b8e80941Smrg    const GLuint cmdlen = 16;
8133b8e80941Smrgemit_header(gc->pc, X_GLrop_VertexAttrib1dvNV, cmdlen);
8134b8e80941Smrg(void) memcpy((void *)(gc->pc + 4), (void *)(&index), 4);
8135b8e80941Smrg(void) memcpy((void *)(gc->pc + 8), (void *)(&x), 8);
8136b8e80941Smrggc->pc += cmdlen;
8137b8e80941Smrgif (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); }
8138848b8605Smrg}
8139848b8605Smrg
8140848b8605Smrg#define X_GLrop_VertexAttrib1dvNV 4273
8141b8e80941Smrgvoid __indirect_glVertexAttrib1dvNV(GLuint index, const GLdouble * v)
8142b8e80941Smrg{
8143b8e80941Smrg    struct glx_context * const gc = __glXGetCurrentContext();
8144b8e80941Smrg    const GLuint cmdlen = 16;
8145b8e80941Smrgemit_header(gc->pc, X_GLrop_VertexAttrib1dvNV, cmdlen);
8146b8e80941Smrg(void) memcpy((void *)(gc->pc + 4), (void *)(&index), 4);
8147b8e80941Smrg(void) memcpy((void *)(gc->pc + 8), (void *)(v), 8);
8148b8e80941Smrggc->pc += cmdlen;
8149b8e80941Smrgif (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); }
8150848b8605Smrg}
8151848b8605Smrg
8152848b8605Smrg#define X_GLrop_VertexAttrib1fvNV 4269
8153b8e80941Smrgvoid __indirect_glVertexAttrib1fNV(GLuint index, GLfloat x)
8154b8e80941Smrg{
8155b8e80941Smrg    struct glx_context * const gc = __glXGetCurrentContext();
8156b8e80941Smrg    const GLuint cmdlen = 12;
8157b8e80941Smrgemit_header(gc->pc, X_GLrop_VertexAttrib1fvNV, cmdlen);
8158b8e80941Smrg(void) memcpy((void *)(gc->pc + 4), (void *)(&index), 4);
8159b8e80941Smrg(void) memcpy((void *)(gc->pc + 8), (void *)(&x), 4);
8160b8e80941Smrggc->pc += cmdlen;
8161b8e80941Smrgif (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); }
8162848b8605Smrg}
8163848b8605Smrg
8164848b8605Smrg#define X_GLrop_VertexAttrib1fvNV 4269
8165b8e80941Smrgvoid __indirect_glVertexAttrib1fvNV(GLuint index, const GLfloat * v)
8166b8e80941Smrg{
8167b8e80941Smrg    struct glx_context * const gc = __glXGetCurrentContext();
8168b8e80941Smrg    const GLuint cmdlen = 12;
8169b8e80941Smrgemit_header(gc->pc, X_GLrop_VertexAttrib1fvNV, cmdlen);
8170b8e80941Smrg(void) memcpy((void *)(gc->pc + 4), (void *)(&index), 4);
8171b8e80941Smrg(void) memcpy((void *)(gc->pc + 8), (void *)(v), 4);
8172b8e80941Smrggc->pc += cmdlen;
8173b8e80941Smrgif (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); }
8174848b8605Smrg}
8175848b8605Smrg
8176848b8605Smrg#define X_GLrop_VertexAttrib1svNV 4265
8177b8e80941Smrgvoid __indirect_glVertexAttrib1sNV(GLuint index, GLshort x)
8178b8e80941Smrg{
8179b8e80941Smrg    struct glx_context * const gc = __glXGetCurrentContext();
8180b8e80941Smrg    const GLuint cmdlen = 12;
8181b8e80941Smrgemit_header(gc->pc, X_GLrop_VertexAttrib1svNV, cmdlen);
8182b8e80941Smrg(void) memcpy((void *)(gc->pc + 4), (void *)(&index), 4);
8183b8e80941Smrg(void) memcpy((void *)(gc->pc + 8), (void *)(&x), 2);
8184b8e80941Smrggc->pc += cmdlen;
8185b8e80941Smrgif (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); }
8186848b8605Smrg}
8187848b8605Smrg
8188848b8605Smrg#define X_GLrop_VertexAttrib1svNV 4265
8189b8e80941Smrgvoid __indirect_glVertexAttrib1svNV(GLuint index, const GLshort * v)
8190b8e80941Smrg{
8191b8e80941Smrg    struct glx_context * const gc = __glXGetCurrentContext();
8192b8e80941Smrg    const GLuint cmdlen = 12;
8193b8e80941Smrgemit_header(gc->pc, X_GLrop_VertexAttrib1svNV, cmdlen);
8194b8e80941Smrg(void) memcpy((void *)(gc->pc + 4), (void *)(&index), 4);
8195b8e80941Smrg(void) memcpy((void *)(gc->pc + 8), (void *)(v), 2);
8196b8e80941Smrggc->pc += cmdlen;
8197b8e80941Smrgif (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); }
8198848b8605Smrg}
8199848b8605Smrg
8200848b8605Smrg#define X_GLrop_VertexAttrib2dvNV 4274
8201b8e80941Smrgvoid __indirect_glVertexAttrib2dNV(GLuint index, GLdouble x, GLdouble y)
8202b8e80941Smrg{
8203b8e80941Smrg    struct glx_context * const gc = __glXGetCurrentContext();
8204b8e80941Smrg    const GLuint cmdlen = 24;
8205b8e80941Smrgemit_header(gc->pc, X_GLrop_VertexAttrib2dvNV, cmdlen);
8206b8e80941Smrg(void) memcpy((void *)(gc->pc + 4), (void *)(&index), 4);
8207b8e80941Smrg(void) memcpy((void *)(gc->pc + 8), (void *)(&x), 8);
8208b8e80941Smrg(void) memcpy((void *)(gc->pc + 16), (void *)(&y), 8);
8209b8e80941Smrggc->pc += cmdlen;
8210b8e80941Smrgif (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); }
8211848b8605Smrg}
8212848b8605Smrg
8213848b8605Smrg#define X_GLrop_VertexAttrib2dvNV 4274
8214b8e80941Smrgvoid __indirect_glVertexAttrib2dvNV(GLuint index, const GLdouble * v)
8215b8e80941Smrg{
8216b8e80941Smrg    struct glx_context * const gc = __glXGetCurrentContext();
8217b8e80941Smrg    const GLuint cmdlen = 24;
8218b8e80941Smrgemit_header(gc->pc, X_GLrop_VertexAttrib2dvNV, cmdlen);
8219b8e80941Smrg(void) memcpy((void *)(gc->pc + 4), (void *)(&index), 4);
8220b8e80941Smrg(void) memcpy((void *)(gc->pc + 8), (void *)(v), 16);
8221b8e80941Smrggc->pc += cmdlen;
8222b8e80941Smrgif (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); }
8223848b8605Smrg}
8224848b8605Smrg
8225848b8605Smrg#define X_GLrop_VertexAttrib2fvNV 4270
8226b8e80941Smrgvoid __indirect_glVertexAttrib2fNV(GLuint index, GLfloat x, GLfloat y)
8227b8e80941Smrg{
8228b8e80941Smrg    struct glx_context * const gc = __glXGetCurrentContext();
8229b8e80941Smrg    const GLuint cmdlen = 16;
8230b8e80941Smrgemit_header(gc->pc, X_GLrop_VertexAttrib2fvNV, cmdlen);
8231b8e80941Smrg(void) memcpy((void *)(gc->pc + 4), (void *)(&index), 4);
8232b8e80941Smrg(void) memcpy((void *)(gc->pc + 8), (void *)(&x), 4);
8233b8e80941Smrg(void) memcpy((void *)(gc->pc + 12), (void *)(&y), 4);
8234b8e80941Smrggc->pc += cmdlen;
8235b8e80941Smrgif (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); }
8236848b8605Smrg}
8237848b8605Smrg
8238848b8605Smrg#define X_GLrop_VertexAttrib2fvNV 4270
8239b8e80941Smrgvoid __indirect_glVertexAttrib2fvNV(GLuint index, const GLfloat * v)
8240b8e80941Smrg{
8241b8e80941Smrg    struct glx_context * const gc = __glXGetCurrentContext();
8242b8e80941Smrg    const GLuint cmdlen = 16;
8243b8e80941Smrgemit_header(gc->pc, X_GLrop_VertexAttrib2fvNV, cmdlen);
8244b8e80941Smrg(void) memcpy((void *)(gc->pc + 4), (void *)(&index), 4);
8245b8e80941Smrg(void) memcpy((void *)(gc->pc + 8), (void *)(v), 8);
8246b8e80941Smrggc->pc += cmdlen;
8247b8e80941Smrgif (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); }
8248848b8605Smrg}
8249848b8605Smrg
8250848b8605Smrg#define X_GLrop_VertexAttrib2svNV 4266
8251b8e80941Smrgvoid __indirect_glVertexAttrib2sNV(GLuint index, GLshort x, GLshort y)
8252b8e80941Smrg{
8253b8e80941Smrg    struct glx_context * const gc = __glXGetCurrentContext();
8254b8e80941Smrg    const GLuint cmdlen = 12;
8255b8e80941Smrgemit_header(gc->pc, X_GLrop_VertexAttrib2svNV, cmdlen);
8256b8e80941Smrg(void) memcpy((void *)(gc->pc + 4), (void *)(&index), 4);
8257b8e80941Smrg(void) memcpy((void *)(gc->pc + 8), (void *)(&x), 2);
8258b8e80941Smrg(void) memcpy((void *)(gc->pc + 10), (void *)(&y), 2);
8259b8e80941Smrggc->pc += cmdlen;
8260b8e80941Smrgif (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); }
8261848b8605Smrg}
8262848b8605Smrg
8263848b8605Smrg#define X_GLrop_VertexAttrib2svNV 4266
8264b8e80941Smrgvoid __indirect_glVertexAttrib2svNV(GLuint index, const GLshort * v)
8265b8e80941Smrg{
8266b8e80941Smrg    struct glx_context * const gc = __glXGetCurrentContext();
8267b8e80941Smrg    const GLuint cmdlen = 12;
8268b8e80941Smrgemit_header(gc->pc, X_GLrop_VertexAttrib2svNV, cmdlen);
8269b8e80941Smrg(void) memcpy((void *)(gc->pc + 4), (void *)(&index), 4);
8270b8e80941Smrg(void) memcpy((void *)(gc->pc + 8), (void *)(v), 4);
8271b8e80941Smrggc->pc += cmdlen;
8272b8e80941Smrgif (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); }
8273848b8605Smrg}
8274848b8605Smrg
8275848b8605Smrg#define X_GLrop_VertexAttrib3dvNV 4275
8276b8e80941Smrgvoid __indirect_glVertexAttrib3dNV(GLuint index, GLdouble x, GLdouble y, GLdouble z)
8277b8e80941Smrg{
8278b8e80941Smrg    struct glx_context * const gc = __glXGetCurrentContext();
8279b8e80941Smrg    const GLuint cmdlen = 32;
8280b8e80941Smrgemit_header(gc->pc, X_GLrop_VertexAttrib3dvNV, cmdlen);
8281b8e80941Smrg(void) memcpy((void *)(gc->pc + 4), (void *)(&index), 4);
8282b8e80941Smrg(void) memcpy((void *)(gc->pc + 8), (void *)(&x), 8);
8283b8e80941Smrg(void) memcpy((void *)(gc->pc + 16), (void *)(&y), 8);
8284b8e80941Smrg(void) memcpy((void *)(gc->pc + 24), (void *)(&z), 8);
8285b8e80941Smrggc->pc += cmdlen;
8286b8e80941Smrgif (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); }
8287848b8605Smrg}
8288848b8605Smrg
8289848b8605Smrg#define X_GLrop_VertexAttrib3dvNV 4275
8290b8e80941Smrgvoid __indirect_glVertexAttrib3dvNV(GLuint index, const GLdouble * v)
8291b8e80941Smrg{
8292b8e80941Smrg    struct glx_context * const gc = __glXGetCurrentContext();
8293b8e80941Smrg    const GLuint cmdlen = 32;
8294b8e80941Smrgemit_header(gc->pc, X_GLrop_VertexAttrib3dvNV, cmdlen);
8295b8e80941Smrg(void) memcpy((void *)(gc->pc + 4), (void *)(&index), 4);
8296b8e80941Smrg(void) memcpy((void *)(gc->pc + 8), (void *)(v), 24);
8297b8e80941Smrggc->pc += cmdlen;
8298b8e80941Smrgif (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); }
8299848b8605Smrg}
8300848b8605Smrg
8301848b8605Smrg#define X_GLrop_VertexAttrib3fvNV 4271
8302b8e80941Smrgvoid __indirect_glVertexAttrib3fNV(GLuint index, GLfloat x, GLfloat y, GLfloat z)
8303b8e80941Smrg{
8304b8e80941Smrg    struct glx_context * const gc = __glXGetCurrentContext();
8305b8e80941Smrg    const GLuint cmdlen = 20;
8306b8e80941Smrgemit_header(gc->pc, X_GLrop_VertexAttrib3fvNV, cmdlen);
8307b8e80941Smrg(void) memcpy((void *)(gc->pc + 4), (void *)(&index), 4);
8308b8e80941Smrg(void) memcpy((void *)(gc->pc + 8), (void *)(&x), 4);
8309b8e80941Smrg(void) memcpy((void *)(gc->pc + 12), (void *)(&y), 4);
8310b8e80941Smrg(void) memcpy((void *)(gc->pc + 16), (void *)(&z), 4);
8311b8e80941Smrggc->pc += cmdlen;
8312b8e80941Smrgif (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); }
8313848b8605Smrg}
8314848b8605Smrg
8315848b8605Smrg#define X_GLrop_VertexAttrib3fvNV 4271
8316b8e80941Smrgvoid __indirect_glVertexAttrib3fvNV(GLuint index, const GLfloat * v)
8317b8e80941Smrg{
8318b8e80941Smrg    struct glx_context * const gc = __glXGetCurrentContext();
8319b8e80941Smrg    const GLuint cmdlen = 20;
8320b8e80941Smrgemit_header(gc->pc, X_GLrop_VertexAttrib3fvNV, cmdlen);
8321b8e80941Smrg(void) memcpy((void *)(gc->pc + 4), (void *)(&index), 4);
8322b8e80941Smrg(void) memcpy((void *)(gc->pc + 8), (void *)(v), 12);
8323b8e80941Smrggc->pc += cmdlen;
8324b8e80941Smrgif (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); }
8325848b8605Smrg}
8326848b8605Smrg
8327848b8605Smrg#define X_GLrop_VertexAttrib3svNV 4267
8328b8e80941Smrgvoid __indirect_glVertexAttrib3sNV(GLuint index, GLshort x, GLshort y, GLshort z)
8329b8e80941Smrg{
8330b8e80941Smrg    struct glx_context * const gc = __glXGetCurrentContext();
8331b8e80941Smrg    const GLuint cmdlen = 16;
8332b8e80941Smrgemit_header(gc->pc, X_GLrop_VertexAttrib3svNV, cmdlen);
8333b8e80941Smrg(void) memcpy((void *)(gc->pc + 4), (void *)(&index), 4);
8334b8e80941Smrg(void) memcpy((void *)(gc->pc + 8), (void *)(&x), 2);
8335b8e80941Smrg(void) memcpy((void *)(gc->pc + 10), (void *)(&y), 2);
8336b8e80941Smrg(void) memcpy((void *)(gc->pc + 12), (void *)(&z), 2);
8337b8e80941Smrggc->pc += cmdlen;
8338b8e80941Smrgif (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); }
8339848b8605Smrg}
8340848b8605Smrg
8341848b8605Smrg#define X_GLrop_VertexAttrib3svNV 4267
8342b8e80941Smrgvoid __indirect_glVertexAttrib3svNV(GLuint index, const GLshort * v)
8343b8e80941Smrg{
8344b8e80941Smrg    struct glx_context * const gc = __glXGetCurrentContext();
8345b8e80941Smrg    const GLuint cmdlen = 16;
8346b8e80941Smrgemit_header(gc->pc, X_GLrop_VertexAttrib3svNV, cmdlen);
8347b8e80941Smrg(void) memcpy((void *)(gc->pc + 4), (void *)(&index), 4);
8348b8e80941Smrg(void) memcpy((void *)(gc->pc + 8), (void *)(v), 6);
8349b8e80941Smrggc->pc += cmdlen;
8350b8e80941Smrgif (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); }
8351848b8605Smrg}
8352848b8605Smrg
8353848b8605Smrg#define X_GLrop_VertexAttrib4dvNV 4276
8354b8e80941Smrgvoid __indirect_glVertexAttrib4dNV(GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w)
8355b8e80941Smrg{
8356b8e80941Smrg    struct glx_context * const gc = __glXGetCurrentContext();
8357b8e80941Smrg    const GLuint cmdlen = 40;
8358b8e80941Smrgemit_header(gc->pc, X_GLrop_VertexAttrib4dvNV, cmdlen);
8359b8e80941Smrg(void) memcpy((void *)(gc->pc + 4), (void *)(&index), 4);
8360b8e80941Smrg(void) memcpy((void *)(gc->pc + 8), (void *)(&x), 8);
8361b8e80941Smrg(void) memcpy((void *)(gc->pc + 16), (void *)(&y), 8);
8362b8e80941Smrg(void) memcpy((void *)(gc->pc + 24), (void *)(&z), 8);
8363b8e80941Smrg(void) memcpy((void *)(gc->pc + 32), (void *)(&w), 8);
8364b8e80941Smrggc->pc += cmdlen;
8365b8e80941Smrgif (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); }
8366848b8605Smrg}
8367848b8605Smrg
8368848b8605Smrg#define X_GLrop_VertexAttrib4dvNV 4276
8369b8e80941Smrgvoid __indirect_glVertexAttrib4dvNV(GLuint index, const GLdouble * v)
8370b8e80941Smrg{
8371b8e80941Smrg    struct glx_context * const gc = __glXGetCurrentContext();
8372b8e80941Smrg    const GLuint cmdlen = 40;
8373b8e80941Smrgemit_header(gc->pc, X_GLrop_VertexAttrib4dvNV, cmdlen);
8374b8e80941Smrg(void) memcpy((void *)(gc->pc + 4), (void *)(&index), 4);
8375b8e80941Smrg(void) memcpy((void *)(gc->pc + 8), (void *)(v), 32);
8376b8e80941Smrggc->pc += cmdlen;
8377b8e80941Smrgif (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); }
8378848b8605Smrg}
8379848b8605Smrg
8380848b8605Smrg#define X_GLrop_VertexAttrib4fvNV 4272
8381b8e80941Smrgvoid __indirect_glVertexAttrib4fNV(GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w)
8382b8e80941Smrg{
8383b8e80941Smrg    struct glx_context * const gc = __glXGetCurrentContext();
8384b8e80941Smrg    const GLuint cmdlen = 24;
8385b8e80941Smrgemit_header(gc->pc, X_GLrop_VertexAttrib4fvNV, cmdlen);
8386b8e80941Smrg(void) memcpy((void *)(gc->pc + 4), (void *)(&index), 4);
8387b8e80941Smrg(void) memcpy((void *)(gc->pc + 8), (void *)(&x), 4);
8388b8e80941Smrg(void) memcpy((void *)(gc->pc + 12), (void *)(&y), 4);
8389b8e80941Smrg(void) memcpy((void *)(gc->pc + 16), (void *)(&z), 4);
8390b8e80941Smrg(void) memcpy((void *)(gc->pc + 20), (void *)(&w), 4);
8391b8e80941Smrggc->pc += cmdlen;
8392b8e80941Smrgif (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); }
8393848b8605Smrg}
8394848b8605Smrg
8395848b8605Smrg#define X_GLrop_VertexAttrib4fvNV 4272
8396b8e80941Smrgvoid __indirect_glVertexAttrib4fvNV(GLuint index, const GLfloat * v)
8397b8e80941Smrg{
8398b8e80941Smrg    struct glx_context * const gc = __glXGetCurrentContext();
8399b8e80941Smrg    const GLuint cmdlen = 24;
8400b8e80941Smrgemit_header(gc->pc, X_GLrop_VertexAttrib4fvNV, cmdlen);
8401b8e80941Smrg(void) memcpy((void *)(gc->pc + 4), (void *)(&index), 4);
8402b8e80941Smrg(void) memcpy((void *)(gc->pc + 8), (void *)(v), 16);
8403b8e80941Smrggc->pc += cmdlen;
8404b8e80941Smrgif (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); }
8405848b8605Smrg}
8406848b8605Smrg
8407848b8605Smrg#define X_GLrop_VertexAttrib4svNV 4268
8408b8e80941Smrgvoid __indirect_glVertexAttrib4sNV(GLuint index, GLshort x, GLshort y, GLshort z, GLshort w)
8409b8e80941Smrg{
8410b8e80941Smrg    struct glx_context * const gc = __glXGetCurrentContext();
8411b8e80941Smrg    const GLuint cmdlen = 16;
8412b8e80941Smrgemit_header(gc->pc, X_GLrop_VertexAttrib4svNV, cmdlen);
8413b8e80941Smrg(void) memcpy((void *)(gc->pc + 4), (void *)(&index), 4);
8414b8e80941Smrg(void) memcpy((void *)(gc->pc + 8), (void *)(&x), 2);
8415b8e80941Smrg(void) memcpy((void *)(gc->pc + 10), (void *)(&y), 2);
8416b8e80941Smrg(void) memcpy((void *)(gc->pc + 12), (void *)(&z), 2);
8417b8e80941Smrg(void) memcpy((void *)(gc->pc + 14), (void *)(&w), 2);
8418b8e80941Smrggc->pc += cmdlen;
8419b8e80941Smrgif (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); }
8420848b8605Smrg}
8421848b8605Smrg
8422848b8605Smrg#define X_GLrop_VertexAttrib4svNV 4268
8423b8e80941Smrgvoid __indirect_glVertexAttrib4svNV(GLuint index, const GLshort * v)
8424b8e80941Smrg{
8425b8e80941Smrg    struct glx_context * const gc = __glXGetCurrentContext();
8426b8e80941Smrg    const GLuint cmdlen = 16;
8427b8e80941Smrgemit_header(gc->pc, X_GLrop_VertexAttrib4svNV, cmdlen);
8428b8e80941Smrg(void) memcpy((void *)(gc->pc + 4), (void *)(&index), 4);
8429b8e80941Smrg(void) memcpy((void *)(gc->pc + 8), (void *)(v), 8);
8430b8e80941Smrggc->pc += cmdlen;
8431b8e80941Smrgif (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); }
8432848b8605Smrg}
8433848b8605Smrg
8434848b8605Smrg#define X_GLrop_VertexAttrib4ubvNV 4277
8435b8e80941Smrgvoid __indirect_glVertexAttrib4ubNV(GLuint index, GLubyte x, GLubyte y, GLubyte z, GLubyte w)
8436b8e80941Smrg{
8437b8e80941Smrg    struct glx_context * const gc = __glXGetCurrentContext();
8438b8e80941Smrg    const GLuint cmdlen = 12;
8439b8e80941Smrgemit_header(gc->pc, X_GLrop_VertexAttrib4ubvNV, cmdlen);
8440b8e80941Smrg(void) memcpy((void *)(gc->pc + 4), (void *)(&index), 4);
8441b8e80941Smrg(void) memcpy((void *)(gc->pc + 8), (void *)(&x), 1);
8442b8e80941Smrg(void) memcpy((void *)(gc->pc + 9), (void *)(&y), 1);
8443b8e80941Smrg(void) memcpy((void *)(gc->pc + 10), (void *)(&z), 1);
8444b8e80941Smrg(void) memcpy((void *)(gc->pc + 11), (void *)(&w), 1);
8445b8e80941Smrggc->pc += cmdlen;
8446b8e80941Smrgif (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); }
8447848b8605Smrg}
8448848b8605Smrg
8449848b8605Smrg#define X_GLrop_VertexAttrib4ubvNV 4277
8450b8e80941Smrgvoid __indirect_glVertexAttrib4ubvNV(GLuint index, const GLubyte * v)
8451b8e80941Smrg{
8452b8e80941Smrg    struct glx_context * const gc = __glXGetCurrentContext();
8453b8e80941Smrg    const GLuint cmdlen = 12;
8454b8e80941Smrgemit_header(gc->pc, X_GLrop_VertexAttrib4ubvNV, cmdlen);
8455b8e80941Smrg(void) memcpy((void *)(gc->pc + 4), (void *)(&index), 4);
8456b8e80941Smrg(void) memcpy((void *)(gc->pc + 8), (void *)(v), 4);
8457b8e80941Smrggc->pc += cmdlen;
8458b8e80941Smrgif (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); }
8459848b8605Smrg}
8460848b8605Smrg
8461848b8605Smrg#define X_GLrop_VertexAttribs1dvNV 4210
8462b8e80941Smrgvoid __indirect_glVertexAttribs1dvNV(GLuint index, GLsizei n, const GLdouble * v)
8463848b8605Smrg{
8464b8e80941Smrg    struct glx_context * const gc = __glXGetCurrentContext();
8465b8e80941Smrg    const GLuint cmdlen = 12 + safe_pad(safe_mul(n, 8));
8466b8e80941Smrg    if (0 + safe_pad(safe_mul(n, 8)) < 0) {
8467b8e80941Smrg        __glXSetError(gc, GL_INVALID_VALUE);
8468b8e80941Smrg        return;
8469b8e80941Smrg    }
8470848b8605Smrg    if (n < 0) {
8471848b8605Smrg        __glXSetError(gc, GL_INVALID_VALUE);
8472848b8605Smrg        return;
8473848b8605Smrg    }
8474848b8605Smrg    if (__builtin_expect(n >= 0, 1)) {
8475b8e80941Smrgemit_header(gc->pc, X_GLrop_VertexAttribs1dvNV, cmdlen);
8476b8e80941Smrg(void) memcpy((void *)(gc->pc + 4), (void *)(&index), 4);
8477b8e80941Smrg(void) memcpy((void *)(gc->pc + 8), (void *)(&n), 4);
8478b8e80941Smrg(void) memcpy((void *)(gc->pc + 12), (void *)(v), safe_mul(n, 8));
8479b8e80941Smrggc->pc += cmdlen;
8480b8e80941Smrgif (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); }
8481848b8605Smrg    }
8482848b8605Smrg}
8483848b8605Smrg
8484848b8605Smrg#define X_GLrop_VertexAttribs1fvNV 4206
8485b8e80941Smrgvoid __indirect_glVertexAttribs1fvNV(GLuint index, GLsizei n, const GLfloat * v)
8486848b8605Smrg{
8487b8e80941Smrg    struct glx_context * const gc = __glXGetCurrentContext();
8488b8e80941Smrg    const GLuint cmdlen = 12 + safe_pad(safe_mul(n, 4));
8489b8e80941Smrg    if (0 + safe_pad(safe_mul(n, 4)) < 0) {
8490b8e80941Smrg        __glXSetError(gc, GL_INVALID_VALUE);
8491b8e80941Smrg        return;
8492b8e80941Smrg    }
8493848b8605Smrg    if (n < 0) {
8494848b8605Smrg        __glXSetError(gc, GL_INVALID_VALUE);
8495848b8605Smrg        return;
8496848b8605Smrg    }
8497848b8605Smrg    if (__builtin_expect(n >= 0, 1)) {
8498b8e80941Smrgemit_header(gc->pc, X_GLrop_VertexAttribs1fvNV, cmdlen);
8499b8e80941Smrg(void) memcpy((void *)(gc->pc + 4), (void *)(&index), 4);
8500b8e80941Smrg(void) memcpy((void *)(gc->pc + 8), (void *)(&n), 4);
8501b8e80941Smrg(void) memcpy((void *)(gc->pc + 12), (void *)(v), safe_mul(n, 4));
8502b8e80941Smrggc->pc += cmdlen;
8503b8e80941Smrgif (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); }
8504848b8605Smrg    }
8505848b8605Smrg}
8506848b8605Smrg
8507848b8605Smrg#define X_GLrop_VertexAttribs1svNV 4202
8508b8e80941Smrgvoid __indirect_glVertexAttribs1svNV(GLuint index, GLsizei n, const GLshort * v)
8509848b8605Smrg{
8510b8e80941Smrg    struct glx_context * const gc = __glXGetCurrentContext();
8511b8e80941Smrg    const GLuint cmdlen = 12 + safe_pad(safe_mul(n, 2));
8512b8e80941Smrg    if (0 + safe_pad(safe_mul(n, 2)) < 0) {
8513b8e80941Smrg        __glXSetError(gc, GL_INVALID_VALUE);
8514b8e80941Smrg        return;
8515b8e80941Smrg    }
8516848b8605Smrg    if (n < 0) {
8517848b8605Smrg        __glXSetError(gc, GL_INVALID_VALUE);
8518848b8605Smrg        return;
8519848b8605Smrg    }
8520848b8605Smrg    if (__builtin_expect(n >= 0, 1)) {
8521b8e80941Smrgemit_header(gc->pc, X_GLrop_VertexAttribs1svNV, cmdlen);
8522b8e80941Smrg(void) memcpy((void *)(gc->pc + 4), (void *)(&index), 4);
8523b8e80941Smrg(void) memcpy((void *)(gc->pc + 8), (void *)(&n), 4);
8524b8e80941Smrg(void) memcpy((void *)(gc->pc + 12), (void *)(v), safe_mul(n, 2));
8525b8e80941Smrggc->pc += cmdlen;
8526b8e80941Smrgif (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); }
8527848b8605Smrg    }
8528848b8605Smrg}
8529848b8605Smrg
8530848b8605Smrg#define X_GLrop_VertexAttribs2dvNV 4211
8531b8e80941Smrgvoid __indirect_glVertexAttribs2dvNV(GLuint index, GLsizei n, const GLdouble * v)
8532848b8605Smrg{
8533b8e80941Smrg    struct glx_context * const gc = __glXGetCurrentContext();
8534b8e80941Smrg    const GLuint cmdlen = 12 + safe_pad(safe_mul(n, 16));
8535b8e80941Smrg    if (0 + safe_pad(safe_mul(n, 16)) < 0) {
8536b8e80941Smrg        __glXSetError(gc, GL_INVALID_VALUE);
8537b8e80941Smrg        return;
8538b8e80941Smrg    }
8539848b8605Smrg    if (n < 0) {
8540848b8605Smrg        __glXSetError(gc, GL_INVALID_VALUE);
8541848b8605Smrg        return;
8542848b8605Smrg    }
8543848b8605Smrg    if (__builtin_expect(n >= 0, 1)) {
8544b8e80941Smrgemit_header(gc->pc, X_GLrop_VertexAttribs2dvNV, cmdlen);
8545b8e80941Smrg(void) memcpy((void *)(gc->pc + 4), (void *)(&index), 4);
8546b8e80941Smrg(void) memcpy((void *)(gc->pc + 8), (void *)(&n), 4);
8547b8e80941Smrg(void) memcpy((void *)(gc->pc + 12), (void *)(v), safe_mul(n, 16));
8548b8e80941Smrggc->pc += cmdlen;
8549b8e80941Smrgif (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); }
8550848b8605Smrg    }
8551848b8605Smrg}
8552848b8605Smrg
8553848b8605Smrg#define X_GLrop_VertexAttribs2fvNV 4207
8554b8e80941Smrgvoid __indirect_glVertexAttribs2fvNV(GLuint index, GLsizei n, const GLfloat * v)
8555848b8605Smrg{
8556b8e80941Smrg    struct glx_context * const gc = __glXGetCurrentContext();
8557b8e80941Smrg    const GLuint cmdlen = 12 + safe_pad(safe_mul(n, 8));
8558b8e80941Smrg    if (0 + safe_pad(safe_mul(n, 8)) < 0) {
8559b8e80941Smrg        __glXSetError(gc, GL_INVALID_VALUE);
8560b8e80941Smrg        return;
8561b8e80941Smrg    }
8562848b8605Smrg    if (n < 0) {
8563848b8605Smrg        __glXSetError(gc, GL_INVALID_VALUE);
8564848b8605Smrg        return;
8565848b8605Smrg    }
8566848b8605Smrg    if (__builtin_expect(n >= 0, 1)) {
8567b8e80941Smrgemit_header(gc->pc, X_GLrop_VertexAttribs2fvNV, cmdlen);
8568b8e80941Smrg(void) memcpy((void *)(gc->pc + 4), (void *)(&index), 4);
8569b8e80941Smrg(void) memcpy((void *)(gc->pc + 8), (void *)(&n), 4);
8570b8e80941Smrg(void) memcpy((void *)(gc->pc + 12), (void *)(v), safe_mul(n, 8));
8571b8e80941Smrggc->pc += cmdlen;
8572b8e80941Smrgif (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); }
8573848b8605Smrg    }
8574848b8605Smrg}
8575848b8605Smrg
8576848b8605Smrg#define X_GLrop_VertexAttribs2svNV 4203
8577b8e80941Smrgvoid __indirect_glVertexAttribs2svNV(GLuint index, GLsizei n, const GLshort * v)
8578848b8605Smrg{
8579b8e80941Smrg    struct glx_context * const gc = __glXGetCurrentContext();
8580b8e80941Smrg    const GLuint cmdlen = 12 + safe_pad(safe_mul(n, 4));
8581b8e80941Smrg    if (0 + safe_pad(safe_mul(n, 4)) < 0) {
8582b8e80941Smrg        __glXSetError(gc, GL_INVALID_VALUE);
8583b8e80941Smrg        return;
8584b8e80941Smrg    }
8585848b8605Smrg    if (n < 0) {
8586848b8605Smrg        __glXSetError(gc, GL_INVALID_VALUE);
8587848b8605Smrg        return;
8588848b8605Smrg    }
8589848b8605Smrg    if (__builtin_expect(n >= 0, 1)) {
8590b8e80941Smrgemit_header(gc->pc, X_GLrop_VertexAttribs2svNV, cmdlen);
8591b8e80941Smrg(void) memcpy((void *)(gc->pc + 4), (void *)(&index), 4);
8592b8e80941Smrg(void) memcpy((void *)(gc->pc + 8), (void *)(&n), 4);
8593b8e80941Smrg(void) memcpy((void *)(gc->pc + 12), (void *)(v), safe_mul(n, 4));
8594b8e80941Smrggc->pc += cmdlen;
8595b8e80941Smrgif (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); }
8596848b8605Smrg    }
8597848b8605Smrg}
8598848b8605Smrg
8599848b8605Smrg#define X_GLrop_VertexAttribs3dvNV 4212
8600b8e80941Smrgvoid __indirect_glVertexAttribs3dvNV(GLuint index, GLsizei n, const GLdouble * v)
8601848b8605Smrg{
8602b8e80941Smrg    struct glx_context * const gc = __glXGetCurrentContext();
8603b8e80941Smrg    const GLuint cmdlen = 12 + safe_pad(safe_mul(n, 24));
8604b8e80941Smrg    if (0 + safe_pad(safe_mul(n, 24)) < 0) {
8605b8e80941Smrg        __glXSetError(gc, GL_INVALID_VALUE);
8606b8e80941Smrg        return;
8607b8e80941Smrg    }
8608848b8605Smrg    if (n < 0) {
8609848b8605Smrg        __glXSetError(gc, GL_INVALID_VALUE);
8610848b8605Smrg        return;
8611848b8605Smrg    }
8612848b8605Smrg    if (__builtin_expect(n >= 0, 1)) {
8613b8e80941Smrgemit_header(gc->pc, X_GLrop_VertexAttribs3dvNV, cmdlen);
8614b8e80941Smrg(void) memcpy((void *)(gc->pc + 4), (void *)(&index), 4);
8615b8e80941Smrg(void) memcpy((void *)(gc->pc + 8), (void *)(&n), 4);
8616b8e80941Smrg(void) memcpy((void *)(gc->pc + 12), (void *)(v), safe_mul(n, 24));
8617b8e80941Smrggc->pc += cmdlen;
8618b8e80941Smrgif (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); }
8619848b8605Smrg    }
8620848b8605Smrg}
8621848b8605Smrg
8622848b8605Smrg#define X_GLrop_VertexAttribs3fvNV 4208
8623b8e80941Smrgvoid __indirect_glVertexAttribs3fvNV(GLuint index, GLsizei n, const GLfloat * v)
8624848b8605Smrg{
8625b8e80941Smrg    struct glx_context * const gc = __glXGetCurrentContext();
8626b8e80941Smrg    const GLuint cmdlen = 12 + safe_pad(safe_mul(n, 12));
8627b8e80941Smrg    if (0 + safe_pad(safe_mul(n, 12)) < 0) {
8628b8e80941Smrg        __glXSetError(gc, GL_INVALID_VALUE);
8629b8e80941Smrg        return;
8630b8e80941Smrg    }
8631848b8605Smrg    if (n < 0) {
8632848b8605Smrg        __glXSetError(gc, GL_INVALID_VALUE);
8633848b8605Smrg        return;
8634848b8605Smrg    }
8635848b8605Smrg    if (__builtin_expect(n >= 0, 1)) {
8636b8e80941Smrgemit_header(gc->pc, X_GLrop_VertexAttribs3fvNV, cmdlen);
8637b8e80941Smrg(void) memcpy((void *)(gc->pc + 4), (void *)(&index), 4);
8638b8e80941Smrg(void) memcpy((void *)(gc->pc + 8), (void *)(&n), 4);
8639b8e80941Smrg(void) memcpy((void *)(gc->pc + 12), (void *)(v), safe_mul(n, 12));
8640b8e80941Smrggc->pc += cmdlen;
8641b8e80941Smrgif (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); }
8642848b8605Smrg    }
8643848b8605Smrg}
8644848b8605Smrg
8645848b8605Smrg#define X_GLrop_VertexAttribs3svNV 4204
8646b8e80941Smrgvoid __indirect_glVertexAttribs3svNV(GLuint index, GLsizei n, const GLshort * v)
8647848b8605Smrg{
8648b8e80941Smrg    struct glx_context * const gc = __glXGetCurrentContext();
8649b8e80941Smrg    const GLuint cmdlen = 12 + safe_pad(safe_mul(n, 6));
8650b8e80941Smrg    if (0 + safe_pad(safe_mul(n, 6)) < 0) {
8651b8e80941Smrg        __glXSetError(gc, GL_INVALID_VALUE);
8652b8e80941Smrg        return;
8653b8e80941Smrg    }
8654848b8605Smrg    if (n < 0) {
8655848b8605Smrg        __glXSetError(gc, GL_INVALID_VALUE);
8656848b8605Smrg        return;
8657848b8605Smrg    }
8658848b8605Smrg    if (__builtin_expect(n >= 0, 1)) {
8659b8e80941Smrgemit_header(gc->pc, X_GLrop_VertexAttribs3svNV, cmdlen);
8660b8e80941Smrg(void) memcpy((void *)(gc->pc + 4), (void *)(&index), 4);
8661b8e80941Smrg(void) memcpy((void *)(gc->pc + 8), (void *)(&n), 4);
8662b8e80941Smrg(void) memcpy((void *)(gc->pc + 12), (void *)(v), safe_mul(n, 6));
8663b8e80941Smrggc->pc += cmdlen;
8664b8e80941Smrgif (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); }
8665848b8605Smrg    }
8666848b8605Smrg}
8667848b8605Smrg
8668848b8605Smrg#define X_GLrop_VertexAttribs4dvNV 4213
8669b8e80941Smrgvoid __indirect_glVertexAttribs4dvNV(GLuint index, GLsizei n, const GLdouble * v)
8670848b8605Smrg{
8671b8e80941Smrg    struct glx_context * const gc = __glXGetCurrentContext();
8672b8e80941Smrg    const GLuint cmdlen = 12 + safe_pad(safe_mul(n, 32));
8673b8e80941Smrg    if (0 + safe_pad(safe_mul(n, 32)) < 0) {
8674b8e80941Smrg        __glXSetError(gc, GL_INVALID_VALUE);
8675b8e80941Smrg        return;
8676b8e80941Smrg    }
8677848b8605Smrg    if (n < 0) {
8678848b8605Smrg        __glXSetError(gc, GL_INVALID_VALUE);
8679848b8605Smrg        return;
8680848b8605Smrg    }
8681848b8605Smrg    if (__builtin_expect(n >= 0, 1)) {
8682b8e80941Smrgemit_header(gc->pc, X_GLrop_VertexAttribs4dvNV, cmdlen);
8683b8e80941Smrg(void) memcpy((void *)(gc->pc + 4), (void *)(&index), 4);
8684b8e80941Smrg(void) memcpy((void *)(gc->pc + 8), (void *)(&n), 4);
8685b8e80941Smrg(void) memcpy((void *)(gc->pc + 12), (void *)(v), safe_mul(n, 32));
8686b8e80941Smrggc->pc += cmdlen;
8687b8e80941Smrgif (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); }
8688848b8605Smrg    }
8689848b8605Smrg}
8690848b8605Smrg
8691848b8605Smrg#define X_GLrop_VertexAttribs4fvNV 4209
8692b8e80941Smrgvoid __indirect_glVertexAttribs4fvNV(GLuint index, GLsizei n, const GLfloat * v)
8693848b8605Smrg{
8694b8e80941Smrg    struct glx_context * const gc = __glXGetCurrentContext();
8695b8e80941Smrg    const GLuint cmdlen = 12 + safe_pad(safe_mul(n, 16));
8696b8e80941Smrg    if (0 + safe_pad(safe_mul(n, 16)) < 0) {
8697b8e80941Smrg        __glXSetError(gc, GL_INVALID_VALUE);
8698b8e80941Smrg        return;
8699b8e80941Smrg    }
8700848b8605Smrg    if (n < 0) {
8701848b8605Smrg        __glXSetError(gc, GL_INVALID_VALUE);
8702848b8605Smrg        return;
8703848b8605Smrg    }
8704848b8605Smrg    if (__builtin_expect(n >= 0, 1)) {
8705b8e80941Smrgemit_header(gc->pc, X_GLrop_VertexAttribs4fvNV, cmdlen);
8706b8e80941Smrg(void) memcpy((void *)(gc->pc + 4), (void *)(&index), 4);
8707b8e80941Smrg(void) memcpy((void *)(gc->pc + 8), (void *)(&n), 4);
8708b8e80941Smrg(void) memcpy((void *)(gc->pc + 12), (void *)(v), safe_mul(n, 16));
8709b8e80941Smrggc->pc += cmdlen;
8710b8e80941Smrgif (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); }
8711848b8605Smrg    }
8712848b8605Smrg}
8713848b8605Smrg
8714848b8605Smrg#define X_GLrop_VertexAttribs4svNV 4205
8715b8e80941Smrgvoid __indirect_glVertexAttribs4svNV(GLuint index, GLsizei n, const GLshort * v)
8716848b8605Smrg{
8717b8e80941Smrg    struct glx_context * const gc = __glXGetCurrentContext();
8718b8e80941Smrg    const GLuint cmdlen = 12 + safe_pad(safe_mul(n, 8));
8719b8e80941Smrg    if (0 + safe_pad(safe_mul(n, 8)) < 0) {
8720b8e80941Smrg        __glXSetError(gc, GL_INVALID_VALUE);
8721b8e80941Smrg        return;
8722b8e80941Smrg    }
8723848b8605Smrg    if (n < 0) {
8724848b8605Smrg        __glXSetError(gc, GL_INVALID_VALUE);
8725848b8605Smrg        return;
8726848b8605Smrg    }
8727848b8605Smrg    if (__builtin_expect(n >= 0, 1)) {
8728b8e80941Smrgemit_header(gc->pc, X_GLrop_VertexAttribs4svNV, cmdlen);
8729b8e80941Smrg(void) memcpy((void *)(gc->pc + 4), (void *)(&index), 4);
8730b8e80941Smrg(void) memcpy((void *)(gc->pc + 8), (void *)(&n), 4);
8731b8e80941Smrg(void) memcpy((void *)(gc->pc + 12), (void *)(v), safe_mul(n, 8));
8732b8e80941Smrggc->pc += cmdlen;
8733b8e80941Smrgif (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); }
8734848b8605Smrg    }
8735848b8605Smrg}
8736848b8605Smrg
8737848b8605Smrg#define X_GLrop_VertexAttribs4ubvNV 4214
8738b8e80941Smrgvoid __indirect_glVertexAttribs4ubvNV(GLuint index, GLsizei n, const GLubyte * v)
8739848b8605Smrg{
8740b8e80941Smrg    struct glx_context * const gc = __glXGetCurrentContext();
8741b8e80941Smrg    const GLuint cmdlen = 12 + safe_pad(safe_mul(n, 4));
8742b8e80941Smrg    if (0 + safe_pad(safe_mul(n, 4)) < 0) {
8743b8e80941Smrg        __glXSetError(gc, GL_INVALID_VALUE);
8744b8e80941Smrg        return;
8745b8e80941Smrg    }
8746848b8605Smrg    if (n < 0) {
8747848b8605Smrg        __glXSetError(gc, GL_INVALID_VALUE);
8748848b8605Smrg        return;
8749848b8605Smrg    }
8750848b8605Smrg    if (__builtin_expect(n >= 0, 1)) {
8751b8e80941Smrgemit_header(gc->pc, X_GLrop_VertexAttribs4ubvNV, cmdlen);
8752b8e80941Smrg(void) memcpy((void *)(gc->pc + 4), (void *)(&index), 4);
8753b8e80941Smrg(void) memcpy((void *)(gc->pc + 8), (void *)(&n), 4);
8754b8e80941Smrg(void) memcpy((void *)(gc->pc + 12), (void *)(v), safe_mul(n, 4));
8755b8e80941Smrggc->pc += cmdlen;
8756b8e80941Smrgif (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); }
8757848b8605Smrg    }
8758848b8605Smrg}
8759848b8605Smrg
8760848b8605Smrg#define X_GLrop_ActiveStencilFaceEXT 4220
8761b8e80941Smrgvoid __indirect_glActiveStencilFaceEXT(GLenum face)
8762848b8605Smrg{
8763b8e80941Smrg    struct glx_context * const gc = __glXGetCurrentContext();
8764b8e80941Smrg    const GLuint cmdlen = 8;
8765b8e80941Smrgemit_header(gc->pc, X_GLrop_ActiveStencilFaceEXT, cmdlen);
8766b8e80941Smrg(void) memcpy((void *)(gc->pc + 4), (void *)(&face), 4);
8767b8e80941Smrggc->pc += cmdlen;
8768b8e80941Smrgif (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); }
8769848b8605Smrg}
8770848b8605Smrg
8771848b8605Smrg#define X_GLvop_GetProgramNamedParameterdvNV 1311
8772b8e80941Smrgvoid __indirect_glGetProgramNamedParameterdvNV(GLuint id, GLsizei len, const GLubyte * name, GLdouble * params)
8773848b8605Smrg{
8774b8e80941Smrg    struct glx_context * const gc = __glXGetCurrentContext();
8775b8e80941Smrg    Display * const dpy = gc->currentDpy;
8776b8e80941Smrg    const GLuint cmdlen = 8 + safe_pad(len);
8777b8e80941Smrg    if (0 + safe_pad(len) < 0) {
8778b8e80941Smrg        __glXSetError(gc, GL_INVALID_VALUE);
8779b8e80941Smrg        return;
8780b8e80941Smrg    }
8781848b8605Smrg    if (len < 0) {
8782848b8605Smrg        __glXSetError(gc, GL_INVALID_VALUE);
8783848b8605Smrg        return;
8784848b8605Smrg    }
8785848b8605Smrg    if (__builtin_expect((len >= 0) && (dpy != NULL), 1)) {
8786b8e80941Smrg        GLubyte const * pc = __glXSetupVendorRequest(gc, X_GLXVendorPrivateWithReply, X_GLvop_GetProgramNamedParameterdvNV, cmdlen);
8787b8e80941Smrg(void) memcpy((void *)(pc + 0), (void *)(&id), 4);
8788b8e80941Smrg(void) memcpy((void *)(pc + 4), (void *)(&len), 4);
8789b8e80941Smrg(void) memcpy((void *)(pc + 8), (void *)(name), len);
8790848b8605Smrg        (void) __glXReadReply(dpy, 8, params, GL_TRUE);
8791b8e80941Smrg        UnlockDisplay(dpy); SyncHandle();
8792848b8605Smrg    }
8793848b8605Smrg    return;
8794848b8605Smrg}
8795848b8605Smrg
8796848b8605Smrg#define X_GLvop_GetProgramNamedParameterfvNV 1310
8797b8e80941Smrgvoid __indirect_glGetProgramNamedParameterfvNV(GLuint id, GLsizei len, const GLubyte * name, GLfloat * params)
8798848b8605Smrg{
8799b8e80941Smrg    struct glx_context * const gc = __glXGetCurrentContext();
8800b8e80941Smrg    Display * const dpy = gc->currentDpy;
8801b8e80941Smrg    const GLuint cmdlen = 8 + safe_pad(len);
8802b8e80941Smrg    if (0 + safe_pad(len) < 0) {
8803b8e80941Smrg        __glXSetError(gc, GL_INVALID_VALUE);
8804b8e80941Smrg        return;
8805b8e80941Smrg    }
8806848b8605Smrg    if (len < 0) {
8807848b8605Smrg        __glXSetError(gc, GL_INVALID_VALUE);
8808848b8605Smrg        return;
8809848b8605Smrg    }
8810848b8605Smrg    if (__builtin_expect((len >= 0) && (dpy != NULL), 1)) {
8811b8e80941Smrg        GLubyte const * pc = __glXSetupVendorRequest(gc, X_GLXVendorPrivateWithReply, X_GLvop_GetProgramNamedParameterfvNV, cmdlen);
8812b8e80941Smrg(void) memcpy((void *)(pc + 0), (void *)(&id), 4);
8813b8e80941Smrg(void) memcpy((void *)(pc + 4), (void *)(&len), 4);
8814b8e80941Smrg(void) memcpy((void *)(pc + 8), (void *)(name), len);
8815848b8605Smrg        (void) __glXReadReply(dpy, 4, params, GL_TRUE);
8816b8e80941Smrg        UnlockDisplay(dpy); SyncHandle();
8817848b8605Smrg    }
8818848b8605Smrg    return;
8819848b8605Smrg}
8820848b8605Smrg
8821848b8605Smrg#define X_GLrop_ProgramNamedParameter4dvNV 4219
8822b8e80941Smrgvoid __indirect_glProgramNamedParameter4dNV(GLuint id, GLsizei len, const GLubyte * name, GLdouble x, GLdouble y, GLdouble z, GLdouble w)
8823848b8605Smrg{
8824b8e80941Smrg    struct glx_context * const gc = __glXGetCurrentContext();
8825b8e80941Smrg    const GLuint cmdlen = 44 + safe_pad(len);
8826b8e80941Smrg    if (0 + safe_pad(len) < 0) {
8827b8e80941Smrg        __glXSetError(gc, GL_INVALID_VALUE);
8828b8e80941Smrg        return;
8829b8e80941Smrg    }
8830848b8605Smrg    if (len < 0) {
8831848b8605Smrg        __glXSetError(gc, GL_INVALID_VALUE);
8832848b8605Smrg        return;
8833848b8605Smrg    }
8834848b8605Smrg    if (__builtin_expect(len >= 0, 1)) {
8835b8e80941Smrgemit_header(gc->pc, X_GLrop_ProgramNamedParameter4dvNV, cmdlen);
8836b8e80941Smrg(void) memcpy((void *)(gc->pc + 4), (void *)(&x), 8);
8837b8e80941Smrg(void) memcpy((void *)(gc->pc + 12), (void *)(&y), 8);
8838b8e80941Smrg(void) memcpy((void *)(gc->pc + 20), (void *)(&z), 8);
8839b8e80941Smrg(void) memcpy((void *)(gc->pc + 28), (void *)(&w), 8);
8840b8e80941Smrg(void) memcpy((void *)(gc->pc + 36), (void *)(&id), 4);
8841b8e80941Smrg(void) memcpy((void *)(gc->pc + 40), (void *)(&len), 4);
8842b8e80941Smrg(void) memcpy((void *)(gc->pc + 44), (void *)(name), len);
8843b8e80941Smrggc->pc += cmdlen;
8844b8e80941Smrgif (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); }
8845848b8605Smrg    }
8846848b8605Smrg}
8847848b8605Smrg
8848848b8605Smrg#define X_GLrop_ProgramNamedParameter4dvNV 4219
8849b8e80941Smrgvoid __indirect_glProgramNamedParameter4dvNV(GLuint id, GLsizei len, const GLubyte * name, const GLdouble * v)
8850848b8605Smrg{
8851b8e80941Smrg    struct glx_context * const gc = __glXGetCurrentContext();
8852b8e80941Smrg    const GLuint cmdlen = 44 + safe_pad(len);
8853b8e80941Smrg    if (0 + safe_pad(len) < 0) {
8854b8e80941Smrg        __glXSetError(gc, GL_INVALID_VALUE);
8855b8e80941Smrg        return;
8856b8e80941Smrg    }
8857848b8605Smrg    if (len < 0) {
8858848b8605Smrg        __glXSetError(gc, GL_INVALID_VALUE);
8859848b8605Smrg        return;
8860848b8605Smrg    }
8861848b8605Smrg    if (__builtin_expect(len >= 0, 1)) {
8862b8e80941Smrgemit_header(gc->pc, X_GLrop_ProgramNamedParameter4dvNV, cmdlen);
8863b8e80941Smrg(void) memcpy((void *)(gc->pc + 4), (void *)(v), 32);
8864b8e80941Smrg(void) memcpy((void *)(gc->pc + 36), (void *)(&id), 4);
8865b8e80941Smrg(void) memcpy((void *)(gc->pc + 40), (void *)(&len), 4);
8866b8e80941Smrg(void) memcpy((void *)(gc->pc + 44), (void *)(name), len);
8867b8e80941Smrggc->pc += cmdlen;
8868b8e80941Smrgif (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); }
8869848b8605Smrg    }
8870848b8605Smrg}
8871848b8605Smrg
8872848b8605Smrg#define X_GLrop_ProgramNamedParameter4fvNV 4218
8873b8e80941Smrgvoid __indirect_glProgramNamedParameter4fNV(GLuint id, GLsizei len, const GLubyte * name, GLfloat x, GLfloat y, GLfloat z, GLfloat w)
8874848b8605Smrg{
8875b8e80941Smrg    struct glx_context * const gc = __glXGetCurrentContext();
8876b8e80941Smrg    const GLuint cmdlen = 28 + safe_pad(len);
8877b8e80941Smrg    if (0 + safe_pad(len) < 0) {
8878b8e80941Smrg        __glXSetError(gc, GL_INVALID_VALUE);
8879b8e80941Smrg        return;
8880b8e80941Smrg    }
8881848b8605Smrg    if (len < 0) {
8882848b8605Smrg        __glXSetError(gc, GL_INVALID_VALUE);
8883848b8605Smrg        return;
8884848b8605Smrg    }
8885848b8605Smrg    if (__builtin_expect(len >= 0, 1)) {
8886b8e80941Smrgemit_header(gc->pc, X_GLrop_ProgramNamedParameter4fvNV, cmdlen);
8887b8e80941Smrg(void) memcpy((void *)(gc->pc + 4), (void *)(&id), 4);
8888b8e80941Smrg(void) memcpy((void *)(gc->pc + 8), (void *)(&len), 4);
8889b8e80941Smrg(void) memcpy((void *)(gc->pc + 12), (void *)(&x), 4);
8890b8e80941Smrg(void) memcpy((void *)(gc->pc + 16), (void *)(&y), 4);
8891b8e80941Smrg(void) memcpy((void *)(gc->pc + 20), (void *)(&z), 4);
8892b8e80941Smrg(void) memcpy((void *)(gc->pc + 24), (void *)(&w), 4);
8893b8e80941Smrg(void) memcpy((void *)(gc->pc + 28), (void *)(name), len);
8894b8e80941Smrggc->pc += cmdlen;
8895b8e80941Smrgif (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); }
8896848b8605Smrg    }
8897848b8605Smrg}
8898848b8605Smrg
8899848b8605Smrg#define X_GLrop_ProgramNamedParameter4fvNV 4218
8900b8e80941Smrgvoid __indirect_glProgramNamedParameter4fvNV(GLuint id, GLsizei len, const GLubyte * name, const GLfloat * v)
8901848b8605Smrg{
8902b8e80941Smrg    struct glx_context * const gc = __glXGetCurrentContext();
8903b8e80941Smrg    const GLuint cmdlen = 28 + safe_pad(len);
8904b8e80941Smrg    if (0 + safe_pad(len) < 0) {
8905b8e80941Smrg        __glXSetError(gc, GL_INVALID_VALUE);
8906b8e80941Smrg        return;
8907b8e80941Smrg    }
8908848b8605Smrg    if (len < 0) {
8909848b8605Smrg        __glXSetError(gc, GL_INVALID_VALUE);
8910848b8605Smrg        return;
8911848b8605Smrg    }
8912848b8605Smrg    if (__builtin_expect(len >= 0, 1)) {
8913b8e80941Smrgemit_header(gc->pc, X_GLrop_ProgramNamedParameter4fvNV, cmdlen);
8914b8e80941Smrg(void) memcpy((void *)(gc->pc + 4), (void *)(&id), 4);
8915b8e80941Smrg(void) memcpy((void *)(gc->pc + 8), (void *)(&len), 4);
8916b8e80941Smrg(void) memcpy((void *)(gc->pc + 12), (void *)(v), 16);
8917b8e80941Smrg(void) memcpy((void *)(gc->pc + 28), (void *)(name), len);
8918b8e80941Smrggc->pc += cmdlen;
8919b8e80941Smrgif (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); }
8920848b8605Smrg    }
8921848b8605Smrg}
8922848b8605Smrg
8923848b8605Smrg#define X_GLrop_BindFramebufferEXT 4319
8924b8e80941Smrgvoid __indirect_glBindFramebufferEXT(GLenum target, GLuint framebuffer)
8925b8e80941Smrg{
8926b8e80941Smrg    struct glx_context * const gc = __glXGetCurrentContext();
8927b8e80941Smrg    const GLuint cmdlen = 12;
8928b8e80941Smrgemit_header(gc->pc, X_GLrop_BindFramebufferEXT, cmdlen);
8929b8e80941Smrg(void) memcpy((void *)(gc->pc + 4), (void *)(&target), 4);
8930b8e80941Smrg(void) memcpy((void *)(gc->pc + 8), (void *)(&framebuffer), 4);
8931b8e80941Smrggc->pc += cmdlen;
8932b8e80941Smrgif (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); }
8933848b8605Smrg}
8934848b8605Smrg
8935848b8605Smrg#define X_GLrop_BindRenderbufferEXT 4316
8936b8e80941Smrgvoid __indirect_glBindRenderbufferEXT(GLenum target, GLuint renderbuffer)
8937b8e80941Smrg{
8938b8e80941Smrg    struct glx_context * const gc = __glXGetCurrentContext();
8939b8e80941Smrg    const GLuint cmdlen = 12;
8940b8e80941Smrgemit_header(gc->pc, X_GLrop_BindRenderbufferEXT, cmdlen);
8941b8e80941Smrg(void) memcpy((void *)(gc->pc + 4), (void *)(&target), 4);
8942b8e80941Smrg(void) memcpy((void *)(gc->pc + 8), (void *)(&renderbuffer), 4);
8943b8e80941Smrggc->pc += cmdlen;
8944b8e80941Smrgif (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); }
8945b8e80941Smrg}
8946b8e80941Smrg
8947b8e80941Smrg
8948b8e80941Smrg#ifdef GLX_INDIRECT_RENDERING
8949b8e80941Smrg
8950b8e80941Smrgstatic const struct proc_pair
8951b8e80941Smrg{
8952b8e80941Smrg   const char *name;
8953b8e80941Smrg   _glapi_proc proc;
8954b8e80941Smrg} proc_pairs[20] = {
8955b8e80941Smrg   { "AreTexturesResidentEXT", (_glapi_proc) glAreTexturesResidentEXT },
8956b8e80941Smrg   { "DeleteTexturesEXT", (_glapi_proc) glDeleteTexturesEXT },
8957b8e80941Smrg   { "GenTexturesEXT", (_glapi_proc) glGenTexturesEXT },
8958b8e80941Smrg   { "GetColorTableEXT", (_glapi_proc) gl_dispatch_stub_343 },
8959b8e80941Smrg   { "GetColorTableParameterfvEXT", (_glapi_proc) gl_dispatch_stub_344 },
8960b8e80941Smrg   { "GetColorTableParameterfvSGI", (_glapi_proc) gl_dispatch_stub_344 },
8961b8e80941Smrg   { "GetColorTableParameterivEXT", (_glapi_proc) gl_dispatch_stub_345 },
8962b8e80941Smrg   { "GetColorTableParameterivSGI", (_glapi_proc) gl_dispatch_stub_345 },
8963b8e80941Smrg   { "GetColorTableSGI", (_glapi_proc) gl_dispatch_stub_343 },
8964b8e80941Smrg   { "GetConvolutionFilterEXT", (_glapi_proc) gl_dispatch_stub_356 },
8965b8e80941Smrg   { "GetConvolutionParameterfvEXT", (_glapi_proc) gl_dispatch_stub_357 },
8966b8e80941Smrg   { "GetConvolutionParameterivEXT", (_glapi_proc) gl_dispatch_stub_358 },
8967b8e80941Smrg   { "GetHistogramEXT", (_glapi_proc) gl_dispatch_stub_361 },
8968b8e80941Smrg   { "GetHistogramParameterfvEXT", (_glapi_proc) gl_dispatch_stub_362 },
8969b8e80941Smrg   { "GetHistogramParameterivEXT", (_glapi_proc) gl_dispatch_stub_363 },
8970b8e80941Smrg   { "GetMinmaxEXT", (_glapi_proc) gl_dispatch_stub_364 },
8971b8e80941Smrg   { "GetMinmaxParameterfvEXT", (_glapi_proc) gl_dispatch_stub_365 },
8972b8e80941Smrg   { "GetMinmaxParameterivEXT", (_glapi_proc) gl_dispatch_stub_366 },
8973b8e80941Smrg   { "GetSeparableFilterEXT", (_glapi_proc) gl_dispatch_stub_359 },
8974b8e80941Smrg   { "IsTextureEXT", (_glapi_proc) glIsTextureEXT }
8975848b8605Smrg};
8976848b8605Smrg
8977848b8605Smrgstatic int
8978848b8605Smrg__indirect_get_proc_compare(const void *key, const void *memb)
8979848b8605Smrg{
8980b8e80941Smrg   const struct proc_pair *pair = (const struct proc_pair *) memb;
8981b8e80941Smrg   return strcmp((const char *) key, pair->name);
8982848b8605Smrg}
8983848b8605Smrg
8984848b8605Smrg_glapi_proc
8985848b8605Smrg__indirect_get_proc_address(const char *name)
8986848b8605Smrg{
8987b8e80941Smrg   const struct proc_pair *pair;
8988b8e80941Smrg
8989b8e80941Smrg   /* skip "gl" */
8990b8e80941Smrg   name += 2;
8991848b8605Smrg
8992b8e80941Smrg   pair = (const struct proc_pair *) bsearch((const void *) name,
8993b8e80941Smrg      (const void *) proc_pairs, ARRAY_SIZE(proc_pairs), sizeof(proc_pairs[0]),
8994b8e80941Smrg      __indirect_get_proc_compare);
8995848b8605Smrg
8996b8e80941Smrg   return (pair) ? pair->proc : NULL;
8997848b8605Smrg}
8998848b8605Smrg
8999b8e80941Smrg#endif /* GLX_INDIRECT_RENDERING */
9000848b8605Smrg
9001848b8605Smrg
9002b8e80941Smrg#  undef FASTCALL
9003b8e80941Smrg#  undef NOINLINE
9004