Remove assumptions that captures are always frames

* Previously we had "Frame X" and "Start of Frame" hardcoded in the event
  browser, and the end of frame was in many cases assumed to be a present call.
  However with the in-application API this is not necessarily true.
* Presents are now serialised separately in all APIs and displayed wherever they
  happen in the frame, and if there is no present at the end of the frame an
  "End of Capture" marker is inserted. Similarly API-defined captures are not
  given a potentially misleading frame number.
This commit is contained in:
baldurk
2019-11-21 13:52:38 +00:00
parent cb216441fe
commit 4458ab3205
37 changed files with 454 additions and 147 deletions
+11 -3
View File
@@ -857,7 +857,10 @@ std::string RenderDoc::GetOverlayText(RDCDriver driver, uint32_t frameNumber, in
{
if(now - m_Captures[i].timestamp < 20)
{
overlayText += StringFormat::Fmt("Captured frame %d.\n", m_Captures[i].frameNumber);
if(m_Captures[i].frameNumber == ~0U)
overlayText += "Captured user-defined capture.\n";
else
overlayText += StringFormat::Fmt("Captured frame %d.\n", m_Captures[i].frameNumber);
}
}
}
@@ -1061,7 +1064,12 @@ RDCFile *RenderDoc::CreateRDC(RDCDriver driver, uint32_t frameNum, const FramePi
{
RDCFile *ret = new RDCFile;
m_CurrentLogFile = StringFormat::Fmt("%s_frame%u.rdc", m_CaptureFileTemplate.c_str(), frameNum);
std::string suffix = StringFormat::Fmt("_frame%u", frameNum);
if(frameNum == ~0U)
suffix = "_capture";
m_CurrentLogFile = StringFormat::Fmt("%s%s.rdc", m_CaptureFileTemplate.c_str(), suffix.c_str());
// make sure we don't stomp another capture if we make multiple captures in the same frame.
{
@@ -1072,7 +1080,7 @@ RDCFile *RenderDoc::CreateRDC(RDCDriver driver, uint32_t frameNum, const FramePi
}) != m_Captures.end())
{
m_CurrentLogFile =
StringFormat::Fmt("%s_frame%u_%d.rdc", m_CaptureFileTemplate.c_str(), frameNum, altnum);
StringFormat::Fmt("%s%s_%d.rdc", m_CaptureFileTemplate.c_str(), suffix.c_str(), altnum);
altnum++;
}
}