Support resource naming

This commit is contained in:
baldurk
2016-07-31 19:00:12 +07:00
parent cdde7606a8
commit 77e9030e55
3 changed files with 8 additions and 2 deletions
+3
View File
@@ -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());
}
+3
View File
@@ -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];
+2 -2
View File
@@ -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 == "")
{