diff options
Diffstat (limited to 'src/mesa/main/get_gen.py')
-rw-r--r-- | src/mesa/main/get_gen.py | 29 |
1 files changed, 28 insertions, 1 deletions
diff --git a/src/mesa/main/get_gen.py b/src/mesa/main/get_gen.py index 97dc7850201..2878c1b5526 100644 --- a/src/mesa/main/get_gen.py +++ b/src/mesa/main/get_gen.py @@ -35,6 +35,7 @@ GLfloat = 3 GLdouble = 4 GLboolean = 5 GLfloatN = 6 # A normalized value, such as a color or depth range +GLint64 = 7 TypeStrings = { @@ -42,7 +43,8 @@ TypeStrings = { GLenum : "GLenum", GLfloat : "GLfloat", GLdouble : "GLdouble", - GLboolean : "GLboolean" + GLboolean : "GLboolean", + GLint64 : "GLint64" } @@ -1020,6 +1022,10 @@ StateVars = [ # GL_ARB_seamless_cube_map ( "GL_TEXTURE_CUBE_MAP_SEAMLESS", GLboolean, ["ctx->Texture.CubeMapSeamless"], "", ["ARB_seamless_cube_map"] ), + + # GL_ARB_sync + ( "GL_MAX_SERVER_WAIT_TIMEOUT", GLint64, ["ctx->Const.MaxServerWaitTimeout"], "", + ["ARB_sync"] ), ] @@ -1029,10 +1035,16 @@ def ConversionFunc(fromType, toType): return "" elif fromType == GLfloat and toType == GLint: return "IROUND" + elif fromType == GLfloat and toType == GLint64: + return "IROUND64" elif fromType == GLfloatN and toType == GLfloat: return "" elif fromType == GLint and toType == GLfloat: # but not GLfloatN! return "(GLfloat)" + elif fromType == GLint and toType == GLint64: + return "" + elif fromType == GLint64 and toType == GLfloat: # but not GLfloatN! + return "(GLfloat)" else: if fromType == GLfloatN: fromType = GLfloat @@ -1047,6 +1059,7 @@ def EmitGetFunction(stateVars, returnType): """Emit the code to implement glGetBooleanv, glGetIntegerv or glGetFloatv.""" assert (returnType == GLboolean or returnType == GLint or + returnType == GLint64 or returnType == GLfloat) strType = TypeStrings[returnType] @@ -1057,9 +1070,14 @@ def EmitGetFunction(stateVars, returnType): function = "GetBooleanv" elif returnType == GLfloat: function = "GetFloatv" + elif returnType == GLint64: + function = "GetInteger64v" else: abort() + if returnType == GLint64: + print "#if FEATURE_ARB_sync" + print "void GLAPIENTRY" print "_mesa_%s( GLenum pname, %s *params )" % (function, strType) print "{" @@ -1113,6 +1131,8 @@ def EmitGetFunction(stateVars, returnType): print ' _mesa_error(ctx, GL_INVALID_ENUM, "gl%s(pname=0x%%x)", pname);' % function print " }" print "}" + if returnType == GLint64: + print "#endif /* FEATURE_ARB_sync */" print "" return @@ -1141,9 +1161,15 @@ def EmitHeader(): #define INT_TO_BOOLEAN(I) ( (I) ? GL_TRUE : GL_FALSE ) +#define INT64_TO_BOOLEAN(I) ( (I) ? GL_TRUE : GL_FALSE ) +#define INT64_TO_INT(I) ( (GLint)((I > INT_MAX) ? INT_MAX : ((I < INT_MIN) ? INT_MIN : (I))) ) + #define BOOLEAN_TO_INT(B) ( (GLint) (B) ) +#define BOOLEAN_TO_INT64(B) ( (GLint64) (B) ) #define BOOLEAN_TO_FLOAT(B) ( (B) ? 1.0F : 0.0F ) +#define ENUM_TO_INT64(E) ( (GLint64) (E) ) + /* * Check if named extension is enabled, if not generate error and return. @@ -1221,5 +1247,6 @@ EmitHeader() EmitGetFunction(StateVars, GLboolean) EmitGetFunction(StateVars, GLfloat) EmitGetFunction(StateVars, GLint) +EmitGetFunction(StateVars, GLint64) EmitGetDoublev() |