]> git.cworth.org Git - apitrace/commitdiff
Split D3D specs for trace generators.
authorJosé Fonseca <jose.r.fonseca@gmail.com>
Wed, 21 Sep 2011 07:12:39 +0000 (08:12 +0100)
committerJosé Fonseca <jose.r.fonseca@gmail.com>
Wed, 21 Sep 2011 07:12:39 +0000 (08:12 +0100)
.gitignore
CMakeLists.txt
d3d.py
d3d8.py
d3d8trace.py [new file with mode: 0644]
d3d9.py
d3d9trace.py [new file with mode: 0644]
ddraw.py
ddrawtrace.py [new file with mode: 0644]

index b2dda4247a2e4acd178f8d4ca7967f30fdb07549..ed1ea5a05b227f50e72f0e5c3d1df78a280c7a04 100644 (file)
@@ -27,11 +27,10 @@ CMakeCache.txt
 CMakeFiles
 Makefile
 build
-d3d10.cpp
-d3d10_1.cpp
-d3d8.cpp
-d3d9.cpp
-ddraw.cpp
+d3d10trace.cpp
+d3d8trace.cpp
+d3d9trace.cpp
+ddrawtrace.cpp
 dxsdk
 glproc.hpp
 glretrace
index 360e8301bb3c6bc4090b66b08e2a1ea2162b68fe..32f1498342d91932016c41d0c2b8a65c8c46dbc1 100755 (executable)
@@ -208,6 +208,7 @@ link_libraries (common)
 add_executable (tracedump tracedump.cpp)
 install (TARGETS tracedump RUNTIME DESTINATION bin) 
 
+
 ##############################################################################
 # API tracers
 
@@ -216,11 +217,11 @@ if (WIN32)
     if (DirectX_D3D_INCLUDE_DIR)
         include_directories (SYSTEM ${DirectX_D3D_INCLUDE_DIR})
         add_custom_command (
-            OUTPUT ddraw.cpp
-            COMMAND ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/d3d.py > ${CMAKE_CURRENT_BINARY_DIR}/ddraw.cpp
-            DEPENDS d3d.py d3dtypes.py d3dcaps.py ddraw.py trace.py winapi.py stdapi.py
+            OUTPUT ddrawtrace.cpp
+            COMMAND ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/ddrawtrace.py > ${CMAKE_CURRENT_BINARY_DIR}/ddrawtrace.cpp
+            DEPENDS ddrawtrace.py d3d.py d3dtypes.py d3dcaps.py ddraw.py trace.py winapi.py stdapi.py
         )
-        add_library (ddraw MODULE ddraw.def ddraw.cpp)
+        add_library (ddraw MODULE ddraw.def ddrawtrace.cpp)
         set_target_properties (ddraw
             PROPERTIES PREFIX ""
             RUNTIME_OUTPUT_DIRECTORY ${PROJECT_BINARY_DIR}/wrappers
@@ -233,11 +234,11 @@ if (WIN32)
     if (DirectX_D3D8_INCLUDE_DIR AND DirectX_D3DX9_INCLUDE_DIR)
         include_directories (SYSTEM ${DirectX_D3D8_INCLUDE_DIR} ${DirectX_D3DX9_INCLUDE_DIR})
         add_custom_command (
-            OUTPUT d3d8.cpp
-            COMMAND ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/d3d8.py > ${CMAKE_CURRENT_BINARY_DIR}/d3d8.cpp
-            DEPENDS d3d8.py trace.py d3d8types.py d3d8caps.py winapi.py stdapi.py
+            OUTPUT d3d8trace.cpp
+            COMMAND ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/d3d8trace.py > ${CMAKE_CURRENT_BINARY_DIR}/d3d8trace.cpp
+            DEPENDS d3d8trace.py d3d8.py trace.py d3d8types.py d3d8caps.py winapi.py stdapi.py
         )
-        add_library (d3d8 MODULE d3d8.def d3d8.cpp d3dshader.cpp)
+        add_library (d3d8 MODULE d3d8.def d3d8trace.cpp d3dshader.cpp)
         set_target_properties (d3d8
             PROPERTIES PREFIX ""
             RUNTIME_OUTPUT_DIRECTORY ${PROJECT_BINARY_DIR}/wrappers
@@ -250,11 +251,11 @@ if (WIN32)
     if (DirectX_D3DX9_INCLUDE_DIR)
         include_directories (SYSTEM ${DirectX_D3DX9_INCLUDE_DIR})
         add_custom_command (
-            OUTPUT d3d9.cpp
-            COMMAND ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/d3d9.py > ${CMAKE_CURRENT_BINARY_DIR}/d3d9.cpp
-            DEPENDS d3d9.py trace.py d3d9types.py d3d9caps.py winapi.py stdapi.py
+            OUTPUT d3d9trace.cpp
+            COMMAND ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/d3d9trace.py > ${CMAKE_CURRENT_BINARY_DIR}/d3d9trace.cpp
+            DEPENDS d3d9trace.py d3d9.py trace.py d3d9types.py d3d9caps.py winapi.py stdapi.py
         )
-        add_library (d3d9 MODULE d3d9.def d3d9.cpp d3dshader.cpp)
+        add_library (d3d9 MODULE d3d9.def d3d9trace.cpp d3dshader.cpp)
         set_target_properties (d3d9
             PROPERTIES PREFIX ""
             RUNTIME_OUTPUT_DIRECTORY ${PROJECT_BINARY_DIR}/wrappers
@@ -268,10 +269,10 @@ if (WIN32)
     #    include_directories (SYSTEM ${DirectX_D3D10_INCLUDE_DIR})
     #    add_custom_command (
     #        OUTPUT d3d10.cpp
-    #        COMMAND ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/d3d10misc.py > ${CMAKE_CURRENT_BINARY_DIR}/d3d10.cpp
+    #        COMMAND ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/d3d10misc.py > ${CMAKE_CURRENT_BINARY_DIR}/d3d10trace.cpp
     #        DEPENDS d3d10misc.py winapi.py stdapi.py
     #    )
-    #    add_library (d3d10 MODULE d3d10.def d3d10.cpp)
+    #    add_library (d3d10 MODULE d3d10.def d3d10trace.cpp)
     #    set_target_properties (d3d10 PROPERTIES PREFIX "")
     #    install (TARGETS d3d10 LIBRARY DESTINATION wrappers)
     #endif (DirectX_D3D10_INCLUDE_DIR)
diff --git a/d3d.py b/d3d.py
index f587fc532dd3203a8c58747609f8ab934851d763..857e5b3f49bffa3a2ea54e96415ee6de13963919 100644 (file)
--- a/d3d.py
+++ b/d3d.py
@@ -473,55 +473,3 @@ interfaces = [
 
 ddraw.add_interfaces(interfaces)
 
-
-class DDrawTracer(DllTracer):
-
-    def trace_function_impl_body(self, function):
-        if function.name in ('AcquireDDThreadLock', 'ReleaseDDThreadLock'):
-            self.dispatch_function(function)
-            return
-
-        DllTracer.trace_function_impl_body(self, function)
-
-    def wrap_arg(self, function, arg):
-        if function.name == 'DirectDrawCreateEx' and arg.name == 'lplpDD':
-            print '    if (*lplpDD) {'
-            for iface in interfaces:
-                print '        if (iid == IID_%s) {' % iface.name
-                print '            *lplpDD = (LPVOID) new Wrap%s((%s *)*lplpDD);' % (iface.name, iface.name)
-                print '        }'
-            print '    }'
-
-        DllTracer.wrap_arg(self, function, arg)
-
-
-if __name__ == '__main__':
-    print '#define INITGUID'
-    print '#include <windows.h>'
-    print '#include <ddraw.h>'
-    print '#include <d3d.h>'
-    print
-    print '''
-
-#ifndef DDBLT_EXTENDED_FLAGS
-#define DDBLT_EXTENDED_FLAGS 0x40000000l
-#endif
-
-#ifndef DDBLT_EXTENDED_LINEAR_CONTENT
-#define DDBLT_EXTENDED_LINEAR_CONTENT 0x00000004l
-#endif
-
-#ifndef D3DLIGHT_PARALLELPOINT
-#define D3DLIGHT_PARALLELPOINT (D3DLIGHTTYPE)4
-#endif
-
-#ifndef D3DLIGHT_GLSPOT
-#define D3DLIGHT_GLSPOT (D3DLIGHTTYPE)5
-#endif
-
-'''
-    print '#include "trace_writer.hpp"'
-    print '#include "os.hpp"'
-    print
-    tracer = DDrawTracer('ddraw.dll')
-    tracer.trace_api(ddraw)
diff --git a/d3d8.py b/d3d8.py
index f579a9b40617733f19d243d6532bc8e73a759cd0..0713696ecd9a65dd8eab9a007d3302f1fca067e9 100644 (file)
--- a/d3d8.py
+++ b/d3d8.py
@@ -28,7 +28,6 @@
 from winapi import *
 from d3d8types import *
 from d3d8caps import *
-from trace import DllTracer
 
 HRESULT = Enum("HRESULT", [
     "D3D_OK",
@@ -281,27 +280,3 @@ d3d8 = API("d3d8")
 d3d8.add_functions([
     StdFunction(PDIRECT3D8, "Direct3DCreate8", [(UINT, "SDKVersion")]),
 ])
-
-
-class D3D8Tracer(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)
-            return
-
-        DllTracer.dump_arg_instance(self, function, arg)
-
-
-if __name__ == '__main__':
-    print '#include <windows.h>'
-    print '#include <d3d8.h>'
-    print '#include "d3dshader.hpp"'
-    print
-    print '#include "trace_writer.hpp"'
-    print '#include "os.hpp"'
-    print
-    tracer = D3D8Tracer('d3d8.dll')
-    tracer.trace_api(d3d8)
-
diff --git a/d3d8trace.py b/d3d8trace.py
new file mode 100644 (file)
index 0000000..236f56c
--- /dev/null
@@ -0,0 +1,52 @@
+##########################################################################
+#
+# Copyright 2008-2009 VMware, Inc.
+# All Rights Reserved.
+#
+# Permission is hereby granted, free of charge, to any person obtaining a copy
+# of this software and associated documentation files (the "Software"), to deal
+# in the Software without restriction, including without limitation the rights
+# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+# copies of the Software, and to permit persons to whom the Software is
+# furnished to do so, subject to the following conditions:
+#
+# The above copyright notice and this permission notice shall be included in
+# all copies or substantial portions of the Software.
+#
+# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+# THE SOFTWARE.
+#
+##########################################################################/
+
+
+from d3d8 import d3d8
+from trace import DllTracer
+
+
+class D3D8Tracer(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)
+            return
+
+        DllTracer.dump_arg_instance(self, function, arg)
+
+
+if __name__ == '__main__':
+    print '#include <windows.h>'
+    print '#include <d3d8.h>'
+    print '#include "d3dshader.hpp"'
+    print
+    print '#include "trace_writer.hpp"'
+    print '#include "os.hpp"'
+    print
+    tracer = D3D8Tracer('d3d8.dll')
+    tracer.trace_api(d3d8)
+
diff --git a/d3d9.py b/d3d9.py
index 640d218dc7a8c2b4726d142cd268e6ec92e128ca..251f2920fb90cf37110c369a326446c1503ac3a0 100644 (file)
--- a/d3d9.py
+++ b/d3d9.py
@@ -28,7 +28,7 @@
 from winapi import *
 from d3d9types import *
 from d3d9caps import *
-from trace import DllTracer
+
 
 D3DSHADER9 = Opaque("const DWORD *")
 
@@ -448,26 +448,3 @@ d3d9.add_functions([
     StdFunction(Void, "D3DPERF_SetOptions", [(DWORD, "dwOptions")]),
     StdFunction(DWORD, "D3DPERF_GetStatus", [], fail='0'),
 ])
-
-
-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)
-            return
-
-        DllTracer.dump_arg_instance(self, function, arg)
-
-
-if __name__ == '__main__':
-    print '#include "trace_writer.hpp"'
-    print '#include "os.hpp"'
-    print
-    print '#include "d3d9imports.hpp"'
-    print '#include "d3dshader.hpp"'
-    print
-    tracer = D3D9Tracer('d3d9.dll')
-    tracer.trace_api(d3d9)
-
diff --git a/d3d9trace.py b/d3d9trace.py
new file mode 100644 (file)
index 0000000..b83ebf6
--- /dev/null
@@ -0,0 +1,51 @@
+##########################################################################
+#
+# Copyright 2008-2009 VMware, Inc.
+# All Rights Reserved.
+#
+# Permission is hereby granted, free of charge, to any person obtaining a copy
+# of this software and associated documentation files (the "Software"), to deal
+# in the Software without restriction, including without limitation the rights
+# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+# copies of the Software, and to permit persons to whom the Software is
+# furnished to do so, subject to the following conditions:
+#
+# The above copyright notice and this permission notice shall be included in
+# all copies or substantial portions of the Software.
+#
+# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+# THE SOFTWARE.
+#
+##########################################################################/
+
+
+from trace import DllTracer
+from d3d9 import d3d9
+
+
+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)
+            return
+
+        DllTracer.dump_arg_instance(self, function, arg)
+
+
+if __name__ == '__main__':
+    print '#include "trace_writer.hpp"'
+    print '#include "os.hpp"'
+    print
+    print '#include "d3d9imports.hpp"'
+    print '#include "d3dshader.hpp"'
+    print
+    tracer = D3D9Tracer('d3d9.dll')
+    tracer.trace_api(d3d9)
+
index 8ac08a85685e6e77f7623b45c849199c74ea98a1..eb5a07204b17235d3dd322403e8e664649dfce09 100644 (file)
--- a/ddraw.py
+++ b/ddraw.py
@@ -26,7 +26,6 @@
 """ddraw.h"""
 
 from winapi import *
-from trace import DllTracer
 
 DirectDrawOptSurfaceDescFlags = Flags(DWORD, [
     "DDOSD_GUID",
diff --git a/ddrawtrace.py b/ddrawtrace.py
new file mode 100644 (file)
index 0000000..0b53f0d
--- /dev/null
@@ -0,0 +1,81 @@
+##########################################################################
+#
+# Copyright 2008-2009 VMware, Inc.
+# All Rights Reserved.
+#
+# Permission is hereby granted, free of charge, to any person obtaining a copy
+# of this software and associated documentation files (the "Software"), to deal
+# in the Software without restriction, including without limitation the rights
+# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+# copies of the Software, and to permit persons to whom the Software is
+# furnished to do so, subject to the following conditions:
+#
+# The above copyright notice and this permission notice shall be included in
+# all copies or substantial portions of the Software.
+#
+# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+# THE SOFTWARE.
+#
+##########################################################################/
+
+
+from d3d import ddraw, interfaces
+from trace import DllTracer
+
+
+class DDrawTracer(DllTracer):
+
+    def trace_function_impl_body(self, function):
+        if function.name in ('AcquireDDThreadLock', 'ReleaseDDThreadLock'):
+            self.dispatch_function(function)
+            return
+
+        DllTracer.trace_function_impl_body(self, function)
+
+    def wrap_arg(self, function, arg):
+        if function.name == 'DirectDrawCreateEx' and arg.name == 'lplpDD':
+            print '    if (*lplpDD) {'
+            for iface in interfaces:
+                print '        if (iid == IID_%s) {' % iface.name
+                print '            *lplpDD = (LPVOID) new Wrap%s((%s *)*lplpDD);' % (iface.name, iface.name)
+                print '        }'
+            print '    }'
+
+        DllTracer.wrap_arg(self, function, arg)
+
+
+if __name__ == '__main__':
+    print '#define INITGUID'
+    print '#include <windows.h>'
+    print '#include <ddraw.h>'
+    print '#include <d3d.h>'
+    print
+    print '''
+
+#ifndef DDBLT_EXTENDED_FLAGS
+#define DDBLT_EXTENDED_FLAGS 0x40000000l
+#endif
+
+#ifndef DDBLT_EXTENDED_LINEAR_CONTENT
+#define DDBLT_EXTENDED_LINEAR_CONTENT 0x00000004l
+#endif
+
+#ifndef D3DLIGHT_PARALLELPOINT
+#define D3DLIGHT_PARALLELPOINT (D3DLIGHTTYPE)4
+#endif
+
+#ifndef D3DLIGHT_GLSPOT
+#define D3DLIGHT_GLSPOT (D3DLIGHTTYPE)5
+#endif
+
+'''
+    print '#include "trace_writer.hpp"'
+    print '#include "os.hpp"'
+    print
+    tracer = DDrawTracer('ddraw.dll')
+    tracer.trace_api(ddraw)