]> git.cworth.org Git - apitrace/blobdiff - retrace/retrace.py
Avoid glCreateShaderProgramv when dumping satate so that the shader
[apitrace] / retrace / retrace.py
index 9828cfbaa831d20c242bc2da89cf7f2d33c7d79d..82910213a0d678e379b8a4f1d6e3c26183d1dec2 100644 (file)
@@ -328,6 +328,7 @@ class Retracer:
 
         self.deserializeArgs(function)
         
+        self.declareRet(function)
         self.invokeFunction(function)
 
         self.swizzleValues(function)
@@ -342,6 +343,7 @@ class Retracer:
 
         self.deserializeArgs(method)
         
+        self.declareRet(method)
         self.invokeInterfaceMethod(interface, method)
 
         self.swizzleValues(method)
@@ -430,10 +432,13 @@ class Retracer:
         visitor = SwizzledValueRegistrator()
         visitor.visit(type, lvalue, rvalue)
 
+    def declareRet(self, function):
+        if function.type is not stdapi.Void:
+            print '    %s _result;' % (function.type)
+
     def invokeFunction(self, function):
         arg_names = ", ".join(function.argNames())
         if function.type is not stdapi.Void:
-            print '    %s _result;' % (function.type)
             print '    _result = %s(%s);' % (function.name, arg_names)
             print '    (void)_result;'
         else:
@@ -450,7 +455,6 @@ class Retracer:
 
         arg_names = ", ".join(method.argNames())
         if method.type is not stdapi.Void:
-            print '    %s _result;' % (method.type)
             print '    _result = _this->%s(%s);' % (method.name, arg_names)
             print '    (void)_result;'
         else:
@@ -486,20 +490,21 @@ class Retracer:
 
         functions = filter(self.filterFunction, api.functions)
         for function in functions:
-            if function.sideeffects:
+            if function.sideeffects and not function.internal:
                 self.retraceFunction(function)
         interfaces = api.getAllInterfaces()
         for interface in interfaces:
             for method in interface.iterMethods():
-                if method.sideeffects:
+                if method.sideeffects and not method.internal:
                     self.retraceInterfaceMethod(interface, method)
 
         print 'const retrace::Entry %s[] = {' % self.table_name
         for function in functions:
-            if function.sideeffects:
-                print '    {"%s", &retrace_%s},' % (function.name, function.name)
-            else:
-                print '    {"%s", &retrace::ignore},' % (function.name,)
+            if not function.internal:
+                if function.sideeffects:
+                    print '    {"%s", &retrace_%s},' % (function.name, function.name)
+                else:
+                    print '    {"%s", &retrace::ignore},' % (function.name,)
         for interface in interfaces:
             for method in interface.iterMethods():                
                 if method.sideeffects: