Skip to content

Commit

Permalink
Remove Present calls from DXGI as test.
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
bo3b committed Apr 1, 2014
1 parent 456696c commit 5d9bef1
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 29 deletions.
8 changes: 4 additions & 4 deletions DirectX11/d3d11Wrapper.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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;
}
}
Expand Down Expand Up @@ -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)
Expand Down Expand Up @@ -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)
Expand Down
50 changes: 25 additions & 25 deletions DirectXGI/Direct3DXGIFunctions.h
Original file line number Diff line number Diff line change
Expand Up @@ -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 **) &param) == 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 **) &param) == 0x13bc7e31)
// {
// //if (D3D11Wrapper::LogFile) fprintf(D3D11Wrapper::LogFile, " forward was successful.\n");
// //
// }
//}

//if (LogFile) fprintf(LogFile, " returns %x\n", hr);
//
Expand Down Expand Up @@ -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 **) &param) == 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 **) &param) == 0x13bc7e31)
// {
// if (D3D11Wrapper::LogFile) fprintf(D3D11Wrapper::LogFile, " forward was successful.\n");
// }
//}

if (LogFile) fprintf(LogFile, " returns result = %x\n", hr);

Expand Down

0 comments on commit 5d9bef1

Please sign in to comment.