From 003433989597771bbb4f03cf678f5771c09606fd Mon Sep 17 00:00:00 2001 From: =?utf8?q?Kristian=20H=C3=B8gsberg?= Date: Sat, 24 Apr 2010 16:22:02 -0400 Subject: [PATCH] es: Prefix the get* functions with _es1/2 so they don't conflict --- src/mesa/es/main/get_gen.py | 21 +++++++++------------ src/mesa/main/APIspec.xml | 14 +++++++------- src/mesa/main/APIspecutil.py | 7 +++++++ src/mesa/main/es_generator.py | 4 ++++ src/mesa/main/get.h | 23 +++++++++++++++++++++++ 5 files changed, 50 insertions(+), 19 deletions(-) diff --git a/src/mesa/es/main/get_gen.py b/src/mesa/es/main/get_gen.py index b820157be0c..5fadfee8411 100644 --- a/src/mesa/es/main/get_gen.py +++ b/src/mesa/es/main/get_gen.py @@ -565,7 +565,7 @@ def ConversionFunc(fromType, toType): return fromStr + "_TO_" + toStr -def EmitGetFunction(stateVars, returnType): +def EmitGetFunction(stateVars, returnType, API): """Emit the code to implement glGetBooleanv, glGetIntegerv or glGetFloatv.""" assert (returnType == GLboolean or returnType == GLint or @@ -575,13 +575,13 @@ def EmitGetFunction(stateVars, returnType): strType = TypeStrings[returnType] # Capitalize first letter of return type if returnType == GLint: - function = "_mesa_GetIntegerv" + function = "_es%d_GetIntegerv" % API elif returnType == GLboolean: - function = "_mesa_GetBooleanv" + function = "_es%d_GetBooleanv" % API elif returnType == GLfloat: - function = "_mesa_GetFloatv" + function = "_es%d_GetFloatv" % API elif returnType == GLfixed: - function = "_mesa_GetFixedv" + function = "_es%d_GetFixedv" % API else: abort() @@ -773,20 +773,17 @@ static GLenum compressed_formats[] = { #define ARRAY_SIZE(A) (sizeof(A) / sizeof(A[0])) -void GLAPIENTRY -_mesa_GetFixedv( GLenum pname, GLfixed *params ); - """ return def EmitAll(stateVars, API): EmitHeader() - EmitGetFunction(stateVars, GLboolean) - EmitGetFunction(stateVars, GLfloat) - EmitGetFunction(stateVars, GLint) + EmitGetFunction(stateVars, GLboolean, API) + EmitGetFunction(stateVars, GLfloat, API) + EmitGetFunction(stateVars, GLint, API) if API == 1: - EmitGetFunction(stateVars, GLfixed) + EmitGetFunction(stateVars, GLfixed, API) def main(args): diff --git a/src/mesa/main/APIspec.xml b/src/mesa/main/APIspec.xml index 7e77eb74d5c..7ed303dab00 100644 --- a/src/mesa/main/APIspec.xml +++ b/src/mesa/main/APIspec.xml @@ -3939,15 +3939,15 @@ - + - - - + + + @@ -4173,10 +4173,10 @@ - + - - + + diff --git a/src/mesa/main/APIspecutil.py b/src/mesa/main/APIspecutil.py index 27a8fe8a6d4..9e604bb84b3 100644 --- a/src/mesa/main/APIspecutil.py +++ b/src/mesa/main/APIspecutil.py @@ -222,6 +222,13 @@ def Parameters(funcname): return params +def FunctionPrefix(funcname): + """Return function specific prefix.""" + func = __functions[funcname] + + return func.prefix + + def FindParamIndex(params, paramname): """Find the index of a named parameter.""" for i in xrange(len(params)): diff --git a/src/mesa/main/es_generator.py b/src/mesa/main/es_generator.py index 1282a1c4f5e..8f08a3a6f92 100644 --- a/src/mesa/main/es_generator.py +++ b/src/mesa/main/es_generator.py @@ -293,6 +293,7 @@ for funcName in keys: passthroughFuncName = "" passthroughDeclarationString = "" passthroughCallString = "" + prefixOverride = None variables = [] conversionCodeOutgoing = [] conversionCodeIncoming = [] @@ -311,6 +312,9 @@ for funcName in keys: funcPrefix = "_es_" aliasprefix = apiutil.AliasPrefix(funcName) alias = apiutil.ConversionFunction(funcName) + prefixOverride = apiutil.FunctionPrefix(funcName) + if prefixOverride != "_mesa_": + aliasprefix = apiutil.FunctionPrefix(funcName) if not alias: # There may still be a Mesa alias for the function if apiutil.Alias(funcName): diff --git a/src/mesa/main/get.h b/src/mesa/main/get.h index cc426fc0f61..47e549e396b 100644 --- a/src/mesa/main/get.h +++ b/src/mesa/main/get.h @@ -71,4 +71,27 @@ _mesa_GetStringi(GLenum name, GLuint index); extern GLenum GLAPIENTRY _mesa_GetError( void ); + +extern void GLAPIENTRY +_es1_GetBooleanv( GLenum pname, GLboolean *params ); + +extern void GLAPIENTRY +_es1_GetFloatv( GLenum pname, GLfloat *params ); + +extern void GLAPIENTRY +_es1_GetIntegerv( GLenum pname, GLint *params ); + +extern void GLAPIENTRY +_es1_GetFixedv( GLenum pname, GLfixed *params ); + + +extern void GLAPIENTRY +_es2_GetBooleanv( GLenum pname, GLboolean *params ); + +extern void GLAPIENTRY +_es2_GetFloatv( GLenum pname, GLfloat *params ); + +extern void GLAPIENTRY +_es2_GetIntegerv( GLenum pname, GLint *params ); + #endif -- 2.30.2