Allow the queued capturing of frame 1 immediately. Refs #150

This commit is contained in:
baldurk
2015-09-12 17:23:30 +02:00
parent 193aa5addd
commit 96b43aa54d
4 changed files with 21 additions and 1 deletions
+14
View File
@@ -2988,6 +2988,20 @@ bool WrappedID3D11Device::EndFrameCapture(void *dev, void *wnd)
}
}
void WrappedID3D11Device::FirstFrame(IDXGISwapChain *swap)
{
DXGI_SWAP_CHAIN_DESC swapdesc;
swap->GetDesc(&swapdesc);
// if we have to capture the first frame, begin capturing immediately
if(m_State == WRITING_IDLE && RenderDoc::Inst().ShouldTriggerCapture(0))
{
StartFrameCapture(this, swapdesc.OutputWindow);
m_AppControlledCapture = false;
}
}
HRESULT WrappedID3D11Device::Present(IDXGISwapChain *swap, UINT SyncInterval, UINT Flags)
{
if((Flags & DXGI_PRESENT_TEST) != 0)
+2
View File
@@ -305,6 +305,8 @@ public:
const FetchDrawcall *GetDrawcall(uint32_t frameID, uint32_t eventID);
void FirstFrame(IDXGISwapChain *swap);
vector<DebugMessage> GetDebugMessages();
void AddDebugMessage(DebugMessage msg) { if(m_State < WRITING) m_DebugMessages.push_back(msg); }
void AddDebugMessage(DebugMessageCategory c, DebugMessageSeverity sv, DebugMessageSource src, std::string d);
+4
View File
@@ -272,6 +272,10 @@ WrappedIDXGISwapChain2::WrappedIDXGISwapChain2(IDXGISwapChain* real, HWND wnd, W
}
SAFE_ADDREF(m_pDevice);
// we do a 'fake' present right at the start, so that we can capture frame 1, by
// going from this fake present to the first present.
m_pDevice->FirstFrame(this);
}
WrappedIDXGISwapChain2::~WrappedIDXGISwapChain2()
+1 -1
View File
@@ -196,7 +196,7 @@
0,
0});
this.queuedCapFrame.Minimum = new decimal(new int[] {
2,
1,
0,
0,
0});