diff options
-rw-r--r-- | common/trace_parser_flags.cpp | 1 | ||||
-rw-r--r-- | dispatch/d3d10_1imports.hpp | 4 | ||||
-rw-r--r-- | dispatch/d3d10imports.hpp | 2 | ||||
-rw-r--r-- | dispatch/d3d11imports.hpp | 2 | ||||
-rw-r--r-- | dispatch/dxgiint.h | 62 | ||||
-rw-r--r-- | specs/dxgi.py | 27 | ||||
-rwxr-xr-x | specs/scripts/cdecl.py | 4 |
7 files changed, 97 insertions, 5 deletions
diff --git a/common/trace_parser_flags.cpp b/common/trace_parser_flags.cpp index 2589b434..1ff2b0b7 100644 --- a/common/trace_parser_flags.cpp +++ b/common/trace_parser_flags.cpp @@ -82,6 +82,7 @@ callFlagTable[] = { { "ID3D11DeviceContext::OMSetRenderTargets", CALL_FLAG_SWAP_RENDERTARGET }, { "ID3D11DeviceContext::OMSetRenderTargetsAndUnorderedAccessViews", CALL_FLAG_SWAP_RENDERTARGET }, { "IDXGISwapChain::Present", CALL_FLAG_END_FRAME }, + { "IDXGISwapChainDWM::Present", CALL_FLAG_END_FRAME }, { "IDirect3D9::CheckDeviceFormat", CALL_FLAG_NO_SIDE_EFFECTS | CALL_FLAG_VERBOSE }, { "IDirect3D9::EnumAdapterModes", CALL_FLAG_NO_SIDE_EFFECTS | CALL_FLAG_VERBOSE }, { "IDirect3D9::GetAdapterModeCount", CALL_FLAG_NO_SIDE_EFFECTS | CALL_FLAG_VERBOSE }, diff --git a/dispatch/d3d10_1imports.hpp b/dispatch/d3d10_1imports.hpp index 254323e7..6f9c6fea 100644 --- a/dispatch/d3d10_1imports.hpp +++ b/dispatch/d3d10_1imports.hpp @@ -24,7 +24,7 @@ **************************************************************************/ /* - * Central place for all D3D10 includes, and respective OS dependent headers. + * Central place for all D3D10.1 includes, and respective OS dependent headers. */ #ifndef _D3D10_1IMPORTS_HPP_ @@ -39,5 +39,7 @@ #include "d3derr.hpp" +#include "dxgiint.h" + #endif /* _D3D10_1IMPORTS_HPP_ */ diff --git a/dispatch/d3d10imports.hpp b/dispatch/d3d10imports.hpp index d21aec8c..88bf4097 100644 --- a/dispatch/d3d10imports.hpp +++ b/dispatch/d3d10imports.hpp @@ -39,5 +39,7 @@ #include "d3derr.hpp" +#include "dxgiint.h" + #endif /* _D3D10IMPORTS_HPP_ */ diff --git a/dispatch/d3d11imports.hpp b/dispatch/d3d11imports.hpp index eabcaf13..b667bf85 100644 --- a/dispatch/d3d11imports.hpp +++ b/dispatch/d3d11imports.hpp @@ -39,5 +39,7 @@ #include "d3derr.hpp" +#include "dxgiint.h" + #endif /* _D3D11IMPORTS_HPP_ */ diff --git a/dispatch/dxgiint.h b/dispatch/dxgiint.h new file mode 100644 index 00000000..f985ed18 --- /dev/null +++ b/dispatch/dxgiint.h @@ -0,0 +1,62 @@ +/************************************************************************** + * + * Copyright 2012 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. + * + **************************************************************************/ + + +#ifndef _DXGIINT_H_ +#define _DXGIINT_H_ + +#include <windows.h> + +#include "compat.h" + +#include <dxgi.h> + + +static const GUID IID_IDXGIFactoryDWM = {0x713F394E,0x92CA,0x47E7,{0xAB,0x81,0x11,0x59,0xC2,0x79,0x1E,0x54}}; +static const GUID IID_IDXGISwapChainDWM = {0x00000000,0x0000,0x0000,{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00}}; // XXX + +struct IDXGIFactoryDWM; +struct IDXGISwapChainDWM; + +struct IDXGIFactoryDWM: public IUnknown +{ + virtual HRESULT STDMETHODCALLTYPE CreateSwapChain(IUnknown *pDevice, DXGI_SWAP_CHAIN_DESC *pDesc, IDXGIOutput *pOutput, IDXGISwapChainDWM **ppSwapChain) = 0; +}; + +struct IDXGISwapChainDWM: public IDXGIDeviceSubObject +{ + virtual HRESULT STDMETHODCALLTYPE Present (UINT SyncInterval, UINT Flags) = 0; + virtual HRESULT STDMETHODCALLTYPE GetBuffer (UINT Buffer, REFIID riid, void **ppSurface) = 0; + virtual HRESULT STDMETHODCALLTYPE GetDesc (DXGI_SWAP_CHAIN_DESC *pDesc) = 0; + virtual HRESULT STDMETHODCALLTYPE ResizeBuffers (UINT BufferCount, UINT Width, UINT Height, DXGI_FORMAT NewFormat, UINT SwapChainFlags) = 0; + virtual HRESULT STDMETHODCALLTYPE ResizeTarget (const DXGI_MODE_DESC *pNewTargetParameters) = 0; + virtual HRESULT STDMETHODCALLTYPE GetContainingOutput (IDXGIOutput **ppOutput) = 0; + virtual HRESULT STDMETHODCALLTYPE GetFrameStatistics (DXGI_FRAME_STATISTICS *pStats) = 0; + virtual HRESULT STDMETHODCALLTYPE GetLastPresentCount (UINT *pLastPresentCount) = 0; + virtual HRESULT STDMETHODCALLTYPE SetFullscreenState (BOOL Fullscreen, IDXGIOutput *pTarget) = 0; + virtual HRESULT STDMETHODCALLTYPE GetFullscreenState (BOOL *pFullscreen, IDXGIOutput **ppTarget) = 0; +}; + +#endif /* _DXGIINT_H_ */ diff --git a/specs/dxgi.py b/specs/dxgi.py index eef7c65d..ca05368a 100644 --- a/specs/dxgi.py +++ b/specs/dxgi.py @@ -215,7 +215,7 @@ IDXGISwapChain.methods += [ StdMethod(HRESULT, "SetFullscreenState", [(BOOL, "Fullscreen"), (ObjPointer(IDXGIOutput), "pTarget")]), StdMethod(HRESULT, "GetFullscreenState", [Out(Pointer(BOOL), "pFullscreen"), Out(Pointer(ObjPointer(IDXGIOutput)), "ppTarget")]), StdMethod(HRESULT, "GetDesc", [Out(Pointer(DXGI_SWAP_CHAIN_DESC), "pDesc")], sideeffects=False), - StdMethod(HRESULT, "ResizeBuffers", [(UINT, "BufferCount"), (UINT, "Width"), (UINT, "Height"), (DXGI_FORMAT, "NewFormat"), (UINT, "SwapChainFlags")]), + StdMethod(HRESULT, "ResizeBuffers", [(UINT, "BufferCount"), (UINT, "Width"), (UINT, "Height"), (DXGI_FORMAT, "NewFormat"), (DXGI_SWAP_CHAIN_FLAG, "SwapChainFlags")]), StdMethod(HRESULT, "ResizeTarget", [(Pointer(Const(DXGI_MODE_DESC)), "pNewTargetParameters")]), StdMethod(HRESULT, "GetContainingOutput", [Out(Pointer(ObjPointer(IDXGIOutput)), "ppOutput")]), StdMethod(HRESULT, "GetFrameStatistics", [Out(Pointer(DXGI_FRAME_STATISTICS), "pStats")], sideeffects=False), @@ -282,9 +282,32 @@ IDXGIDevice1.methods += [ StdMethod(HRESULT, "GetMaximumFrameLatency", [Out(Pointer(UINT), "pMaxLatency")], sideeffects=False), ] + +IDXGIFactoryDWM = Interface("IDXGIFactoryDWM", IUnknown) +IDXGISwapChainDWM = Interface("IDXGISwapChainDWM", IDXGIDeviceSubObject) + +IDXGIFactoryDWM.methods += [ + StdMethod(HRESULT, "CreateSwapChain", [(ObjPointer(IUnknown), "pDevice"), (Pointer(DXGI_SWAP_CHAIN_DESC), "pDesc"), (ObjPointer(IDXGIOutput), "pOutput"), Out(Pointer(ObjPointer(IDXGISwapChainDWM)), "ppSwapChain")]), +] + +IDXGISwapChainDWM.methods += [ + StdMethod(HRESULT, "Present", [(UINT, "SyncInterval"), (DXGI_PRESENT, "Flags")]), + StdMethod(HRESULT, "GetBuffer", [(UINT, "Buffer"), (REFIID, "riid"), Out(Pointer(ObjPointer(Void)), "ppSurface")]), + StdMethod(HRESULT, "GetDesc", [Out(Pointer(DXGI_SWAP_CHAIN_DESC), "pDesc")], sideeffects=False), + StdMethod(HRESULT, "ResizeBuffers", [(UINT, "BufferCount"), (UINT, "Width"), (UINT, "Height"), (DXGI_FORMAT, "NewFormat"), (DXGI_SWAP_CHAIN_FLAG, "SwapChainFlags")]), + StdMethod(HRESULT, "ResizeTarget", [(Pointer(Const(DXGI_MODE_DESC)), "pNewTargetParameters")]), + StdMethod(HRESULT, "GetContainingOutput", [Out(Pointer(ObjPointer(IDXGIOutput)), "ppOutput")]), + StdMethod(HRESULT, "GetFrameStatistics", [(Pointer(DXGI_FRAME_STATISTICS), "pStats")], sideeffects=False), + StdMethod(HRESULT, "GetLastPresentCount", [(Pointer(UINT), "pLastPresentCount")], sideeffects=False), + StdMethod(HRESULT, "SetFullscreenState", [(BOOL, "Fullscreen"), (ObjPointer(IDXGIOutput), "pTarget")]), + StdMethod(HRESULT, "GetFullscreenState", [Out(Pointer(BOOL), "pFullscreen"), Out(Pointer(ObjPointer(IDXGIOutput)), "ppTarget")]), +] + + dxgi = Module('dxgi') dxgi.addInterfaces([ - IDXGIFactory1 + IDXGIFactory1, + IDXGIFactoryDWM, ]) dxgi.addFunctions([ StdFunction(HRESULT, "CreateDXGIFactory", [(REFIID, "riid"), Out(Pointer(ObjPointer(Void)), "ppFactory")]), diff --git a/specs/scripts/cdecl.py b/specs/scripts/cdecl.py index 7c1568ae..7deb2955 100755 --- a/specs/scripts/cdecl.py +++ b/specs/scripts/cdecl.py @@ -234,7 +234,7 @@ class DeclParser: self.consume() self.consume(':') else: - self.parse_prototype('StdMethod') + self.parse_prototype('Method') self.consume(';') self.consume('}') @@ -247,7 +247,7 @@ class DeclParser: ret = self.parse_type() - if self.match('__stdcall', 'WINAPI'): + if self.match('__stdcall', 'WINAPI', 'STDMETHODCALLTYPE'): self.consume() creator = 'Std' + creator |