2004-06-30 22:06:56 +02:00
|
|
|
/* DO NOT EDIT - THIS FILE IS AUTOMATICALLY GENERATED */
|
|
|
|
/*
|
Update to SGI FreeB 2.0.
Under the terms of version 1.1, "once Covered Code has been published
under a particular version of the License, Recipient may, for the
duration of the License, continue to use it under the terms of that
version, or choose to use such Covered Code under the terms of any
subsequent version published by SGI."
FreeB 2.0 license refers to "dates of first publication". They are here
taken to be 1991-2000, as noted in the original license text:
** Original Code. The Original Code is: OpenGL Sample Implementation,
** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
** Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
** Copyright in any portions created by third parties is as indicated
** elsewhere herein. All Rights Reserved.
Official FreeB 2.0 text:
http://oss.sgi.com/projects/FreeB/SGIFreeSWLicB.2.0.pdf
As always, this code has not been tested for conformance with the OpenGL
specification. OpenGL conformance testing is available from
http://khronos.org/ and is required for use of the OpenGL logo in
product advertising and promotion.
2008-09-19 18:02:28 +02:00
|
|
|
* SGI FREE SOFTWARE LICENSE B (Version 2.0, Sept. 18, 2008)
|
|
|
|
* Copyright (C) 1991-2000 Silicon Graphics, Inc. All Rights Reserved.
|
|
|
|
*
|
|
|
|
* Permission is hereby granted, free of charge, to any person obtaining a
|
|
|
|
* copy of this software and associated documentation files (the "Software"),
|
|
|
|
* to deal in the Software without restriction, including without limitation
|
|
|
|
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
|
|
|
|
* and/or sell copies of the Software, and to permit persons to whom the
|
|
|
|
* Software is furnished to do so, subject to the following conditions:
|
|
|
|
*
|
|
|
|
* The above copyright notice including the dates of first publication and
|
|
|
|
* either this permission notice or a reference to
|
|
|
|
* http://oss.sgi.com/projects/FreeB/
|
|
|
|
* shall be included in all copies or substantial portions of the Software.
|
|
|
|
*
|
|
|
|
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
|
|
|
|
* OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
|
|
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
|
|
|
|
* SILICON GRAPHICS, INC. BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
|
|
|
|
* WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF
|
|
|
|
* OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
|
|
* SOFTWARE.
|
|
|
|
*
|
|
|
|
* Except as contained in this notice, the name of Silicon Graphics, Inc.
|
|
|
|
* shall not be used in advertising or otherwise to promote the sale, use or
|
|
|
|
* other dealings in this Software without prior written authorization from
|
|
|
|
* Silicon Graphics, Inc.
|
|
|
|
*/
|
2004-06-30 22:06:56 +02:00
|
|
|
|
2005-07-27 10:16:35 +02:00
|
|
|
#ifdef HAVE_DMX_CONFIG_H
|
|
|
|
#include <dmx-config.h>
|
|
|
|
#endif
|
|
|
|
|
2004-06-30 22:06:56 +02:00
|
|
|
#include "dmx.h"
|
|
|
|
#include "dmxwindow.h"
|
|
|
|
#include "dmxpixmap.h"
|
|
|
|
#include "dmxfont.h"
|
|
|
|
|
|
|
|
#include "glxserver.h"
|
|
|
|
#include "glxext.h"
|
|
|
|
#include "g_disptab.h"
|
|
|
|
/* #include "g_disptab_EXT.h" */
|
|
|
|
#include "unpack.h"
|
|
|
|
#include "glxutil.h"
|
|
|
|
|
|
|
|
#include "GL/glxproto.h"
|
|
|
|
|
|
|
|
#ifdef PANORAMIX
|
|
|
|
#include "panoramiXsrv.h"
|
|
|
|
#endif
|
|
|
|
|
|
|
|
/*
|
|
|
|
* GetReqVendorPrivate - this is the equivalent of GetReq macro
|
|
|
|
* from Xlibint.h but it does not set the reqType field (the opcode).
|
|
|
|
* this is because the GL single opcodes has different naming convension
|
|
|
|
* the other X opcodes (ie. X_GLsop_GetFloatv).
|
|
|
|
*/
|
2004-07-07 06:32:52 +02:00
|
|
|
#if (defined(__STDC__) && !defined(UNIXCPP)) || defined(ANSICPP)
|
2004-06-30 22:06:56 +02:00
|
|
|
#define GetReqVendorPrivate(name, req) \
|
|
|
|
WORD64ALIGN\
|
|
|
|
if ((dpy->bufptr + SIZEOF(x##name##Req)) > dpy->bufmax)\
|
|
|
|
_XFlush(dpy);\
|
|
|
|
req = (x##name##Req *)(dpy->last_req = dpy->bufptr);\
|
|
|
|
req->length = (SIZEOF(x##name##Req))>>2;\
|
|
|
|
dpy->bufptr += SIZEOF(x##name##Req);\
|
|
|
|
dpy->request++
|
|
|
|
|
2012-03-21 20:55:09 +01:00
|
|
|
#else /* non-ANSI C uses empty comment instead of "##" for token concatenation */
|
2004-06-30 22:06:56 +02:00
|
|
|
#define GetReqVendorPrivate(name, req) \
|
|
|
|
WORD64ALIGN\
|
|
|
|
if ((dpy->bufptr + SIZEOF(x/**/name/**/Req)) > dpy->bufmax)\
|
|
|
|
_XFlush(dpy);\
|
|
|
|
req = (x/**/name/**/Req *)(dpy->last_req = dpy->bufptr);\
|
|
|
|
req->length = (SIZEOF(x/**/name/**/Req))>>2;\
|
|
|
|
dpy->bufptr += SIZEOF(x/**/name/**/Req);\
|
|
|
|
dpy->request++
|
|
|
|
#endif
|
|
|
|
|
2012-03-21 20:55:09 +01:00
|
|
|
extern Display *GetBackEndDisplay(__GLXclientState * cl, int s);
|
|
|
|
extern int GetCurrentBackEndTag(__GLXclientState * cl, GLXContextTag tag,
|
|
|
|
int s);
|
2004-06-30 22:06:56 +02:00
|
|
|
|
|
|
|
static int swap_vec_element_size = 0;
|
|
|
|
|
2012-03-21 20:55:09 +01:00
|
|
|
static void
|
|
|
|
SendSwappedReply(ClientPtr client,
|
|
|
|
xGLXVendorPrivReply * reply, char *buf, int buf_size)
|
2004-06-30 22:06:56 +02:00
|
|
|
{
|
2012-03-21 20:55:09 +01:00
|
|
|
__GLX_DECLARE_SWAP_VARIABLES;
|
|
|
|
__GLX_SWAP_SHORT(&reply->sequenceNumber);
|
|
|
|
__GLX_SWAP_INT(&reply->length);
|
|
|
|
__GLX_SWAP_INT(&reply->retval);
|
|
|
|
__GLX_SWAP_INT(&reply->size);
|
|
|
|
|
|
|
|
if ((buf_size == 0) && (swap_vec_element_size > 0)) {
|
|
|
|
/*
|
|
|
|
* the reply has single component - need to swap pad3
|
|
|
|
*/
|
|
|
|
if (swap_vec_element_size == 2) {
|
|
|
|
__GLX_SWAP_SHORT(&reply->pad3);
|
|
|
|
}
|
|
|
|
else if (swap_vec_element_size == 4) {
|
|
|
|
__GLX_SWAP_INT(&reply->pad3);
|
|
|
|
__GLX_SWAP_INT(&reply->pad4);
|
|
|
|
}
|
|
|
|
else if (swap_vec_element_size == 8) {
|
|
|
|
__GLX_SWAP_DOUBLE(&reply->pad3);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else if ((buf_size > 0) && (swap_vec_element_size > 0)) {
|
|
|
|
/*
|
|
|
|
* the reply has vector of elements which needs to be swapped
|
|
|
|
*/
|
|
|
|
int vsize = buf_size / swap_vec_element_size;
|
|
|
|
char *p = buf;
|
|
|
|
int i;
|
|
|
|
|
|
|
|
for (i = 0; i < vsize; i++) {
|
|
|
|
if (swap_vec_element_size == 2) {
|
|
|
|
__GLX_SWAP_SHORT(p);
|
|
|
|
}
|
|
|
|
else if (swap_vec_element_size == 4) {
|
|
|
|
__GLX_SWAP_INT(p);
|
|
|
|
}
|
|
|
|
else if (swap_vec_element_size == 8) {
|
|
|
|
__GLX_SWAP_DOUBLE(p);
|
|
|
|
}
|
|
|
|
|
|
|
|
p += swap_vec_element_size;
|
|
|
|
}
|
|
|
|
|
|
|
|
__GLX_SWAP_INT(&reply->pad3);
|
|
|
|
__GLX_SWAP_INT(&reply->pad4);
|
|
|
|
__GLX_SWAP_INT(&reply->pad5);
|
|
|
|
__GLX_SWAP_INT(&reply->pad6);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
2012-05-13 09:03:35 +02:00
|
|
|
WriteToClient(client, sizeof(xGLXVendorPrivReply), reply);
|
2004-06-30 22:06:56 +02:00
|
|
|
if (buf_size > 0)
|
2012-05-13 09:03:35 +02:00
|
|
|
WriteToClient(client, buf_size, buf);
|
2004-06-30 22:06:56 +02:00
|
|
|
|
|
|
|
}
|
|
|
|
|
2012-03-21 20:55:09 +01:00
|
|
|
int
|
|
|
|
__glXVForwardSingleReq(__GLXclientState * cl, GLbyte * pc)
|
2004-06-30 22:06:56 +02:00
|
|
|
{
|
2012-03-21 20:55:09 +01:00
|
|
|
xGLXVendorPrivateReq *req = (xGLXVendorPrivateReq *) pc;
|
|
|
|
xGLXVendorPrivateReq *be_req;
|
2004-06-30 22:06:56 +02:00
|
|
|
__GLXcontext *glxc;
|
2012-03-21 20:55:09 +01:00
|
|
|
int from_screen = 0;
|
|
|
|
int to_screen = 0;
|
|
|
|
int buf_size;
|
|
|
|
int s;
|
2004-06-30 22:06:56 +02:00
|
|
|
|
|
|
|
glxc = __glXLookupContextByTag(cl, req->contextTag);
|
|
|
|
if (!glxc) {
|
2012-03-21 20:55:09 +01:00
|
|
|
return 0;
|
2004-06-30 22:06:56 +02:00
|
|
|
}
|
|
|
|
from_screen = to_screen = glxc->pScreen->myNum;
|
|
|
|
|
|
|
|
#ifdef PANORAMIX
|
|
|
|
if (!noPanoramiXExtension) {
|
2012-03-21 20:55:09 +01:00
|
|
|
from_screen = 0;
|
|
|
|
to_screen = screenInfo.numScreens - 1;
|
2004-06-30 22:06:56 +02:00
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
|
|
|
pc += sz_xGLXVendorPrivateReq;
|
|
|
|
buf_size = (req->length << 2) - sz_xGLXVendorPrivateReq;
|
|
|
|
|
|
|
|
/*
|
|
|
|
* just forward the request to back-end server(s)
|
|
|
|
*/
|
2012-03-21 20:55:09 +01:00
|
|
|
for (s = from_screen; s <= to_screen; s++) {
|
|
|
|
DMXScreenInfo *dmxScreen = &dmxScreens[s];
|
|
|
|
Display *dpy = GetBackEndDisplay(cl, s);
|
|
|
|
|
|
|
|
LockDisplay(dpy);
|
|
|
|
GetReqVendorPrivate(GLXVendorPrivate, be_req);
|
|
|
|
be_req->reqType = dmxScreen->glxMajorOpcode;
|
|
|
|
be_req->glxCode = req->glxCode;
|
|
|
|
be_req->length = req->length;
|
|
|
|
be_req->vendorCode = req->vendorCode;
|
|
|
|
be_req->contextTag = GetCurrentBackEndTag(cl, req->contextTag, s);
|
|
|
|
if (buf_size > 0)
|
|
|
|
_XSend(dpy, (const char *) pc, buf_size);
|
|
|
|
UnlockDisplay(dpy);
|
|
|
|
SyncHandle();
|
2004-06-30 22:06:56 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
return Success;
|
|
|
|
}
|
|
|
|
|
2012-03-21 20:55:09 +01:00
|
|
|
int
|
|
|
|
__glXVForwardPipe0WithReply(__GLXclientState * cl, GLbyte * pc)
|
2004-06-30 22:06:56 +02:00
|
|
|
{
|
2012-03-21 20:55:09 +01:00
|
|
|
ClientPtr client = cl->client;
|
|
|
|
xGLXVendorPrivateReq *req = (xGLXVendorPrivateReq *) pc;
|
|
|
|
xGLXVendorPrivateReq *be_req;
|
|
|
|
xGLXVendorPrivReply reply;
|
|
|
|
xGLXVendorPrivReply be_reply;
|
2004-06-30 22:06:56 +02:00
|
|
|
__GLXcontext *glxc;
|
2012-03-21 20:55:09 +01:00
|
|
|
int buf_size;
|
|
|
|
char *be_buf = NULL;
|
|
|
|
int be_buf_size;
|
|
|
|
DMXScreenInfo *dmxScreen;
|
|
|
|
Display *dpy;
|
2004-06-30 22:06:56 +02:00
|
|
|
|
|
|
|
glxc = __glXLookupContextByTag(cl, req->contextTag);
|
|
|
|
if (!glxc) {
|
2012-03-21 20:55:09 +01:00
|
|
|
return __glXBadContext;
|
2004-06-30 22:06:56 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
pc += sz_xGLXVendorPrivateReq;
|
|
|
|
buf_size = (req->length << 2) - sz_xGLXVendorPrivateReq;
|
|
|
|
|
|
|
|
dmxScreen = &dmxScreens[glxc->pScreen->myNum];
|
|
|
|
dpy = GetBackEndDisplay(cl, glxc->pScreen->myNum);
|
|
|
|
|
|
|
|
/*
|
|
|
|
* send the request to the first back-end server
|
|
|
|
*/
|
|
|
|
LockDisplay(dpy);
|
2012-03-21 20:55:09 +01:00
|
|
|
GetReqVendorPrivate(GLXVendorPrivate, be_req);
|
2004-06-30 22:06:56 +02:00
|
|
|
be_req->reqType = dmxScreen->glxMajorOpcode;
|
|
|
|
be_req->glxCode = req->glxCode;
|
|
|
|
be_req->length = req->length;
|
|
|
|
be_req->vendorCode = req->vendorCode;
|
2012-03-21 20:55:09 +01:00
|
|
|
be_req->contextTag =
|
|
|
|
GetCurrentBackEndTag(cl, req->contextTag, glxc->pScreen->myNum);
|
|
|
|
if (buf_size > 0)
|
|
|
|
_XSend(dpy, (const char *) pc, buf_size);
|
2004-06-30 22:06:56 +02:00
|
|
|
|
|
|
|
/*
|
|
|
|
* get the reply from the back-end server
|
|
|
|
*/
|
2012-03-21 20:55:09 +01:00
|
|
|
_XReply(dpy, (xReply *) & be_reply, 0, False);
|
2004-06-30 22:06:56 +02:00
|
|
|
be_buf_size = be_reply.length << 2;
|
|
|
|
if (be_buf_size > 0) {
|
2012-03-21 20:55:09 +01:00
|
|
|
be_buf = (char *) malloc(be_buf_size);
|
|
|
|
if (be_buf) {
|
|
|
|
_XRead(dpy, be_buf, be_buf_size);
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
/* Throw data on the floor */
|
|
|
|
_XEatData(dpy, be_buf_size);
|
|
|
|
return BadAlloc;
|
|
|
|
}
|
2004-06-30 22:06:56 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
UnlockDisplay(dpy);
|
|
|
|
SyncHandle();
|
|
|
|
|
|
|
|
/*
|
|
|
|
* send the reply to the client
|
|
|
|
*/
|
2012-03-21 20:55:09 +01:00
|
|
|
memcpy(&reply, &be_reply, sz_xGLXVendorPrivReply);
|
2004-06-30 22:06:56 +02:00
|
|
|
reply.type = X_Reply;
|
|
|
|
reply.sequenceNumber = client->sequence;
|
|
|
|
|
|
|
|
if (client->swapped) {
|
2012-03-21 20:55:09 +01:00
|
|
|
SendSwappedReply(client, &reply, be_buf, be_buf_size);
|
2004-06-30 22:06:56 +02:00
|
|
|
}
|
|
|
|
else {
|
2012-05-13 09:03:35 +02:00
|
|
|
WriteToClient(client, sizeof(xGLXVendorPrivReply), &reply);
|
2012-03-21 20:55:09 +01:00
|
|
|
if (be_buf_size > 0)
|
2012-05-13 09:03:35 +02:00
|
|
|
WriteToClient(client, be_buf_size, be_buf);
|
2004-06-30 22:06:56 +02:00
|
|
|
}
|
|
|
|
|
2012-03-21 20:55:09 +01:00
|
|
|
if (be_buf_size > 0)
|
|
|
|
free(be_buf);
|
2004-06-30 22:06:56 +02:00
|
|
|
|
|
|
|
return Success;
|
|
|
|
}
|
|
|
|
|
2012-03-21 20:55:09 +01:00
|
|
|
int
|
|
|
|
__glXVForwardAllWithReply(__GLXclientState * cl, GLbyte * pc)
|
2004-06-30 22:06:56 +02:00
|
|
|
{
|
2012-03-21 20:55:09 +01:00
|
|
|
ClientPtr client = cl->client;
|
|
|
|
xGLXVendorPrivateReq *req = (xGLXVendorPrivateReq *) pc;
|
|
|
|
xGLXVendorPrivateReq *be_req;
|
|
|
|
xGLXVendorPrivReply reply;
|
|
|
|
xGLXVendorPrivReply be_reply;
|
2004-06-30 22:06:56 +02:00
|
|
|
__GLXcontext *glxc;
|
2012-03-21 20:55:09 +01:00
|
|
|
int buf_size;
|
|
|
|
char *be_buf = NULL;
|
|
|
|
int be_buf_size = 0;
|
|
|
|
int from_screen = 0;
|
|
|
|
int to_screen = 0;
|
|
|
|
int s;
|
2004-06-30 22:06:56 +02:00
|
|
|
|
2012-03-21 20:55:09 +01:00
|
|
|
DMXScreenInfo *dmxScreen;
|
|
|
|
Display *dpy;
|
2004-06-30 22:06:56 +02:00
|
|
|
|
|
|
|
glxc = __glXLookupContextByTag(cl, req->contextTag);
|
|
|
|
if (!glxc) {
|
2012-03-21 20:55:09 +01:00
|
|
|
return 0;
|
2004-06-30 22:06:56 +02:00
|
|
|
}
|
|
|
|
from_screen = to_screen = glxc->pScreen->myNum;
|
|
|
|
|
|
|
|
#ifdef PANORAMIX
|
|
|
|
if (!noPanoramiXExtension) {
|
2012-03-21 20:55:09 +01:00
|
|
|
from_screen = 0;
|
|
|
|
to_screen = screenInfo.numScreens - 1;
|
2004-06-30 22:06:56 +02:00
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
|
|
|
pc += sz_xGLXVendorPrivateReq;
|
|
|
|
buf_size = (req->length << 2) - sz_xGLXVendorPrivateReq;
|
|
|
|
|
|
|
|
/*
|
|
|
|
* send the request to the first back-end server(s)
|
|
|
|
*/
|
2012-03-21 20:55:09 +01:00
|
|
|
for (s = to_screen; s >= from_screen; s--) {
|
|
|
|
dmxScreen = &dmxScreens[s];
|
|
|
|
dpy = GetBackEndDisplay(cl, s);
|
|
|
|
|
|
|
|
LockDisplay(dpy);
|
|
|
|
GetReqVendorPrivate(GLXVendorPrivate, be_req);
|
|
|
|
be_req->reqType = dmxScreen->glxMajorOpcode;
|
|
|
|
be_req->glxCode = req->glxCode;
|
|
|
|
be_req->length = req->length;
|
|
|
|
be_req->vendorCode = req->vendorCode;
|
|
|
|
be_req->contextTag = GetCurrentBackEndTag(cl, req->contextTag, s);
|
|
|
|
if (buf_size > 0)
|
|
|
|
_XSend(dpy, (const char *) pc, buf_size);
|
|
|
|
|
|
|
|
/*
|
|
|
|
* get the reply from the back-end server
|
|
|
|
*/
|
|
|
|
_XReply(dpy, (xReply *) & be_reply, 0, False);
|
|
|
|
be_buf_size = be_reply.length << 2;
|
|
|
|
if (be_buf_size > 0) {
|
|
|
|
be_buf = (char *) malloc(be_buf_size);
|
|
|
|
if (be_buf) {
|
|
|
|
_XRead(dpy, be_buf, be_buf_size);
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
/* Throw data on the floor */
|
|
|
|
_XEatData(dpy, be_buf_size);
|
|
|
|
return BadAlloc;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
UnlockDisplay(dpy);
|
|
|
|
SyncHandle();
|
|
|
|
|
|
|
|
if (s > from_screen && be_buf_size > 0) {
|
|
|
|
free(be_buf);
|
|
|
|
}
|
2004-06-30 22:06:56 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
/*
|
|
|
|
* send the reply to the client
|
|
|
|
*/
|
2012-03-21 20:55:09 +01:00
|
|
|
memcpy(&reply, &be_reply, sz_xGLXVendorPrivReply);
|
2004-06-30 22:06:56 +02:00
|
|
|
reply.type = X_Reply;
|
|
|
|
reply.sequenceNumber = client->sequence;
|
|
|
|
|
|
|
|
if (client->swapped) {
|
2012-03-21 20:55:09 +01:00
|
|
|
SendSwappedReply(client, &reply, be_buf, be_buf_size);
|
2004-06-30 22:06:56 +02:00
|
|
|
}
|
|
|
|
else {
|
2012-05-13 09:03:35 +02:00
|
|
|
WriteToClient(client, sizeof(xGLXVendorPrivReply), &reply);
|
2012-03-21 20:55:09 +01:00
|
|
|
if (be_buf_size > 0)
|
2012-05-13 09:03:35 +02:00
|
|
|
WriteToClient(client, be_buf_size, be_buf);
|
2004-06-30 22:06:56 +02:00
|
|
|
}
|
|
|
|
|
2012-03-21 20:55:09 +01:00
|
|
|
if (be_buf_size > 0)
|
|
|
|
free(be_buf);
|
2004-06-30 22:06:56 +02:00
|
|
|
|
|
|
|
return Success;
|
|
|
|
}
|
|
|
|
|
2012-03-21 20:55:09 +01:00
|
|
|
int
|
|
|
|
__glXVForwardSingleReqSwap(__GLXclientState * cl, GLbyte * pc)
|
2004-06-30 22:06:56 +02:00
|
|
|
{
|
2012-03-21 20:55:09 +01:00
|
|
|
xGLXVendorPrivateReq *req = (xGLXVendorPrivateReq *) pc;
|
2004-06-30 22:06:56 +02:00
|
|
|
|
2012-03-21 20:55:09 +01:00
|
|
|
__GLX_DECLARE_SWAP_VARIABLES;
|
2004-06-30 22:06:56 +02:00
|
|
|
|
2012-03-21 20:55:09 +01:00
|
|
|
__GLX_SWAP_SHORT(&req->length);
|
|
|
|
__GLX_SWAP_INT(&req->vendorCode);
|
|
|
|
__GLX_SWAP_INT(&req->contextTag);
|
2004-06-30 22:06:56 +02:00
|
|
|
|
2012-03-21 20:55:09 +01:00
|
|
|
swap_vec_element_size = 0;
|
|
|
|
|
|
|
|
return (__glXVForwardSingleReq(cl, pc));
|
2004-06-30 22:06:56 +02:00
|
|
|
}
|
|
|
|
|
2012-03-21 20:55:09 +01:00
|
|
|
int
|
|
|
|
__glXVForwardPipe0WithReplySwap(__GLXclientState * cl, GLbyte * pc)
|
2004-06-30 22:06:56 +02:00
|
|
|
{
|
2012-03-21 20:55:09 +01:00
|
|
|
xGLXVendorPrivateReq *req = (xGLXVendorPrivateReq *) pc;
|
|
|
|
|
|
|
|
__GLX_DECLARE_SWAP_VARIABLES;
|
|
|
|
__GLX_DECLARE_SWAP_ARRAY_VARIABLES;
|
|
|
|
|
|
|
|
__GLX_SWAP_SHORT(&req->length);
|
|
|
|
__GLX_SWAP_INT(&req->vendorCode);
|
|
|
|
__GLX_SWAP_INT(&req->contextTag);
|
|
|
|
|
|
|
|
swap_vec_element_size = 0;
|
|
|
|
|
|
|
|
/*
|
|
|
|
* swap extra data in request - assuming all data
|
|
|
|
* (if available) are arrays of 4 bytes components !
|
|
|
|
*/
|
|
|
|
if (req->length > sz_xGLXVendorPrivateReq / 4) {
|
|
|
|
int *data = (int *) (req + 1);
|
|
|
|
int count = req->length - sz_xGLXVendorPrivateReq / 4;
|
|
|
|
|
|
|
|
__GLX_SWAP_INT_ARRAY(data, count);
|
|
|
|
}
|
|
|
|
|
|
|
|
return (__glXVForwardPipe0WithReply(cl, pc));
|
2004-06-30 22:06:56 +02:00
|
|
|
}
|
|
|
|
|
2012-03-21 20:55:09 +01:00
|
|
|
int
|
|
|
|
__glXVForwardPipe0WithReplySwapsv(__GLXclientState * cl, GLbyte * pc)
|
2004-06-30 22:06:56 +02:00
|
|
|
{
|
2012-03-21 20:55:09 +01:00
|
|
|
xGLXVendorPrivateReq *req = (xGLXVendorPrivateReq *) pc;
|
|
|
|
|
|
|
|
__GLX_DECLARE_SWAP_VARIABLES;
|
|
|
|
__GLX_DECLARE_SWAP_ARRAY_VARIABLES;
|
|
|
|
|
|
|
|
__GLX_SWAP_SHORT(&req->length);
|
|
|
|
__GLX_SWAP_INT(&req->vendorCode);
|
|
|
|
__GLX_SWAP_INT(&req->contextTag);
|
|
|
|
|
|
|
|
swap_vec_element_size = 2;
|
|
|
|
|
|
|
|
/*
|
|
|
|
* swap extra data in request - assuming all data
|
|
|
|
* (if available) are arrays of 4 bytes components !
|
|
|
|
*/
|
|
|
|
if (req->length > sz_xGLXVendorPrivateReq / 4) {
|
|
|
|
int *data = (int *) (req + 1);
|
|
|
|
int count = req->length - sz_xGLXVendorPrivateReq / 4;
|
|
|
|
|
|
|
|
__GLX_SWAP_INT_ARRAY(data, count);
|
|
|
|
}
|
|
|
|
|
|
|
|
return (__glXVForwardPipe0WithReply(cl, pc));
|
2004-06-30 22:06:56 +02:00
|
|
|
}
|
|
|
|
|
2012-03-21 20:55:09 +01:00
|
|
|
int
|
|
|
|
__glXVForwardPipe0WithReplySwapiv(__GLXclientState * cl, GLbyte * pc)
|
2004-06-30 22:06:56 +02:00
|
|
|
{
|
2012-03-21 20:55:09 +01:00
|
|
|
xGLXVendorPrivateReq *req = (xGLXVendorPrivateReq *) pc;
|
|
|
|
|
|
|
|
__GLX_DECLARE_SWAP_VARIABLES;
|
|
|
|
__GLX_DECLARE_SWAP_ARRAY_VARIABLES;
|
|
|
|
|
|
|
|
__GLX_SWAP_SHORT(&req->length);
|
|
|
|
__GLX_SWAP_INT(&req->vendorCode);
|
|
|
|
__GLX_SWAP_INT(&req->contextTag);
|
|
|
|
|
|
|
|
swap_vec_element_size = 4;
|
|
|
|
|
|
|
|
/*
|
|
|
|
* swap extra data in request - assuming all data
|
|
|
|
* (if available) are arrays of 4 bytes components !
|
|
|
|
*/
|
|
|
|
if (req->length > sz_xGLXVendorPrivateReq / 4) {
|
|
|
|
int *data = (int *) (req + 1);
|
|
|
|
int count = req->length - sz_xGLXVendorPrivateReq / 4;
|
|
|
|
|
|
|
|
__GLX_SWAP_INT_ARRAY(data, count);
|
|
|
|
}
|
|
|
|
|
|
|
|
return (__glXVForwardPipe0WithReply(cl, pc));
|
2004-06-30 22:06:56 +02:00
|
|
|
}
|
|
|
|
|
2012-03-21 20:55:09 +01:00
|
|
|
int
|
|
|
|
__glXVForwardPipe0WithReplySwapdv(__GLXclientState * cl, GLbyte * pc)
|
2004-06-30 22:06:56 +02:00
|
|
|
{
|
2012-03-21 20:55:09 +01:00
|
|
|
xGLXVendorPrivateReq *req = (xGLXVendorPrivateReq *) pc;
|
|
|
|
|
|
|
|
__GLX_DECLARE_SWAP_VARIABLES;
|
|
|
|
__GLX_DECLARE_SWAP_ARRAY_VARIABLES;
|
|
|
|
|
|
|
|
__GLX_SWAP_SHORT(&req->length);
|
|
|
|
__GLX_SWAP_INT(&req->vendorCode);
|
|
|
|
__GLX_SWAP_INT(&req->contextTag);
|
|
|
|
|
|
|
|
swap_vec_element_size = 8;
|
|
|
|
|
|
|
|
/*
|
|
|
|
* swap extra data in request - assuming all data
|
|
|
|
* (if available) are arrays of 4 bytes components !
|
|
|
|
*/
|
|
|
|
if (req->length > sz_xGLXVendorPrivateReq / 4) {
|
|
|
|
int *data = (int *) (req + 1);
|
|
|
|
int count = req->length - sz_xGLXVendorPrivateReq / 4;
|
|
|
|
|
|
|
|
__GLX_SWAP_INT_ARRAY(data, count);
|
|
|
|
}
|
|
|
|
|
|
|
|
return (__glXVForwardPipe0WithReply(cl, pc));
|
2004-06-30 22:06:56 +02:00
|
|
|
}
|
|
|
|
|
2012-03-21 20:55:09 +01:00
|
|
|
int
|
|
|
|
__glXVForwardAllWithReplySwap(__GLXclientState * cl, GLbyte * pc)
|
2004-06-30 22:06:56 +02:00
|
|
|
{
|
2012-03-21 20:55:09 +01:00
|
|
|
xGLXVendorPrivateReq *req = (xGLXVendorPrivateReq *) pc;
|
|
|
|
|
|
|
|
__GLX_DECLARE_SWAP_VARIABLES;
|
|
|
|
__GLX_DECLARE_SWAP_ARRAY_VARIABLES;
|
|
|
|
|
|
|
|
__GLX_SWAP_SHORT(&req->length);
|
|
|
|
__GLX_SWAP_INT(&req->vendorCode);
|
|
|
|
__GLX_SWAP_INT(&req->contextTag);
|
|
|
|
|
|
|
|
swap_vec_element_size = 0;
|
|
|
|
|
|
|
|
/*
|
|
|
|
* swap extra data in request - assuming all data
|
|
|
|
* (if available) are arrays of 4 bytes components !
|
|
|
|
*/
|
|
|
|
if (req->length > sz_xGLXVendorPrivateReq / 4) {
|
|
|
|
int *data = (int *) (req + 1);
|
|
|
|
int count = req->length - sz_xGLXVendorPrivateReq / 4;
|
|
|
|
|
|
|
|
__GLX_SWAP_INT_ARRAY(data, count);
|
|
|
|
}
|
|
|
|
|
|
|
|
return (__glXVForwardAllWithReply(cl, pc));
|
2004-06-30 22:06:56 +02:00
|
|
|
}
|
|
|
|
|
2012-03-21 20:55:09 +01:00
|
|
|
int
|
|
|
|
__glXVForwardAllWithReplySwapsv(__GLXclientState * cl, GLbyte * pc)
|
2004-06-30 22:06:56 +02:00
|
|
|
{
|
2012-03-21 20:55:09 +01:00
|
|
|
xGLXVendorPrivateReq *req = (xGLXVendorPrivateReq *) pc;
|
|
|
|
|
|
|
|
__GLX_DECLARE_SWAP_VARIABLES;
|
|
|
|
__GLX_DECLARE_SWAP_ARRAY_VARIABLES;
|
|
|
|
|
|
|
|
__GLX_SWAP_SHORT(&req->length);
|
|
|
|
__GLX_SWAP_INT(&req->vendorCode);
|
|
|
|
__GLX_SWAP_INT(&req->contextTag);
|
|
|
|
|
|
|
|
swap_vec_element_size = 2;
|
|
|
|
|
|
|
|
/*
|
|
|
|
* swap extra data in request - assuming all data
|
|
|
|
* (if available) are arrays of 4 bytes components !
|
|
|
|
*/
|
|
|
|
if (req->length > sz_xGLXVendorPrivateReq / 4) {
|
|
|
|
int *data = (int *) (req + 1);
|
|
|
|
int count = req->length - sz_xGLXVendorPrivateReq / 4;
|
|
|
|
|
|
|
|
__GLX_SWAP_INT_ARRAY(data, count);
|
|
|
|
}
|
|
|
|
|
|
|
|
return (__glXVForwardAllWithReply(cl, pc));
|
2004-06-30 22:06:56 +02:00
|
|
|
}
|
|
|
|
|
2012-03-21 20:55:09 +01:00
|
|
|
int
|
|
|
|
__glXVForwardAllWithReplySwapiv(__GLXclientState * cl, GLbyte * pc)
|
2004-06-30 22:06:56 +02:00
|
|
|
{
|
2012-03-21 20:55:09 +01:00
|
|
|
xGLXVendorPrivateReq *req = (xGLXVendorPrivateReq *) pc;
|
|
|
|
|
|
|
|
__GLX_DECLARE_SWAP_VARIABLES;
|
|
|
|
__GLX_DECLARE_SWAP_ARRAY_VARIABLES;
|
|
|
|
|
|
|
|
__GLX_SWAP_SHORT(&req->length);
|
|
|
|
__GLX_SWAP_INT(&req->vendorCode);
|
|
|
|
__GLX_SWAP_INT(&req->contextTag);
|
|
|
|
|
|
|
|
swap_vec_element_size = 4;
|
|
|
|
|
|
|
|
/*
|
|
|
|
* swap extra data in request - assuming all data
|
|
|
|
* (if available) are arrays of 4 bytes components !
|
|
|
|
*/
|
|
|
|
if (req->length > sz_xGLXVendorPrivateReq / 4) {
|
|
|
|
int *data = (int *) (req + 1);
|
|
|
|
int count = req->length - sz_xGLXVendorPrivateReq / 4;
|
|
|
|
|
|
|
|
__GLX_SWAP_INT_ARRAY(data, count);
|
|
|
|
}
|
|
|
|
|
|
|
|
return (__glXVForwardAllWithReply(cl, pc));
|
2004-06-30 22:06:56 +02:00
|
|
|
}
|
|
|
|
|
2012-03-21 20:55:09 +01:00
|
|
|
int
|
|
|
|
__glXVForwardAllWithReplySwapdv(__GLXclientState * cl, GLbyte * pc)
|
2004-06-30 22:06:56 +02:00
|
|
|
{
|
2012-03-21 20:55:09 +01:00
|
|
|
xGLXVendorPrivateReq *req = (xGLXVendorPrivateReq *) pc;
|
2004-06-30 22:06:56 +02:00
|
|
|
|
2012-03-21 20:55:09 +01:00
|
|
|
__GLX_DECLARE_SWAP_VARIABLES;
|
|
|
|
__GLX_DECLARE_SWAP_ARRAY_VARIABLES;
|
|
|
|
|
|
|
|
__GLX_SWAP_SHORT(&req->length);
|
|
|
|
__GLX_SWAP_INT(&req->vendorCode);
|
|
|
|
__GLX_SWAP_INT(&req->contextTag);
|
|
|
|
|
|
|
|
swap_vec_element_size = 8;
|
|
|
|
|
|
|
|
/*
|
|
|
|
* swap extra data in request - assuming all data
|
|
|
|
* (if available) are arrays of 4 bytes components !
|
|
|
|
*/
|
|
|
|
if (req->length > sz_xGLXVendorPrivateReq / 4) {
|
|
|
|
int *data = (int *) (req + 1);
|
|
|
|
int count = req->length - sz_xGLXVendorPrivateReq / 4;
|
|
|
|
|
|
|
|
__GLX_SWAP_INT_ARRAY(data, count);
|
|
|
|
}
|
|
|
|
|
|
|
|
return (__glXVForwardAllWithReply(cl, pc));
|
|
|
|
}
|