From ca7885f7337141b50abd8f64d8773cabbf0256fe Mon Sep 17 00:00:00 2001 From: Wei Wang Date: Sun, 8 Apr 2007 11:24:08 -0600 Subject: [PATCH] fix bug 9823: GL_CLIENT_ATTRIB_STACK_DEPTH query fails for indirect rendering --- src/glx/x11/single2.c | 18 +++++++++--------- src/mesa/glapi/gl_API.xml | 8 ++++++-- 2 files changed, 15 insertions(+), 11 deletions(-) diff --git a/src/glx/x11/single2.c b/src/glx/x11/single2.c index 1c3b8f0..d535757 100644 --- a/src/glx/x11/single2.c +++ b/src/glx/x11/single2.c @@ -145,9 +145,10 @@ GLenum __indirect_glGetError(void) * On success \c GL_TRUE is returned. Otherwise, \c GL_FALSE is returned. */ static GLboolean -get_client_data( __GLXattribute * state, GLenum cap, GLintptr * data ) +get_client_data( __GLXcontext * gc, GLenum cap, GLintptr * data ) { GLboolean retval = GL_TRUE; + __GLXattribute * state = (__GLXattribute *)(gc->client_state_private); const GLint tex_unit = __glXGetActiveTextureUnit( state ); @@ -281,6 +282,9 @@ get_client_data( __GLXattribute * state, GLenum cap, GLintptr * data ) case GL_UNPACK_LSB_FIRST: *data = (GLintptr)state->storeUnpack.lsbFirst; break; + case GL_CLIENT_ATTRIB_STACK_DEPTH: + *data = (GLintptr)(gc->attributes.stackPointer - gc->attributes.stack); + break; case GL_MAX_CLIENT_ATTRIB_STACK_DEPTH: *data = (GLintptr)__GL_CLIENT_ATTRIB_STACK_DEPTH; break; @@ -302,7 +306,6 @@ void __indirect_glGetBooleanv(GLenum val, GLboolean *b) { const GLenum origVal = val; __GLX_SINGLE_DECLARE_VARIABLES(); - __GLXattribute * state = (__GLXattribute *)(gc->client_state_private); xGLXSingleReply reply; val = RemapTransposeEnum( val ); @@ -326,7 +329,7 @@ void __indirect_glGetBooleanv(GLenum val, GLboolean *b) ** for example, to call a query between glBegin() and glEnd()). */ - if ( get_client_data( state, val, & data ) ) { + if ( get_client_data( gc, val, & data ) ) { *b = (GLboolean) data; } else { @@ -351,7 +354,6 @@ void __indirect_glGetDoublev(GLenum val, GLdouble *d) { const GLenum origVal = val; __GLX_SINGLE_DECLARE_VARIABLES(); - __GLXattribute * state = (__GLXattribute *)(gc->client_state_private); xGLXSingleReply reply; val = RemapTransposeEnum( val ); @@ -375,7 +377,7 @@ void __indirect_glGetDoublev(GLenum val, GLdouble *d) ** for example, to call a query between glBegin() and glEnd()). */ - if ( get_client_data( state, val, & data ) ) { + if ( get_client_data( gc, val, & data ) ) { *d = (GLdouble) data; } else { @@ -400,7 +402,6 @@ void __indirect_glGetFloatv(GLenum val, GLfloat *f) { const GLenum origVal = val; __GLX_SINGLE_DECLARE_VARIABLES(); - __GLXattribute * state = (__GLXattribute *)(gc->client_state_private); xGLXSingleReply reply; val = RemapTransposeEnum( val ); @@ -424,7 +425,7 @@ void __indirect_glGetFloatv(GLenum val, GLfloat *f) ** for example, to call a query between glBegin() and glEnd()). */ - if ( get_client_data( state, val, & data ) ) { + if ( get_client_data( gc, val, & data ) ) { *f = (GLfloat) data; } else { @@ -449,7 +450,6 @@ void __indirect_glGetIntegerv(GLenum val, GLint *i) { const GLenum origVal = val; __GLX_SINGLE_DECLARE_VARIABLES(); - __GLXattribute * state = (__GLXattribute *)(gc->client_state_private); xGLXSingleReply reply; val = RemapTransposeEnum( val ); @@ -473,7 +473,7 @@ void __indirect_glGetIntegerv(GLenum val, GLint *i) ** for example, to call a query between glBegin() and glEnd()). */ - if ( get_client_data( state, val, & data ) ) { + if ( get_client_data( gc, val, & data ) ) { *i = (GLint) data; } else { diff --git a/src/mesa/glapi/gl_API.xml b/src/mesa/glapi/gl_API.xml index 1f23d8c..c7b48c4 100644 --- a/src/mesa/glapi/gl_API.xml +++ b/src/mesa/glapi/gl_API.xml @@ -317,7 +317,9 @@ - + + + @@ -577,7 +579,9 @@ - + + + -- 2.7.4