From 8368f9b8bed7ef21a2c1c1c581eb24090f7ef3b5 Mon Sep 17 00:00:00 2001 From: baldurk Date: Tue, 13 Feb 2018 17:17:48 +0000 Subject: [PATCH] Stringify ResourceIds consistently as "ResourceId::12345" * This means even strings generated in the core code will become richtext in the UI. --- qrenderdoc/Code/CaptureContext.cpp | 4 ++-- qrenderdoc/Code/QRDUtils.cpp | 4 ++-- renderdoc/core/core.cpp | 2 +- renderdoc/driver/d3d12/d3d12_command_list_wrap.cpp | 6 +++--- 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/qrenderdoc/Code/CaptureContext.cpp b/qrenderdoc/Code/CaptureContext.cpp index 444c6ecd9..3e221ae6a 100644 --- a/qrenderdoc/Code/CaptureContext.cpp +++ b/qrenderdoc/Code/CaptureContext.cpp @@ -1001,9 +1001,9 @@ void CaptureContext::LoadRenames(const QString &data) { ResourceId id; - if(str.startsWith(lit("resourceid::"))) + if(str.startsWith(lit("ResourceId::"))) { - qulonglong num = str.mid(sizeof("resourceid::") - 1).toULongLong(); + qulonglong num = str.mid(sizeof("ResourceId::") - 1).toULongLong(); memcpy(&id, &num, sizeof(num)); } else diff --git a/qrenderdoc/Code/QRDUtils.cpp b/qrenderdoc/Code/QRDUtils.cpp index 66664cd86..3b98b5658 100644 --- a/qrenderdoc/Code/QRDUtils.cpp +++ b/qrenderdoc/Code/QRDUtils.cpp @@ -64,7 +64,7 @@ std::string DoStringise(const ResourceId &el) { uint64_t num; memcpy(&num, &el, sizeof(num)); - return lit("resourceid::%1").arg(num).toStdString(); + return lit("ResourceId::%1").arg(num).toStdString(); } struct RichResourceText @@ -180,7 +180,7 @@ void RegisterMetatypeConversions() void RichResourceTextInitialise(QVariant &var) { - static QRegularExpression re(lit("(resourceid::)([0-9]*)")); + static QRegularExpression re(lit("(ResourceId::)([0-9]*)")); if(var.userType() == qMetaTypeId() || re.match(var.toString()).hasMatch()) { diff --git a/renderdoc/core/core.cpp b/renderdoc/core/core.cpp index bf9b4b5d4..6a24f270e 100644 --- a/renderdoc/core/core.cpp +++ b/renderdoc/core/core.cpp @@ -45,7 +45,7 @@ std::string DoStringise(const ResourceId &el) { RDCCOMPILE_ASSERT(sizeof(el) == sizeof(uint64_t), "ResourceId is no longer 1:1 with uint64_t"); - return StringFormat::Fmt("ResourceId(%llu)", el); + return StringFormat::Fmt("ResourceId::%llu", el); } BASIC_TYPE_SERIALISE_STRINGIFY(ResourceId, (uint64_t &)el, SDBasic::UnsignedInteger, 8); diff --git a/renderdoc/driver/d3d12/d3d12_command_list_wrap.cpp b/renderdoc/driver/d3d12/d3d12_command_list_wrap.cpp index b388d2c59..8745672e0 100644 --- a/renderdoc/driver/d3d12/d3d12_command_list_wrap.cpp +++ b/renderdoc/driver/d3d12/d3d12_command_list_wrap.cpp @@ -3762,7 +3762,7 @@ void WrappedID3D12GraphicsCommandList::PatchExecuteIndirect(BakedCmdListInfo &in buf->AddChild(makeSDObject("Offset", offs)); buf->data.children[0]->type.flags |= SDTypeFlags::HasCustomString; - buf->data.children[0]->data.str = ToStr(id); + buf->data.children[0]->data.str = ToStr(GetResourceManager()->GetOriginalID(id)); command->AddChild(buf); } @@ -3811,7 +3811,7 @@ void WrappedID3D12GraphicsCommandList::PatchExecuteIndirect(BakedCmdListInfo &in buf->AddChild(makeSDObject("Offset", offs)); buf->data.children[0]->type.flags |= SDTypeFlags::HasCustomString; - buf->data.children[0]->data.str = ToStr(id); + buf->data.children[0]->data.str = ToStr(GetResourceManager()->GetOriginalID(id)); command->AddChild(buf); } @@ -3867,7 +3867,7 @@ void WrappedID3D12GraphicsCommandList::PatchExecuteIndirect(BakedCmdListInfo &in buf->AddChild(makeSDObject("Offset", offs)); buf->data.children[0]->type.flags |= SDTypeFlags::HasCustomString; - buf->data.children[0]->data.str = ToStr(id); + buf->data.children[0]->data.str = ToStr(GetResourceManager()->GetOriginalID(id)); fakeChunk->AddChild(buf); }