summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--GL/glx/glxcmds.c23
-rw-r--r--GL/glx/glxcmdsswap.c24
2 files changed, 11 insertions, 36 deletions
diff --git a/GL/glx/glxcmds.c b/GL/glx/glxcmds.c
index fdd36e218..e16087a67 100644
--- a/GL/glx/glxcmds.c
+++ b/GL/glx/glxcmds.c
@@ -1814,7 +1814,6 @@ int __glXDisp_RenderLarge(__GLXclientState *cl, GLbyte *pc)
xGLXRenderLargeReq *req;
ClientPtr client= cl->client;
GLuint dataBytes;
- __GLXdispatchRenderProcPtr proc;
__GLXrenderLargeHeader *hdr;
__GLXcontext *glxc;
int error;
@@ -1873,13 +1872,6 @@ int __glXDisp_RenderLarge(__GLXclientState *cl, GLbyte *pc)
return __glXError(GLXBadLargeRequest);
}
- proc = (__GLXdispatchRenderProcPtr)
- __glXGetProtocolDecodeFunction(& Render_dispatch_info, opcode, 0);
- if (proc == NULL) {
- client->errorValue = opcode;
- return __glXError(GLXBadLargeRequest);
- }
-
if (entry.varsize) {
/*
** If it's a variable-size command (a command whose length must
@@ -1956,6 +1948,8 @@ int __glXDisp_RenderLarge(__GLXclientState *cl, GLbyte *pc)
cl->largeCmdRequestsSoFar++;
if (req->requestNumber == cl->largeCmdRequestsTotal) {
+ __GLXdispatchRenderProcPtr proc;
+
/*
** This is the last request; it must have enough bytes to complete
** the command.
@@ -1981,16 +1975,9 @@ int __glXDisp_RenderLarge(__GLXclientState *cl, GLbyte *pc)
/*
** Use the opcode to index into the procedure table.
*/
- if ( (opcode >= __GLX_MIN_RENDER_OPCODE) &&
- (opcode <= __GLX_MAX_RENDER_OPCODE) ) {
- proc = __glXRenderTable[opcode];
-#if __GLX_MAX_RENDER_OPCODE_EXT > __GLX_MIN_RENDER_OPCODE_EXT
- } else if ( (opcode >= __GLX_MIN_RENDER_OPCODE_EXT) &&
- (opcode <= __GLX_MAX_RENDER_OPCODE_EXT) ) {
- opcode -= __GLX_MIN_RENDER_OPCODE_EXT;
- proc = __glXRenderTable_EXT[opcode];
-#endif /* __GLX_MAX_RENDER_OPCODE_EXT > __GLX_MIN_RENDER_OPCODE_EXT */
- } else {
+ proc = (__GLXdispatchRenderProcPtr)
+ __glXGetProtocolDecodeFunction(& Render_dispatch_info, opcode, 0);
+ if (proc == NULL) {
client->errorValue = opcode;
return __glXError(GLXBadLargeRequest);
}
diff --git a/GL/glx/glxcmdsswap.c b/GL/glx/glxcmdsswap.c
index 5dd98caef..ae6a9d11c 100644
--- a/GL/glx/glxcmdsswap.c
+++ b/GL/glx/glxcmdsswap.c
@@ -736,7 +736,6 @@ int __glXDispSwap_RenderLarge(__GLXclientState *cl, GLbyte *pc)
xGLXRenderLargeReq *req;
ClientPtr client= cl->client;
size_t dataBytes;
- __GLXdispatchRenderProcPtr proc;
__GLXrenderLargeHeader *hdr;
__GLXcontext *cx;
int error;
@@ -800,13 +799,6 @@ int __glXDispSwap_RenderLarge(__GLXclientState *cl, GLbyte *pc)
return __glXError(GLXBadLargeRequest);
}
- proc = (__GLXdispatchRenderProcPtr)
- __glXGetProtocolDecodeFunction(& Render_dispatch_info, opcode, 0);
- if (proc == NULL) {
- client->errorValue = opcode;
- return __glXError(GLXBadLargeRequest);
- }
-
if (entry.varsize) {
/*
** If it's a variable-size command (a command whose length must
@@ -882,6 +874,8 @@ int __glXDispSwap_RenderLarge(__GLXclientState *cl, GLbyte *pc)
cl->largeCmdRequestsSoFar++;
if (req->requestNumber == cl->largeCmdRequestsTotal) {
+ __GLXdispatchRenderProcPtr proc;
+
/*
** This is the last request; it must have enough bytes to complete
** the command.
@@ -911,16 +905,10 @@ int __glXDispSwap_RenderLarge(__GLXclientState *cl, GLbyte *pc)
** Use the opcode to index into the procedure table.
*/
opcode = hdr->opcode;
- if ( (opcode >= __GLX_MIN_RENDER_OPCODE) &&
- (opcode <= __GLX_MAX_RENDER_OPCODE) ) {
- proc = __glXSwapRenderTable[opcode];
-#if __GLX_MAX_RENDER_OPCODE_EXT > __GLX_MIN_RENDER_OPCODE_EXT
- } else if ( (opcode >= __GLX_MIN_RENDER_OPCODE_EXT) &&
- (opcode <= __GLX_MAX_RENDER_OPCODE_EXT) ) {
- int index = opcode - __GLX_MIN_RENDER_OPCODE_EXT;
- proc = __glXSwapRenderTable_EXT[index];
-#endif /* __GLX_MAX_RENDER_OPCODE_EXT > __GLX_MIN_RENDER_OPCODE_EXT */
- } else {
+
+ proc = (__GLXdispatchRenderProcPtr)
+ __glXGetProtocolDecodeFunction(& Render_dispatch_info, opcode, 1);
+ if (proc == NULL) {
client->errorValue = opcode;
return __glXError(GLXBadLargeRequest);
}