Export drawcall times with proper summation over regions. Refs #468

This commit is contained in:
baldurk
2017-01-05 11:38:00 +00:00
parent 45e7b64eb4
commit 89b1ff2337
+30 -3
View File
@@ -1234,6 +1234,29 @@ namespace renderdocui.Windows
GetMaxNameLength(ref maxNameLength, indent + 1, i == 0, drawcall.children[i]);
}
private double GetDrawTime(FetchDrawcall drawcall)
{
if (drawcall.children.Length > 0)
{
double total = 0.0;
foreach (FetchDrawcall c in drawcall.children)
{
double f = GetDrawTime(c);
if(f >= 0)
total += f;
}
return total;
}
else if (m_Times.ContainsKey(drawcall.eventID))
{
return m_Times[drawcall.eventID][0].value.d;
}
return -1.0;
}
private void ExportDrawcall(StreamWriter sw, int maxNameLength, int indent, bool firstchild, FetchDrawcall drawcall)
{
string eidString = drawcall.children.Length > 0 ? "" : drawcall.eventID.ToString();
@@ -1247,10 +1270,10 @@ namespace renderdocui.Windows
if (m_Core.Config.EventBrowser_TimeUnit != m_TimeUnit)
UpdateDurationColumn();
if(m_Times.ContainsKey(drawcall.eventID))
{
double f = m_Times[drawcall.eventID][0].value.d;
double f = GetDrawTime(drawcall);
if (f >= 0)
{
if (m_Core.Config.EventBrowser_TimeUnit == PersistantConfig.TimeUnit.Milliseconds)
f *= 1000.0;
else if (m_Core.Config.EventBrowser_TimeUnit == PersistantConfig.TimeUnit.Microseconds)
@@ -1260,6 +1283,10 @@ namespace renderdocui.Windows
line += String.Format(" | {0}", Formatter.Format(f));
}
else
{
line += " |";
}
}
sw.WriteLine(line);