]> git.cworth.org Git - apitrace/commitdiff
Try to handle arbitrary sizes better.
authorJosé Fonseca <jfonseca@vmware.com>
Thu, 25 Nov 2010 10:08:50 +0000 (10:08 +0000)
committerJosé Fonseca <jfonseca@vmware.com>
Thu, 25 Nov 2010 10:08:50 +0000 (10:08 +0000)
glapi.py
helpers/spec.py

index 0b37d3ca68608ace077e8d45ca9ed07bb2743b9a..219ae94a677123e913c520cf6ab0ac78be94f6a5 100644 (file)
--- a/glapi.py
+++ b/glapi.py
@@ -3635,6 +3635,7 @@ glapi.add_functions([
     GlFunction(Void, "glGetProgramNamedParameterfvNV", [(GLprogram, "id"), (GLsizei, "len"), (Const(OpaquePointer(GLubyte)), "name"), (OpaquePointer(GLfloat), "params")], sideeffects=False),
 
     # GL_ATI_separate_stencil
+    GlFunction(Void, "glStencilOpSeparateATI", [(GLenum, "face"), (GLenum, "sfail"), (GLenum, "dpfail"), (GLenum, "dppass")]),
     GlFunction(Void, "glStencilFuncSeparateATI", [(GLenum, "frontfunc"), (GLenum, "backfunc"), (GLint, "ref"), (GLuint, "mask")]),
 
     # GL_EXT_depth_bounds_test
@@ -3665,6 +3666,9 @@ glapi.add_functions([
     # GL_EXT_framebuffer_blit
     GlFunction(Void, "glBlitFramebufferEXT", [(GLint, "srcX0"), (GLint, "srcY0"), (GLint, "srcX1"), (GLint, "srcY1"), (GLint, "dstX0"), (GLint, "dstY0"), (GLint, "dstX1"), (GLint, "dstY1"), (GLbitfield_attrib, "mask"), (GLenum, "filter")]),
 
+    # GL_EXT_framebuffer_multisample
+    GlFunction(Void, "glRenderbufferStorageMultisampleEXT", [(GLenum, "target"), (GLsizei, "samples"), (GLenum, "internalformat"), (GLsizei, "width"), (GLsizei, "height")]),
+
     # GL_EXT_timer_query
     GlFunction(Void, "glGetQueryObjecti64vEXT", [(GLuint, "id"), (GLenum, "pname"), (OpaquePointer(GLint64EXT), "params")], sideeffects=False),
     GlFunction(Void, "glGetQueryObjectui64vEXT", [(GLuint, "id"), (GLenum, "pname"), (OpaquePointer(GLuint64EXT), "params")], sideeffects=False),
index dd4a5ba95998b61cf3a922972079206f6756fca4..401c317b064a3825a1dce2ffbb39507af73e9aa9 100755 (executable)
@@ -147,6 +147,11 @@ class SpecParser(LineParser):
         function_name, arg_names = mo.groups()
         arg_names = [arg_name.strip() for arg_name in arg_names.split(',') if arg_name.strip()]
         
+        extra = ''
+        if self.get_function_re.match(function_name):
+            extra += ', sideeffects=False'
+        function_name = self.prefix + function_name
+
         ret_type = 'Void'
         arg_types = {}
         category = None
@@ -157,7 +162,7 @@ class SpecParser(LineParser):
                 ret_type = self.parse_type(fields[1])
             elif fields[0] == 'param':
                 arg_name, arg_type = fields[1:3]
-                arg_types[fields[1]] = self.parse_arg(arg_name, arg_type)
+                arg_types[fields[1]] = self.parse_arg(function_name, arg_name, arg_type)
             elif fields[0] == 'category':
                 category = fields[1]
             else:
@@ -182,10 +187,8 @@ class SpecParser(LineParser):
             constructor = 'StdFunction'
         else:
             constructor = 'GlFunction'
-        extra = ''
-        if self.get_function_re.match(function_name):
-            extra += ', sideeffects=False'
-        print '    %s(%s, "%s%s", [%s]%s),' % (constructor, ret_type, self.prefix, function_name, ', '.join(args), extra)
+
+        print '    %s(%s, "%s", [%s]%s),' % (constructor, ret_type, function_name, ', '.join(args), extra)
 
     array_re = re.compile(r'^array\s+\[(.*)\]$')
 
@@ -194,7 +197,7 @@ class SpecParser(LineParser):
         'GLcharARB': 'GLstringARB',
     }
 
-    def parse_arg(self, arg_name, arg_type):
+    def parse_arg(self, function_name, arg_name, arg_type):
         orig_type, inout, kind = arg_type.split(' ', 2)
 
         base_type = self.parse_type(orig_type)
@@ -219,9 +222,12 @@ class SpecParser(LineParser):
                 elif length == '1':
                     arg_type = 'Pointer(%s)' % base_type
                 elif length.find("COMPSIZE") == -1:
+                    arg_type = 'Array(%s, "%s")' % (base_type, length)
+                else:
                     # XXX: Handle COMPSIZE better
+                    length = length.replace("COMPSIZE", "__%s_size" % function_name)
+                    length = length.replace("/", ",")
                     arg_type = 'Array(%s, "%s")' % (base_type, length)
-            
             if inout == 'in':
                 arg_type = 'Const(%s)' % arg_type
         else: