From ba09c19ed65051cd9244c8a5ff380d08e7db1aed Mon Sep 17 00:00:00 2001 From: Ian Romanick Date: Tue, 1 Feb 2005 00:13:04 +0000 Subject: 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. --- src/mesa/glapi/gl_XML.py | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'src/mesa/glapi/gl_XML.py') 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): -- cgit v1.2.3