]> git.cworth.org Git - apitrace/blobdiff - d3d9trace.py
Move local writer definitions to a separate header file.
[apitrace] / d3d9trace.py
index b83ebf6d9123af417d7308f90d2a86a847fe4cc4..27fbc354a088383608f35ec8f3385f7658fe0cce 100644 (file)
@@ -25,7 +25,7 @@
 
 
 from trace import DllTracer
-from d3d9 import d3d9
+from specs.d3d9 import d3d9
 
 
 class D3D9Tracer(DllTracer):
@@ -33,19 +33,30 @@ class D3D9Tracer(DllTracer):
     def dump_arg_instance(self, function, arg):
         # Dump shaders as strings
         if function.name in ('CreateVertexShader', 'CreatePixelShader') and arg.name == 'pFunction':
-            print '    DumpShader(Trace::localWriter, %s);' % (arg.name)
+            print '    DumpShader(trace::localWriter, %s);' % (arg.name)
             return
 
         DllTracer.dump_arg_instance(self, function, arg)
 
 
 if __name__ == '__main__':
-    print '#include "trace_writer.hpp"'
+    print '#include "trace_writer_local.hpp"'
     print '#include "os.hpp"'
     print
     print '#include "d3d9imports.hpp"'
     print '#include "d3dshader.hpp"'
     print
+    print '''
+static inline size_t
+_declCount(const D3DVERTEXELEMENT9 *pVertexElements) {
+    size_t count = 0;
+    if (pVertexElements) {
+        while (pVertexElements[count++].Stream != 0xff)
+            ;
+    }
+    return count;
+}
+'''
     tracer = D3D9Tracer('d3d9.dll')
     tracer.trace_api(d3d9)