]> git.cworth.org Git - apitrace/commitdiff
dxgi: Support tracng DWM process.
authorJosé Fonseca <jose.r.fonseca@gmail.com>
Tue, 20 Nov 2012 14:48:31 +0000 (14:48 +0000)
committerJosé Fonseca <jose.r.fonseca@gmail.com>
Tue, 20 Nov 2012 15:23:57 +0000 (15:23 +0000)
common/trace_parser_flags.cpp
dispatch/d3d10_1imports.hpp
dispatch/d3d10imports.hpp
dispatch/d3d11imports.hpp
dispatch/dxgiint.h [new file with mode: 0644]
specs/dxgi.py
specs/scripts/cdecl.py

index 2589b4342f6667175a5f67b6b8950af6375b5c18..1ff2b0b76677b68c5c035a62b88d1d005daf3405 100644 (file)
@@ -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 },
index 254323e7850cf73612705a0d46e543e34a59e18a..6f9c6feab512aa4afe82fc1b4df81bd064f92a68 100644 (file)
@@ -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_ */
index d21aec8c1133e2e9257b17b165259a81c42804d4..88bf409764d88f4fe2fd7c345b96c45d1c8c335f 100644 (file)
@@ -39,5 +39,7 @@
 
 #include "d3derr.hpp"
 
+#include "dxgiint.h"
+
 
 #endif /* _D3D10IMPORTS_HPP_ */
index eabcaf13957e0af40e0ca7dbdaedd4251a9ce0f6..b667bf85611719a3679809977f06d772ab4cd81a 100644 (file)
@@ -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 (file)
index 0000000..f985ed1
--- /dev/null
@@ -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_ */
index eef7c65d6d66ab9700d8c686fbb42da4b0481f7f..ca05368a82cfb00f95168e3c40bb7f0e1401f05e 100644 (file)
@@ -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")]),
index 7c1568aed544a4a56452f6c3e0cd475a9eb4512c..7deb2955d51778d1c4559a54e9f0e227cf379b69 100755 (executable)
@@ -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