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
add_executable (tracedump tracedump.cpp)
install (TARGETS tracedump RUNTIME DESTINATION bin)
+
##############################################################################
# API tracers
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
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
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
# 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)
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)
from winapi import *
from d3d8types import *
from d3d8caps import *
-from trace import DllTracer
HRESULT = Enum("HRESULT", [
"D3D_OK",
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)
-
--- /dev/null
+##########################################################################
+#
+# 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)
+
from winapi import *
from d3d9types import *
from d3d9caps import *
-from trace import DllTracer
+
D3DSHADER9 = Opaque("const DWORD *")
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)
-
--- /dev/null
+##########################################################################
+#
+# 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)
+
"""ddraw.h"""
from winapi import *
-from trace import DllTracer
DirectDrawOptSurfaceDescFlags = Flags(DWORD, [
"DDOSD_GUID",
--- /dev/null
+##########################################################################
+#
+# 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)