Don't use current driver for creating RDC, pass in driver explicitly

This commit is contained in:
baldurk
2017-12-29 12:53:48 +00:00
parent 184e5c7f8d
commit 87280c549d
6 changed files with 13 additions and 10 deletions
+3 -3
View File
@@ -699,8 +699,8 @@ bool RenderDoc::ShouldTriggerCapture(uint32_t frameNumber)
return ret;
}
RDCFile *RenderDoc::CreateRDC(uint32_t frameNum, void *thpixels, size_t thlen, uint16_t thwidth,
uint16_t thheight)
RDCFile *RenderDoc::CreateRDC(RDCDriver driver, uint32_t frameNum, void *thpixels, size_t thlen,
uint16_t thwidth, uint16_t thheight)
{
RDCFile *ret = new RDCFile;
@@ -731,7 +731,7 @@ RDCFile *RenderDoc::CreateRDC(uint32_t frameNum, void *thpixels, size_t thlen, u
thumb = &th;
}
ret->SetData(m_CurrentDriver, ToStr(m_CurrentDriver).c_str(), OSUtility::GetMachineIdent(), thumb);
ret->SetData(driver, ToStr(driver).c_str(), OSUtility::GetMachineIdent(), thumb);
ret->Create(m_CurrentLogFile.c_str());
+2 -2
View File
@@ -288,8 +288,8 @@ public:
void RecreateCrashHandler();
void UnloadCrashHandler();
ICrashHandler *GetCrashHandler() const { return m_ExHandler; }
RDCFile *CreateRDC(uint32_t frameNum, void *thpixels, size_t thlen, uint16_t thwidth,
uint16_t thheight);
RDCFile *CreateRDC(RDCDriver driver, uint32_t frameNum, void *thpixels, size_t thlen,
uint16_t thwidth, uint16_t thheight);
void FinishCaptureWriting(RDCFile *rdc, uint32_t frameNumber);
void AddChildProcess(uint32_t pid, uint32_t ident)
+2 -1
View File
@@ -1646,7 +1646,8 @@ bool WrappedID3D11Device::EndFrameCapture(void *dev, void *wnd)
}
}
RDCFile *rdc = RenderDoc::Inst().CreateRDC(m_FrameCounter, jpgbuf, len, thwidth, thheight);
RDCFile *rdc = RenderDoc::Inst().CreateRDC(RDCDriver::D3D11, m_FrameCounter, jpgbuf, len,
thwidth, thheight);
SAFE_DELETE_ARRAY(jpgbuf);
SAFE_DELETE_ARRAY(thpixels);
+2 -1
View File
@@ -1559,7 +1559,8 @@ bool WrappedID3D12Device::EndFrameCapture(void *dev, void *wnd)
if((*it)->GetResourceRecord()->ContainsExecuteIndirect)
WrappedID3D12Resource::RefBuffers(GetResourceManager());
rdc = RenderDoc::Inst().CreateRDC(m_FrameCounter, jpgbuf, len, thwidth, thheight);
rdc = RenderDoc::Inst().CreateRDC(RDCDriver::D3D12, m_FrameCounter, jpgbuf, len, thwidth,
thheight);
SAFE_DELETE_ARRAY(jpgbuf);
SAFE_DELETE_ARRAY(thpixels);
+2 -2
View File
@@ -2401,8 +2401,8 @@ bool WrappedOpenGL::EndFrameCapture(void *dev, void *wnd)
if(bbim == NULL)
bbim = SaveBackbufferImage();
RDCFile *rdc = RenderDoc::Inst().CreateRDC(m_FrameCounter, bbim->jpgbuf, bbim->len,
bbim->thwidth, bbim->thheight);
RDCFile *rdc = RenderDoc::Inst().CreateRDC(GetDriverType(), m_FrameCounter, bbim->jpgbuf,
bbim->len, bbim->thwidth, bbim->thheight);
SAFE_DELETE(bbim);
+2 -1
View File
@@ -1291,7 +1291,8 @@ bool WrappedVulkan::EndFrameCapture(void *dev, void *wnd)
}
}
RDCFile *rdc = RenderDoc::Inst().CreateRDC(m_FrameCounter, jpgbuf, len, thwidth, thheight);
RDCFile *rdc =
RenderDoc::Inst().CreateRDC(RDCDriver::Vulkan, m_FrameCounter, jpgbuf, len, thwidth, thheight);
SAFE_DELETE_ARRAY(jpgbuf);
SAFE_DELETE_ARRAY(thpixels);