mirror of
https://github.com/baldurk/renderdoc.git
synced 2026-08-28 09:26:52 +00:00
Implement empty-marker hiding options for event browser
This commit is contained in:
@@ -276,6 +276,57 @@ void EventBrowser::OnEventChanged(uint32_t eventId)
|
||||
highlightBookmarks();
|
||||
}
|
||||
|
||||
bool EventBrowser::ShouldHide(const DrawcallDescription &drawcall)
|
||||
{
|
||||
if(drawcall.flags & DrawFlags::PushMarker)
|
||||
{
|
||||
if(m_Ctx.Config().EventBrowser_HideEmpty)
|
||||
{
|
||||
if(drawcall.children.isEmpty())
|
||||
return true;
|
||||
|
||||
bool allhidden = true;
|
||||
|
||||
for(const DrawcallDescription &child : drawcall.children)
|
||||
{
|
||||
if(ShouldHide(child))
|
||||
continue;
|
||||
|
||||
allhidden = false;
|
||||
break;
|
||||
}
|
||||
|
||||
if(allhidden)
|
||||
return true;
|
||||
}
|
||||
|
||||
if(m_Ctx.Config().EventBrowser_HideAPICalls)
|
||||
{
|
||||
if(drawcall.children.isEmpty())
|
||||
return false;
|
||||
|
||||
bool onlyapi = true;
|
||||
|
||||
for(const DrawcallDescription &child : drawcall.children)
|
||||
{
|
||||
if(ShouldHide(child))
|
||||
continue;
|
||||
|
||||
if(!(child.flags & DrawFlags::APICalls))
|
||||
{
|
||||
onlyapi = false;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if(onlyapi)
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
QPair<uint32_t, uint32_t> EventBrowser::AddDrawcalls(RDTreeWidgetItem *parent,
|
||||
const rdcarray<DrawcallDescription> &draws)
|
||||
{
|
||||
@@ -285,6 +336,9 @@ QPair<uint32_t, uint32_t> EventBrowser::AddDrawcalls(RDTreeWidgetItem *parent,
|
||||
{
|
||||
const DrawcallDescription &d = draws[i];
|
||||
|
||||
if(ShouldHide(d))
|
||||
continue;
|
||||
|
||||
QVariant name = QString(d.name);
|
||||
|
||||
RichResourceTextInitialise(name);
|
||||
|
||||
Reference in New Issue
Block a user