X-Git-Url: https://git.cworth.org/git?a=blobdiff_plain;f=wrappers%2Fdxgitrace.py;h=0ecaed254217ad23c54af84a9043cba3c40cbd4e;hb=2b6d24e83e0c7072da8c67a8f29fd85f2d64cff5;hp=640f3562fdbbe8303acb82f0dae6072679d97a07;hpb=20aa935d4c87e47040d2e75bf746fcf9d5d8d6b2;p=apitrace diff --git a/wrappers/dxgitrace.py b/wrappers/dxgitrace.py index 640f356..0ecaed2 100644 --- a/wrappers/dxgitrace.py +++ b/wrappers/dxgitrace.py @@ -42,6 +42,36 @@ class D3DCommonTracer(DllTracer): print ' DumpShader(trace::localWriter, %s, %s);' % (arg.name, arg.type.size) return + # Serialize the swapchain dimensions + if function.name == 'CreateSwapChain' and arg.name == 'pDesc' \ + or arg.name == 'pSwapChainDesc': + print r' DXGI_SWAP_CHAIN_DESC *_pSwapChainDesc = NULL;' + print r' DXGI_SWAP_CHAIN_DESC _SwapChainDesc;' + print r' if (%s) {' % arg.name + print r' _SwapChainDesc = *%s;' % arg.name + if function.name != 'CreateSwapChain' or not self.interface.name.endswith('DWM'): + # Obtain size from the window + print r' RECT _rect;' + print r' if (GetClientRect(%s->OutputWindow, &_rect)) {' % arg.name + print r' if (%s->BufferDesc.Width == 0) {' % arg.name + print r' _SwapChainDesc.BufferDesc.Width = _rect.right - _rect.left;' + print r' }' + print r' if (%s->BufferDesc.Height == 0) {' % arg.name + print r' _SwapChainDesc.BufferDesc.Height = _rect.bottom - _rect.top;' + print r' }' + print r' }' + else: + # Obtain size from the output + print r' DXGI_OUTPUT_DESC _OutputDesc;' + print r' if (SUCCEEDED(pOutput->GetDesc(&_OutputDesc))) {' + print r' _SwapChainDesc.BufferDesc.Width = _OutputDesc.DesktopCoordinates.right - _OutputDesc.DesktopCoordinates.left;' + print r' _SwapChainDesc.BufferDesc.Height = _OutputDesc.DesktopCoordinates.bottom - _OutputDesc.DesktopCoordinates.top;' + print r' }' + print r' _pSwapChainDesc = &_SwapChainDesc;' + print r' }' + self.serializeValue(arg.type, '_pSwapChainDesc') + return + DllTracer.serializeArgValue(self, function, arg) def enumWrapperInterfaceVariables(self, interface): @@ -93,8 +123,6 @@ if __name__ == '__main__': if 'd3d10' in moduleNames: if 'd3d10_1' in moduleNames: print r'#include "d3d10_1imports.hpp"' - # D3D10CreateBlob is duplicated in d3d10 and d3d10_1 - d3d10_1.functions = [function for function in d3d10_1.functions if function.name != 'D3D10CreateBlob'] api.addModule(d3d10_1) else: print r'#include "d3d10imports.hpp"'