mirror of
https://github.com/baldurk/renderdoc.git
synced 2026-08-16 19:46:40 +00:00
Stringify ResourceIds consistently as "ResourceId::12345"
* This means even strings generated in the core code will become richtext in the UI.
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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<ResourceId>() || re.match(var.toString()).hasMatch())
|
||||
{
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user