From 8a5150297f782a23d3e147a6a86d304e59758d8c Mon Sep 17 00:00:00 2001 From: baldurk Date: Sun, 17 Aug 2014 15:22:11 +0100 Subject: [PATCH] Set the event for group marker selection to the last real drawcall --- renderdocui/Windows/EventBrowser.cs | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/renderdocui/Windows/EventBrowser.cs b/renderdocui/Windows/EventBrowser.cs index 3b4944079..e5058a57b 100644 --- a/renderdocui/Windows/EventBrowser.cs +++ b/renderdocui/Windows/EventBrowser.cs @@ -283,7 +283,20 @@ namespace renderdocui.Windows drawNode["Duration"] = Math.Max(0.0, (double)drawNode["Duration"]) + (double)drawNode.Nodes[i]["Duration"]; } - drawNode.Tag = drawNode.Nodes.LastNode.Tag; + bool found = false; + + for (int i = drawcall.children.Length - 1; i >= 0; i--) + { + if ((drawcall.children[i].flags & DrawcallFlags.SetMarker) == 0) + { + drawNode.Tag = drawNode.Nodes[i].Tag; + found = true; + break; + } + } + + if(!found) + drawNode.Tag = drawNode.Nodes.LastNode.Tag; } return drawNode;