~ubuntu-branches/ubuntu/intrepid/xserver-xgl/intrepid

« back to all changes in this revision

Viewing changes to hw/dmx/glxProxy/glxvendor.c

  • Committer: Bazaar Package Importer
  • Author(s): Matthew Garrett
  • Date: 2006-02-13 14:21:43 UTC
  • Revision ID: james.westby@ubuntu.com-20060213142143-mad6z9xzem7hzxz9
Tags: upstream-7.0.0
ImportĀ upstreamĀ versionĀ 7.0.0

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/* $XFree86: xc/programs/Xserver/GL/glx/g_single.c,v 1.4 2001/03/21 16:29:35 dawes Exp $ */
 
2
/* DO NOT EDIT - THIS FILE IS AUTOMATICALLY GENERATED */
 
3
/*
 
4
** License Applicability. Except to the extent portions of this file are
 
5
** made subject to an alternative license as permitted in the SGI Free
 
6
** Software License B, Version 1.1 (the "License"), the contents of this
 
7
** file are subject only to the provisions of the License. You may not use
 
8
** this file except in compliance with the License. You may obtain a copy
 
9
** of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
 
10
** Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
 
11
** 
 
12
** http://oss.sgi.com/projects/FreeB
 
13
** 
 
14
** Note that, as provided in the License, the Software is distributed on an
 
15
** "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
 
16
** DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
 
17
** CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
 
18
** PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
 
19
** 
 
20
** Original Code. The Original Code is: OpenGL Sample Implementation,
 
21
** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
 
22
** Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
 
23
** Copyright in any portions created by third parties is as indicated
 
24
** elsewhere herein. All Rights Reserved.
 
25
** 
 
26
** Additional Notice Provisions: This software was created using the
 
27
** OpenGL(R) version 1.2.1 Sample Implementation published by SGI, but has
 
28
** not been independently verified as being compliant with the OpenGL(R)
 
29
** version 1.2.1 Specification.
 
30
*/
 
31
 
 
32
#ifdef HAVE_DMX_CONFIG_H
 
33
#include <dmx-config.h>
 
34
#endif
 
35
 
 
36
#include "dmx.h"
 
37
#include "dmxwindow.h"
 
38
#include "dmxpixmap.h"
 
39
#include "dmxfont.h"
 
40
 
 
41
#undef Xmalloc
 
42
#undef Xcalloc
 
43
#undef Xrealloc
 
44
#undef Xfree
 
45
 
 
46
#define NEED_REPLIES
 
47
#include "glxserver.h"
 
48
#include "glxext.h"
 
49
#include "g_disptab.h"
 
50
/* #include "g_disptab_EXT.h" */
 
51
#include "unpack.h"
 
52
#include "glxutil.h"
 
53
 
 
54
#include "GL/glxproto.h"
 
55
 
 
56
#ifdef PANORAMIX
 
57
#include "panoramiXsrv.h"
 
58
#endif
 
59
 
 
60
/*
 
61
 * GetReqVendorPrivate - this is the equivalent of GetReq macro
 
62
 *    from Xlibint.h but it does not set the reqType field (the opcode).
 
63
 *    this is because the GL single opcodes has different naming convension
 
64
 *    the other X opcodes (ie. X_GLsop_GetFloatv).
 
65
 */
 
66
#if (defined(__STDC__) && !defined(UNIXCPP)) || defined(ANSICPP)
 
67
#define GetReqVendorPrivate(name, req) \
 
68
        WORD64ALIGN\
 
69
        if ((dpy->bufptr + SIZEOF(x##name##Req)) > dpy->bufmax)\
 
70
                _XFlush(dpy);\
 
71
        req = (x##name##Req *)(dpy->last_req = dpy->bufptr);\
 
72
        req->length = (SIZEOF(x##name##Req))>>2;\
 
73
        dpy->bufptr += SIZEOF(x##name##Req);\
 
74
        dpy->request++
 
75
 
 
76
#else  /* non-ANSI C uses empty comment instead of "##" for token concatenation */
 
77
#define GetReqVendorPrivate(name, req) \
 
78
        WORD64ALIGN\
 
79
        if ((dpy->bufptr + SIZEOF(x/**/name/**/Req)) > dpy->bufmax)\
 
80
                _XFlush(dpy);\
 
81
        req = (x/**/name/**/Req *)(dpy->last_req = dpy->bufptr);\
 
82
        req->length = (SIZEOF(x/**/name/**/Req))>>2;\
 
83
        dpy->bufptr += SIZEOF(x/**/name/**/Req);\
 
84
        dpy->request++
 
85
#endif
 
86
 
 
87
extern Display *GetBackEndDisplay( __GLXclientState *cl, int s );
 
88
extern int GetCurrentBackEndTag(__GLXclientState *cl, GLXContextTag tag, int s);
 
89
 
 
90
static int swap_vec_element_size = 0;
 
91
 
 
92
static void SendSwappedReply( ClientPtr client,
 
93
                              xGLXVendorPrivReply *reply, 
 
94
                              char *buf,
 
95
                              int   buf_size )
 
96
{
 
97
   __GLX_DECLARE_SWAP_VARIABLES;
 
98
   __GLX_SWAP_SHORT(&reply->sequenceNumber);
 
99
   __GLX_SWAP_INT(&reply->length);
 
100
   __GLX_SWAP_INT(&reply->retval);
 
101
   __GLX_SWAP_INT(&reply->size);
 
102
 
 
103
   if ( (buf_size == 0) && (swap_vec_element_size > 0) ) {
 
104
      /*
 
105
       * the reply has single component - need to swap pad3
 
106
       */
 
107
      if (swap_vec_element_size == 2) {
 
108
         __GLX_SWAP_SHORT(&reply->pad3);
 
109
      }
 
110
      else if (swap_vec_element_size == 4) {
 
111
         __GLX_SWAP_INT(&reply->pad3);
 
112
         __GLX_SWAP_INT(&reply->pad4);
 
113
      }
 
114
      else if (swap_vec_element_size == 8) {
 
115
         __GLX_SWAP_DOUBLE(&reply->pad3);
 
116
      }
 
117
   }
 
118
   else if ( (buf_size > 0) && (swap_vec_element_size > 0) ) {
 
119
      /*
 
120
       * the reply has vector of elements which needs to be swapped
 
121
       */
 
122
      int vsize = buf_size / swap_vec_element_size;
 
123
      char *p = buf;
 
124
      int i;
 
125
 
 
126
      for (i=0; i<vsize; i++) {
 
127
         if (swap_vec_element_size == 2) {
 
128
            __GLX_SWAP_SHORT(p);
 
129
         }
 
130
         else if (swap_vec_element_size == 4) {
 
131
            __GLX_SWAP_INT(p);
 
132
         }
 
133
         else if (swap_vec_element_size == 8) {
 
134
            __GLX_SWAP_DOUBLE(p);
 
135
         }
 
136
 
 
137
         p += swap_vec_element_size;
 
138
      }
 
139
 
 
140
      __GLX_SWAP_INT(&reply->pad3);
 
141
      __GLX_SWAP_INT(&reply->pad4);
 
142
      __GLX_SWAP_INT(&reply->pad5);
 
143
      __GLX_SWAP_INT(&reply->pad6);
 
144
 
 
145
   }
 
146
 
 
147
    WriteToClient(client, sizeof(xGLXVendorPrivReply),(char *)reply);
 
148
    if (buf_size > 0)
 
149
       WriteToClient(client, buf_size, (char *)buf);
 
150
 
 
151
}
 
152
 
 
153
int __glXVForwardSingleReq( __GLXclientState *cl, GLbyte *pc )
 
154
{
 
155
   xGLXVendorPrivateReq *req = (xGLXVendorPrivateReq *)pc;
 
156
   xGLXVendorPrivateReq *be_req;
 
157
    __GLXcontext *glxc;
 
158
   int from_screen = 0;
 
159
   int to_screen = 0;
 
160
   int buf_size;
 
161
   int s;
 
162
 
 
163
    glxc = __glXLookupContextByTag(cl, req->contextTag);
 
164
    if (!glxc) {
 
165
        return 0;
 
166
    }
 
167
    from_screen = to_screen = glxc->pScreen->myNum;
 
168
 
 
169
#ifdef PANORAMIX
 
170
    if (!noPanoramiXExtension) {
 
171
       from_screen = 0;
 
172
       to_screen = screenInfo.numScreens - 1;
 
173
    }
 
174
#endif
 
175
 
 
176
    pc += sz_xGLXVendorPrivateReq;
 
177
    buf_size = (req->length << 2) - sz_xGLXVendorPrivateReq;
 
178
 
 
179
    /*
 
180
     * just forward the request to back-end server(s)
 
181
     */
 
182
    for (s=from_screen; s<=to_screen; s++) {
 
183
       DMXScreenInfo *dmxScreen = &dmxScreens[s];
 
184
       Display *dpy = GetBackEndDisplay(cl,s);
 
185
 
 
186
       LockDisplay(dpy);
 
187
       GetReqVendorPrivate(GLXVendorPrivate,be_req);
 
188
       be_req->reqType = dmxScreen->glxMajorOpcode;
 
189
       be_req->glxCode = req->glxCode;
 
190
       be_req->length = req->length;
 
191
       be_req->vendorCode = req->vendorCode;
 
192
       be_req->contextTag = GetCurrentBackEndTag(cl,req->contextTag,s);
 
193
       if (buf_size > 0) 
 
194
          _XSend(dpy, (const char *)pc, buf_size);
 
195
       UnlockDisplay(dpy);
 
196
       SyncHandle();
 
197
    }
 
198
 
 
199
    return Success;
 
200
}
 
201
 
 
202
int __glXVForwardPipe0WithReply( __GLXclientState *cl, GLbyte *pc )
 
203
{
 
204
   ClientPtr client = cl->client;
 
205
   xGLXVendorPrivateReq *req = (xGLXVendorPrivateReq *)pc;
 
206
   xGLXVendorPrivateReq *be_req;
 
207
   xGLXVendorPrivReply reply;
 
208
   xGLXVendorPrivReply be_reply;
 
209
    __GLXcontext *glxc;
 
210
   int buf_size;
 
211
   char *be_buf;
 
212
   int   be_buf_size;
 
213
   DMXScreenInfo *dmxScreen;
 
214
   Display *dpy;
 
215
 
 
216
    glxc = __glXLookupContextByTag(cl, req->contextTag);
 
217
    if (!glxc) {
 
218
        return __glXBadContext;
 
219
    }
 
220
 
 
221
    pc += sz_xGLXVendorPrivateReq;
 
222
    buf_size = (req->length << 2) - sz_xGLXVendorPrivateReq;
 
223
 
 
224
    dmxScreen = &dmxScreens[glxc->pScreen->myNum];
 
225
    dpy = GetBackEndDisplay(cl, glxc->pScreen->myNum);
 
226
 
 
227
    /* 
 
228
     * send the request to the first back-end server
 
229
     */
 
230
    LockDisplay(dpy);
 
231
    GetReqVendorPrivate(GLXVendorPrivate,be_req);
 
232
    be_req->reqType = dmxScreen->glxMajorOpcode;
 
233
    be_req->glxCode = req->glxCode;
 
234
    be_req->length = req->length;
 
235
    be_req->vendorCode = req->vendorCode;
 
236
    be_req->contextTag = GetCurrentBackEndTag(cl,req->contextTag, glxc->pScreen->myNum);
 
237
    if (buf_size > 0) 
 
238
       _XSend(dpy, (const char *)pc, buf_size);
 
239
 
 
240
    /*
 
241
     * get the reply from the back-end server
 
242
     */
 
243
    _XReply(dpy, (xReply*) &be_reply, 0, False);
 
244
    be_buf_size = be_reply.length << 2;
 
245
    if (be_buf_size > 0) {
 
246
       be_buf = (char *)Xalloc( be_buf_size );
 
247
       if (be_buf) {
 
248
          _XRead(dpy, be_buf, be_buf_size);
 
249
       }
 
250
       else {
 
251
          /* Throw data on the floor */
 
252
          _XEatData(dpy, be_buf_size);
 
253
          return BadAlloc;
 
254
       }
 
255
    }
 
256
 
 
257
    UnlockDisplay(dpy);
 
258
    SyncHandle();
 
259
 
 
260
    /*
 
261
     * send the reply to the client
 
262
     */
 
263
    memcpy( &reply, &be_reply, sz_xGLXVendorPrivReply );
 
264
    reply.type = X_Reply;
 
265
    reply.sequenceNumber = client->sequence;
 
266
 
 
267
    if (client->swapped) {
 
268
       SendSwappedReply( client, &reply, be_buf, be_buf_size );
 
269
    }
 
270
    else {
 
271
       WriteToClient(client, sizeof(xGLXVendorPrivReply),(char *)&reply);
 
272
       if (be_buf_size > 0)
 
273
          WriteToClient(client, be_buf_size, (char *)be_buf);
 
274
    }
 
275
 
 
276
    if (be_buf_size > 0) Xfree(be_buf);
 
277
 
 
278
    return Success;
 
279
}
 
280
 
 
281
int __glXVForwardAllWithReply( __GLXclientState *cl, GLbyte *pc )
 
282
{
 
283
   ClientPtr client = cl->client;
 
284
   xGLXVendorPrivateReq *req = (xGLXVendorPrivateReq *)pc;
 
285
   xGLXVendorPrivateReq *be_req;
 
286
   xGLXVendorPrivReply reply;
 
287
   xGLXVendorPrivReply be_reply;
 
288
    __GLXcontext *glxc;
 
289
   int buf_size;
 
290
   char *be_buf;
 
291
   int   be_buf_size;
 
292
   int from_screen = 0;
 
293
   int to_screen = 0;
 
294
   int s;
 
295
 
 
296
   DMXScreenInfo *dmxScreen;
 
297
   Display *dpy;
 
298
 
 
299
    glxc = __glXLookupContextByTag(cl, req->contextTag);
 
300
    if (!glxc) {
 
301
        return 0;
 
302
    }
 
303
    from_screen = to_screen = glxc->pScreen->myNum;
 
304
 
 
305
#ifdef PANORAMIX
 
306
    if (!noPanoramiXExtension) {
 
307
       from_screen = 0;
 
308
       to_screen = screenInfo.numScreens - 1;
 
309
    }
 
310
#endif
 
311
 
 
312
    pc += sz_xGLXVendorPrivateReq;
 
313
    buf_size = (req->length << 2) - sz_xGLXVendorPrivateReq;
 
314
 
 
315
    /* 
 
316
     * send the request to the first back-end server(s)
 
317
     */
 
318
    for (s=to_screen; s>=from_screen; s--) {
 
319
       dmxScreen = &dmxScreens[s];
 
320
       dpy = GetBackEndDisplay(cl,s);
 
321
 
 
322
       LockDisplay(dpy);
 
323
       GetReqVendorPrivate(GLXVendorPrivate,be_req);
 
324
       be_req->reqType = dmxScreen->glxMajorOpcode;
 
325
       be_req->glxCode = req->glxCode;
 
326
       be_req->length = req->length;
 
327
       be_req->vendorCode = req->vendorCode;
 
328
       be_req->contextTag = GetCurrentBackEndTag(cl,req->contextTag,s);
 
329
       if (buf_size > 0) 
 
330
          _XSend(dpy, (const char *)pc, buf_size);
 
331
 
 
332
       /*
 
333
        * get the reply from the back-end server
 
334
        */
 
335
       _XReply(dpy, (xReply*) &be_reply, 0, False);
 
336
       be_buf_size = be_reply.length << 2;
 
337
       if (be_buf_size > 0) {
 
338
          be_buf = (char *)Xalloc( be_buf_size );
 
339
          if (be_buf) {
 
340
             _XRead(dpy, be_buf, be_buf_size);
 
341
          }
 
342
          else {
 
343
             /* Throw data on the floor */
 
344
             _XEatData(dpy, be_buf_size);
 
345
             return BadAlloc;
 
346
          }
 
347
       }
 
348
 
 
349
       UnlockDisplay(dpy);
 
350
       SyncHandle();
 
351
 
 
352
       if (s > from_screen && be_buf_size > 0) {
 
353
          Xfree(be_buf);
 
354
       }
 
355
    }
 
356
 
 
357
    /*
 
358
     * send the reply to the client
 
359
     */
 
360
    memcpy( &reply, &be_reply, sz_xGLXVendorPrivReply );
 
361
    reply.type = X_Reply;
 
362
    reply.sequenceNumber = client->sequence;
 
363
 
 
364
    if (client->swapped) {
 
365
       SendSwappedReply( client, &reply, be_buf, be_buf_size );
 
366
    }
 
367
    else {
 
368
       WriteToClient(client, sizeof(xGLXVendorPrivReply),(char *)&reply);
 
369
       if (be_buf_size > 0)
 
370
          WriteToClient(client, be_buf_size, (char *)be_buf);
 
371
    }
 
372
 
 
373
    if (be_buf_size > 0) Xfree(be_buf);
 
374
 
 
375
    return Success;
 
376
}
 
377
 
 
378
int __glXVForwardSingleReqSwap( __GLXclientState *cl, GLbyte *pc )
 
379
{
 
380
   xGLXVendorPrivateReq *req = (xGLXVendorPrivateReq *)pc;
 
381
   __GLX_DECLARE_SWAP_VARIABLES;
 
382
 
 
383
   __GLX_SWAP_SHORT(&req->length);
 
384
   __GLX_SWAP_INT(&req->vendorCode);
 
385
   __GLX_SWAP_INT(&req->contextTag);
 
386
 
 
387
   swap_vec_element_size = 0;
 
388
 
 
389
   return( __glXVForwardSingleReq( cl, pc ) );
 
390
}
 
391
 
 
392
int __glXVForwardPipe0WithReplySwap( __GLXclientState *cl, GLbyte *pc )
 
393
{
 
394
   xGLXVendorPrivateReq *req = (xGLXVendorPrivateReq *)pc;
 
395
   __GLX_DECLARE_SWAP_VARIABLES;
 
396
 
 
397
   __GLX_SWAP_SHORT(&req->length);
 
398
   __GLX_SWAP_INT(&req->vendorCode);
 
399
   __GLX_SWAP_INT(&req->contextTag);
 
400
 
 
401
   swap_vec_element_size = 0;
 
402
 
 
403
   /*
 
404
    * swap extra data in request - assuming all data
 
405
    * (if available) are arrays of 4 bytes components !
 
406
    */
 
407
   if (req->length > sz_xGLXVendorPrivateReq/4) {
 
408
      int *data = (int *)(req+1);
 
409
      int count = req->length - sz_xGLXVendorPrivateReq/4;
 
410
      __GLX_SWAP_INT_ARRAY(data, count );
 
411
   }
 
412
 
 
413
   return( __glXVForwardPipe0WithReply( cl, pc ) );
 
414
}
 
415
 
 
416
int __glXVForwardPipe0WithReplySwapsv( __GLXclientState *cl, GLbyte *pc )
 
417
{
 
418
   xGLXVendorPrivateReq *req = (xGLXVendorPrivateReq *)pc;
 
419
   __GLX_DECLARE_SWAP_VARIABLES;
 
420
 
 
421
   __GLX_SWAP_SHORT(&req->length);
 
422
   __GLX_SWAP_INT(&req->vendorCode);
 
423
   __GLX_SWAP_INT(&req->contextTag);
 
424
 
 
425
   swap_vec_element_size = 2;
 
426
 
 
427
   /*
 
428
    * swap extra data in request - assuming all data
 
429
    * (if available) are arrays of 4 bytes components !
 
430
    */
 
431
   if (req->length > sz_xGLXVendorPrivateReq/4) {
 
432
      int *data = (int *)(req+1);
 
433
      int count = req->length - sz_xGLXVendorPrivateReq/4;
 
434
      __GLX_SWAP_INT_ARRAY(data, count );
 
435
   }
 
436
 
 
437
   return( __glXVForwardPipe0WithReply( cl, pc ) );
 
438
}
 
439
 
 
440
int __glXVForwardPipe0WithReplySwapiv( __GLXclientState *cl, GLbyte *pc )
 
441
{
 
442
   xGLXVendorPrivateReq *req = (xGLXVendorPrivateReq *)pc;
 
443
   __GLX_DECLARE_SWAP_VARIABLES;
 
444
 
 
445
   __GLX_SWAP_SHORT(&req->length);
 
446
   __GLX_SWAP_INT(&req->vendorCode);
 
447
   __GLX_SWAP_INT(&req->contextTag);
 
448
 
 
449
   swap_vec_element_size = 4;
 
450
 
 
451
   /*
 
452
    * swap extra data in request - assuming all data
 
453
    * (if available) are arrays of 4 bytes components !
 
454
    */
 
455
   if (req->length > sz_xGLXVendorPrivateReq/4) {
 
456
      int *data = (int *)(req+1);
 
457
      int count = req->length - sz_xGLXVendorPrivateReq/4;
 
458
      __GLX_SWAP_INT_ARRAY(data, count );
 
459
   }
 
460
 
 
461
   return( __glXVForwardPipe0WithReply( cl, pc ) );
 
462
}
 
463
 
 
464
int __glXVForwardPipe0WithReplySwapdv( __GLXclientState *cl, GLbyte *pc )
 
465
{
 
466
   xGLXVendorPrivateReq *req = (xGLXVendorPrivateReq *)pc;
 
467
   __GLX_DECLARE_SWAP_VARIABLES;
 
468
 
 
469
   __GLX_SWAP_SHORT(&req->length);
 
470
   __GLX_SWAP_INT(&req->vendorCode);
 
471
   __GLX_SWAP_INT(&req->contextTag);
 
472
 
 
473
   swap_vec_element_size = 8;
 
474
 
 
475
   /*
 
476
    * swap extra data in request - assuming all data
 
477
    * (if available) are arrays of 4 bytes components !
 
478
    */
 
479
   if (req->length > sz_xGLXVendorPrivateReq/4) {
 
480
      int *data = (int *)(req+1);
 
481
      int count = req->length - sz_xGLXVendorPrivateReq/4;
 
482
      __GLX_SWAP_INT_ARRAY(data, count );
 
483
   }
 
484
 
 
485
   return( __glXVForwardPipe0WithReply( cl, pc ) );
 
486
}
 
487
 
 
488
int __glXVForwardAllWithReplySwap( __GLXclientState *cl, GLbyte *pc )
 
489
{
 
490
   xGLXVendorPrivateReq *req = (xGLXVendorPrivateReq *)pc;
 
491
   __GLX_DECLARE_SWAP_VARIABLES;
 
492
 
 
493
   __GLX_SWAP_SHORT(&req->length);
 
494
   __GLX_SWAP_INT(&req->vendorCode);
 
495
   __GLX_SWAP_INT(&req->contextTag);
 
496
 
 
497
   swap_vec_element_size = 0;
 
498
 
 
499
   /*
 
500
    * swap extra data in request - assuming all data
 
501
    * (if available) are arrays of 4 bytes components !
 
502
    */
 
503
   if (req->length > sz_xGLXVendorPrivateReq/4) {
 
504
      int *data = (int *)(req+1);
 
505
      int count = req->length - sz_xGLXVendorPrivateReq/4;
 
506
      __GLX_SWAP_INT_ARRAY(data, count );
 
507
   }
 
508
 
 
509
   return( __glXVForwardAllWithReply( cl, pc ) );
 
510
}
 
511
 
 
512
int __glXVForwardAllWithReplySwapsv( __GLXclientState *cl, GLbyte *pc )
 
513
{
 
514
   xGLXVendorPrivateReq *req = (xGLXVendorPrivateReq *)pc;
 
515
   __GLX_DECLARE_SWAP_VARIABLES;
 
516
 
 
517
   __GLX_SWAP_SHORT(&req->length);
 
518
   __GLX_SWAP_INT(&req->vendorCode);
 
519
   __GLX_SWAP_INT(&req->contextTag);
 
520
 
 
521
   swap_vec_element_size = 2;
 
522
 
 
523
   /*
 
524
    * swap extra data in request - assuming all data
 
525
    * (if available) are arrays of 4 bytes components !
 
526
    */
 
527
   if (req->length > sz_xGLXVendorPrivateReq/4) {
 
528
      int *data = (int *)(req+1);
 
529
      int count = req->length - sz_xGLXVendorPrivateReq/4;
 
530
      __GLX_SWAP_INT_ARRAY(data, count );
 
531
   }
 
532
 
 
533
   return( __glXVForwardAllWithReply( cl, pc ) );
 
534
}
 
535
 
 
536
int __glXVForwardAllWithReplySwapiv( __GLXclientState *cl, GLbyte *pc )
 
537
{
 
538
   xGLXVendorPrivateReq *req = (xGLXVendorPrivateReq *)pc;
 
539
   __GLX_DECLARE_SWAP_VARIABLES;
 
540
 
 
541
   __GLX_SWAP_SHORT(&req->length);
 
542
   __GLX_SWAP_INT(&req->vendorCode);
 
543
   __GLX_SWAP_INT(&req->contextTag);
 
544
 
 
545
   swap_vec_element_size = 4;
 
546
 
 
547
   /*
 
548
    * swap extra data in request - assuming all data
 
549
    * (if available) are arrays of 4 bytes components !
 
550
    */
 
551
   if (req->length > sz_xGLXVendorPrivateReq/4) {
 
552
      int *data = (int *)(req+1);
 
553
      int count = req->length - sz_xGLXVendorPrivateReq/4;
 
554
      __GLX_SWAP_INT_ARRAY(data, count );
 
555
   }
 
556
 
 
557
   return( __glXVForwardAllWithReply( cl, pc ) );
 
558
}
 
559
 
 
560
int __glXVForwardAllWithReplySwapdv( __GLXclientState *cl, GLbyte *pc )
 
561
{
 
562
   xGLXVendorPrivateReq *req = (xGLXVendorPrivateReq *)pc;
 
563
   __GLX_DECLARE_SWAP_VARIABLES;
 
564
 
 
565
   __GLX_SWAP_SHORT(&req->length);
 
566
   __GLX_SWAP_INT(&req->vendorCode);
 
567
   __GLX_SWAP_INT(&req->contextTag);
 
568
 
 
569
   swap_vec_element_size = 8;
 
570
 
 
571
   /*
 
572
    * swap extra data in request - assuming all data
 
573
    * (if available) are arrays of 4 bytes components !
 
574
    */
 
575
   if (req->length > sz_xGLXVendorPrivateReq/4) {
 
576
      int *data = (int *)(req+1);
 
577
      int count = req->length - sz_xGLXVendorPrivateReq/4;
 
578
      __GLX_SWAP_INT_ARRAY(data, count );
 
579
   }
 
580
 
 
581
   return( __glXVForwardAllWithReply( cl, pc ) );
 
582
}
 
583