aboutsummaryrefslogtreecommitdiffstats
path: root/src/mesa/glapi/glX_XML.py
diff options
context:
space:
mode:
authorIan Romanick <[email protected]>2005-03-17 21:48:37 +0000
committerIan Romanick <[email protected]>2005-03-17 21:48:37 +0000
commit80a939cafb7a67837a9fc82e45b5ec85c5912a06 (patch)
treec0deaae4d238750dfae5ab7c7eea475d9ff264b5 /src/mesa/glapi/glX_XML.py
parent6af6a6931240b1e05b3bb7cc2b56df29193ea65a (diff)
Enable the generation of server-side __glGetBooleanv_size and related
functions. There are two parts to this. First, a size element with a name "Get" is shorthand for having four separate size elements with names "GetIntegerv", "GetDoublev", "GetFloatv", and "GetBooleanv". Additionally, a count of "?" is treated specially. This causes a call to a handcoded function named "__gl<base name>_variable_size". This is *only* needed to support GL_COMPRESSED_TEXTURE_FORMATS. That enum can return a variable number of values depending how many compressed texture formats are supported by the implementation. Fix a problem with glGetProgram{Local,Env}Parameter[df]vARB, glAreProgramsResidentNV, and glGetVertexAttribivNV. These changes only affect code generated for the server-side. The changes to enum.c are caused by enums added for the server-side __glGetBooleanv_size functions.
Diffstat (limited to 'src/mesa/glapi/glX_XML.py')
-rw-r--r--src/mesa/glapi/glX_XML.py30
1 files changed, 21 insertions, 9 deletions
diff --git a/src/mesa/glapi/glX_XML.py b/src/mesa/glapi/glX_XML.py
index 98be9965704..4c16a68cb6b 100644
--- a/src/mesa/glapi/glX_XML.py
+++ b/src/mesa/glapi/glX_XML.py
@@ -125,6 +125,9 @@ class glXEnumFunction:
for a in self.enums:
count += 1
+ if self.count.has_key(-1):
+ return 0
+
# Determine if there is some mask M, such that M = (2^N) - 1,
# that will generate unique values for all of the enums.
@@ -176,7 +179,7 @@ class glXEnumFunction:
else:
return 0;
- def PrintUsingSwitch(self):
+ def PrintUsingSwitch(self, name):
"""Emit the body of the __gl*_size function using a
switch-statement."""
@@ -200,7 +203,10 @@ class glXEnumFunction:
else:
print '/* case %s:*/' % (j)
- print ' return %u;' % (c)
+ if c == -1:
+ print ' return __gl%s_variable_size( e );' % (name)
+ else:
+ print ' return %u;' % (c)
print ' default: return 0;'
print ' }'
@@ -212,7 +218,7 @@ class glXEnumFunction:
print '{'
if not self.PrintUsingTable():
- self.PrintUsingSwitch()
+ self.PrintUsingSwitch(name)
print '}'
print ''
@@ -226,14 +232,20 @@ class glXEnum(gl_XML.glEnum):
def startElement(self, name, attrs):
if name == "size":
- [n, c, mode] = self.process_attributes(attrs)
+ [temp_n, c, mode] = self.process_attributes(attrs)
+
+ if temp_n == "Get":
+ names = ["GetIntegerv", "GetBooleanv", "GetFloatv", "GetDoublev" ]
+ else:
+ names = [ temp_n ]
- if not self.context.glx_enum_functions.has_key( n ):
- f = self.context.createEnumFunction( n )
- f.set_mode( mode )
- self.context.glx_enum_functions[ f.name ] = f
+ for n in names:
+ if not self.context.glx_enum_functions.has_key( n ):
+ f = self.context.createEnumFunction( n )
+ f.set_mode( mode )
+ self.context.glx_enum_functions[ f.name ] = f
- self.context.glx_enum_functions[ n ].append( c, self.value, self.name )
+ self.context.glx_enum_functions[ n ].append( c, self.value, self.name )
else:
gl_XML.glEnum.startElement(self, context, name, attrs)
return