Add support for DXGI 1.4 (1.5 has nothing we need to wrap). Refs #232

This commit is contained in:
baldurk
2016-06-21 17:14:34 +02:00
parent 6ef40b140c
commit dea4c04d61
5 changed files with 536 additions and 26 deletions
+1 -1
View File
@@ -236,7 +236,7 @@ private:
wrap->GetImmediateContext(ppImmediateContext);
if(ppSwapChain && *ppSwapChain)
*ppSwapChain = new WrappedIDXGISwapChain2(
*ppSwapChain = new WrappedIDXGISwapChain3(
*ppSwapChain, pSwapChainDesc ? pSwapChainDesc->OutputWindow : NULL, wrap);
}
}
@@ -216,11 +216,16 @@
<ClInclude Include="official\d3d11_1.h" />
<ClInclude Include="official\d3d11_2.h" />
<ClInclude Include="official\d3d11_3.h" />
<ClInclude Include="official\d3d11_4.h" />
<ClInclude Include="official\d3dcommon.h" />
<ClInclude Include="official\d3dcompiler.h" />
<ClInclude Include="official\dxgi.h" />
<ClInclude Include="official\dxgi1_2.h" />
<ClInclude Include="official\dxgi1_3.h" />
<ClInclude Include="official\dxgi1_4.h" />
<ClInclude Include="official\dxgi1_5.h" />
<ClInclude Include="official\dxgiformat.h" />
<ClInclude Include="official\dxgitype.h" />
<ClInclude Include="official\winapifamily.h" />
</ItemGroup>
<ItemGroup>
@@ -131,5 +131,20 @@
<ClInclude Include="official\d3d11_3.h">
<Filter>official</Filter>
</ClInclude>
<ClInclude Include="official\d3d11_4.h">
<Filter>official</Filter>
</ClInclude>
<ClInclude Include="official\dxgi1_4.h">
<Filter>official</Filter>
</ClInclude>
<ClInclude Include="official\dxgi1_5.h">
<Filter>official</Filter>
</ClInclude>
<ClInclude Include="official\dxgiformat.h">
<Filter>official</Filter>
</ClInclude>
<ClInclude Include="official\dxgitype.h">
<Filter>official</Filter>
</ClInclude>
</ItemGroup>
</Project>
+76 -21
View File
@@ -67,7 +67,7 @@ HRESULT WrappedIDXGIFactory::staticCreateSwapChain(IDXGIFactory *factory, IUnkno
if(SUCCEEDED(ret))
*ppSwapChain =
new WrappedIDXGISwapChain2(*ppSwapChain, pDesc ? pDesc->OutputWindow : NULL, wrapDevice);
new WrappedIDXGISwapChain3(*ppSwapChain, pDesc ? pDesc->OutputWindow : NULL, wrapDevice);
return ret;
}
@@ -112,7 +112,7 @@ HRESULT WrappedIDXGIFactory2::staticCreateSwapChainForHwnd(
pFullscreenDesc, pRestrictToOutput, ppSwapChain);
if(SUCCEEDED(ret))
*ppSwapChain = new WrappedIDXGISwapChain2(*ppSwapChain, hWnd, wrapDevice);
*ppSwapChain = new WrappedIDXGISwapChain3(*ppSwapChain, hWnd, wrapDevice);
return ret;
}
@@ -162,7 +162,7 @@ HRESULT WrappedIDXGIFactory2::staticCreateSwapChainForCoreWindow(IDXGIFactory2 *
{
HWND wnd = NULL;
(*ppSwapChain)->GetHwnd(&wnd);
*ppSwapChain = new WrappedIDXGISwapChain2(*ppSwapChain, wnd, wrapDevice);
*ppSwapChain = new WrappedIDXGISwapChain3(*ppSwapChain, wnd, wrapDevice);
}
return ret;
@@ -213,7 +213,7 @@ HRESULT WrappedIDXGIFactory2::staticCreateSwapChainForComposition(IDXGIFactory2
{
HWND wnd = NULL;
(*ppSwapChain)->GetHwnd(&wnd);
*ppSwapChain = new WrappedIDXGISwapChain2(*ppSwapChain, wnd, wrapDevice);
*ppSwapChain = new WrappedIDXGISwapChain3(*ppSwapChain, wnd, wrapDevice);
}
return ret;
@@ -226,7 +226,7 @@ HRESULT WrappedIDXGIFactory2::staticCreateSwapChainForComposition(IDXGIFactory2
return factory->CreateSwapChainForComposition(pDevice, pDesc, pRestrictToOutput, ppSwapChain);
}
WrappedIDXGISwapChain2::WrappedIDXGISwapChain2(IDXGISwapChain *real, HWND wnd,
WrappedIDXGISwapChain3::WrappedIDXGISwapChain3(IDXGISwapChain *real, HWND wnd,
WrappedID3D11Device *device)
: RefCountDXGIObject(real), m_pReal(real), m_pDevice(device), m_iRefcount(1), m_Wnd(wnd)
{
@@ -237,6 +237,8 @@ WrappedIDXGISwapChain2::WrappedIDXGISwapChain2(IDXGISwapChain *real, HWND wnd,
real->QueryInterface(__uuidof(IDXGISwapChain1), (void **)&m_pReal1);
m_pReal2 = NULL;
real->QueryInterface(__uuidof(IDXGISwapChain2), (void **)&m_pReal2);
m_pReal3 = NULL;
real->QueryInterface(__uuidof(IDXGISwapChain3), (void **)&m_pReal3);
int bufCount = desc.BufferCount;
@@ -271,7 +273,7 @@ WrappedIDXGISwapChain2::WrappedIDXGISwapChain2(IDXGISwapChain *real, HWND wnd,
m_pDevice->FirstFrame(this);
}
WrappedIDXGISwapChain2::~WrappedIDXGISwapChain2()
WrappedIDXGISwapChain3::~WrappedIDXGISwapChain3()
{
m_pDevice->ReleaseSwapchainResources(this);
@@ -284,17 +286,13 @@ WrappedIDXGISwapChain2::~WrappedIDXGISwapChain2()
}
SAFE_RELEASE(m_pReal1);
SAFE_RELEASE(m_pReal2);
SAFE_RELEASE(m_pReal3);
SAFE_RELEASE(m_pReal);
SAFE_RELEASE(m_pDevice);
}
HRESULT WrappedIDXGISwapChain2::ResizeBuffers(
/* [in] */ UINT BufferCount,
/* [in] */ UINT Width,
/* [in] */ UINT Height,
/* [in] */ DXGI_FORMAT NewFormat,
/* [in] */ UINT SwapChainFlags)
void WrappedIDXGISwapChain3::ReleaseBuffersForResize()
{
for(int i = 0; i < MAX_NUM_BACKBUFFERS; i++)
{
@@ -311,9 +309,10 @@ HRESULT WrappedIDXGISwapChain2::ResizeBuffers(
}
m_pDevice->ReleaseSwapchainResources(this);
}
HRESULT ret = m_pReal->ResizeBuffers(BufferCount, Width, Height, NewFormat, SwapChainFlags);
void WrappedIDXGISwapChain3::WrapBuffersAfterResize()
{
DXGI_SWAP_CHAIN_DESC desc;
m_pReal->GetDesc(&desc);
@@ -342,11 +341,42 @@ HRESULT WrappedIDXGISwapChain2::ResizeBuffers(
}
}
}
}
HRESULT WrappedIDXGISwapChain3::ResizeBuffers(
/* [in] */ UINT BufferCount,
/* [in] */ UINT Width,
/* [in] */ UINT Height,
/* [in] */ DXGI_FORMAT NewFormat,
/* [in] */ UINT SwapChainFlags)
{
ReleaseBuffersForResize();
HRESULT ret = m_pReal->ResizeBuffers(BufferCount, Width, Height, NewFormat, SwapChainFlags);
WrapBuffersAfterResize();
return ret;
}
HRESULT WrappedIDXGISwapChain2::SetFullscreenState(
HRESULT WrappedIDXGISwapChain3::ResizeBuffers1(_In_ UINT BufferCount, _In_ UINT Width,
_In_ UINT Height, _In_ DXGI_FORMAT Format,
_In_ UINT SwapChainFlags,
_In_reads_(BufferCount) const UINT *pCreationNodeMask,
_In_reads_(BufferCount)
IUnknown *const *ppPresentQueue)
{
ReleaseBuffersForResize();
HRESULT ret = m_pReal3->ResizeBuffers1(BufferCount, Width, Height, Format, SwapChainFlags,
pCreationNodeMask, ppPresentQueue);
WrapBuffersAfterResize();
return ret;
}
HRESULT WrappedIDXGISwapChain3::SetFullscreenState(
/* [in] */ BOOL Fullscreen,
/* [in] */ IDXGIOutput *pTarget)
{
@@ -356,14 +386,14 @@ HRESULT WrappedIDXGISwapChain2::SetFullscreenState(
return S_OK;
}
HRESULT WrappedIDXGISwapChain2::GetFullscreenState(
HRESULT WrappedIDXGISwapChain3::GetFullscreenState(
/* [out] */ BOOL *pFullscreen,
/* [out] */ IDXGIOutput **ppTarget)
{
return m_pReal->GetFullscreenState(pFullscreen, ppTarget);
}
HRESULT WrappedIDXGISwapChain2::GetBuffer(
HRESULT WrappedIDXGISwapChain3::GetBuffer(
/* [in] */ UINT Buffer,
/* [in] */ REFIID riid,
/* [out][in] */ void **ppSurface)
@@ -427,7 +457,7 @@ HRESULT WrappedIDXGISwapChain2::GetBuffer(
return ret;
}
HRESULT WrappedIDXGISwapChain2::GetDevice(
HRESULT WrappedIDXGISwapChain3::GetDevice(
/* [in] */ REFIID riid,
/* [retval][out] */ void **ppDevice)
{
@@ -459,7 +489,7 @@ HRESULT WrappedIDXGISwapChain2::GetDevice(
return ret;
}
HRESULT WrappedIDXGISwapChain2::Present(
HRESULT WrappedIDXGISwapChain3::Present(
/* [in] */ UINT SyncInterval,
/* [in] */ UINT Flags)
{
@@ -473,7 +503,7 @@ HRESULT WrappedIDXGISwapChain2::Present(
return m_pReal->Present(SyncInterval, Flags);
}
HRESULT WrappedIDXGISwapChain2::Present1(UINT SyncInterval, UINT Flags,
HRESULT WrappedIDXGISwapChain3::Present1(UINT SyncInterval, UINT Flags,
const DXGI_PRESENT_PARAMETERS *pPresentParameters)
{
if(!RenderDoc::Inst().GetCaptureOptions().AllowVSync)
@@ -546,6 +576,12 @@ bool RefCountDXGIObject::HandleWrap(REFIID riid, void **ppvObject)
*ppvObject = new WrappedIDXGIAdapter2(real);
return true;
}
else if(riid == __uuidof(IDXGIAdapter3))
{
IDXGIAdapter3 *real = (IDXGIAdapter3 *)(*ppvObject);
*ppvObject = new WrappedIDXGIAdapter3(real);
return true;
}
else if(riid == __uuidof(IDXGIFactory2))
{
IDXGIFactory2 *real = (IDXGIFactory2 *)(*ppvObject);
@@ -558,6 +594,12 @@ bool RefCountDXGIObject::HandleWrap(REFIID riid, void **ppvObject)
*ppvObject = new WrappedIDXGIFactory3(real);
return true;
}
else if(riid == __uuidof(IDXGIFactory4))
{
IDXGIFactory4 *real = (IDXGIFactory4 *)(*ppvObject);
*ppvObject = new WrappedIDXGIFactory4(real);
return true;
}
else
{
string guid = ToStr::Get(riid);
@@ -589,7 +631,7 @@ HRESULT RefCountDXGIObject::WrapQueryInterface(IUnknown *real, REFIID riid, void
return ret;
}
HRESULT STDMETHODCALLTYPE WrappedIDXGISwapChain2::QueryInterface(REFIID riid, void **ppvObject)
HRESULT STDMETHODCALLTYPE WrappedIDXGISwapChain3::QueryInterface(REFIID riid, void **ppvObject)
{
if(riid == __uuidof(IDXGISwapChain))
{
@@ -623,6 +665,19 @@ HRESULT STDMETHODCALLTYPE WrappedIDXGISwapChain2::QueryInterface(REFIID riid, vo
return E_NOINTERFACE;
}
}
else if(riid == __uuidof(IDXGISwapChain3))
{
if(m_pReal3)
{
AddRef();
*ppvObject = (IDXGISwapChain3 *)this;
return S_OK;
}
else
{
return E_NOINTERFACE;
}
}
else
{
string guid = ToStr::Get(riid);
+439 -4
View File
@@ -26,7 +26,7 @@
#pragma once
#include "../d3d11/official/d3d11_3.h"
#include "../d3d11/official/dxgi1_3.h"
#include "../d3d11/official/dxgi1_5.h"
#include "common/common.h"
#include "common/wrapped_pool.h"
@@ -145,11 +145,12 @@ public:
class WrappedID3D11Device;
struct ID3D11Resource;
class WrappedIDXGISwapChain2 : public IDXGISwapChain2, public RefCountDXGIObject
class WrappedIDXGISwapChain3 : public IDXGISwapChain3, public RefCountDXGIObject
{
IDXGISwapChain *m_pReal;
IDXGISwapChain1 *m_pReal1;
IDXGISwapChain2 *m_pReal2;
IDXGISwapChain3 *m_pReal3;
WrappedID3D11Device *m_pDevice;
unsigned int m_iRefcount;
@@ -159,9 +160,12 @@ class WrappedIDXGISwapChain2 : public IDXGISwapChain2, public RefCountDXGIObject
ID3D11Resource *m_pBackBuffers[MAX_NUM_BACKBUFFERS];
void ReleaseBuffersForResize();
void WrapBuffersAfterResize();
public:
WrappedIDXGISwapChain2(IDXGISwapChain *real, HWND wnd, WrappedID3D11Device *device);
virtual ~WrappedIDXGISwapChain2();
WrappedIDXGISwapChain3(IDXGISwapChain *real, HWND wnd, WrappedID3D11Device *device);
virtual ~WrappedIDXGISwapChain3();
IMPLEMENT_IDXGIOBJECT_WITH_REFCOUNTDXGIOBJECT_CUSTOMQUERY;
HRESULT STDMETHODCALLTYPE QueryInterface(REFIID riid, void **ppvObject);
@@ -353,6 +357,46 @@ public:
{
return m_pReal2->GetMatrixTransform(pMatrix);
}
//////////////////////////////
// implement IDXGISwapChain3
virtual UINT STDMETHODCALLTYPE GetCurrentBackBufferIndex(void)
{
return m_pReal3->GetCurrentBackBufferIndex();
}
virtual HRESULT STDMETHODCALLTYPE CheckColorSpaceSupport(
/* [annotation][in] */
_In_ DXGI_COLOR_SPACE_TYPE ColorSpace,
/* [annotation][out] */
_Out_ UINT *pColorSpaceSupport)
{
return m_pReal3->CheckColorSpaceSupport(ColorSpace, pColorSpaceSupport);
}
virtual HRESULT STDMETHODCALLTYPE SetColorSpace1(
/* [annotation][in] */
_In_ DXGI_COLOR_SPACE_TYPE ColorSpace)
{
return m_pReal3->SetColorSpace1(ColorSpace);
}
virtual HRESULT STDMETHODCALLTYPE ResizeBuffers1(
/* [annotation][in] */
_In_ UINT BufferCount,
/* [annotation][in] */
_In_ UINT Width,
/* [annotation][in] */
_In_ UINT Height,
/* [annotation][in] */
_In_ DXGI_FORMAT Format,
/* [annotation][in] */
_In_ UINT SwapChainFlags,
/* [annotation][in] */
_In_reads_(BufferCount) const UINT *pCreationNodeMask,
/* [annotation][in] */
_In_reads_(BufferCount) IUnknown *const *ppPresentQueue);
};
//////////////////////////////////////////////////////////////////////////////
@@ -1518,3 +1562,394 @@ public:
virtual UINT STDMETHODCALLTYPE GetCreationFlags(void) { return m_pReal->GetCreationFlags(); }
};
class WrappedIDXGIAdapter3 : public IDXGIAdapter3, public RefCountDXGIObject
{
IDXGIAdapter3 *m_pReal;
unsigned int m_iRefcount;
public:
WrappedIDXGIAdapter3(IDXGIAdapter3 *real)
: RefCountDXGIObject(real), m_pReal(real), m_iRefcount(1)
{
}
virtual ~WrappedIDXGIAdapter3() { SAFE_RELEASE(m_pReal); }
IMPLEMENT_IDXGIOBJECT_WITH_REFCOUNTDXGIOBJECT;
//////////////////////////////
// implement IDXGIAdapter
virtual HRESULT STDMETHODCALLTYPE EnumOutputs(
/* [in] */ UINT Output,
/* [annotation][out][in] */
__out IDXGIOutput **ppOutput)
{
return m_pReal->EnumOutputs(Output, ppOutput);
}
virtual HRESULT STDMETHODCALLTYPE GetDesc(
/* [annotation][out] */
__out DXGI_ADAPTER_DESC *pDesc)
{
return m_pReal->GetDesc(pDesc);
}
virtual HRESULT STDMETHODCALLTYPE CheckInterfaceSupport(
/* [annotation][in] */
__in REFGUID InterfaceName,
/* [annotation][out] */
__out LARGE_INTEGER *pUMDVersion)
{
return m_pReal->CheckInterfaceSupport(InterfaceName, pUMDVersion);
}
//////////////////////////////
// implement IDXGIAdapter1
virtual HRESULT STDMETHODCALLTYPE GetDesc1(
/* [out] */ DXGI_ADAPTER_DESC1 *pDesc)
{
return m_pReal->GetDesc1(pDesc);
}
//////////////////////////////
// implement IDXGIAdapter2
virtual HRESULT STDMETHODCALLTYPE GetDesc2(
/* [annotation][out] */
_Out_ DXGI_ADAPTER_DESC2 *pDesc)
{
return m_pReal->GetDesc2(pDesc);
}
//////////////////////////////
// implement IDXGIAdapter3
virtual HRESULT STDMETHODCALLTYPE RegisterHardwareContentProtectionTeardownStatusEvent(
/* [annotation][in] */
_In_ HANDLE hEvent,
/* [annotation][out] */
_Out_ DWORD *pdwCookie)
{
return m_pReal->RegisterHardwareContentProtectionTeardownStatusEvent(hEvent, pdwCookie);
}
virtual void STDMETHODCALLTYPE UnregisterHardwareContentProtectionTeardownStatus(
/* [annotation][in] */
_In_ DWORD dwCookie)
{
return m_pReal->UnregisterHardwareContentProtectionTeardownStatus(dwCookie);
}
virtual HRESULT STDMETHODCALLTYPE QueryVideoMemoryInfo(
/* [annotation][in] */
_In_ UINT NodeIndex,
/* [annotation][in] */
_In_ DXGI_MEMORY_SEGMENT_GROUP MemorySegmentGroup,
/* [annotation][out] */
_Out_ DXGI_QUERY_VIDEO_MEMORY_INFO *pVideoMemoryInfo)
{
return m_pReal->QueryVideoMemoryInfo(NodeIndex, MemorySegmentGroup, pVideoMemoryInfo);
}
virtual HRESULT STDMETHODCALLTYPE SetVideoMemoryReservation(
/* [annotation][in] */
_In_ UINT NodeIndex,
/* [annotation][in] */
_In_ DXGI_MEMORY_SEGMENT_GROUP MemorySegmentGroup,
/* [annotation][in] */
_In_ UINT64 Reservation)
{
return m_pReal->SetVideoMemoryReservation(NodeIndex, MemorySegmentGroup, Reservation);
}
virtual HRESULT STDMETHODCALLTYPE RegisterVideoMemoryBudgetChangeNotificationEvent(
/* [annotation][in] */
_In_ HANDLE hEvent,
/* [annotation][out] */
_Out_ DWORD *pdwCookie)
{
return m_pReal->RegisterVideoMemoryBudgetChangeNotificationEvent(hEvent, pdwCookie);
}
virtual void STDMETHODCALLTYPE UnregisterVideoMemoryBudgetChangeNotification(
/* [annotation][in] */
_In_ DWORD dwCookie)
{
return m_pReal->UnregisterVideoMemoryBudgetChangeNotification(dwCookie);
}
};
class WrappedIDXGIFactory4 : public IDXGIFactory4, public RefCountDXGIObject
{
IDXGIFactory4 *m_pReal;
unsigned int m_iRefcount;
public:
WrappedIDXGIFactory4(IDXGIFactory4 *real)
: RefCountDXGIObject(real), m_pReal(real), m_iRefcount(1)
{
}
virtual ~WrappedIDXGIFactory4() { SAFE_RELEASE(m_pReal); }
IMPLEMENT_IDXGIOBJECT_WITH_REFCOUNTDXGIOBJECT;
//////////////////////////////
// implement IDXGIFactory
virtual HRESULT STDMETHODCALLTYPE EnumAdapters(
/* [in] */ UINT Adapter,
/* [annotation][out] */
__out IDXGIAdapter **ppAdapter)
{
HRESULT ret = m_pReal->EnumAdapters(Adapter, ppAdapter);
if(SUCCEEDED(ret))
*ppAdapter = new WrappedIDXGIAdapter(*ppAdapter);
return ret;
}
virtual HRESULT STDMETHODCALLTYPE MakeWindowAssociation(HWND WindowHandle, UINT Flags)
{
return m_pReal->MakeWindowAssociation(WindowHandle, Flags);
}
virtual HRESULT STDMETHODCALLTYPE GetWindowAssociation(
/* [annotation][out] */
__out HWND *pWindowHandle)
{
return m_pReal->GetWindowAssociation(pWindowHandle);
}
virtual HRESULT STDMETHODCALLTYPE CreateSwapChain(
/* [annotation][in] */
__in IUnknown *pDevice,
/* [annotation][in] */
__in DXGI_SWAP_CHAIN_DESC *pDesc,
/* [annotation][out] */
__out IDXGISwapChain **ppSwapChain)
{
return WrappedIDXGIFactory::staticCreateSwapChain(m_pReal, pDevice, pDesc, ppSwapChain);
}
virtual HRESULT STDMETHODCALLTYPE CreateSoftwareAdapter(
/* [in] */ HMODULE Module,
/* [annotation][out] */
__out IDXGIAdapter **ppAdapter)
{
HRESULT ret = m_pReal->CreateSoftwareAdapter(Module, ppAdapter);
if(SUCCEEDED(ret))
*ppAdapter = new WrappedIDXGIAdapter(*ppAdapter);
return ret;
}
//////////////////////////////
// implement IDXGIFactory1
virtual HRESULT STDMETHODCALLTYPE EnumAdapters1(
/* [in] */ UINT Adapter,
/* [annotation][out] */
__out IDXGIAdapter1 **ppAdapter)
{
HRESULT ret = m_pReal->EnumAdapters1(Adapter, ppAdapter);
if(SUCCEEDED(ret))
*ppAdapter = new WrappedIDXGIAdapter1(*ppAdapter);
return ret;
}
virtual BOOL STDMETHODCALLTYPE IsCurrent(void) { return m_pReal->IsCurrent(); }
//////////////////////////////
// implement IDXGIFactory2
virtual BOOL STDMETHODCALLTYPE IsWindowedStereoEnabled(void)
{
return m_pReal->IsWindowedStereoEnabled();
}
virtual HRESULT STDMETHODCALLTYPE CreateSwapChainForHwnd(
/* [annotation][in] */
_In_ IUnknown *pDevice,
/* [annotation][in] */
_In_ HWND hWnd,
/* [annotation][in] */
_In_ const DXGI_SWAP_CHAIN_DESC1 *pDesc,
/* [annotation][in] */
_In_opt_ const DXGI_SWAP_CHAIN_FULLSCREEN_DESC *pFullscreenDesc,
/* [annotation][in] */
_In_opt_ IDXGIOutput *pRestrictToOutput,
/* [annotation][out] */
_Out_ IDXGISwapChain1 **ppSwapChain)
{
return WrappedIDXGIFactory2::staticCreateSwapChainForHwnd(
m_pReal, pDevice, hWnd, pDesc, pFullscreenDesc, pRestrictToOutput, ppSwapChain);
}
virtual HRESULT STDMETHODCALLTYPE CreateSwapChainForCoreWindow(
/* [annotation][in] */
_In_ IUnknown *pDevice,
/* [annotation][in] */
_In_ IUnknown *pWindow,
/* [annotation][in] */
_In_ const DXGI_SWAP_CHAIN_DESC1 *pDesc,
/* [annotation][in] */
_In_opt_ IDXGIOutput *pRestrictToOutput,
/* [annotation][out] */
_Out_ IDXGISwapChain1 **ppSwapChain)
{
return WrappedIDXGIFactory2::staticCreateSwapChainForCoreWindow(
m_pReal, pDevice, pWindow, pDesc, pRestrictToOutput, ppSwapChain);
}
virtual HRESULT STDMETHODCALLTYPE GetSharedResourceAdapterLuid(
/* [annotation] */
_In_ HANDLE hResource,
/* [annotation] */
_Out_ LUID *pLuid)
{
return m_pReal->GetSharedResourceAdapterLuid(hResource, pLuid);
}
virtual HRESULT STDMETHODCALLTYPE RegisterStereoStatusWindow(
/* [annotation][in] */
_In_ HWND WindowHandle,
/* [annotation][in] */
_In_ UINT wMsg,
/* [annotation][out] */
_Out_ DWORD *pdwCookie)
{
return m_pReal->RegisterOcclusionStatusWindow(WindowHandle, wMsg, pdwCookie);
}
virtual HRESULT STDMETHODCALLTYPE RegisterStereoStatusEvent(
/* [annotation][in] */
_In_ HANDLE hEvent,
/* [annotation][out] */
_Out_ DWORD *pdwCookie)
{
return m_pReal->RegisterStereoStatusEvent(hEvent, pdwCookie);
}
virtual void STDMETHODCALLTYPE UnregisterStereoStatus(
/* [annotation][in] */
_In_ DWORD dwCookie)
{
return m_pReal->UnregisterStereoStatus(dwCookie);
}
virtual HRESULT STDMETHODCALLTYPE RegisterOcclusionStatusWindow(
/* [annotation][in] */
_In_ HWND WindowHandle,
/* [annotation][in] */
_In_ UINT wMsg,
/* [annotation][out] */
_Out_ DWORD *pdwCookie)
{
return m_pReal->RegisterOcclusionStatusWindow(WindowHandle, wMsg, pdwCookie);
}
virtual HRESULT STDMETHODCALLTYPE RegisterOcclusionStatusEvent(
/* [annotation][in] */
_In_ HANDLE hEvent,
/* [annotation][out] */
_Out_ DWORD *pdwCookie)
{
return m_pReal->RegisterOcclusionStatusEvent(hEvent, pdwCookie);
}
virtual void STDMETHODCALLTYPE UnregisterOcclusionStatus(
/* [annotation][in] */
_In_ DWORD dwCookie)
{
return m_pReal->UnregisterOcclusionStatus(dwCookie);
}
virtual HRESULT STDMETHODCALLTYPE CreateSwapChainForComposition(
/* [annotation][in] */
_In_ IUnknown *pDevice,
/* [annotation][in] */
_In_ const DXGI_SWAP_CHAIN_DESC1 *pDesc,
/* [annotation][in] */
_In_opt_ IDXGIOutput *pRestrictToOutput,
/* [annotation][out] */
_Outptr_ IDXGISwapChain1 **ppSwapChain)
{
return WrappedIDXGIFactory2::staticCreateSwapChainForComposition(
m_pReal, pDevice, pDesc, pRestrictToOutput, ppSwapChain);
}
// static functions to share implementation between this and WrappedIDXGIFactory3
static HRESULT staticCreateSwapChainForHwnd(
IDXGIFactory2 *factory,
/* [annotation][in] */
_In_ IUnknown *pDevice,
/* [annotation][in] */
_In_ HWND hWnd,
/* [annotation][in] */
_In_ const DXGI_SWAP_CHAIN_DESC1 *pDesc,
/* [annotation][in] */
_In_opt_ const DXGI_SWAP_CHAIN_FULLSCREEN_DESC *pFullscreenDesc,
/* [annotation][in] */
_In_opt_ IDXGIOutput *pRestrictToOutput,
/* [annotation][out] */
_Out_ IDXGISwapChain1 **ppSwapChain);
static HRESULT staticCreateSwapChainForCoreWindow(IDXGIFactory2 *factory,
/* [annotation][in] */
_In_ IUnknown *pDevice,
/* [annotation][in] */
_In_ IUnknown *pWindow,
/* [annotation][in] */
_In_ const DXGI_SWAP_CHAIN_DESC1 *pDesc,
/* [annotation][in] */
_In_opt_ IDXGIOutput *pRestrictToOutput,
/* [annotation][out] */
_Out_ IDXGISwapChain1 **ppSwapChain);
static HRESULT staticCreateSwapChainForComposition(IDXGIFactory2 *factory,
/* [annotation][in] */
_In_ IUnknown *pDevice,
/* [annotation][in] */
_In_ const DXGI_SWAP_CHAIN_DESC1 *pDesc,
/* [annotation][in] */
_In_opt_ IDXGIOutput *pRestrictToOutput,
/* [annotation][out] */
_Outptr_ IDXGISwapChain1 **ppSwapChain);
//////////////////////////////
// implement IDXGIFactory3
virtual UINT STDMETHODCALLTYPE GetCreationFlags(void) { return m_pReal->GetCreationFlags(); }
//////////////////////////////
// implement IDXGIFactory4
virtual HRESULT STDMETHODCALLTYPE EnumAdapterByLuid(
/* [annotation] */
_In_ LUID AdapterLuid,
/* [annotation] */
_In_ REFIID riid,
/* [annotation] */
_COM_Outptr_ void **ppvAdapter)
{
HRESULT ret = m_pReal->EnumAdapterByLuid(AdapterLuid, riid, ppvAdapter);
if(SUCCEEDED(ret) && ppvAdapter && *ppvAdapter)
{
IDXGIAdapter *adapter = (IDXGIAdapter *)*ppvAdapter;
*ppvAdapter = (void *)new WrappedIDXGIAdapter(adapter);
}
return ret;
}
virtual HRESULT STDMETHODCALLTYPE EnumWarpAdapter(
/* [annotation] */
_In_ REFIID riid,
/* [annotation] */
_COM_Outptr_ void **ppvAdapter)
{
HRESULT ret = m_pReal->EnumWarpAdapter(riid, ppvAdapter);
if(SUCCEEDED(ret) && ppvAdapter && *ppvAdapter)
{
IDXGIAdapter *adapter = (IDXGIAdapter *)*ppvAdapter;
*ppvAdapter = (void *)new WrappedIDXGIAdapter(adapter);
}
return ret;
}
};