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:
d3d11.addFunctions([
StdFunction(HRESULT, "D3D11CreateDevice", [(ObjPointer(IDXGIAdapter), "pAdapter"), (D3D_DRIVER_TYPE, "DriverType"), (HMODULE, "Software"), (D3D11_CREATE_DEVICE_FLAG, "Flags"), (Array(Const(D3D_FEATURE_LEVEL), "FeatureLevels"), "pFeatureLevels"), (UINT, "FeatureLevels"), (UINT, "SDKVersion"), Out(Pointer(ObjPointer(ID3D11Device)), "ppDevice"), Out(Pointer(D3D_FEATURE_LEVEL), "pFeatureLevel"), Out(Pointer(ObjPointer(ID3D11DeviceContext)), "ppImmediateContext")]),
StdFunction(HRESULT, "D3D11CreateDeviceAndSwapChain", [(ObjPointer(IDXGIAdapter), "pAdapter"), (D3D_DRIVER_TYPE, "DriverType"), (HMODULE, "Software"), (D3D11_CREATE_DEVICE_FLAG, "Flags"), (Array(Const(D3D_FEATURE_LEVEL), "FeatureLevels"), "pFeatureLevels"), (UINT, "FeatureLevels"), (UINT, "SDKVersion"), (Pointer(Const(DXGI_SWAP_CHAIN_DESC)), "pSwapChainDesc"), Out(Pointer(ObjPointer(IDXGISwapChain)), "ppSwapChain"), Out(Pointer(ObjPointer(ID3D11Device)), "ppDevice"), Out(Pointer(D3D_FEATURE_LEVEL), "pFeatureLevel"), Out(Pointer(ObjPointer(ID3D11DeviceContext)), "ppImmediateContext")]),
+
+ # XXX: Undocumented functions, called by d3d11sdklayers.dll when D3D11_CREATE_DEVICE_DEBUG is set
+ StdFunction(HRESULT, "D3D11CoreRegisterLayers", [LPCVOID, DWORD], internal=True),
+ StdFunction(SIZE_T, "D3D11CoreGetLayeredDeviceSize", [LPCVOID, DWORD], internal=True),
+ StdFunction(HRESULT, "D3D11CoreCreateLayeredDevice", [LPCVOID, DWORD, LPCVOID, (REFIID, "riid"), Out(Pointer(ObjPointer(Void)), "ppvObj")], internal=True),
+ StdFunction(HRESULT, "D3D11CoreCreateDevice", [DWORD, DWORD, DWORD, DWORD, DWORD, DWORD, DWORD, DWORD, DWORD], internal=True),
])
d3d11.addInterfaces([
# 0-3 are reserved to memcpy, malloc, free, and realloc
__id = 4
- def __init__(self, type, name, args, call = '', fail = None, sideeffects=True):
+ def __init__(self, type, name, args, call = '', fail = None, sideeffects=True, internal=False):
self.id = Function.__id
Function.__id += 1
self.call = call
self.fail = fail
self.sideeffects = sideeffects
+ self.internal = internal
def prototype(self, name=None):
if name is not None:
LIBRARY "d3d11"
EXPORTS
+ D3D11CoreCreateDevice
+ D3D11CoreCreateLayeredDevice
+ D3D11CoreGetLayeredDeviceSize
+ D3D11CoreRegisterLayers
D3D11CreateDevice
D3D11CreateDeviceAndSwapChain
def traceFunctionDecl(self, function):
# Per-function declarations
- if function.args:
- print 'static const char * _%s_args[%u] = {%s};' % (function.name, len(function.args), ', '.join(['"%s"' % arg.name for arg in function.args]))
- else:
- print 'static const char ** _%s_args = NULL;' % (function.name,)
- print 'static const trace::FunctionSig _%s_sig = {%u, "%s", %u, _%s_args};' % (function.name, function.id, function.name, len(function.args), function.name)
- print
+ if not function.internal:
+ if function.args:
+ print 'static const char * _%s_args[%u] = {%s};' % (function.name, len(function.args), ', '.join(['"%s"' % arg.name for arg in function.args]))
+ else:
+ print 'static const char ** _%s_args = NULL;' % (function.name,)
+ print 'static const trace::FunctionSig _%s_sig = {%u, "%s", %u, _%s_args};' % (function.name, function.id, function.name, len(function.args), function.name)
+ print
def isFunctionPublic(self, function):
return True
print
def traceFunctionImplBody(self, function):
- print ' unsigned _call = trace::localWriter.beginEnter(&_%s_sig);' % (function.name,)
- for arg in function.args:
- if not arg.output:
- self.unwrapArg(function, arg)
- self.serializeArg(function, arg)
- print ' trace::localWriter.endEnter();'
+ if not function.internal:
+ print ' unsigned _call = trace::localWriter.beginEnter(&_%s_sig);' % (function.name,)
+ for arg in function.args:
+ if not arg.output:
+ self.unwrapArg(function, arg)
+ self.serializeArg(function, arg)
+ print ' trace::localWriter.endEnter();'
self.invokeFunction(function)
- print ' trace::localWriter.beginLeave(_call);'
- for arg in function.args:
- if arg.output:
- self.serializeArg(function, arg)
- self.wrapArg(function, arg)
- if function.type is not stdapi.Void:
- self.serializeRet(function, "_result")
- print ' trace::localWriter.endLeave();'
- if function.type is not stdapi.Void:
- self.wrapRet(function, "_result")
+ if not function.internal:
+ print ' trace::localWriter.beginLeave(_call);'
+ for arg in function.args:
+ if arg.output:
+ self.serializeArg(function, arg)
+ self.wrapArg(function, arg)
+ if function.type is not stdapi.Void:
+ self.serializeRet(function, "_result")
+ print ' trace::localWriter.endLeave();'
+ if function.type is not stdapi.Void:
+ self.wrapRet(function, "_result")
def invokeFunction(self, function, prefix='_', suffix=''):
if function.type is stdapi.Void:
print
def implementWrapperInterfaceMethodBody(self, interface, base, method):
+ assert not method.internal
+
print ' static const char * _args[%u] = {%s};' % (len(method.args) + 1, ', '.join(['"this"'] + ['"%s"' % arg.name for arg in method.args]))
print ' static const trace::FunctionSig _sig = {%u, "%s", %u, _args};' % (method.id, interface.name + '::' + method.name, len(method.args) + 1)