From d0accc409b3f34ef8a2c00d4a2bdd95a575922fb Mon Sep 17 00:00:00 2001 From: baldurk Date: Thu, 24 Jun 2021 15:10:02 +0100 Subject: [PATCH] Rename 'name' member of ActionDescription to 'customName' * This is a deliberate break of compatibility since the field is now often empty, for non-markers. This means code will get a more explicit error when the name is being referenced, so it can be updated to fetch the name it needs as needed. --- .../examples/renderdoc/fetch_counters.py | 2 +- .../examples/renderdoc/fetch_counters.rst | 18 +- .../examples/renderdoc/iter_actions.py | 6 +- .../examples/renderdoc/iter_actions.rst | 210 +++++++++++------- qrenderdoc/Code/Interface/QRDInterface.h | 12 + qrenderdoc/Code/RGPInterop.cpp | 11 +- qrenderdoc/Widgets/MarkerBreadcrumbs.cpp | 4 +- qrenderdoc/Windows/APIInspector.cpp | 2 +- qrenderdoc/Windows/EventBrowser.cpp | 24 +- qrenderdoc/Windows/EventBrowser.h | 1 + .../PipelineState/PipelineStateViewer.cpp | 5 +- qrenderdoc/Windows/PixelHistoryView.cpp | 10 +- qrenderdoc/Windows/ShaderMessageViewer.cpp | 3 +- qrenderdoc/Windows/TimelineBar.cpp | 2 +- renderdoc/api/replay/data_types.h | 44 +++- renderdoc/core/image_viewer.cpp | 4 +- renderdoc/driver/d3d11/d3d11_context.cpp | 4 +- .../driver/d3d11/d3d11_context1_wrap.cpp | 5 - renderdoc/driver/d3d11/d3d11_context_wrap.cpp | 15 +- renderdoc/driver/d3d11/d3d11_pixelhistory.cpp | 3 +- .../driver/d3d12/d3d12_command_list1_wrap.cpp | 9 - .../driver/d3d12/d3d12_command_list4_wrap.cpp | 4 +- .../driver/d3d12/d3d12_command_list_wrap.cpp | 30 +-- .../driver/d3d12/d3d12_command_queue_wrap.cpp | 8 +- renderdoc/driver/d3d12/d3d12_commands.cpp | 2 +- renderdoc/driver/d3d12/d3d12_device.cpp | 2 +- renderdoc/driver/gl/gl_driver.cpp | 6 +- .../driver/gl/wrappers/gl_debug_funcs.cpp | 7 +- .../driver/gl/wrappers/gl_draw_funcs.cpp | 66 +++--- renderdoc/driver/vulkan/vk_core.cpp | 2 +- .../driver/vulkan/wrappers/vk_cmd_funcs.cpp | 37 ++- .../driver/vulkan/wrappers/vk_draw_funcs.cpp | 41 ++-- .../driver/vulkan/wrappers/vk_queue_funcs.cpp | 33 +-- .../driver/vulkan/wrappers/vk_wsi_funcs.cpp | 2 +- renderdoc/replay/renderdoc_serialise.inl | 2 +- renderdoc/replay/replay_controller.cpp | 12 +- 36 files changed, 373 insertions(+), 275 deletions(-) diff --git a/docs/python_api/examples/renderdoc/fetch_counters.py b/docs/python_api/examples/renderdoc/fetch_counters.py index 6c2c04c1c..e45f7e9dc 100644 --- a/docs/python_api/examples/renderdoc/fetch_counters.py +++ b/docs/python_api/examples/renderdoc/fetch_counters.py @@ -62,7 +62,7 @@ def sampleCode(controller): val = r.value.u64 if val == 0: - print("EID %d '%s' had no samples pass depth/stencil test!" % (r.eventId, draw.name)) + print("EID %d '%s' had no samples pass depth/stencil test!" % (r.eventId, draw.GetName(controller.GetStructuredFile()))) def loadCapture(filename): # Open a capture file handle diff --git a/docs/python_api/examples/renderdoc/fetch_counters.rst b/docs/python_api/examples/renderdoc/fetch_counters.rst index 1986079df..7c97d8439 100644 --- a/docs/python_api/examples/renderdoc/fetch_counters.rst +++ b/docs/python_api/examples/renderdoc/fetch_counters.rst @@ -54,7 +54,7 @@ Once we have the list of :py:class:`~renderdoc.CounterResult` from sampling the val = r.value.u64 if val == 0: - print("EID %d '%s' had no samples pass depth/stencil test!" % (r.eventId, draw.name)) + print("EID %d '%s' had no samples pass depth/stencil test!" % (r.eventId, draw.GetName(controller.GetStructuredFile()))) Example Source -------------- @@ -109,11 +109,11 @@ Sample output: Counter 13 (CS Invocations): Number of times a compute shader was invoked. Returns 8 byte CompType.UInt, representing CounterUnit.Absolute - EID 69 'DrawIndexed(5580)' had no samples pass depth/stencil test! - EID 82 'DrawIndexed(5580)' had no samples pass depth/stencil test! - EID 95 'DrawIndexed(5580)' had no samples pass depth/stencil test! - EID 108 'DrawIndexed(5580)' had no samples pass depth/stencil test! - EID 199 'DrawIndexed(5220)' had no samples pass depth/stencil test! - EID 212 'DrawIndexed(5220)' had no samples pass depth/stencil test! - EID 225 'DrawIndexed(5220)' had no samples pass depth/stencil test! - EID 238 'DrawIndexed(5220)' had no samples pass depth/stencil test! \ No newline at end of file + EID 69 'DrawIndexed()' had no samples pass depth/stencil test! + EID 82 'DrawIndexed()' had no samples pass depth/stencil test! + EID 95 'DrawIndexed()' had no samples pass depth/stencil test! + EID 108 'DrawIndexed()' had no samples pass depth/stencil test! + EID 199 'DrawIndexed()' had no samples pass depth/stencil test! + EID 212 'DrawIndexed()' had no samples pass depth/stencil test! + EID 225 'DrawIndexed()' had no samples pass depth/stencil test! + EID 238 'DrawIndexed()' had no samples pass depth/stencil test! \ No newline at end of file diff --git a/docs/python_api/examples/renderdoc/iter_actions.py b/docs/python_api/examples/renderdoc/iter_actions.py index 5ce31f5bc..f9e58685b 100644 --- a/docs/python_api/examples/renderdoc/iter_actions.py +++ b/docs/python_api/examples/renderdoc/iter_actions.py @@ -10,7 +10,7 @@ rd = renderdoc # Define a recursive function for iterating over actions def iterAction(d, indent = ''): # Print this action - print('%s%d: %s' % (indent, d.eventId, d.name)) + print('%s%d: %s' % (indent, d.eventId, d.GetName(controller.GetStructuredFile()))) # Iterate over the action's children for d in d.children: @@ -35,7 +35,7 @@ def sampleCode(controller): # starting clear calls that may be batched together inpass = False - print("Pass #0 starts with %d: %s" % (action.eventId, action.name)) + print("Pass #0 starts with %d: %s" % (action.eventId, action.GetName(controller.GetStructuredFile()))) while action != None: # When we encounter a clear @@ -43,7 +43,7 @@ def sampleCode(controller): if inpass: print("Pass #%d contained %d actions" % (passnum, passcontents)) passnum += 1 - print("Pass #%d starts with %d: %s" % (passnum, action.eventId, action.name)) + print("Pass #%d starts with %d: %s" % (passnum, action.eventId, action.GetName(controller.GetStructuredFile()))) passcontents = 0 inpass = False else: diff --git a/docs/python_api/examples/renderdoc/iter_actions.rst b/docs/python_api/examples/renderdoc/iter_actions.rst index 2daa1f064..d0affff06 100644 --- a/docs/python_api/examples/renderdoc/iter_actions.rst +++ b/docs/python_api/examples/renderdoc/iter_actions.rst @@ -25,81 +25,137 @@ Sample output: .. sourcecode:: text 1: Scene - 2: ClearRenderTargetView(0.000000, 0.000000, 0.000000, 1.000000) - 3: ClearDepthStencilView(D=1.000000, S=00) - 9: ClearRenderTargetView(0.000000, 0.000000, 0.000000, 0.000000) - 10: ClearRenderTargetView(0.000000, 0.000000, 0.000000, 0.000000) - 11: ClearDepthStencilView(D=1.000000, S=00) - 13: GBuffer - 28: DrawIndexed(4800) - 43: DrawIndexed(36) - 56: DrawIndexed(5220) - 69: DrawIndexed(5580) - 82: DrawIndexed(5580) - 95: DrawIndexed(5580) - 108: DrawIndexed(5580) - 121: DrawIndexed(5580) - 134: DrawIndexed(5580) - 147: DrawIndexed(5580) - 160: DrawIndexed(5580) - 173: DrawIndexed(5580) - 186: DrawIndexed(5580) - 199: DrawIndexed(5220) - 212: DrawIndexed(5220) - 225: DrawIndexed(5220) - 238: DrawIndexed(5220) - 251: DrawIndexed(5220) - 264: DrawIndexed(5220) - 277: DrawIndexed(5220) - 290: DrawIndexed(5220) - 303: DrawIndexed(5220) - 316: DrawIndexed(5220) - 319: ClearDepthStencilView(D=1.000000, S=00) - 321: Shadowmap - 333: DrawIndexed(4800) - 345: DrawIndexed(36) - 355: DrawIndexed(5220) - 365: DrawIndexed(5580) - 375: DrawIndexed(5580) - 385: DrawIndexed(5580) - 395: DrawIndexed(5580) - 405: DrawIndexed(5580) - 415: DrawIndexed(5580) - 425: DrawIndexed(5580) - 435: DrawIndexed(5580) - 445: DrawIndexed(5580) - 455: DrawIndexed(5580) - 465: DrawIndexed(5220) - 475: DrawIndexed(5220) - 485: DrawIndexed(5220) - 495: DrawIndexed(5220) - 505: DrawIndexed(5220) - 515: DrawIndexed(5220) - 525: DrawIndexed(5220) - 535: DrawIndexed(5220) - 545: DrawIndexed(5220) - 555: DrawIndexed(5220) - 558: ClearRenderTargetView(0.000000, 0.000000, 0.000000, 1.000000) - 559: ClearDepthStencilView(D=1.000000, S=00) - 561: Lighting - 563: ClearRenderTargetView(0.000000, 0.000000, 0.000000, 0.000000) - 564: ClearRenderTargetView(0.000000, 0.000000, 0.000000, 0.000000) - 580: DrawIndexed(36) - 597: DrawIndexed(36) - 614: DrawIndexed(36) - 617: ClearRenderTargetView(0.000000, 0.000000, 0.000000, 1.000000) - 618: ClearDepthStencilView(D=1.000000, S=00) - 620: Shading - 630: Draw(6) - 645: DrawIndexed(960) - 652: API Calls - 655: End of Frame - Pass #0 starts with 2: ClearRenderTargetView(0.000000, 0.000000, 0.000000, 1.000000) - Pass #0 contained 24 actions - Pass #1 starts with 319: ClearDepthStencilView(D=1.000000, S=00) - Pass #1 contained 24 actions - Pass #2 starts with 558: ClearRenderTargetView(0.000000, 0.000000, 0.000000, 1.000000) + 2: ID3D11DeviceContext::ClearRenderTargetView() + 3: ID3D11DeviceContext::ClearDepthStencilView() + 9: ID3D11DeviceContext::ClearRenderTargetView() + 10: ID3D11DeviceContext::ClearRenderTargetView() + 11: ID3D11DeviceContext::ClearDepthStencilView() + 13: GBuffer + 25: Floor + 28: ID3D11DeviceContext::DrawIndexed() + 29: empty label + 30: ID3DUserDefinedAnnotation::EndEvent() + 40: Base + 43: ID3D11DeviceContext::DrawIndexed() + 53: Center sphere + 56: ID3D11DeviceContext::DrawIndexed() + 66: Cone + 69: ID3D11DeviceContext::DrawIndexed() + 79: Cone + 82: ID3D11DeviceContext::DrawIndexed() + 92: Cone + 95: ID3D11DeviceContext::DrawIndexed() + 105: Cone + 108: ID3D11DeviceContext::DrawIndexed() + 118: Cone + 121: ID3D11DeviceContext::DrawIndexed() + 131: Cone + 134: ID3D11DeviceContext::DrawIndexed() + 144: Cone + 147: ID3D11DeviceContext::DrawIndexed() + 157: Cone + 160: ID3D11DeviceContext::DrawIndexed() + 170: Cone + 173: ID3D11DeviceContext::DrawIndexed() + 183: Cone + 186: ID3D11DeviceContext::DrawIndexed() + 196: Sphere + 199: ID3D11DeviceContext::DrawIndexed() + 209: Sphere + 212: ID3D11DeviceContext::DrawIndexed() + 222: Sphere + 225: ID3D11DeviceContext::DrawIndexed() + 235: Sphere + 238: ID3D11DeviceContext::DrawIndexed() + 248: Sphere + 251: ID3D11DeviceContext::DrawIndexed() + 261: Sphere + 264: ID3D11DeviceContext::DrawIndexed() + 274: Sphere + 277: ID3D11DeviceContext::DrawIndexed() + 287: Sphere + 290: ID3D11DeviceContext::DrawIndexed() + 300: Sphere + 303: ID3D11DeviceContext::DrawIndexed() + 313: Sphere + 316: ID3D11DeviceContext::DrawIndexed() + 317: ID3DUserDefinedAnnotation::EndEvent() + 319: ID3D11DeviceContext::ClearDepthStencilView() + 321: Shadowmap + 330: Floor + 333: ID3D11DeviceContext::DrawIndexed() + 334: empty label + 335: ID3DUserDefinedAnnotation::EndEvent() + 342: Base + 345: ID3D11DeviceContext::DrawIndexed() + 352: Center sphere + 355: ID3D11DeviceContext::DrawIndexed() + 362: Cone + 365: ID3D11DeviceContext::DrawIndexed() + 372: Cone + 375: ID3D11DeviceContext::DrawIndexed() + 382: Cone + 385: ID3D11DeviceContext::DrawIndexed() + 392: Cone + 395: ID3D11DeviceContext::DrawIndexed() + 402: Cone + 405: ID3D11DeviceContext::DrawIndexed() + 412: Cone + 415: ID3D11DeviceContext::DrawIndexed() + 422: Cone + 425: ID3D11DeviceContext::DrawIndexed() + 432: Cone + 435: ID3D11DeviceContext::DrawIndexed() + 442: Cone + 445: ID3D11DeviceContext::DrawIndexed() + 452: Cone + 455: ID3D11DeviceContext::DrawIndexed() + 462: Sphere + 465: ID3D11DeviceContext::DrawIndexed() + 472: Sphere + 475: ID3D11DeviceContext::DrawIndexed() + 482: Sphere + 485: ID3D11DeviceContext::DrawIndexed() + 492: Sphere + 495: ID3D11DeviceContext::DrawIndexed() + 502: Sphere + 505: ID3D11DeviceContext::DrawIndexed() + 512: Sphere + 515: ID3D11DeviceContext::DrawIndexed() + 522: Sphere + 525: ID3D11DeviceContext::DrawIndexed() + 532: Sphere + 535: ID3D11DeviceContext::DrawIndexed() + 542: Sphere + 545: ID3D11DeviceContext::DrawIndexed() + 552: Sphere + 555: ID3D11DeviceContext::DrawIndexed() + 556: ID3DUserDefinedAnnotation::EndEvent() + 558: ID3D11DeviceContext::ClearRenderTargetView() + 559: ID3D11DeviceContext::ClearDepthStencilView() + 561: Lighting + 563: ID3D11DeviceContext::ClearRenderTargetView() + 564: ID3D11DeviceContext::ClearRenderTargetView() + 566: Point light + 580: ID3D11DeviceContext::DrawIndexed() + 581: Sun light + 597: ID3D11DeviceContext::DrawIndexed() + 600: Cube light + 614: ID3D11DeviceContext::DrawIndexed() + 615: ID3DUserDefinedAnnotation::EndEvent() + 617: ID3D11DeviceContext::ClearRenderTargetView() + 618: ID3D11DeviceContext::ClearDepthStencilView() + 620: Shading + 630: ID3D11DeviceContext::Draw() + 645: ID3D11DeviceContext::DrawIndexed() + 652: ID3DUserDefinedAnnotation::EndEvent() + 653: ID3DUserDefinedAnnotation::EndEvent() + 654: Present(ResourceId::47) + Pass #0 starts with 2: ID3D11DeviceContext::ClearRenderTargetView() + Pass #0 contained 23 actions + Pass #1 starts with 319: ID3D11DeviceContext::ClearDepthStencilView() + Pass #1 contained 23 actions + Pass #2 starts with 558: ID3D11DeviceContext::ClearRenderTargetView() Pass #2 contained 3 actions - Pass #3 starts with 617: ClearRenderTargetView(0.000000, 0.000000, 0.000000, 1.000000) - Pass #3 contained 4 actions - + Pass #3 starts with 617: ID3D11DeviceContext::ClearRenderTargetView() + Pass #3 contained 3 actions diff --git a/qrenderdoc/Code/Interface/QRDInterface.h b/qrenderdoc/Code/Interface/QRDInterface.h index dbaab7427..a5aaaa22d 100644 --- a/qrenderdoc/Code/Interface/QRDInterface.h +++ b/qrenderdoc/Code/Interface/QRDInterface.h @@ -297,6 +297,18 @@ If no capture is loaded or the EID doesn't correspond to a known event, ``None`` )"); virtual const ActionDescription *GetActionForEID(uint32_t eventId) = 0; + DOCUMENT(R"(Returns the formatted name of an event according to the current settings, whether +that be a custom name or an auto-generated name with/without parameter names. + +If no capture is loaded or the EID doesn't correspond to a known event, an empty string will be +returned. + +:param int eventId: The EID to look up. +:return: The formatted name of the specified event, or ``None`` if no such EID exists. +:rtype: str +)"); + virtual rdcstr GetEventName(uint32_t eventId) = 0; + DOCUMENT(R"(Determines if a given EID is visible with the current filters applied to the event browser. diff --git a/qrenderdoc/Code/RGPInterop.cpp b/qrenderdoc/Code/RGPInterop.cpp index d297d6adb..68936855a 100644 --- a/qrenderdoc/Code/RGPInterop.cpp +++ b/qrenderdoc/Code/RGPInterop.cpp @@ -215,9 +215,11 @@ void RGPInterop::EventSelected(RGPInteropEvent event) const ActionDescription *action = m_Ctx.GetAction(eventId); - if(action && QString(action->name) != event.eventname) + const SDFile &file = m_Ctx.GetStructuredFile(); + + if(action && QString(file.chunks[action->events.back().chunkIndex]->name) != event.eventname) qWarning() << "Action name mismatch. Expected " << event.eventname << " but got " - << QString(action->name); + << QString(file.chunks[action->events.back().chunkIndex]->name); m_Ctx.SetEventID({}, eventId, eventId); @@ -265,10 +267,7 @@ void RGPInterop::CreateMapping(const rdcarray &actions) if(m_EventNames.contains(chunk->name, Qt::CaseSensitive)) { m_Event2RGP[ev.eventId].interoplinearid = (uint32_t)m_RGP2Event.size(); - if(ev.eventId == action.eventId) - m_Event2RGP[ev.eventId].eventname = action.name; - else - m_Event2RGP[ev.eventId].eventname = chunk->name; + m_Event2RGP[ev.eventId].eventname = chunk->name; m_RGP2Event.push_back(ev.eventId); } diff --git a/qrenderdoc/Widgets/MarkerBreadcrumbs.cpp b/qrenderdoc/Widgets/MarkerBreadcrumbs.cpp index 388ba864b..f499ed46a 100644 --- a/qrenderdoc/Widgets/MarkerBreadcrumbs.cpp +++ b/qrenderdoc/Widgets/MarkerBreadcrumbs.cpp @@ -278,7 +278,7 @@ void MarkerBreadcrumbs::ConfigurePathMenu(QMenu *menu, const ActionDescription * if((child.flags & ActionFlags::PushMarker) && m_Ctx.GetEventBrowser()->IsAPIEventVisible(child.eventId)) { - QAction *menuAction = new QAction(child.name, menu); + QAction *menuAction = new QAction(child.customName, menu); uint32_t eid = child.eventId; @@ -318,7 +318,7 @@ void MarkerBreadcrumbs::elidedItemsClicked() void MarkerBreadcrumbs::AddPathButton(const ActionDescription *action) { RDToolButton *b = new RDToolButton(); - b->setText(action ? QString(action->name) : QString()); + b->setText(action ? QString(action->customName) : QString()); if(!action) { b->setIcon(Icons::house()); diff --git a/qrenderdoc/Windows/APIInspector.cpp b/qrenderdoc/Windows/APIInspector.cpp index cb4e593d9..f05c6f562 100644 --- a/qrenderdoc/Windows/APIInspector.cpp +++ b/qrenderdoc/Windows/APIInspector.cpp @@ -212,7 +212,7 @@ void APIInspector::fillAPIView() { if(action->IsFakeMarker()) { - RDTreeWidgetItem *root = new RDTreeWidgetItem({lit("---"), QString(action->name)}); + RDTreeWidgetItem *root = new RDTreeWidgetItem({lit("---"), QString(action->customName)}); root->setBold(true); ui->apiEvents->addTopLevelItem(root); ui->apiEvents->setSelectedItem(root); diff --git a/qrenderdoc/Windows/EventBrowser.cpp b/qrenderdoc/Windows/EventBrowser.cpp index ce01d7231..38a25141a 100644 --- a/qrenderdoc/Windows/EventBrowser.cpp +++ b/qrenderdoc/Windows/EventBrowser.cpp @@ -514,13 +514,22 @@ struct EventItemModel : public QAbstractItemModel return NULL; } + rdcstr GetEventName(uint32_t eid) + { + if(eid < m_Actions.size()) + return RichResourceTextFormat(m_Ctx, GetCachedEIDName(eid)); + + return rdcstr(); + } + rdcarray GetMarkerList() const { rdcarray ret; for(auto it = m_Nodes.begin(); it != m_Nodes.end(); ++it) - if(it.value().action && (it.value().action->flags & ActionFlags::PushMarker)) - ret.push_back(it.value().action->name); + if(it.value().action && (it.value().action->flags & ActionFlags::PushMarker) && + !it.value().action->customName.isEmpty()) + ret.push_back(it.value().action->customName); return ret; } @@ -1080,14 +1089,14 @@ private: { if(m_UseCustomActionNames) { - name = action->name; + name = action->customName; } else { if((action->flags & (ActionFlags::SetMarker | ActionFlags::PushMarker)) && !(action->flags & (ActionFlags::CommandBufferBoundary | ActionFlags::PassBoundary | ActionFlags::CmdList | ActionFlags::MultiAction))) - name = action->name; + name = action->customName; } } @@ -2564,7 +2573,7 @@ nesting level. const SDChunk *, const ActionDescription *action, const rdcstr &) { while(action->parent) { - if(QString(action->parent->name).contains(markerName, Qt::CaseInsensitive)) + if(QString(action->parent->customName).contains(markerName, Qt::CaseInsensitive)) return true; action = action->parent; @@ -5234,6 +5243,11 @@ const ActionDescription *EventBrowser::GetActionForEID(uint32_t eid) return m_Model->GetActionForEID(eid); } +rdcstr EventBrowser::GetEventName(uint32_t eid) +{ + return m_Model->GetEventName(eid); +} + bool EventBrowser::IsAPIEventVisible(uint32_t eid) { return m_FilterModel->mapFromSource(m_Model->GetIndexForEID(eid)).isValid(); diff --git a/qrenderdoc/Windows/EventBrowser.h b/qrenderdoc/Windows/EventBrowser.h index 935bdeb0d..ab87342ce 100644 --- a/qrenderdoc/Windows/EventBrowser.h +++ b/qrenderdoc/Windows/EventBrowser.h @@ -124,6 +124,7 @@ public: void UpdateDurationColumn() override; APIEvent GetAPIEventForEID(uint32_t eid) override; const ActionDescription *GetActionForEID(uint32_t eid) override; + rdcstr GetEventName(uint32_t eventId) override; bool IsAPIEventVisible(uint32_t eid) override; bool RegisterEventFilterFunction(const rdcstr &name, const rdcstr &description, EventFilterCallback filter, FilterParseCallback parser, diff --git a/qrenderdoc/Windows/PipelineState/PipelineStateViewer.cpp b/qrenderdoc/Windows/PipelineState/PipelineStateViewer.cpp index f45c61965..23a8a77bc 100644 --- a/qrenderdoc/Windows/PipelineState/PipelineStateViewer.cpp +++ b/qrenderdoc/Windows/PipelineState/PipelineStateViewer.cpp @@ -501,11 +501,12 @@ div.stage table tr td { border-right: 1px solid #AAAAAA; background-color: #EEEE for(const ActionDescription *d : actionstack) { - context += QFormatStr(" > %1").arg(d->name); + context += QFormatStr(" > %1").arg(d->customName); } if(action) - context += QFormatStr(" => %1").arg(action->name); + context += + QFormatStr(" => %1").arg(m_Ctx.GetEventBrowser()->GetEventName(action->eventId)); else context += tr(" => Capture Start"); diff --git a/qrenderdoc/Windows/PixelHistoryView.cpp b/qrenderdoc/Windows/PixelHistoryView.cpp index b0e8a8ea9..bb9537b36 100644 --- a/qrenderdoc/Windows/PixelHistoryView.cpp +++ b/qrenderdoc/Windows/PixelHistoryView.cpp @@ -209,7 +209,7 @@ public: if(!actionstack.isEmpty()) { - ret += lit("> ") + actionstack.back()->name; + ret += lit("> ") + actionstack.back()->customName; if(actionstack.count() > 3) ret += lit(" ..."); @@ -217,9 +217,9 @@ public: ret += lit("\n"); if(actionstack.count() > 2) - ret += lit("> ") + actionstack[1]->name + lit("\n"); + ret += lit("> ") + actionstack[1]->customName + lit("\n"); if(actionstack.count() > 1) - ret += lit("> ") + actionstack[0]->name + lit("\n"); + ret += lit("> ") + actionstack[0]->customName + lit("\n"); ret += lit("\n"); } @@ -231,7 +231,7 @@ public: { ret += tr("EID %1\n%2\nBound as UAV or copy - potential modification") .arg(mods.front().eventId) - .arg(action->name); + .arg(m_Ctx.GetEventBrowser()->GetEventName(action->eventId)); if(mods[0].preMod.col.uintValue == mods[0].postMod.col.uintValue) { @@ -249,7 +249,7 @@ public: ret += tr("EID %1\n%2%3\n%4 Fragments touching pixel\n") .arg(mods.front().eventId) - .arg(action->name) + .arg(m_Ctx.GetEventBrowser()->GetEventName(action->eventId)) .arg(failure) .arg(mods.count()); } diff --git a/qrenderdoc/Windows/ShaderMessageViewer.cpp b/qrenderdoc/Windows/ShaderMessageViewer.cpp index 60557ec2d..f88384e43 100644 --- a/qrenderdoc/Windows/ShaderMessageViewer.cpp +++ b/qrenderdoc/Windows/ShaderMessageViewer.cpp @@ -418,7 +418,8 @@ ShaderMessageViewer::ShaderMessageViewer(ICaptureContext &ctx, ShaderStageMask s ui->label->setText(tr("Shader messages from @%1 - %2") .arg(m_EID) - .arg(m_Action ? m_Action->name : rdcstr("Unknown action"))); + .arg(m_Action ? m_Ctx.GetEventBrowser()->GetEventName(m_Action->eventId) + : rdcstr("Unknown action"))); setWindowTitle(tr("Shader messages at @%1").arg(m_EID)); diff --git a/qrenderdoc/Windows/TimelineBar.cpp b/qrenderdoc/Windows/TimelineBar.cpp index f61ec62ea..e548de017 100644 --- a/qrenderdoc/Windows/TimelineBar.cpp +++ b/qrenderdoc/Windows/TimelineBar.cpp @@ -1048,7 +1048,7 @@ uint32_t TimelineBar::processActions(QVector &markers, QVector markers.push_back(Marker()); Marker &m = markers.back(); - m.name = a.name; + m.name = a.customName; m.eidStart = a.eventId; m.eidEnd = processActions(m.children, m.actions, a.children); diff --git a/renderdoc/api/replay/data_types.h b/renderdoc/api/replay/data_types.h index 1370f6706..64f172c6a 100644 --- a/renderdoc/api/replay/data_types.h +++ b/renderdoc/api/replay/data_types.h @@ -30,6 +30,7 @@ #include "replay_enums.h" #include "resourceid.h" #include "stringise.h" +#include "structured_data.h" DOCUMENT("A floating point four-component vector"); struct FloatVector @@ -1569,6 +1570,35 @@ processing them wherever possible. return events.size() == 1 && events[0].chunkIndex == APIEvent::NoChunk; } + DOCUMENT(R"(Returns the name for this action, either from its custom name (see :data:`customName`) +or from the matching chunk in the structured data passed in. + +:param SDFile structuredFile: The structured data file for the capture this action is from. +:return: Returns the best available name for this action. +:rtype: str +)"); + rdcstr GetName(const SDFile &structuredFile) const + { + if(!customName.empty()) + return customName; + + // if we have events, the last one is the one for this action. Return the corresponding chunk + // name + if(events.size() >= 1) + { + const uint32_t chunkIndex = events.back().chunkIndex; + + if(chunkIndex < structuredFile.chunks.size()) + { + rdcstr ret = structuredFile.chunks[chunkIndex]->name; + ret += "()"; + return ret; + } + } + + return rdcstr(); + } + DOCUMENT(""); bool operator==(const ActionDescription &o) const { return eventId == o.eventId; } bool operator<(const ActionDescription &o) const { return eventId < o.eventId; } @@ -1577,14 +1607,16 @@ processing them wherever possible. DOCUMENT("A 1-based index of this action relative to other actions."); uint32_t actionId = 0; - DOCUMENT(R"(The name of this action. Typically a summarised/concise list of parameters. + DOCUMENT(R"(The custom name of this action. -.. note:: For markers this will be a user-provided string. In most other cases this name will be - empty, and the name can be generated using structured data. Some actions will have a custom - name generated for e.g. reading back and directly displaying indirect parameters or render pass - parameters. +For markers this will be a user-provided string. In most other cases this will be empty, and the +name can be generated using structured data. The last listed event in :data:`events` will correspond +to the event for the overall action, and its chunk will contain a name and any parameters. + +Some actions will have a custom name generated for e.g. reading back and directly displaying +indirect parameters or render pass parameters. )"); - rdcstr name; + rdcstr customName; DOCUMENT("A set of :class:`ActionFlags` properties describing what kind of action this is."); ActionFlags flags = ActionFlags::NoFlags; diff --git a/renderdoc/core/image_viewer.cpp b/renderdoc/core/image_viewer.cpp index 750292602..9c8c7029f 100644 --- a/renderdoc/core/image_viewer.cpp +++ b/renderdoc/core/image_viewer.cpp @@ -50,12 +50,12 @@ public: ActionDescription &action = m_FrameRecord.actionList[0]; action.actionId = 1; action.eventId = 1; - action.name = get_basename(filename); + action.customName = get_basename(filename); APIEvent ev; ev.eventId = 1; action.events.push_back(ev); - SDChunk *chunk = new SDChunk(action.name); + SDChunk *chunk = new SDChunk(action.customName); chunk->AddAndOwnChild(makeSDString("path"_lit, filename)); m_File.chunks.push_back(chunk); diff --git a/renderdoc/driver/d3d11/d3d11_context.cpp b/renderdoc/driver/d3d11/d3d11_context.cpp index 3c520f7f1..eaf1f0405 100644 --- a/renderdoc/driver/d3d11/d3d11_context.cpp +++ b/renderdoc/driver/d3d11/d3d11_context.cpp @@ -568,7 +568,7 @@ bool WrappedID3D11DeviceContext::Serialise_Present(SerialiserType &ser, UINT Syn action.copyDestination = m_pDevice->GetBackbufferResourceID(); - action.name = StringFormat::Fmt("Present(%s)", ToStr(action.copyDestination).c_str()); + action.customName = StringFormat::Fmt("Present(%s)", ToStr(action.copyDestination).c_str()); action.flags |= ActionFlags::Present; AddAction(action); @@ -945,7 +945,7 @@ bool WrappedID3D11DeviceContext::ProcessChunk(ReadSerialiser &ser, D3D11Chunk ch AddEvent(); ActionDescription action; - action.name = "End of Capture"; + action.customName = "End of Capture"; action.flags |= ActionFlags::Present; action.copyDestination = m_pDevice->GetBackbufferResourceID(); diff --git a/renderdoc/driver/d3d11/d3d11_context1_wrap.cpp b/renderdoc/driver/d3d11/d3d11_context1_wrap.cpp index db2661e47..5ddc5b3cf 100644 --- a/renderdoc/driver/d3d11/d3d11_context1_wrap.cpp +++ b/renderdoc/driver/d3d11/d3d11_context1_wrap.cpp @@ -1740,7 +1740,6 @@ bool WrappedID3D11DeviceContext::Serialise_DiscardResource(SerialiserType &ser, ActionDescription action; - action.name = StringFormat::Fmt("DiscardResource(%s)", ToStr(dstOrigID).c_str()); action.flags |= ActionFlags::Clear; action.copyDestination = dstOrigID; action.copyDestinationSubresource = Subresource(); @@ -1839,8 +1838,6 @@ bool WrappedID3D11DeviceContext::Serialise_DiscardView(SerialiserType &ser, ID3D EventUsage(m_CurEventID, ResourceUsage::Discard, GetIDForDeviceChild(pResourceView))); } - action.name = StringFormat::Fmt("DiscardView(%s)", ToStr(action.copyDestination).c_str()); - AddAction(action); } } @@ -1976,8 +1973,6 @@ bool WrappedID3D11DeviceContext::Serialise_DiscardView1(SerialiserType &ser, EventUsage(m_CurEventID, ResourceUsage::Discard, GetIDForDeviceChild(pResourceView))); } - action.name = StringFormat::Fmt("DiscardView1(%s)", ToStr(action.copyDestination).c_str()); - AddAction(action); } } diff --git a/renderdoc/driver/d3d11/d3d11_context_wrap.cpp b/renderdoc/driver/d3d11/d3d11_context_wrap.cpp index 17c679413..f26cfcf4d 100644 --- a/renderdoc/driver/d3d11/d3d11_context_wrap.cpp +++ b/renderdoc/driver/d3d11/d3d11_context_wrap.cpp @@ -56,7 +56,7 @@ bool WrappedID3D11DeviceContext::Serialise_SetMarker(SerialiserType &ser, uint32 if(IsLoading(m_State)) { ActionDescription action; - action.name = MarkerName; + action.customName = MarkerName; action.flags |= ActionFlags::SetMarker; byte alpha = (Color >> 24) & 0xff; @@ -94,7 +94,7 @@ bool WrappedID3D11DeviceContext::Serialise_PushMarker(SerialiserType &ser, uint3 if(IsLoading(m_State)) { ActionDescription action; - action.name = MarkerName; + action.customName = MarkerName; action.flags |= ActionFlags::PushMarker; byte alpha = (Color >> 24) & 0xff; @@ -4139,7 +4139,7 @@ bool WrappedID3D11DeviceContext::Serialise_DrawAuto(SerialiserType &ser) AddEvent(); ActionDescription action; - action.name = StringFormat::Fmt("DrawAuto(<%u>)", numVerts); + action.customName = StringFormat::Fmt("DrawAuto(<%u>)", numVerts); action.flags |= ActionFlags::Drawcall | ActionFlags::Auto; action.numIndices = (uint32_t)numVerts; action.vertexOffset = 0; @@ -4268,7 +4268,7 @@ bool WrappedID3D11DeviceContext::Serialise_DrawIndexedInstancedIndirect(Serialis EventUsage(m_CurEventID, ResourceUsage::Indirect)); } - action.name = name; + action.customName = name; action.flags |= ActionFlags::Drawcall | ActionFlags::Instanced | ActionFlags::Indexed | ActionFlags::Indirect; @@ -4397,7 +4397,7 @@ bool WrappedID3D11DeviceContext::Serialise_DrawInstancedIndirect(SerialiserType EventUsage(m_CurEventID, ResourceUsage::Indirect)); } - action.name = name; + action.customName = name; action.flags |= ActionFlags::Drawcall | ActionFlags::Instanced | ActionFlags::Indirect; @@ -5102,7 +5102,7 @@ bool WrappedID3D11DeviceContext::Serialise_DispatchIndirect(SerialiserType &ser, EventUsage(m_CurEventID, ResourceUsage::Indirect)); } - action.name = name; + action.customName = name; action.flags |= ActionFlags::Dispatch | ActionFlags::Indirect; AddAction(action); @@ -6397,9 +6397,6 @@ bool WrappedID3D11DeviceContext::Serialise_GenerateMips(SerialiserType &ser, AddEvent(); ActionDescription action; - action.name = - "GenerateMips(" + - ToStr(GetResourceManager()->GetOriginalID(GetIDForDeviceChild(pShaderResourceView))) + ")"; action.flags |= ActionFlags::GenMips; AddAction(action); diff --git a/renderdoc/driver/d3d11/d3d11_pixelhistory.cpp b/renderdoc/driver/d3d11/d3d11_pixelhistory.cpp index e06ac2918..f0c7d40fd 100644 --- a/renderdoc/driver/d3d11/d3d11_pixelhistory.cpp +++ b/renderdoc/driver/d3d11/d3d11_pixelhistory.cpp @@ -2003,8 +2003,7 @@ rdcarray D3D11Replay::PixelHistory(rdcarray event if(action->flags & ActionFlags::Clear) continue; - D3D11MarkerRegion historyData(StringFormat::Fmt("Fetching history data for %u: %s", - action->eventId, action->name.c_str())); + D3D11MarkerRegion historyData(StringFormat::Fmt("Fetching history data for %u", action->eventId)); if(prev != history[h].eventId) { diff --git a/renderdoc/driver/d3d12/d3d12_command_list1_wrap.cpp b/renderdoc/driver/d3d12/d3d12_command_list1_wrap.cpp index 842225518..c5415930b 100644 --- a/renderdoc/driver/d3d12/d3d12_command_list1_wrap.cpp +++ b/renderdoc/driver/d3d12/d3d12_command_list1_wrap.cpp @@ -89,9 +89,6 @@ bool WrappedID3D12GraphicsCommandList::Serialise_AtomicCopyBufferUINT( action.copySource = GetResourceManager()->GetOriginalID(GetResID(pSrcBuffer)); action.copyDestination = GetResourceManager()->GetOriginalID(GetResID(pDstBuffer)); - action.name = - StringFormat::Fmt("AtomicCopyBufferUINT(%s, %s)", ToStr(action.copyDestination).c_str(), - ToStr(action.copySource).c_str()); action.flags |= ActionFlags::Copy; m_Cmd->AddAction(action); @@ -207,9 +204,6 @@ bool WrappedID3D12GraphicsCommandList::Serialise_AtomicCopyBufferUINT64( action.copySource = GetResourceManager()->GetOriginalID(GetResID(pSrcBuffer)); action.copyDestination = GetResourceManager()->GetOriginalID(GetResID(pDstBuffer)); - action.name = StringFormat::Fmt("AtomicCopyBufferUINT64(%s, %s)", - ToStr(action.copyDestination).c_str(), - ToStr(action.copySource).c_str()); action.flags |= ActionFlags::Copy; m_Cmd->AddAction(action); @@ -485,9 +479,6 @@ bool WrappedID3D12GraphicsCommandList::Serialise_ResolveSubresourceRegion( action.copySource = GetResourceManager()->GetOriginalID(GetResID(pSrcResource)); action.copyDestination = GetResourceManager()->GetOriginalID(GetResID(pDstResource)); - action.name = StringFormat::Fmt("ResolveSubresourceRegion(%s, %s)", - ToStr(action.copyDestination).c_str(), - ToStr(action.copySource).c_str()); action.flags |= ActionFlags::Resolve; m_Cmd->AddAction(action); diff --git a/renderdoc/driver/d3d12/d3d12_command_list4_wrap.cpp b/renderdoc/driver/d3d12/d3d12_command_list4_wrap.cpp index 26fa44139..d0580aa9c 100644 --- a/renderdoc/driver/d3d12/d3d12_command_list4_wrap.cpp +++ b/renderdoc/driver/d3d12/d3d12_command_list4_wrap.cpp @@ -358,7 +358,7 @@ bool WrappedID3D12GraphicsCommandList::Serialise_BeginRenderPass( m_Cmd->AddEvent(); ActionDescription action; - action.name = StringFormat::Fmt( + action.customName = StringFormat::Fmt( "BeginRenderPass(%s)", MakeRenderPassOpString(false, NumRenderTargets, pRenderTargets, pDepthStencil, Flags).c_str()); action.flags |= ActionFlags::BeginPass | ActionFlags::PassBoundary; @@ -512,7 +512,7 @@ bool WrappedID3D12GraphicsCommandList::Serialise_EndRenderPass(SerialiserType &s D3D12RenderState &state = m_Cmd->m_BakedCmdListInfo[m_Cmd->m_LastCmdListID].state; ActionDescription action; - action.name = StringFormat::Fmt( + action.customName = StringFormat::Fmt( "EndRenderPass(%s)", MakeRenderPassOpString(true, (UINT)state.rpRTs.size(), state.rpRTs.data(), state.rpDSV.cpuDescriptor.ptr ? &state.rpDSV : NULL, state.rpFlags) diff --git a/renderdoc/driver/d3d12/d3d12_command_list_wrap.cpp b/renderdoc/driver/d3d12/d3d12_command_list_wrap.cpp index 08202692e..8f7058cfc 100644 --- a/renderdoc/driver/d3d12/d3d12_command_list_wrap.cpp +++ b/renderdoc/driver/d3d12/d3d12_command_list_wrap.cpp @@ -2975,7 +2975,7 @@ bool WrappedID3D12GraphicsCommandList::Serialise_SetMarker(SerialiserType &ser, D3D12MarkerRegion::Set(GetWrappedCrackedList(), MarkerText); ActionDescription action; - action.name = MarkerText; + action.customName = MarkerText; action.flags |= ActionFlags::SetMarker; m_Cmd->AddEvent(); @@ -3040,7 +3040,7 @@ bool WrappedID3D12GraphicsCommandList::Serialise_BeginEvent(SerialiserType &ser, D3D12MarkerRegion::Begin(GetWrappedCrackedList(), MarkerText); ActionDescription action; - action.name = MarkerText; + action.customName = MarkerText; action.flags |= ActionFlags::PushMarker; m_Cmd->AddEvent(); @@ -3509,7 +3509,6 @@ void WrappedID3D12GraphicsCommandList::ReserveExecuteIndirect(ID3D12GraphicsComm { m_Cmd->AddEvent(); ActionDescription action; - action.name = "ID3D12GraphicsCommandList::ExecuteIndirect()"; action.flags = ActionFlags::PopMarker; m_Cmd->AddAction(action); } @@ -3563,7 +3562,7 @@ void WrappedID3D12GraphicsCommandList::PatchExecuteIndirect(BakedCmdListInfo &in RDCASSERTMSG("Couldn't find base event action!", idx < actions.size(), idx, actions.size()); // patch the name for the base action - actions[idx].action.name = + actions[idx].action.customName = StringFormat::Fmt("ExecuteIndirect(maxCount %u, count <%u>)", exec.maxCount, count); // if there's only one command running, remove its pushmarker flag if(!multiaction) @@ -3576,15 +3575,16 @@ void WrappedID3D12GraphicsCommandList::PatchExecuteIndirect(BakedCmdListInfo &in D3D12RenderState state; + SDChunk *baseChunk = NULL; + if(count > 0) { RDCASSERT(actions[idx].state); state = *actions[idx].state; + baseChunk = m_Cmd->m_StructuredFile->chunks[actions[idx].action.events[0].chunkIndex]; } - SDChunk *baseChunk = m_Cmd->m_StructuredFile->chunks[actions[idx].action.events[0].chunkIndex]; - for(uint32_t i = 0; i < count; i++) { byte *data = mapPtr + exec.argOffs; @@ -3640,10 +3640,10 @@ void WrappedID3D12GraphicsCommandList::PatchExecuteIndirect(BakedCmdListInfo &in curAction.vertexOffset = args->StartVertexLocation; curAction.instanceOffset = args->StartInstanceLocation; curAction.flags |= ActionFlags::Drawcall | ActionFlags::Instanced | ActionFlags::Indirect; - curAction.name = StringFormat::Fmt("[%u] arg%u: IndirectDraw(<%u, %u>)", i, a, - curAction.numIndices, curAction.numInstances); + curAction.customName = StringFormat::Fmt("[%u] arg%u: IndirectDraw(<%u, %u>)", i, a, + curAction.numIndices, curAction.numInstances); - fakeChunk->name = curAction.name; + fakeChunk->name = curAction.customName; structuriser.Serialise("ArgumentData"_lit, *args).Important(); @@ -3673,10 +3673,10 @@ void WrappedID3D12GraphicsCommandList::PatchExecuteIndirect(BakedCmdListInfo &in curAction.instanceOffset = args->StartInstanceLocation; curAction.flags |= ActionFlags::Drawcall | ActionFlags::Instanced | ActionFlags::Indexed | ActionFlags::Indirect; - curAction.name = StringFormat::Fmt("[%u] arg%u: IndirectDrawIndexed(<%u, %u>)", i, a, - curAction.numIndices, curAction.numInstances); + curAction.customName = StringFormat::Fmt("[%u] arg%u: IndirectDrawIndexed(<%u, %u>)", i, + a, curAction.numIndices, curAction.numInstances); - fakeChunk->name = curAction.name; + fakeChunk->name = curAction.customName; structuriser.Serialise("ArgumentData"_lit, *args).Important(); @@ -3702,11 +3702,11 @@ void WrappedID3D12GraphicsCommandList::PatchExecuteIndirect(BakedCmdListInfo &in curAction.dispatchDimension[1] = args->ThreadGroupCountY; curAction.dispatchDimension[2] = args->ThreadGroupCountZ; curAction.flags |= ActionFlags::Dispatch | ActionFlags::Indirect; - curAction.name = StringFormat::Fmt( + curAction.customName = StringFormat::Fmt( "[%u] arg%u: IndirectDispatch(<%u, %u, %u>)", i, a, curAction.dispatchDimension[0], curAction.dispatchDimension[1], curAction.dispatchDimension[2]); - fakeChunk->name = curAction.name; + fakeChunk->name = curAction.customName; structuriser.Serialise("ArgumentData"_lit, *args).Important(); @@ -4321,7 +4321,7 @@ bool WrappedID3D12GraphicsCommandList::Serialise_ExecuteIndirect( m_Cmd->AddEvent(); ActionDescription action; - action.name = "ExecuteIndirect"; + action.customName = "ExecuteIndirect"; action.flags |= ActionFlags::MultiAction; diff --git a/renderdoc/driver/d3d12/d3d12_command_queue_wrap.cpp b/renderdoc/driver/d3d12/d3d12_command_queue_wrap.cpp index 4702a553e..0c0eff53b 100644 --- a/renderdoc/driver/d3d12/d3d12_command_queue_wrap.cpp +++ b/renderdoc/driver/d3d12/d3d12_command_queue_wrap.cpp @@ -537,7 +537,7 @@ bool WrappedID3D12CommandQueue::Serialise_ExecuteCommandLists(SerialiserType &se // add a fake marker ActionDescription action; { - action.name = + action.customName = StringFormat::Fmt("=> %s[%u]: Reset(%s)", basename.c_str(), c, ToStr(cmd).c_str()); action.flags = ActionFlags::CommandBufferBoundary | ActionFlags::PassBoundary | ActionFlags::BeginPass; @@ -587,7 +587,7 @@ bool WrappedID3D12CommandQueue::Serialise_ExecuteCommandLists(SerialiserType &se m_Cmd.m_RootActionID += cmdListInfo.actionCount; { - action.name = + action.customName = StringFormat::Fmt("=> %s[%u]: Close(%s)", basename.c_str(), c, ToStr(cmd).c_str()); action.flags = ActionFlags::CommandBufferBoundary | ActionFlags::PassBoundary | ActionFlags::EndPass; @@ -1041,7 +1041,7 @@ bool WrappedID3D12CommandQueue::Serialise_SetMarker(SerialiserType &ser, UINT Me if(IsLoading(m_State)) { ActionDescription action; - action.name = MarkerText; + action.customName = MarkerText; action.flags |= ActionFlags::SetMarker; m_Cmd.AddEvent(); @@ -1090,7 +1090,7 @@ bool WrappedID3D12CommandQueue::Serialise_BeginEvent(SerialiserType &ser, UINT M if(IsLoading(m_State)) { ActionDescription action; - action.name = MarkerText; + action.customName = MarkerText; action.flags |= ActionFlags::PushMarker; m_Cmd.AddEvent(); diff --git a/renderdoc/driver/d3d12/d3d12_commands.cpp b/renderdoc/driver/d3d12/d3d12_commands.cpp index 32695268b..2d08c732c 100644 --- a/renderdoc/driver/d3d12/d3d12_commands.cpp +++ b/renderdoc/driver/d3d12/d3d12_commands.cpp @@ -867,7 +867,7 @@ bool WrappedID3D12CommandQueue::ProcessChunk(ReadSerialiser &ser, D3D12Chunk chu m_Cmd.AddEvent(); ActionDescription action; - action.name = "End of Capture"; + action.customName = "End of Capture"; action.flags |= ActionFlags::Present; action.copyDestination = m_Cmd.m_LastPresentedImage; diff --git a/renderdoc/driver/d3d12/d3d12_device.cpp b/renderdoc/driver/d3d12/d3d12_device.cpp index 48b988fee..f6a32d2e9 100644 --- a/renderdoc/driver/d3d12/d3d12_device.cpp +++ b/renderdoc/driver/d3d12/d3d12_device.cpp @@ -2115,7 +2115,7 @@ bool WrappedID3D12Device::Serialise_Present(SerialiserType &ser, ID3D12Resource ActionDescription action; - action.name = StringFormat::Fmt("Present(%s)", ToStr(PresentedBackbuffer).c_str()); + action.customName = StringFormat::Fmt("Present(%s)", ToStr(PresentedBackbuffer).c_str()); action.flags |= ActionFlags::Present; cmd.m_LastPresentedImage = PresentedBackbuffer; diff --git a/renderdoc/driver/gl/gl_driver.cpp b/renderdoc/driver/gl/gl_driver.cpp index ea152b30e..1ac852931 100644 --- a/renderdoc/driver/gl/gl_driver.cpp +++ b/renderdoc/driver/gl/gl_driver.cpp @@ -2671,8 +2671,8 @@ bool WrappedOpenGL::Serialise_Present(SerialiserType &ser) action.copyDestination = GetResourceManager()->GetOriginalID( GetResourceManager()->GetResID(TextureRes(GetCtx(), col))); - action.name = StringFormat::Fmt("%s(%s)", ToStr(gl_CurChunk).c_str(), - ToStr(action.copyDestination).c_str()); + action.customName = StringFormat::Fmt("%s(%s)", ToStr(gl_CurChunk).c_str(), + ToStr(action.copyDestination).c_str()); action.flags |= ActionFlags::Present; AddAction(action); @@ -3478,7 +3478,7 @@ bool WrappedOpenGL::ProcessChunk(ReadSerialiser &ser, GLChunk chunk) AddEvent(); ActionDescription action; - action.name = "End of Capture"; + action.customName = "End of Capture"; action.flags |= ActionFlags::Present; GLuint col = 0; diff --git a/renderdoc/driver/gl/wrappers/gl_debug_funcs.cpp b/renderdoc/driver/gl/wrappers/gl_debug_funcs.cpp index 6e3c1bcd8..d0e138e73 100644 --- a/renderdoc/driver/gl/wrappers/gl_debug_funcs.cpp +++ b/renderdoc/driver/gl/wrappers/gl_debug_funcs.cpp @@ -281,7 +281,7 @@ bool WrappedOpenGL::Serialise_glDebugMessageInsert(SerialiserType &ser, GLenum s if(IsLoading(m_State)) { ActionDescription action; - action.name = name; + action.customName = name; action.flags |= ActionFlags::SetMarker; AddEvent(); @@ -382,7 +382,7 @@ bool WrappedOpenGL::Serialise_glInsertEventMarkerEXT(SerialiserType &ser, GLsize if(IsLoading(m_State)) { ActionDescription action; - action.name = marker; + action.customName = marker; action.flags |= ActionFlags::SetMarker; AddEvent(); @@ -453,7 +453,7 @@ bool WrappedOpenGL::Serialise_glPushDebugGroup(SerialiserType &ser, GLenum sourc if(IsLoading(m_State)) { ActionDescription action; - action.name = message; + action.customName = message; action.flags |= ActionFlags::PushMarker; AddEvent(); @@ -498,7 +498,6 @@ bool WrappedOpenGL::Serialise_glPopDebugGroup(SerialiserType &ser) if(IsLoading(m_State)) { ActionDescription action; - action.name = ToStr(gl_CurChunk) + "()"; action.flags |= ActionFlags::PopMarker; AddEvent(); diff --git a/renderdoc/driver/gl/wrappers/gl_draw_funcs.cpp b/renderdoc/driver/gl/wrappers/gl_draw_funcs.cpp index ae60c6d68..e096f3e87 100644 --- a/renderdoc/driver/gl/wrappers/gl_draw_funcs.cpp +++ b/renderdoc/driver/gl/wrappers/gl_draw_funcs.cpp @@ -502,8 +502,8 @@ bool WrappedOpenGL::Serialise_glDispatchComputeIndirect(SerialiserType &ser, GLi AddEvent(); ActionDescription action; - action.name = StringFormat::Fmt("%s(<%u, %u, %u>)", ToStr(gl_CurChunk).c_str(), groupSizes[0], - groupSizes[1], groupSizes[2]); + action.customName = StringFormat::Fmt("%s(<%u, %u, %u>)", ToStr(gl_CurChunk).c_str(), + groupSizes[0], groupSizes[1], groupSizes[2]); action.flags |= ActionFlags::Dispatch | ActionFlags::Indirect; action.dispatchDimension[0] = groupSizes[0]; @@ -673,7 +673,7 @@ bool WrappedOpenGL::Serialise_glDrawTransformFeedback(SerialiserType &ser, GLenu GLNOTIMP("Not fetching feedback object count for glDrawTransformFeedback() display"); ActionDescription action; - action.name = ToStr(gl_CurChunk) + "()"; + action.customName = ToStr(gl_CurChunk) + "()"; action.numIndices = 1; action.numInstances = 1; action.indexOffset = 0; @@ -745,7 +745,7 @@ bool WrappedOpenGL::Serialise_glDrawTransformFeedbackInstanced(SerialiserType &s GLNOTIMP("Not fetching feedback object count for glDrawTransformFeedbackInstanced() display"); ActionDescription action; - action.name = StringFormat::Fmt("%s()", ToStr(gl_CurChunk).c_str(), instancecount); + action.customName = StringFormat::Fmt("%s()", ToStr(gl_CurChunk).c_str(), instancecount); action.numIndices = 1; action.numInstances = 1; action.indexOffset = 0; @@ -816,7 +816,7 @@ bool WrappedOpenGL::Serialise_glDrawTransformFeedbackStream(SerialiserType &ser, GLNOTIMP("Not fetching feedback object count for glDrawTransformFeedbackStream() display"); ActionDescription action; - action.name = ToStr(gl_CurChunk) + "()"; + action.customName = ToStr(gl_CurChunk) + "()"; action.numIndices = 1; action.numInstances = 1; action.indexOffset = 0; @@ -891,7 +891,7 @@ bool WrappedOpenGL::Serialise_glDrawTransformFeedbackStreamInstanced(SerialiserT "display"); ActionDescription action; - action.name = StringFormat::Fmt("%s()", ToStr(gl_CurChunk).c_str(), instancecount); + action.customName = StringFormat::Fmt("%s()", ToStr(gl_CurChunk).c_str(), instancecount); action.numIndices = 1; action.numInstances = 1; action.indexOffset = 0; @@ -1221,8 +1221,8 @@ bool WrappedOpenGL::Serialise_glDrawArraysIndirect(SerialiserType &ser, GLenum m AddEvent(); ActionDescription action; - action.name = StringFormat::Fmt("%s(<%u, %u>)", ToStr(gl_CurChunk).c_str(), params.count, - params.instanceCount); + action.customName = StringFormat::Fmt("%s(<%u, %u>)", ToStr(gl_CurChunk).c_str(), + params.count, params.instanceCount); action.numIndices = params.count; action.numInstances = params.instanceCount; action.vertexOffset = params.first; @@ -1535,8 +1535,8 @@ bool WrappedOpenGL::Serialise_glDrawElementsIndirect(SerialiserType &ser, GLenum uint32_t IdxSize = GetIdxSize(type); ActionDescription action; - action.name = StringFormat::Fmt("%s(<%u, %u>)", ToStr(gl_CurChunk).c_str(), params.count, - params.instanceCount); + action.customName = StringFormat::Fmt("%s(<%u, %u>)", ToStr(gl_CurChunk).c_str(), + params.count, params.instanceCount); action.numIndices = params.count; action.numInstances = params.instanceCount; action.indexOffset = params.firstIndex; @@ -2198,7 +2198,7 @@ bool WrappedOpenGL::Serialise_glMultiDrawArrays(SerialiserType &ser, GLenum mode GL.glMultiDrawArrays(mode, first, count, drawcount); ActionDescription action; - action.name = StringFormat::Fmt("%s(%i)", ToStr(gl_CurChunk).c_str(), drawcount); + action.customName = StringFormat::Fmt("%s(%i)", ToStr(gl_CurChunk).c_str(), drawcount); action.flags |= ActionFlags::MultiAction; m_LastTopology = MakePrimitiveTopology(mode); @@ -2217,7 +2217,7 @@ bool WrappedOpenGL::Serialise_glMultiDrawArrays(SerialiserType &ser, GLenum mode multidraw.numIndices = count[i]; multidraw.vertexOffset = first[i]; - multidraw.name = + multidraw.customName = StringFormat::Fmt("%s[%i](%u)", ToStr(gl_CurChunk).c_str(), i, multidraw.numIndices); multidraw.flags |= ActionFlags::Drawcall; @@ -2357,7 +2357,7 @@ bool WrappedOpenGL::Serialise_glMultiDrawElements(SerialiserType &ser, GLenum mo uint32_t IdxSize = GetIdxSize(type); ActionDescription action; - action.name = StringFormat::Fmt("%s(%i)", ToStr(gl_CurChunk).c_str(), drawcount); + action.customName = StringFormat::Fmt("%s(%i)", ToStr(gl_CurChunk).c_str(), drawcount); action.flags |= ActionFlags::MultiAction; m_LastIndexWidth = IdxSize; @@ -2382,7 +2382,7 @@ bool WrappedOpenGL::Serialise_glMultiDrawElements(SerialiserType &ser, GLenum mo multidraw.indexOffset /= IdxSize; - multidraw.name = + multidraw.customName = StringFormat::Fmt("%s[%i](%u)", ToStr(gl_CurChunk).c_str(), i, multidraw.numIndices); multidraw.flags |= ActionFlags::Drawcall | ActionFlags::Indexed; @@ -2527,7 +2527,7 @@ bool WrappedOpenGL::Serialise_glMultiDrawElementsBaseVertex(SerialiserType &ser, uint32_t IdxSize = GetIdxSize(type); ActionDescription action; - action.name = StringFormat::Fmt("%s(%i)", ToStr(gl_CurChunk).c_str(), drawcount); + action.customName = StringFormat::Fmt("%s(%i)", ToStr(gl_CurChunk).c_str(), drawcount); action.flags |= ActionFlags::MultiAction; @@ -2551,7 +2551,7 @@ bool WrappedOpenGL::Serialise_glMultiDrawElementsBaseVertex(SerialiserType &ser, multidraw.indexOffset /= IdxSize; - multidraw.name = + multidraw.customName = StringFormat::Fmt("%s[%i](%u)", ToStr(gl_CurChunk).c_str(), i, multidraw.numIndices); multidraw.flags |= ActionFlags::Drawcall | ActionFlags::Indexed; @@ -2682,7 +2682,7 @@ bool WrappedOpenGL::Serialise_glMultiDrawArraysIndirect(SerialiserType &ser, GLe GL.glMultiDrawArraysIndirect(mode, (const void *)offset, drawcount, stride); ActionDescription action; - action.name = StringFormat::Fmt("%s(<%i>)", ToStr(gl_CurChunk).c_str(), drawcount); + action.customName = StringFormat::Fmt("%s(<%i>)", ToStr(gl_CurChunk).c_str(), drawcount); action.flags |= ActionFlags::MultiAction; @@ -2725,15 +2725,15 @@ bool WrappedOpenGL::Serialise_glMultiDrawArraysIndirect(SerialiserType &ser, GLe multidraw.vertexOffset = params.first; multidraw.instanceOffset = params.baseInstance; - multidraw.name = StringFormat::Fmt("%s[%i](<%u, %u>)", ToStr(gl_CurChunk).c_str(), i, - multidraw.numIndices, multidraw.numInstances); + multidraw.customName = StringFormat::Fmt("%s[%i](<%u, %u>)", ToStr(gl_CurChunk).c_str(), i, + multidraw.numIndices, multidraw.numInstances); multidraw.flags |= ActionFlags::Drawcall | ActionFlags::Instanced | ActionFlags::Indirect; m_LastTopology = MakePrimitiveTopology(mode); // add a fake chunk for this individual indirect draw - SDChunk *fakeChunk = new SDChunk(multidraw.name); + SDChunk *fakeChunk = new SDChunk(multidraw.customName); fakeChunk->metadata = baseChunk->metadata; fakeChunk->metadata.chunkID = (uint32_t)GLChunk::glIndirectSubCommand; @@ -2904,7 +2904,7 @@ bool WrappedOpenGL::Serialise_glMultiDrawElementsIndirect(SerialiserType &ser, G GL.glMultiDrawElementsIndirect(mode, type, (const void *)offset, drawcount, stride); ActionDescription action; - action.name = StringFormat::Fmt("%s(<%i>)", ToStr(gl_CurChunk).c_str(), drawcount); + action.customName = StringFormat::Fmt("%s(<%i>)", ToStr(gl_CurChunk).c_str(), drawcount); action.flags |= ActionFlags::MultiAction; @@ -2949,8 +2949,8 @@ bool WrappedOpenGL::Serialise_glMultiDrawElementsIndirect(SerialiserType &ser, G multidraw.baseVertex = params.baseVertex; multidraw.instanceOffset = params.baseInstance; - multidraw.name = StringFormat::Fmt("%s[%i](<%u, %u>)", ToStr(gl_CurChunk).c_str(), i, - multidraw.numIndices, multidraw.numInstances); + multidraw.customName = StringFormat::Fmt("%s[%i](<%u, %u>)", ToStr(gl_CurChunk).c_str(), i, + multidraw.numIndices, multidraw.numInstances); multidraw.flags |= ActionFlags::Drawcall | ActionFlags::Indexed | ActionFlags::Instanced | ActionFlags::Indirect; @@ -2959,7 +2959,7 @@ bool WrappedOpenGL::Serialise_glMultiDrawElementsIndirect(SerialiserType &ser, G m_LastIndexWidth = IdxSize; // add a fake chunk for this individual indirect draw - SDChunk *fakeChunk = new SDChunk(multidraw.name); + SDChunk *fakeChunk = new SDChunk(multidraw.customName); fakeChunk->metadata = baseChunk->metadata; fakeChunk->metadata.chunkID = (uint32_t)GLChunk::glIndirectSubCommand; @@ -3134,7 +3134,7 @@ bool WrappedOpenGL::Serialise_glMultiDrawArraysIndirectCount(SerialiserType &ser maxdrawcount, stride); ActionDescription action; - action.name = StringFormat::Fmt("%s(<%i>)", ToStr(gl_CurChunk).c_str(), realdrawcount); + action.customName = StringFormat::Fmt("%s(<%i>)", ToStr(gl_CurChunk).c_str(), realdrawcount); action.flags |= ActionFlags::MultiAction; @@ -3177,15 +3177,15 @@ bool WrappedOpenGL::Serialise_glMultiDrawArraysIndirectCount(SerialiserType &ser multidraw.vertexOffset = params.first; multidraw.instanceOffset = params.baseInstance; - multidraw.name = StringFormat::Fmt("%s[%i](<%u, %u>)", ToStr(gl_CurChunk).c_str(), i, - multidraw.numIndices, multidraw.numInstances); + multidraw.customName = StringFormat::Fmt("%s[%i](<%u, %u>)", ToStr(gl_CurChunk).c_str(), i, + multidraw.numIndices, multidraw.numInstances); multidraw.flags |= ActionFlags::Drawcall | ActionFlags::Instanced | ActionFlags::Indirect; m_LastTopology = MakePrimitiveTopology(mode); // add a fake chunk for this individual indirect draw - SDChunk *fakeChunk = new SDChunk(multidraw.name); + SDChunk *fakeChunk = new SDChunk(multidraw.customName); fakeChunk->metadata = baseChunk->metadata; fakeChunk->metadata.chunkID = (uint32_t)GLChunk::glIndirectSubCommand; @@ -3365,7 +3365,7 @@ bool WrappedOpenGL::Serialise_glMultiDrawElementsIndirectCount(SerialiserType &s maxdrawcount, stride); ActionDescription action; - action.name = StringFormat::Fmt("%s(<%i>)", ToStr(gl_CurChunk).c_str(), realdrawcount); + action.customName = StringFormat::Fmt("%s(<%i>)", ToStr(gl_CurChunk).c_str(), realdrawcount); action.flags |= ActionFlags::MultiAction; @@ -3410,8 +3410,8 @@ bool WrappedOpenGL::Serialise_glMultiDrawElementsIndirectCount(SerialiserType &s multidraw.baseVertex = params.baseVertex; multidraw.instanceOffset = params.baseInstance; - multidraw.name = StringFormat::Fmt("%s[%i](<%u, %u>)", ToStr(gl_CurChunk).c_str(), i, - multidraw.numIndices, multidraw.numInstances); + multidraw.customName = StringFormat::Fmt("%s[%i](<%u, %u>)", ToStr(gl_CurChunk).c_str(), i, + multidraw.numIndices, multidraw.numInstances); multidraw.flags |= ActionFlags::Drawcall | ActionFlags::Indexed | ActionFlags::Instanced | ActionFlags::Indirect; @@ -3420,7 +3420,7 @@ bool WrappedOpenGL::Serialise_glMultiDrawElementsIndirectCount(SerialiserType &s m_LastIndexWidth = IdxSize; // add a fake chunk for this individual indirect draw - SDChunk *fakeChunk = new SDChunk(multidraw.name); + SDChunk *fakeChunk = new SDChunk(multidraw.customName); fakeChunk->metadata = baseChunk->metadata; fakeChunk->metadata.chunkID = (uint32_t)GLChunk::glIndirectSubCommand; @@ -4445,7 +4445,7 @@ bool WrappedOpenGL::Serialise_glClear(SerialiserType &ser, GLbitfield mask) name += ")"; ActionDescription action; - action.name = name; + action.customName = name; action.flags |= ActionFlags::Clear; if(mask & GL_COLOR_BUFFER_BIT) action.flags |= ActionFlags::ClearColor; diff --git a/renderdoc/driver/vulkan/vk_core.cpp b/renderdoc/driver/vulkan/vk_core.cpp index ca0610bff..e5498e022 100644 --- a/renderdoc/driver/vulkan/vk_core.cpp +++ b/renderdoc/driver/vulkan/vk_core.cpp @@ -3449,7 +3449,7 @@ bool WrappedVulkan::ProcessChunk(ReadSerialiser &ser, VulkanChunk chunk) AddEvent(); ActionDescription action; - action.name = "End of Capture"; + action.customName = "End of Capture"; action.flags |= ActionFlags::Present; action.copyDestination = m_LastPresentedImage; diff --git a/renderdoc/driver/vulkan/wrappers/vk_cmd_funcs.cpp b/renderdoc/driver/vulkan/wrappers/vk_cmd_funcs.cpp index bcc92cb57..5bdf4f956 100644 --- a/renderdoc/driver/vulkan/wrappers/vk_cmd_funcs.cpp +++ b/renderdoc/driver/vulkan/wrappers/vk_cmd_funcs.cpp @@ -1584,7 +1584,7 @@ bool WrappedVulkan::Serialise_vkCmdBeginRenderPass(SerialiserType &ser, VkComman AddEvent(); ActionDescription action; - action.name = + action.customName = StringFormat::Fmt("vkCmdBeginRenderPass(%s)", MakeRenderPassOpString(false).c_str()); action.flags |= ActionFlags::PassBoundary | ActionFlags::BeginPass; @@ -1761,8 +1761,8 @@ bool WrappedVulkan::Serialise_vkCmdNextSubpass(SerialiserType &ser, VkCommandBuf AddEvent(); ActionDescription action; - action.name = StringFormat::Fmt("vkCmdNextSubpass() => %u", - m_BakedCmdBufferInfo[m_LastCmdBufferID].state.subpass); + action.customName = StringFormat::Fmt("vkCmdNextSubpass() => %u", + m_BakedCmdBufferInfo[m_LastCmdBufferID].state.subpass); action.flags |= ActionFlags::PassBoundary | ActionFlags::BeginPass | ActionFlags::EndPass; AddAction(action); @@ -1888,7 +1888,8 @@ bool WrappedVulkan::Serialise_vkCmdEndRenderPass(SerialiserType &ser, VkCommandB AddEvent(); ActionDescription action; - action.name = StringFormat::Fmt("vkCmdEndRenderPass(%s)", MakeRenderPassOpString(true).c_str()); + action.customName = + StringFormat::Fmt("vkCmdEndRenderPass(%s)", MakeRenderPassOpString(true).c_str()); action.flags |= ActionFlags::PassBoundary | ActionFlags::EndPass; AddAction(action); @@ -2208,7 +2209,7 @@ bool WrappedVulkan::Serialise_vkCmdBeginRenderPass2(SerialiserType &ser, AddEvent(); ActionDescription action; - action.name = + action.customName = StringFormat::Fmt("vkCmdBeginRenderPass2(%s)", MakeRenderPassOpString(false).c_str()); action.flags |= ActionFlags::PassBoundary | ActionFlags::BeginPass; @@ -2402,8 +2403,8 @@ bool WrappedVulkan::Serialise_vkCmdNextSubpass2(SerialiserType &ser, VkCommandBu AddEvent(); ActionDescription action; - action.name = StringFormat::Fmt("vkCmdNextSubpass2() => %u", - m_BakedCmdBufferInfo[m_LastCmdBufferID].state.subpass); + action.customName = StringFormat::Fmt("vkCmdNextSubpass2() => %u", + m_BakedCmdBufferInfo[m_LastCmdBufferID].state.subpass); action.flags |= ActionFlags::PassBoundary | ActionFlags::BeginPass | ActionFlags::EndPass; AddAction(action); @@ -2545,7 +2546,7 @@ bool WrappedVulkan::Serialise_vkCmdEndRenderPass2(SerialiserType &ser, VkCommand AddEvent(); ActionDescription action; - action.name = + action.customName = StringFormat::Fmt("vkCmdEndRenderPass2(%s)", MakeRenderPassOpString(true).c_str()); action.flags |= ActionFlags::PassBoundary | ActionFlags::EndPass; @@ -4162,7 +4163,7 @@ bool WrappedVulkan::Serialise_vkCmdExecuteCommands(SerialiserType &ser, VkComman AddEvent(); ActionDescription action; - action.name = StringFormat::Fmt("vkCmdExecuteCommands(%u)", commandBufferCount); + action.customName = StringFormat::Fmt("vkCmdExecuteCommands(%u)", commandBufferCount); action.flags = ActionFlags::CmdList | ActionFlags::PushMarker; AddAction(action); @@ -4183,8 +4184,8 @@ bool WrappedVulkan::Serialise_vkCmdExecuteCommands(SerialiserType &ser, VkComman // add a fake marker ActionDescription marker; - marker.name = StringFormat::Fmt("=> vkCmdExecuteCommands()[%u]: vkBeginCommandBuffer(%s)", - c, ToStr(cmd).c_str()); + marker.customName = StringFormat::Fmt( + "=> vkCmdExecuteCommands()[%u]: vkBeginCommandBuffer(%s)", c, ToStr(cmd).c_str()); marker.flags = ActionFlags::CommandBufferBoundary | ActionFlags::PassBoundary | ActionFlags::BeginPass; AddEvent(); @@ -4249,8 +4250,8 @@ bool WrappedVulkan::Serialise_vkCmdExecuteCommands(SerialiserType &ser, VkComman cmdBufInfo.curEvents.clear(); - marker.name = StringFormat::Fmt("=> vkCmdExecuteCommands()[%u]: vkEndCommandBuffer(%s)", c, - ToStr(cmd).c_str()); + marker.customName = StringFormat::Fmt( + "=> vkCmdExecuteCommands()[%u]: vkEndCommandBuffer(%s)", c, ToStr(cmd).c_str()); marker.flags = ActionFlags::CommandBufferBoundary | ActionFlags::PassBoundary | ActionFlags::EndPass; AddEvent(); @@ -4511,7 +4512,7 @@ bool WrappedVulkan::Serialise_vkCmdDebugMarkerBeginEXT(SerialiserType &ser, ObjDisp(commandBuffer)->CmdDebugMarkerBeginEXT(Unwrap(commandBuffer), &Marker); ActionDescription action; - action.name = Marker.pMarkerName ? Marker.pMarkerName : ""; + action.customName = Marker.pMarkerName ? Marker.pMarkerName : ""; action.flags |= ActionFlags::PushMarker; action.markerColor.x = RDCCLAMP(Marker.color[0], 0.0f, 1.0f); @@ -4582,7 +4583,6 @@ bool WrappedVulkan::Serialise_vkCmdDebugMarkerEndEXT(SerialiserType &ser, // dummy action that is consumed when this command buffer // is being in-lined into the call stream ActionDescription action; - action.name = "vkCmdDebugMarkerEndEXT()"; action.flags = ActionFlags::PopMarker; AddEvent(); @@ -4643,7 +4643,7 @@ bool WrappedVulkan::Serialise_vkCmdDebugMarkerInsertEXT(SerialiserType &ser, ObjDisp(commandBuffer)->CmdDebugMarkerInsertEXT(Unwrap(commandBuffer), &Marker); ActionDescription action; - action.name = Marker.pMarkerName ? Marker.pMarkerName : ""; + action.customName = Marker.pMarkerName ? Marker.pMarkerName : ""; action.flags |= ActionFlags::SetMarker; action.markerColor.x = RDCCLAMP(Marker.color[0], 0.0f, 1.0f); @@ -5500,7 +5500,7 @@ bool WrappedVulkan::Serialise_vkCmdBeginDebugUtilsLabelEXT(SerialiserType &ser, ObjDisp(commandBuffer)->CmdBeginDebugUtilsLabelEXT(Unwrap(commandBuffer), &Label); ActionDescription action; - action.name = Label.pLabelName ? Label.pLabelName : ""; + action.customName = Label.pLabelName ? Label.pLabelName : ""; action.flags |= ActionFlags::PushMarker; action.markerColor.x = RDCCLAMP(Label.color[0], 0.0f, 1.0f); @@ -5569,7 +5569,6 @@ bool WrappedVulkan::Serialise_vkCmdEndDebugUtilsLabelEXT(SerialiserType &ser, ObjDisp(commandBuffer)->CmdEndDebugUtilsLabelEXT(Unwrap(commandBuffer)); ActionDescription action; - action.name = "vkCmdEndDebugUtilsLabelEXT()"; action.flags = ActionFlags::PopMarker; AddEvent(); @@ -5630,7 +5629,7 @@ bool WrappedVulkan::Serialise_vkCmdInsertDebugUtilsLabelEXT(SerialiserType &ser, ObjDisp(commandBuffer)->CmdInsertDebugUtilsLabelEXT(Unwrap(commandBuffer), &Label); ActionDescription action; - action.name = Label.pLabelName ? Label.pLabelName : ""; + action.customName = Label.pLabelName ? Label.pLabelName : ""; action.flags |= ActionFlags::SetMarker; action.markerColor.x = RDCCLAMP(Label.color[0], 0.0f, 1.0f); diff --git a/renderdoc/driver/vulkan/wrappers/vk_draw_funcs.cpp b/renderdoc/driver/vulkan/wrappers/vk_draw_funcs.cpp index a3c0c694e..767b2521e 100644 --- a/renderdoc/driver/vulkan/wrappers/vk_draw_funcs.cpp +++ b/renderdoc/driver/vulkan/wrappers/vk_draw_funcs.cpp @@ -690,7 +690,7 @@ bool WrappedVulkan::Serialise_vkCmdDrawIndirect(SerialiserType &ser, VkCommandBu AddEvent(); - action.name = name; + action.customName = name; action.flags = ActionFlags::Drawcall | ActionFlags::Instanced | ActionFlags::Indirect; AddAction(action); @@ -706,13 +706,13 @@ bool WrappedVulkan::Serialise_vkCmdDrawIndirect(SerialiserType &ser, VkCommandBu } ActionDescription action; - action.name = name; + action.customName = name; action.flags = ActionFlags::MultiAction | ActionFlags::PushMarker; if(count == 0) { action.flags = ActionFlags::Drawcall | ActionFlags::Instanced | ActionFlags::Indirect; - action.name += "(0)"; + action.customName += "(0)"; } AddEvent(); @@ -732,7 +732,7 @@ bool WrappedVulkan::Serialise_vkCmdDrawIndirect(SerialiserType &ser, VkCommandBu { ActionDescription multi; - multi.name = name; + multi.customName = name; multi.flags |= ActionFlags::Drawcall | ActionFlags::Instanced | ActionFlags::Indirect; @@ -763,7 +763,7 @@ bool WrappedVulkan::Serialise_vkCmdDrawIndirect(SerialiserType &ser, VkCommandBu if(count > 0) { AddEvent(); - action.name = name + " end"; + action.customName = name + " end"; action.flags = ActionFlags::PopMarker; AddAction(action); } @@ -1075,7 +1075,7 @@ bool WrappedVulkan::Serialise_vkCmdDrawIndexedIndirect(SerialiserType &ser, AddEvent(); - action.name = name; + action.customName = name; action.flags = ActionFlags::Drawcall | ActionFlags::Instanced | ActionFlags::Indexed | ActionFlags::Indirect; @@ -1092,12 +1092,12 @@ bool WrappedVulkan::Serialise_vkCmdDrawIndexedIndirect(SerialiserType &ser, } ActionDescription action; - action.name = name; + action.customName = name; action.flags = ActionFlags::MultiAction | ActionFlags::PushMarker; if(count == 0) { - action.name += "(0)"; + action.customName += "(0)"; action.flags = ActionFlags::Drawcall | ActionFlags::Instanced | ActionFlags::Indexed | ActionFlags::Indirect; } @@ -1119,7 +1119,7 @@ bool WrappedVulkan::Serialise_vkCmdDrawIndexedIndirect(SerialiserType &ser, { ActionDescription multi; - multi.name = name; + multi.customName = name; multi.flags |= ActionFlags::Drawcall | ActionFlags::Instanced | ActionFlags::Indexed | ActionFlags::Indirect; @@ -1151,7 +1151,7 @@ bool WrappedVulkan::Serialise_vkCmdDrawIndexedIndirect(SerialiserType &ser, if(count > 0) { AddEvent(); - action.name = name + " end"; + action.customName = name + " end"; action.flags = ActionFlags::PopMarker; AddAction(action); } @@ -1312,7 +1312,7 @@ bool WrappedVulkan::Serialise_vkCmdDispatchIndirect(SerialiserType &ser, AddEvent(); ActionDescription action; - action.name = "vkCmdDispatchIndirect()"; + action.customName = "vkCmdDispatchIndirect()"; action.dispatchDimension[0] = 0; action.dispatchDimension[1] = 0; action.dispatchDimension[2] = 0; @@ -2890,11 +2890,11 @@ bool WrappedVulkan::Serialise_vkCmdDrawIndirectCount(SerialiserType &ser, SDChunk *baseChunk = m_StructuredFile->chunks.back(); ActionDescription action; - action.name = name; + action.customName = name; action.flags = ActionFlags::MultiAction | ActionFlags::PushMarker; if(maxDrawCount == 0) - action.name = name + "(0)"; + action.customName = name + "(0)"; AddEvent(); AddAction(action); @@ -2914,7 +2914,7 @@ bool WrappedVulkan::Serialise_vkCmdDrawIndirectCount(SerialiserType &ser, { ActionDescription multi; - multi.name = name; + multi.customName = name; multi.flags |= ActionFlags::Drawcall | ActionFlags::Instanced | ActionFlags::Indirect; @@ -2943,7 +2943,7 @@ bool WrappedVulkan::Serialise_vkCmdDrawIndirectCount(SerialiserType &ser, } AddEvent(); - action.name = name + " end"; + action.customName = name + " end"; action.flags = ActionFlags::PopMarker; AddAction(action); } @@ -3253,11 +3253,11 @@ bool WrappedVulkan::Serialise_vkCmdDrawIndexedIndirectCount( SDChunk *baseChunk = m_StructuredFile->chunks.back(); ActionDescription action; - action.name = name; + action.customName = name; action.flags = ActionFlags::MultiAction | ActionFlags::PushMarker; if(maxDrawCount == 0) - action.name = name + "(0)"; + action.customName = name + "(0)"; AddEvent(); AddAction(action); @@ -3277,7 +3277,7 @@ bool WrappedVulkan::Serialise_vkCmdDrawIndexedIndirectCount( { ActionDescription multi; - multi.name = name; + multi.customName = name; multi.flags |= ActionFlags::Drawcall | ActionFlags::Instanced | ActionFlags::Indexed | ActionFlags::Indirect; @@ -3307,7 +3307,7 @@ bool WrappedVulkan::Serialise_vkCmdDrawIndexedIndirectCount( } AddEvent(); - action.name = name + " end"; + action.customName = name + " end"; action.flags = ActionFlags::PopMarker; AddAction(action); } @@ -3406,8 +3406,6 @@ bool WrappedVulkan::Serialise_vkCmdDrawIndirectByteCountEXT( Unwrap(counterBuffer), counterBufferOffset, counterOffset, vertexStride); - rdcstr name = "vkCmdDrawIndirectByteCountEXT"; - if(!IsDrawInRenderPass()) { AddDebugMessage(MessageCategory::Execution, MessageSeverity::High, @@ -3420,7 +3418,6 @@ bool WrappedVulkan::Serialise_vkCmdDrawIndirectByteCountEXT( AddEvent(); - action.name = name; action.instanceOffset = firstInstance; action.numInstances = instanceCount; action.flags = ActionFlags::Drawcall | ActionFlags::Instanced | ActionFlags::Indirect; diff --git a/renderdoc/driver/vulkan/wrappers/vk_queue_funcs.cpp b/renderdoc/driver/vulkan/wrappers/vk_queue_funcs.cpp index 64c6e40ae..4721b454f 100644 --- a/renderdoc/driver/vulkan/wrappers/vk_queue_funcs.cpp +++ b/renderdoc/driver/vulkan/wrappers/vk_queue_funcs.cpp @@ -268,7 +268,7 @@ void WrappedVulkan::ReplayQueueSubmit(VkQueue queue, VkSubmitInfo2KHR submitInfo ActionDescription action; { // add a fake marker - action.name = name; + action.customName = name; action.flags |= ActionFlags::CommandBufferBoundary | ActionFlags::PassBoundary | ActionFlags::BeginPass; AddEvent(); @@ -327,7 +327,7 @@ void WrappedVulkan::ReplayQueueSubmit(VkQueue queue, VkSubmitInfo2KHR submitInfo name = StringFormat::Fmt("=> %s[%u]: vkEndCommandBuffer(%s)", basename.c_str(), c, ToStr(cmd).c_str()); - action.name = name; + action.customName = name; action.flags = ActionFlags::CommandBufferBoundary | ActionFlags::PassBoundary | ActionFlags::EndPass; AddEvent(); @@ -577,7 +577,7 @@ void WrappedVulkan::InsertActionsAndRefreshIDs(BakedCmdBufferInfo &cmdBufInfo) args = &unknown; } - n.action.name = + n.action.customName = StringFormat::Fmt("vkCmdDispatchIndirect(<%u, %u, %u>)", args->x, args->y, args->z); n.action.dispatchDimension[0] = args->x; n.action.dispatchDimension[1] = args->y; @@ -721,6 +721,8 @@ void WrappedVulkan::InsertActionsAndRefreshIDs(BakedCmdBufferInfo &cmdBufInfo) // be in-lined as a single action, so we patch in-place if(!hasCount && indirectCount == 1) { + rdcstr name = GetStructuredFile().chunks[n.action.events.back().chunkIndex]->name; + bool valid = PatchIndirectDraw(0, n.indirectPatch.stride, n.indirectPatch.type, n.action, ptr, end); @@ -738,10 +740,10 @@ void WrappedVulkan::InsertActionsAndRefreshIDs(BakedCmdBufferInfo &cmdBufInfo) const char *countString = (n.indirectPatch.count > 1 ? "<1>" : "1"); if(valid) - n.action.name = StringFormat::Fmt("%s(%s) => <%u, %u>", n.action.name.c_str(), - countString, n.action.numIndices, n.action.numInstances); + n.action.customName = StringFormat::Fmt("%s(%s) => <%u, %u>", name.c_str(), countString, + n.action.numIndices, n.action.numInstances); else - n.action.name = StringFormat::Fmt("%s(%s) => ", n.action.name.c_str(), countString); + n.action.customName = StringFormat::Fmt("%s(%s) => ", name.c_str(), countString); } else { @@ -749,12 +751,14 @@ void WrappedVulkan::InsertActionsAndRefreshIDs(BakedCmdBufferInfo &cmdBufInfo) RDCASSERT(i + indirectCount < cmdBufNodes.size(), i, indirectCount, n.indirectPatch.count, cmdBufNodes.size()); + rdcstr name = GetStructuredFile().chunks[n.action.events.back().chunkIndex]->name; + // patch the count onto the root action name. The root is otherwise un-suffixed to allow // for collapsing non-multidraws and making everything generally simpler if(hasCount) - n.action.name = StringFormat::Fmt("%s(<%u>)", n.action.name.c_str(), indirectCount); + n.action.customName = StringFormat::Fmt("%s(<%u>)", name.c_str(), indirectCount); else - n.action.name = StringFormat::Fmt("%s(%u)", n.action.name.c_str(), n.indirectPatch.count); + n.action.customName = StringFormat::Fmt("%s(%u)", name.c_str(), n.indirectPatch.count); for(size_t j = 0; j < (size_t)indirectCount && i + j + 1 < cmdBufNodes.size(); j++) { @@ -763,11 +767,13 @@ void WrappedVulkan::InsertActionsAndRefreshIDs(BakedCmdBufferInfo &cmdBufInfo) bool valid = PatchIndirectDraw(j, n.indirectPatch.stride, n.indirectPatch.type, n2.action, ptr, end); + name = GetStructuredFile().chunks[n2.action.events.back().chunkIndex]->name; + if(valid) - n2.action.name = StringFormat::Fmt("%s[%zu](<%u, %u>)", n2.action.name.c_str(), j, - n2.action.numIndices, n2.action.numInstances); + n2.action.customName = StringFormat::Fmt("%s[%zu](<%u, %u>)", name.c_str(), j, + n2.action.numIndices, n2.action.numInstances); else - n2.action.name = StringFormat::Fmt("%s[%zu]()", n2.action.name.c_str(), j); + n2.action.customName = StringFormat::Fmt("%s[%zu]()", name.c_str(), j); if(ptr) ptr += n.indirectPatch.stride; @@ -1843,7 +1849,7 @@ bool WrappedVulkan::Serialise_vkQueueBeginDebugUtilsLabelEXT(SerialiserType &ser if(IsLoading(m_State)) { ActionDescription action; - action.name = Label.pLabelName ? Label.pLabelName : ""; + action.customName = Label.pLabelName ? Label.pLabelName : ""; action.flags |= ActionFlags::PushMarker; action.markerColor.x = RDCCLAMP(Label.color[0], 0.0f, 1.0f); @@ -1897,7 +1903,6 @@ bool WrappedVulkan::Serialise_vkQueueEndDebugUtilsLabelEXT(SerialiserType &ser, if(IsLoading(m_State)) { ActionDescription action; - action.name = "vkQueueEndDebugUtilsLabelEXT()"; action.flags = ActionFlags::PopMarker; AddEvent(); @@ -1947,7 +1952,7 @@ bool WrappedVulkan::Serialise_vkQueueInsertDebugUtilsLabelEXT(SerialiserType &se if(IsLoading(m_State)) { ActionDescription action; - action.name = Label.pLabelName ? Label.pLabelName : ""; + action.customName = Label.pLabelName ? Label.pLabelName : ""; action.flags |= ActionFlags::SetMarker; action.markerColor.x = RDCCLAMP(Label.color[0], 0.0f, 1.0f); diff --git a/renderdoc/driver/vulkan/wrappers/vk_wsi_funcs.cpp b/renderdoc/driver/vulkan/wrappers/vk_wsi_funcs.cpp index f806a67c4..4ca02cb3f 100644 --- a/renderdoc/driver/vulkan/wrappers/vk_wsi_funcs.cpp +++ b/renderdoc/driver/vulkan/wrappers/vk_wsi_funcs.cpp @@ -724,7 +724,7 @@ bool WrappedVulkan::Serialise_vkQueuePresentKHR(SerialiserType &ser, VkQueue que ActionDescription action; - action.name = StringFormat::Fmt("vkQueuePresentKHR(%s)", ToStr(PresentedImage).c_str()); + action.customName = StringFormat::Fmt("vkQueuePresentKHR(%s)", ToStr(PresentedImage).c_str()); action.flags |= ActionFlags::Present; m_LastPresentedImage = action.copyDestination = PresentedImage; diff --git a/renderdoc/replay/renderdoc_serialise.inl b/renderdoc/replay/renderdoc_serialise.inl index a166dcdfc..82131bdd1 100644 --- a/renderdoc/replay/renderdoc_serialise.inl +++ b/renderdoc/replay/renderdoc_serialise.inl @@ -550,7 +550,7 @@ void DoSerialise(SerialiserType &ser, ActionDescription &el) SERIALISE_MEMBER(eventId); SERIALISE_MEMBER(actionId); - SERIALISE_MEMBER(name); + SERIALISE_MEMBER(customName); SERIALISE_MEMBER(flags); diff --git a/renderdoc/replay/replay_controller.cpp b/renderdoc/replay/replay_controller.cpp index a70b836f6..f8ad0e31f 100644 --- a/renderdoc/replay/replay_controller.cpp +++ b/renderdoc/replay/replay_controller.cpp @@ -368,16 +368,16 @@ void ReplayController::AddFakeMarkers() const char *targets = actions[end].depthOut == ResourceId() ? "Targets" : "Targets + Depth"; if(copyOnly) - mark.name = StringFormat::Fmt("Copy/Clear Pass #%d", copypassID++); + mark.customName = StringFormat::Fmt("Copy/Clear Pass #%d", copypassID++); else if(actions[refaction].flags & ActionFlags::Dispatch) - mark.name = StringFormat::Fmt("Compute Pass #%d", computepassID++); + mark.customName = StringFormat::Fmt("Compute Pass #%d", computepassID++); else if(maxOutCount == 0) - mark.name = StringFormat::Fmt("Depth-only Pass #%d", depthpassID++); + mark.customName = StringFormat::Fmt("Depth-only Pass #%d", depthpassID++); else if(minOutCount == maxOutCount) - mark.name = StringFormat::Fmt("Colour Pass #%d (%d %s)", passID++, minOutCount, targets); + mark.customName = StringFormat::Fmt("Colour Pass #%d (%d %s)", passID++, minOutCount, targets); else - mark.name = StringFormat::Fmt("Colour Pass #%d (%d-%d %s)", passID++, minOutCount, - maxOutCount, targets); + mark.customName = StringFormat::Fmt("Colour Pass #%d (%d-%d %s)", passID++, minOutCount, + maxOutCount, targets); mark.children.resize(end - start + 1);