summaryrefslogtreecommitdiff
path: root/glx/indirect_texture_compression.c
diff options
context:
space:
mode:
Diffstat (limited to 'glx/indirect_texture_compression.c')
-rw-r--r--glx/indirect_texture_compression.c129
1 files changed, 70 insertions, 59 deletions
diff --git a/glx/indirect_texture_compression.c b/glx/indirect_texture_compression.c
index 5f44d7b1a..49d6db57f 100644
--- a/glx/indirect_texture_compression.c
+++ b/glx/indirect_texture_compression.c
@@ -39,80 +39,91 @@
#include "glthread.h"
#include "dispatch.h"
-int __glXDisp_GetCompressedTexImageARB(struct __GLXclientStateRec *cl, GLbyte *pc)
+int
+__glXDisp_GetCompressedTexImageARB(struct __GLXclientStateRec *cl, GLbyte * pc)
{
- xGLXSingleReq * const req = (xGLXSingleReq *) pc;
+ xGLXSingleReq *const req = (xGLXSingleReq *) pc;
int error;
- __GLXcontext * const cx = __glXForceCurrent( cl, req->contextTag, & error );
+ __GLXcontext *const cx = __glXForceCurrent(cl, req->contextTag, &error);
ClientPtr client = cl->client;
-
pc += __GLX_SINGLE_HDR_SIZE;
- if ( cx != NULL ) {
- const GLenum target = *(GLenum *)(pc + 0);
- const GLint level = *(GLint *)(pc + 4);
- GLint compsize = 0;
- char *answer = NULL, answerBuffer[200];
-
- CALL_GetTexLevelParameteriv(GET_DISPATCH(), (target, level, GL_TEXTURE_COMPRESSED_IMAGE_SIZE, &compsize));
-
- if ( compsize != 0 ) {
- __GLX_GET_ANSWER_BUFFER(answer,cl,compsize,1);
- __glXClearErrorOccured();
- CALL_GetCompressedTexImageARB(GET_DISPATCH(), (target, level, answer));
- }
-
- if (__glXErrorOccured()) {
- __GLX_BEGIN_REPLY(0);
- __GLX_SEND_HEADER();
- } else {
- __GLX_BEGIN_REPLY(compsize);
- ((xGLXGetTexImageReply *)&__glXReply)->width = compsize;
- __GLX_SEND_HEADER();
- __GLX_SEND_VOID_ARRAY(compsize);
- }
-
- error = Success;
+ if (cx != NULL) {
+ const GLenum target = *(GLenum *) (pc + 0);
+ const GLint level = *(GLint *) (pc + 4);
+ GLint compsize = 0;
+ char *answer = NULL, answerBuffer[200];
+
+ CALL_GetTexLevelParameteriv(GET_DISPATCH(),
+ (target, level,
+ GL_TEXTURE_COMPRESSED_IMAGE_SIZE,
+ &compsize));
+
+ if (compsize != 0) {
+ __GLX_GET_ANSWER_BUFFER(answer, cl, compsize, 1);
+ __glXClearErrorOccured();
+ CALL_GetCompressedTexImageARB(GET_DISPATCH(),
+ (target, level, answer));
+ }
+
+ if (__glXErrorOccured()) {
+ __GLX_BEGIN_REPLY(0);
+ __GLX_SEND_HEADER();
+ }
+ else {
+ __GLX_BEGIN_REPLY(compsize);
+ ((xGLXGetTexImageReply *) & __glXReply)->width = compsize;
+ __GLX_SEND_HEADER();
+ __GLX_SEND_VOID_ARRAY(compsize);
+ }
+
+ error = Success;
}
return error;
}
-
-int __glXDispSwap_GetCompressedTexImageARB(struct __GLXclientStateRec *cl, GLbyte *pc)
+int
+__glXDispSwap_GetCompressedTexImageARB(struct __GLXclientStateRec *cl,
+ GLbyte * pc)
{
- xGLXSingleReq * const req = (xGLXSingleReq *) pc;
+ xGLXSingleReq *const req = (xGLXSingleReq *) pc;
int error;
- __GLXcontext * const cx = __glXForceCurrent( cl, bswap_32( req->contextTag ), & error );
+ __GLXcontext *const cx =
+ __glXForceCurrent(cl, bswap_32(req->contextTag), &error);
ClientPtr client = cl->client;
-
pc += __GLX_SINGLE_HDR_SIZE;
- if ( cx != NULL ) {
- const GLenum target = (GLenum) bswap_32( *(int *)(pc + 0) );
- const GLint level = (GLint ) bswap_32( *(int *)(pc + 4) );
- GLint compsize = 0;
- char *answer = NULL, answerBuffer[200];
-
- CALL_GetTexLevelParameteriv(GET_DISPATCH(), (target, level, GL_TEXTURE_COMPRESSED_IMAGE_SIZE, &compsize));
-
- if ( compsize != 0 ) {
- __GLX_GET_ANSWER_BUFFER(answer,cl,compsize,1);
- __glXClearErrorOccured();
- CALL_GetCompressedTexImageARB(GET_DISPATCH(), (target, level, answer));
- }
-
- if (__glXErrorOccured()) {
- __GLX_BEGIN_REPLY(0);
- __GLX_SEND_HEADER();
- } else {
- __GLX_BEGIN_REPLY(compsize);
- ((xGLXGetTexImageReply *)&__glXReply)->width = compsize;
- __GLX_SEND_HEADER();
- __GLX_SEND_VOID_ARRAY(compsize);
- }
-
- error = Success;
+ if (cx != NULL) {
+ const GLenum target = (GLenum) bswap_32(*(int *) (pc + 0));
+ const GLint level = (GLint) bswap_32(*(int *) (pc + 4));
+ GLint compsize = 0;
+ char *answer = NULL, answerBuffer[200];
+
+ CALL_GetTexLevelParameteriv(GET_DISPATCH(),
+ (target, level,
+ GL_TEXTURE_COMPRESSED_IMAGE_SIZE,
+ &compsize));
+
+ if (compsize != 0) {
+ __GLX_GET_ANSWER_BUFFER(answer, cl, compsize, 1);
+ __glXClearErrorOccured();
+ CALL_GetCompressedTexImageARB(GET_DISPATCH(),
+ (target, level, answer));
+ }
+
+ if (__glXErrorOccured()) {
+ __GLX_BEGIN_REPLY(0);
+ __GLX_SEND_HEADER();
+ }
+ else {
+ __GLX_BEGIN_REPLY(compsize);
+ ((xGLXGetTexImageReply *) & __glXReply)->width = compsize;
+ __GLX_SEND_HEADER();
+ __GLX_SEND_VOID_ARRAY(compsize);
+ }
+
+ error = Success;
}
return error;