From 5d9bef15fe9875bd0a3967d5bea48671d8f0ba51 Mon Sep 17 00:00:00 2001 From: bo3b Date: Tue, 1 Apr 2014 16:07:03 -0700 Subject: [PATCH] Remove Present calls from DXGI as test. This Debug build has no Present call being sent via the QueryInterface, since I know it's a bit off. Also commented out my RunFrameActions so that it cannot run at the moment. --- DirectX11/d3d11Wrapper.cpp | 8 ++--- DirectXGI/Direct3DXGIFunctions.h | 50 ++++++++++++++++---------------- 2 files changed, 29 insertions(+), 29 deletions(-) diff --git a/DirectX11/d3d11Wrapper.cpp b/DirectX11/d3d11Wrapper.cpp index f589e25d8..f5a1b5476 100644 --- a/DirectX11/d3d11Wrapper.cpp +++ b/DirectX11/d3d11Wrapper.cpp @@ -19,7 +19,7 @@ bool LogInput = false, LogDebug = false; // ToDo: this is a hack for the moment to get access to the real device // for loading new shaders. This should be passed down to dxgi probably. -D3D11Base::ID3D11Device* realDevice; +//D3D11Base::ID3D11Device* realDevice; ThreadSafePointerSet D3D11Wrapper::ID3D11Device::m_List; ThreadSafePointerSet D3D11Wrapper::ID3D11DeviceContext::m_List; @@ -1892,7 +1892,7 @@ STDMETHODIMP D3D11Wrapper::IDirect3DUnknown::QueryInterface(THIS_ REFIID riid, v // Present received. // Todo: this cast is wrong. The object is always IDXGIDevice2. // ID3D11Device *device = (ID3D11Device *)this; - RunFrameActions(realDevice); + // RunFrameActions(realDevice); break; } } @@ -2115,7 +2115,7 @@ HRESULT WINAPI D3D11CreateDevice( } // Todo: doesn't really belong here - realDevice = origDevice; + //realDevice = origDevice; D3D11Wrapper::ID3D11Device *wrapper = D3D11Wrapper::ID3D11Device::GetDirect3DDevice(origDevice); if(wrapper == NULL) @@ -2199,7 +2199,7 @@ HRESULT WINAPI D3D11CreateDeviceAndSwapChain( return ret; // Todo: doesn't really belong here - realDevice = origDevice; + //realDevice = origDevice; D3D11Wrapper::ID3D11Device *wrapper = D3D11Wrapper::ID3D11Device::GetDirect3DDevice(origDevice); if (wrapper == NULL) diff --git a/DirectXGI/Direct3DXGIFunctions.h b/DirectXGI/Direct3DXGIFunctions.h index 5a28d380b..010e08654 100644 --- a/DirectXGI/Direct3DXGIFunctions.h +++ b/DirectXGI/Direct3DXGIFunctions.h @@ -1171,19 +1171,19 @@ STDMETHODIMP D3D11Wrapper::IDXGISwapChain::Present(THIS_ */ HRESULT hr = GetSwapChain()->Present(SyncInterval, Flags); - if (m_WrappedDevice) - { - // Forward call to device. - //if (LogFile) fprintf(LogFile, " forwarding Present call to device %x\n", m_WrappedDevice); - const static IID marker = { 0x017b2e72ul, 0xbcde, 0x9f15, { 0xa1, 0x2b, 0x3c, 0x4d, 0x5e, 0x6f, 0x70, 0x02 } }; - IUnknown *deviceIU = (IUnknown *)m_WrappedDevice; - int param = 0; - if (deviceIU->QueryInterface(marker, (void **) ¶m) == 0x13bc7e31) - { - //if (D3D11Wrapper::LogFile) fprintf(D3D11Wrapper::LogFile, " forward was successful.\n"); - // - } - } + //if (m_WrappedDevice) + //{ + // // Forward call to device. + // //if (LogFile) fprintf(LogFile, " forwarding Present call to device %x\n", m_WrappedDevice); + // const static IID marker = { 0x017b2e72ul, 0xbcde, 0x9f15, { 0xa1, 0x2b, 0x3c, 0x4d, 0x5e, 0x6f, 0x70, 0x02 } }; + // IUnknown *deviceIU = (IUnknown *)m_WrappedDevice; + // int param = 0; + // if (deviceIU->QueryInterface(marker, (void **) ¶m) == 0x13bc7e31) + // { + // //if (D3D11Wrapper::LogFile) fprintf(D3D11Wrapper::LogFile, " forward was successful.\n"); + // // + // } + //} //if (LogFile) fprintf(LogFile, " returns %x\n", hr); // @@ -1394,18 +1394,18 @@ STDMETHODIMP D3D11Wrapper::IDXGISwapChain1::Present1(THIS_ HRESULT hr = GetSwapChain1()->Present1(SyncInterval, PresentFlags, pPresentParameters); - if (m_WrappedDevice) - { - // Forward call to device. - if (LogFile) fprintf(LogFile, " forwarding Present call to device %x\n", m_WrappedDevice); - const static IID marker = { 0x017b2e72ul, 0xbcde, 0x9f15, { 0xa1, 0x2b, 0x3c, 0x4d, 0x5e, 0x6f, 0x70, 0x02 } }; - IUnknown *deviceIU = (IUnknown *)m_WrappedDevice; - int param = 0; - if (deviceIU->QueryInterface(marker, (void **) ¶m) == 0x13bc7e31) - { - if (D3D11Wrapper::LogFile) fprintf(D3D11Wrapper::LogFile, " forward was successful.\n"); - } - } + //if (m_WrappedDevice) + //{ + // // Forward call to device. + // if (LogFile) fprintf(LogFile, " forwarding Present call to device %x\n", m_WrappedDevice); + // const static IID marker = { 0x017b2e72ul, 0xbcde, 0x9f15, { 0xa1, 0x2b, 0x3c, 0x4d, 0x5e, 0x6f, 0x70, 0x02 } }; + // IUnknown *deviceIU = (IUnknown *)m_WrappedDevice; + // int param = 0; + // if (deviceIU->QueryInterface(marker, (void **) ¶m) == 0x13bc7e31) + // { + // if (D3D11Wrapper::LogFile) fprintf(D3D11Wrapper::LogFile, " forward was successful.\n"); + // } + //} if (LogFile) fprintf(LogFile, " returns result = %x\n", hr);