summaryrefslogtreecommitdiff
path: root/src/mesa/glapi/gl_XML.py
diff options
context:
space:
mode:
authorIan Romanick <idr@us.ibm.com>2005-02-01 00:13:04 +0000
committerIan Romanick <idr@us.ibm.com>2005-02-01 00:13:04 +0000
commitba09c19ed65051cd9244c8a5ff380d08e7db1aed (patch)
treede5eb21908dcc40c2ebf71c02658f1935cf02054 /src/mesa/glapi/gl_XML.py
parent886280763c8dfa7202bdacdeacf84ced69609b98 (diff)
Add GlxProto::createEnumFunction and add a 'context' parameter to the
glXEnumFunction constructor. The allows sub-classes of GlxProto to over-ride the concrete class used for glXEnumFunction. In addition to tracking p_count_parameters in glParameter, break the comma separated list of parameter names into a Python list called count_parameter_list. It is now possible to query if a name is the name of one of the count parameters just by comparing param.count_parameter_list.count(n) to zero. Eventually the remaining uses of p_count_parameters will be replaced with uses of count_parameter_list. Make sure that 'void *' parameters are handled correctly in glParameter::size_string. Add PrintGlxReqSize_h and PrintGlxReqSize_c. These classes emit prototypes and functions used on the server-side to determine the expected size of an incoming GL command.
Diffstat (limited to 'src/mesa/glapi/gl_XML.py')
-rw-r--r--src/mesa/glapi/gl_XML.py14
1 files changed, 14 insertions, 0 deletions
diff --git a/src/mesa/glapi/gl_XML.py b/src/mesa/glapi/gl_XML.py
index 21f6dc0e62..086133cdf1 100644
--- a/src/mesa/glapi/gl_XML.py
+++ b/src/mesa/glapi/gl_XML.py
@@ -153,6 +153,12 @@ class glParameter( glItem ):
self.p_type_string = attrs.get('type', None)
self.p_count_parameters = attrs.get('variable_param', None)
+ if self.p_count_parameters:
+ temp = self.p_count_parameters.replace( ' ', '' )
+ self.count_parameter_list = temp.split( ',' )
+ else:
+ self.count_parameter_list = []
+
self.p_type = context.context.find_type(self.p_type_string)
if self.p_type == None:
raise RuntimeError("Unknown type '%s' in function '%s'." % (self.p_type_string, context.name))
@@ -300,6 +306,11 @@ class glParameter( glItem ):
a_prod = "compsize"
b_prod = self.p_type.size
+ # Handle functions like glCompressedTexImage2D that
+ # have a counted 'void *' parameter.
+
+ if b_prod == 0: b_prod = 1
+
if self.p_count_parameters == None and self.counter != None:
a_prod = self.counter
elif self.p_count_parameters != None and self.counter == None:
@@ -349,6 +360,7 @@ class glFunction( glItem ):
self.fn_alias = attrs.get('alias', None)
self.fn_parameters = []
self.image = None
+ self.count_parameter_list = []
temp = attrs.get('offset', None)
if temp == None or temp == "?":
@@ -390,6 +402,8 @@ class glFunction( glItem ):
self.image = p
self.fn_parameters.append(p)
+ if p.count_parameter_list != []:
+ self.count_parameter_list.extend( p.count_parameter_list )
def set_return_type(self, t):