mirror of
https://github.com/baldurk/renderdoc.git
synced 2026-05-13 05:20:45 +00:00
Support resource naming
This commit is contained in:
@@ -566,6 +566,7 @@ bool WrappedID3D12Device::Serialise_WrapSwapchainBuffer(WrappedIDXGISwapChain3 *
|
||||
WrappedID3D12Resource *wrapped = new WrappedID3D12Resource(fakeBB, this);
|
||||
fakeBB = wrapped;
|
||||
|
||||
m_ResourceNames[TexID] = "Swap Chain Buffer";
|
||||
fakeBB->SetName(L"Swap Chain Buffer");
|
||||
|
||||
GetResourceManager()->AddLiveResource(TexID, fakeBB);
|
||||
@@ -1231,6 +1232,8 @@ bool WrappedID3D12Device::Serialise_SetResourceName(ID3D12DeviceChild *res, cons
|
||||
{
|
||||
ID3D12DeviceChild *r = GetResourceManager()->GetLiveResource(resource);
|
||||
|
||||
m_ResourceNames[resource] = name;
|
||||
|
||||
r->SetName(StringFormat::UTF82Wide(name).c_str());
|
||||
}
|
||||
|
||||
|
||||
@@ -278,6 +278,8 @@ private:
|
||||
map<ResourceId, SubresourceStateVector> m_ResourceStates;
|
||||
Threading::CriticalSection m_ResourceStatesLock;
|
||||
|
||||
map<ResourceId, string> m_ResourceNames;
|
||||
|
||||
struct SwapPresentInfo
|
||||
{
|
||||
D3D12_CPU_DESCRIPTOR_HANDLE rtvs[8];
|
||||
@@ -321,6 +323,7 @@ public:
|
||||
FetchFrameRecord &GetFrameRecord() { return m_FrameRecord; }
|
||||
const FetchDrawcall *GetDrawcall(uint32_t eventID);
|
||||
|
||||
const string &GetResourceName(ResourceId id) { return m_ResourceNames[id]; }
|
||||
vector<D3D12_RESOURCE_STATES> &GetSubresourceStates(ResourceId id)
|
||||
{
|
||||
return m_ResourceStates[id];
|
||||
|
||||
@@ -96,7 +96,7 @@ FetchBuffer D3D12Replay::GetBuffer(ResourceId id)
|
||||
D3D12_RESOURCE_DESC desc = it->second->GetDesc();
|
||||
|
||||
ret.customName = true;
|
||||
string str = ""; // TODO GetName(it.second);
|
||||
string str = m_pDevice->GetResourceName(ret.ID);
|
||||
|
||||
if(str == "")
|
||||
{
|
||||
@@ -174,7 +174,7 @@ FetchTexture D3D12Replay::GetTexture(ResourceId id)
|
||||
}
|
||||
|
||||
ret.customName = true;
|
||||
string str = ""; // TODO GetName(it.second);
|
||||
string str = m_pDevice->GetResourceName(ret.ID);
|
||||
|
||||
if(str == "")
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user