diff options
Diffstat (limited to 'src/mesa/glapi')
-rw-r--r-- | src/mesa/glapi/gl_XML.py | 29 |
1 files changed, 25 insertions, 4 deletions
diff --git a/src/mesa/glapi/gl_XML.py b/src/mesa/glapi/gl_XML.py index 55bbddafa5b..79da5abab9b 100644 --- a/src/mesa/glapi/gl_XML.py +++ b/src/mesa/glapi/gl_XML.py @@ -193,7 +193,7 @@ class glParameter( glItem ): to glCallLists, are not variable length arrays in this sense.""" - return self.p_count_parameters != None + return (self.p_count_parameters != None) or (self.counter != None) def is_array(self): @@ -211,7 +211,7 @@ class glParameter( glItem ): glDeleteTextures), or a general variable length vector.""" if self.is_array(): - if self.is_variable_length_array(): + if self.p_count_parameters != None: return "compsize" elif self.counter != None: return self.counter @@ -222,13 +222,32 @@ class glParameter( glItem ): def size(self): - if self.is_variable_length_array(): + if self.p_count_parameters != None or self.counter != None or self.is_output: return 0 elif self.p_count == 0: return self.p_type.size else: return self.p_type.size * self.p_count + def size_string(self): + s = self.size() + if s == 0: + a_prod = "compsize" + b_prod = self.p_type.size + + if self.p_count_parameters == None and self.counter != None: + a_prod = self.counter + elif self.p_count_parameters != None and self.counter == None: + pass + elif self.p_count_parameters != None and self.counter != None: + b_prod = self.counter + else: + raise RuntimeError("Parameter '%s' to function '%s' has size 0." % (self.name, self.context.name)) + + return "(%s * %s)" % (a_prod, b_prod) + else: + return str(s) + class glParameterIterator: """Class to iterate over a list of glParameters. @@ -283,7 +302,7 @@ class glFunction( glItem ): def startElement(self, name, attrs): if name == "param": try: - glParameter(self, name, attrs) + self.context.factory.create(self, name, attrs) except RuntimeError: print "Error with parameter '%s' in function '%s'." \ % (attrs.get('name','(unknown)'), self.name) @@ -326,6 +345,8 @@ class glItemFactory: return glType(context, name, attrs) elif name == "enum": return glEnum(context, name, attrs) + elif name == "param": + return glParameter(context, name, attrs) else: return None |