From 8124faf89d638285d8e9aa93adc3ca7f4ee729f3 Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Thu, 25 Sep 2008 11:54:00 -0600 Subject: mesa: fix float->int mapping for glGetIntegerv(GL_DEPTH_CLEAR_VALUE) --- src/mesa/main/get_gen.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/mesa/main/get_gen.py') diff --git a/src/mesa/main/get_gen.py b/src/mesa/main/get_gen.py index decc9dd52a..dc543eb003 100644 --- a/src/mesa/main/get_gen.py +++ b/src/mesa/main/get_gen.py @@ -179,7 +179,7 @@ StateVars = [ ( "GL_DEPTH_BIAS", GLfloat, ["ctx->Pixel.DepthBias"], "", None ), ( "GL_DEPTH_BITS", GLint, ["ctx->DrawBuffer->Visual.depthBits"], "", None ), - ( "GL_DEPTH_CLEAR_VALUE", GLfloat, ["ctx->Depth.Clear"], "", None ), + ( "GL_DEPTH_CLEAR_VALUE", GLfloatN, ["ctx->Depth.Clear"], "", None ), ( "GL_DEPTH_FUNC", GLenum, ["ctx->Depth.Func"], "", None ), ( "GL_DEPTH_RANGE", GLfloatN, [ "ctx->Viewport.Near", "ctx->Viewport.Far" ], "", None ), -- cgit v1.2.3 From 1e3a44fab068f00378613456036716d0c3772969 Mon Sep 17 00:00:00 2001 From: Brian Date: Thu, 25 Sep 2008 19:57:34 -0600 Subject: mesa: fix cast/conversion for optional code --- src/mesa/main/get.c | 4 ++-- src/mesa/main/get_gen.py | 8 +++++--- 2 files changed, 7 insertions(+), 5 deletions(-) (limited to 'src/mesa/main/get_gen.py') diff --git a/src/mesa/main/get.c b/src/mesa/main/get.c index e87eea91dd..f72aa6a288 100644 --- a/src/mesa/main/get.c +++ b/src/mesa/main/get.c @@ -1092,7 +1092,7 @@ _mesa_GetBooleanv( GLenum pname, GLboolean *params ) GLuint i, n = _mesa_get_compressed_formats(ctx, formats, GL_FALSE); ASSERT(n <= 100); for (i = 0; i < n; i++) - params[i] = ENUM_TO_INT(formats[i]); + params[i] = ENUM_TO_BOOLEAN(formats[i]); } break; case GL_ARRAY_ELEMENT_LOCK_FIRST_EXT: @@ -2940,7 +2940,7 @@ _mesa_GetFloatv( GLenum pname, GLfloat *params ) GLuint i, n = _mesa_get_compressed_formats(ctx, formats, GL_FALSE); ASSERT(n <= 100); for (i = 0; i < n; i++) - params[i] = (GLfloat)(ENUM_TO_INT(formats[i])); + params[i] = ENUM_TO_FLOAT(formats[i]); } break; case GL_ARRAY_ELEMENT_LOCK_FIRST_EXT: diff --git a/src/mesa/main/get_gen.py b/src/mesa/main/get_gen.py index dc543eb003..152e378b4f 100644 --- a/src/mesa/main/get_gen.py +++ b/src/mesa/main/get_gen.py @@ -50,7 +50,8 @@ TypeStrings = { # - the GL state name, such as GL_CURRENT_COLOR # - the state datatype, one of GLint, GLfloat, GLboolean or GLenum # - list of code fragments to get the state, such as ["ctx->Foo.Bar"] -# - optional extra code or empty string +# - optional extra code or empty string. If present, "CONVERSION" will be +# replaced by ENUM_TO_FLOAT, INT_TO_FLOAT, etc. # - optional extensions to check, or None # StateVars = [ @@ -532,7 +533,7 @@ StateVars = [ GLuint i, n = _mesa_get_compressed_formats(ctx, formats, GL_FALSE); ASSERT(n <= 100); for (i = 0; i < n; i++) - params[i] = ENUM_TO_INT(formats[i]);""", + params[i] = CONVERSION(formats[i]);""", ["ARB_texture_compression"] ), # GL_EXT_compiled_vertex_array @@ -1083,10 +1084,11 @@ def EmitGetFunction(stateVars, returnType): assert len(extensions) == 4 print (' CHECK_EXT4(%s, %s, %s, %s, "%s");' % (extensions[0], extensions[1], extensions[2], extensions[3], function)) + conversion = ConversionFunc(varType, returnType) if optionalCode: + optionalCode = string.replace(optionalCode, "CONVERSION", conversion); print " {" print " " + optionalCode - conversion = ConversionFunc(varType, returnType) n = len(state) for i in range(n): if conversion: -- cgit v1.2.3