mirror of
https://github.com/baldurk/renderdoc.git
synced 2026-08-02 04:41:08 +00:00
Add an option to hide any markers with only "API Calls" but no draws.
This commit is contained in:
@@ -186,6 +186,17 @@ Marker sections that contain no API calls or drawcalls will be completely remove
|
||||
This option only applies itself the next time you load a log.
|
||||
|
||||
|
||||
---------------
|
||||
|
||||
| ``Hide marker sections with only non-draw API calls`` Default: ``Disabled``
|
||||
|
||||
Marker sections that contain only miscellaneous non-draw API calls like queries or state setting will be completely removed. This also applies to the Timeline Bar.
|
||||
|
||||
This can be useful if you have markers around occlusion queries or where you have a minor state change, and you don't want them cluttering up the capture.
|
||||
|
||||
This option only applies itself the next time you load a log.
|
||||
|
||||
|
||||
---------------
|
||||
|
||||
| ``Apply marker colours`` Default: ``Enabled``
|
||||
|
||||
@@ -470,6 +470,7 @@ enum DrawcallFlags
|
||||
eDraw_ClearDepthStencil = 0x200000,
|
||||
eDraw_BeginPass = 0x400000,
|
||||
eDraw_EndPass = 0x800000,
|
||||
eDraw_APICalls = 0x1000000,
|
||||
};
|
||||
|
||||
enum SolidShadeMode
|
||||
|
||||
@@ -117,7 +117,7 @@ bool WrappedID3D11DeviceContext::Serialise_PopEvent()
|
||||
{
|
||||
FetchDrawcall draw;
|
||||
draw.name = "API Calls";
|
||||
draw.flags |= eDraw_SetMarker;
|
||||
draw.flags |= eDraw_SetMarker | eDraw_APICalls;
|
||||
|
||||
AddDrawcall(draw, true);
|
||||
}
|
||||
|
||||
@@ -92,7 +92,7 @@ bool WrappedID3D12GraphicsCommandList::Serialise_Close()
|
||||
{
|
||||
FetchDrawcall draw;
|
||||
draw.name = "API Calls";
|
||||
draw.flags |= eDraw_SetMarker;
|
||||
draw.flags |= eDraw_SetMarker | eDraw_APICalls;
|
||||
|
||||
m_Cmd->AddDrawcall(draw, true);
|
||||
|
||||
@@ -2570,7 +2570,7 @@ bool WrappedID3D12GraphicsCommandList::Serialise_EndEvent()
|
||||
{
|
||||
FetchDrawcall draw;
|
||||
draw.name = "API Calls";
|
||||
draw.flags = eDraw_SetMarker;
|
||||
draw.flags = eDraw_SetMarker | eDraw_APICalls;
|
||||
|
||||
m_Cmd->AddDrawcall(draw, true);
|
||||
}
|
||||
|
||||
@@ -272,7 +272,7 @@ bool WrappedOpenGL::Serialise_glPopDebugGroup()
|
||||
{
|
||||
FetchDrawcall draw;
|
||||
draw.name = "API Calls";
|
||||
draw.flags |= eDraw_SetMarker;
|
||||
draw.flags |= eDraw_SetMarker | eDraw_APICalls;
|
||||
|
||||
AddDrawcall(draw, true);
|
||||
}
|
||||
|
||||
@@ -730,7 +730,7 @@ bool WrappedVulkan::Serialise_vkEndCommandBuffer(Serialiser *localSerialiser,
|
||||
{
|
||||
FetchDrawcall draw;
|
||||
draw.name = "API Calls";
|
||||
draw.flags |= eDraw_SetMarker;
|
||||
draw.flags |= eDraw_SetMarker | eDraw_APICalls;
|
||||
|
||||
AddDrawcall(draw, true);
|
||||
|
||||
@@ -2660,7 +2660,7 @@ bool WrappedVulkan::Serialise_vkCmdDebugMarkerEndEXT(Serialiser *localSerialiser
|
||||
{
|
||||
FetchDrawcall draw;
|
||||
draw.name = "API Calls";
|
||||
draw.flags = eDraw_SetMarker;
|
||||
draw.flags = eDraw_SetMarker | eDraw_APICalls;
|
||||
|
||||
AddDrawcall(draw, true);
|
||||
}
|
||||
|
||||
@@ -263,6 +263,7 @@ namespace renderdocui.Code
|
||||
|
||||
public TimeUnit EventBrowser_TimeUnit = TimeUnit.Microseconds;
|
||||
public bool EventBrowser_HideEmpty = false;
|
||||
public bool EventBrowser_HideAPICalls = false;
|
||||
|
||||
public bool EventBrowser_ApplyColours = true;
|
||||
public bool EventBrowser_ColourEventRow = true;
|
||||
|
||||
@@ -474,6 +474,7 @@ namespace renderdoc
|
||||
ClearDepthStencil = 0x200000,
|
||||
BeginPass = 0x400000,
|
||||
EndPass = 0x800000,
|
||||
APICalls = 0x1000000,
|
||||
};
|
||||
|
||||
public enum SolidShadeMode
|
||||
|
||||
+40
-7
@@ -54,6 +54,7 @@
|
||||
System.Windows.Forms.GroupBox groupBox4;
|
||||
System.Windows.Forms.Label label8;
|
||||
System.Windows.Forms.Label label9;
|
||||
System.Windows.Forms.Label label35;
|
||||
System.Windows.Forms.Label label16;
|
||||
System.Windows.Forms.Label label17;
|
||||
System.Windows.Forms.GroupBox groupBox7;
|
||||
@@ -102,6 +103,7 @@
|
||||
this.tableLayoutPanel5 = new System.Windows.Forms.TableLayoutPanel();
|
||||
this.EventBrowser_TimeUnit = new System.Windows.Forms.ComboBox();
|
||||
this.EventBrowser_HideEmpty = new System.Windows.Forms.CheckBox();
|
||||
this.EventBrowser_HideAPICalls = new System.Windows.Forms.CheckBox();
|
||||
this.EventBrowser_ApplyColours = new System.Windows.Forms.CheckBox();
|
||||
this.EventBrowser_ColourEventRow = new System.Windows.Forms.CheckBox();
|
||||
this.androidTab = new System.Windows.Forms.TabPage();
|
||||
@@ -137,6 +139,7 @@
|
||||
groupBox4 = new System.Windows.Forms.GroupBox();
|
||||
label8 = new System.Windows.Forms.Label();
|
||||
label9 = new System.Windows.Forms.Label();
|
||||
label35 = new System.Windows.Forms.Label();
|
||||
label16 = new System.Windows.Forms.Label();
|
||||
label17 = new System.Windows.Forms.Label();
|
||||
groupBox7 = new System.Windows.Forms.GroupBox();
|
||||
@@ -1054,18 +1057,21 @@
|
||||
this.tableLayoutPanel5.Controls.Add(this.EventBrowser_TimeUnit, 1, 0);
|
||||
this.tableLayoutPanel5.Controls.Add(label9, 0, 1);
|
||||
this.tableLayoutPanel5.Controls.Add(this.EventBrowser_HideEmpty, 1, 1);
|
||||
this.tableLayoutPanel5.Controls.Add(label16, 0, 2);
|
||||
this.tableLayoutPanel5.Controls.Add(label17, 0, 3);
|
||||
this.tableLayoutPanel5.Controls.Add(this.EventBrowser_ApplyColours, 1, 2);
|
||||
this.tableLayoutPanel5.Controls.Add(this.EventBrowser_ColourEventRow, 1, 3);
|
||||
this.tableLayoutPanel5.Controls.Add(label35, 0, 2);
|
||||
this.tableLayoutPanel5.Controls.Add(this.EventBrowser_HideAPICalls, 1, 2);
|
||||
this.tableLayoutPanel5.Controls.Add(label16, 0, 3);
|
||||
this.tableLayoutPanel5.Controls.Add(label17, 0, 4);
|
||||
this.tableLayoutPanel5.Controls.Add(this.EventBrowser_ApplyColours, 1, 3);
|
||||
this.tableLayoutPanel5.Controls.Add(this.EventBrowser_ColourEventRow, 1, 4);
|
||||
this.tableLayoutPanel5.Dock = System.Windows.Forms.DockStyle.Fill;
|
||||
this.tableLayoutPanel5.Location = new System.Drawing.Point(3, 16);
|
||||
this.tableLayoutPanel5.Name = "tableLayoutPanel5";
|
||||
this.tableLayoutPanel5.RowCount = 5;
|
||||
this.tableLayoutPanel5.RowCount = 6;
|
||||
this.tableLayoutPanel5.RowStyles.Add(new System.Windows.Forms.RowStyle());
|
||||
this.tableLayoutPanel5.RowStyles.Add(new System.Windows.Forms.RowStyle());
|
||||
this.tableLayoutPanel5.RowStyles.Add(new System.Windows.Forms.RowStyle());
|
||||
this.tableLayoutPanel5.RowStyles.Add(new System.Windows.Forms.RowStyle());
|
||||
this.tableLayoutPanel5.RowStyles.Add(new System.Windows.Forms.RowStyle());
|
||||
this.tableLayoutPanel5.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 20F));
|
||||
this.tableLayoutPanel5.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 20F));
|
||||
this.tableLayoutPanel5.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 100F));
|
||||
this.tableLayoutPanel5.Size = new System.Drawing.Size(331, 383);
|
||||
this.tableLayoutPanel5.TabIndex = 0;
|
||||
@@ -1121,6 +1127,32 @@
|
||||
this.EventBrowser_HideEmpty.UseVisualStyleBackColor = true;
|
||||
this.EventBrowser_HideEmpty.CheckedChanged += new System.EventHandler(this.EventBrowser_HideEmpty_CheckedChanged);
|
||||
//
|
||||
// label35
|
||||
//
|
||||
label35.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
|
||||
| System.Windows.Forms.AnchorStyles.Left)
|
||||
| System.Windows.Forms.AnchorStyles.Right)));
|
||||
label35.AutoSize = true;
|
||||
label35.Location = new System.Drawing.Point(3, 30);
|
||||
label35.Margin = new System.Windows.Forms.Padding(3);
|
||||
label35.Name = "label35";
|
||||
label35.Size = new System.Drawing.Size(258, 14);
|
||||
label35.TabIndex = 7;
|
||||
label35.Text = "Hide marker sections with only non-draw API calls (requires log reload)";
|
||||
label35.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
|
||||
//
|
||||
// EventBrowser_HideAPICalls
|
||||
//
|
||||
this.EventBrowser_HideAPICalls.AutoSize = true;
|
||||
this.EventBrowser_HideAPICalls.Location = new System.Drawing.Point(267, 30);
|
||||
this.EventBrowser_HideAPICalls.Name = "EventBrowser_HideAPICalls";
|
||||
this.EventBrowser_HideAPICalls.Size = new System.Drawing.Size(15, 14);
|
||||
this.EventBrowser_HideAPICalls.TabIndex = 51;
|
||||
this.toolTip.SetToolTip(this.EventBrowser_HideAPICalls, "In the Event Browser and Timeline Bar, marker sections that contain only non-draw " +
|
||||
"API calls - e.g. only queries, or only state setting - will be completely removed");
|
||||
this.EventBrowser_HideAPICalls.UseVisualStyleBackColor = true;
|
||||
this.EventBrowser_HideAPICalls.CheckedChanged += new System.EventHandler(this.EventBrowser_HideAPICalls_CheckedChanged);
|
||||
//
|
||||
// label16
|
||||
//
|
||||
label16.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
|
||||
@@ -1402,6 +1434,7 @@
|
||||
private System.Windows.Forms.TableLayoutPanel tableLayoutPanel5;
|
||||
private System.Windows.Forms.ComboBox EventBrowser_TimeUnit;
|
||||
private System.Windows.Forms.CheckBox EventBrowser_HideEmpty;
|
||||
private System.Windows.Forms.CheckBox EventBrowser_HideAPICalls;
|
||||
private System.Windows.Forms.Button browseTempCaptureDirectory;
|
||||
private System.Windows.Forms.FolderBrowserDialog browserCaptureDialog;
|
||||
private System.Windows.Forms.CheckBox AllowGlobalHook;
|
||||
|
||||
@@ -90,6 +90,7 @@ namespace renderdocui.Windows.Dialogs
|
||||
|
||||
EventBrowser_TimeUnit.SelectedIndex = (int)m_Core.Config.EventBrowser_TimeUnit;
|
||||
EventBrowser_HideEmpty.Checked = m_Core.Config.EventBrowser_HideEmpty;
|
||||
EventBrowser_HideAPICalls.Checked = m_Core.Config.EventBrowser_HideAPICalls;
|
||||
EventBrowser_ApplyColours.Checked = m_Core.Config.EventBrowser_ApplyColours;
|
||||
EventBrowser_ColourEventRow.Checked = m_Core.Config.EventBrowser_ColourEventRow;
|
||||
|
||||
@@ -210,6 +211,13 @@ namespace renderdocui.Windows.Dialogs
|
||||
m_Core.Config.Serialize(Core.ConfigFilename);
|
||||
}
|
||||
|
||||
private void EventBrowser_HideAPICalls_CheckedChanged(object sender, EventArgs e)
|
||||
{
|
||||
m_Core.Config.EventBrowser_HideAPICalls = EventBrowser_HideAPICalls.Checked;
|
||||
|
||||
m_Core.Config.Serialize(Core.ConfigFilename);
|
||||
}
|
||||
|
||||
private void EventBrowser_ApplyColours_CheckedChanged(object sender, EventArgs e)
|
||||
{
|
||||
m_Core.Config.EventBrowser_ApplyColours = EventBrowser_ApplyColours.Checked;
|
||||
|
||||
@@ -261,13 +261,61 @@ namespace renderdocui.Windows
|
||||
return GetEndDrawID(drawcall.children.Last());
|
||||
}
|
||||
|
||||
public static bool ShouldHide(Core core, FetchDrawcall drawcall)
|
||||
{
|
||||
if (drawcall.flags.HasFlag(DrawcallFlags.PushMarker))
|
||||
{
|
||||
if (core.Config.EventBrowser_HideEmpty)
|
||||
{
|
||||
if (drawcall.children == null || drawcall.children.Length == 0)
|
||||
return true;
|
||||
|
||||
bool allhidden = true;
|
||||
|
||||
foreach (FetchDrawcall child in drawcall.children)
|
||||
{
|
||||
if (ShouldHide(core, child))
|
||||
continue;
|
||||
|
||||
allhidden = false;
|
||||
break;
|
||||
}
|
||||
|
||||
if (allhidden)
|
||||
return true;
|
||||
}
|
||||
|
||||
if (core.Config.EventBrowser_HideAPICalls)
|
||||
{
|
||||
if (drawcall.children == null || drawcall.children.Length == 0)
|
||||
return false;
|
||||
|
||||
bool onlyapi = true;
|
||||
|
||||
foreach (FetchDrawcall child in drawcall.children)
|
||||
{
|
||||
if (ShouldHide(core, child))
|
||||
continue;
|
||||
|
||||
if (!child.flags.HasFlag(DrawcallFlags.APICalls))
|
||||
{
|
||||
onlyapi = false;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (onlyapi)
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
private TreelistView.Node AddDrawcall(FetchDrawcall drawcall, TreelistView.Node root)
|
||||
{
|
||||
if (m_Core.Config.EventBrowser_HideEmpty)
|
||||
{
|
||||
if ((drawcall.children == null || drawcall.children.Length == 0) && (drawcall.flags & DrawcallFlags.PushMarker) != 0)
|
||||
return null;
|
||||
}
|
||||
if (EventBrowser.ShouldHide(m_Core, drawcall))
|
||||
return null;
|
||||
|
||||
UInt32 eventNum = drawcall.eventID;
|
||||
TreelistView.Node drawNode = null;
|
||||
|
||||
@@ -337,11 +337,8 @@ namespace renderdocui.Windows
|
||||
if ((d.flags & (DrawcallFlags.SetMarker | DrawcallFlags.Present)) > 0)
|
||||
continue;
|
||||
|
||||
if (m_Core.Config.EventBrowser_HideEmpty)
|
||||
{
|
||||
if ((d.children == null || d.children.Length == 0) && (d.flags & (DrawcallFlags.PushMarker | DrawcallFlags.MultiDraw)) != 0)
|
||||
continue;
|
||||
}
|
||||
if(EventBrowser.ShouldHide(m_Core, d))
|
||||
continue;
|
||||
|
||||
bool newSection = ((d.flags & (DrawcallFlags.PushMarker|DrawcallFlags.MultiDraw)) > 0 || sections.Count == 0);
|
||||
if (!newSection)
|
||||
|
||||
Reference in New Issue
Block a user