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.
This commit is contained in:
Ian Romanick 2005-03-17 21:48:37 +00:00
parent 6af6a69312
commit 80a939cafb
5 changed files with 4322 additions and 3229 deletions

View file

@ -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 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
if temp_n == "Get":
names = ["GetIntegerv", "GetBooleanv", "GetFloatv", "GetDoublev" ]
else:
names = [ temp_n ]
self.context.glx_enum_functions[ n ].append( c, self.value, self.name )
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 )
else:
gl_XML.glEnum.startElement(self, context, name, attrs)
return

View file

@ -161,8 +161,11 @@ class PrintGlxSizeStubs_c(PrintGlxSizeStubs_common):
def printRealHeader(self):
print ''
print '#include <GL/gl.h>'
print '#include "indirect_size.h"'
if self.which_functions & self.do_get:
print '#include "indirect_size_get.h"'
print '#include "indirect_size.h"'
print ''
self.printHaveAlias()
print ''

File diff suppressed because it is too large Load diff

View file

@ -91,9 +91,10 @@ class glEnum( glItem ):
glItem.__init__(self, name, enum_name, context)
temp = attrs.get('count', None)
if temp == None:
self.default_count = 0
else:
self.default_count = 0
if temp == "?":
self.default_count = -1
elif temp:
try:
c = int(temp)
except Exception,e:

File diff suppressed because it is too large Load diff