mirror of
https://github.com/baldurk/renderdoc.git
synced 2026-05-29 21:30:53 +00:00
Track resources created with a cubemap SRV, to mark them as cubemaps
This commit is contained in:
@@ -299,6 +299,8 @@ private:
|
||||
map<ResourceId, SubresourceStateVector> m_ResourceStates;
|
||||
Threading::CriticalSection m_ResourceStatesLock;
|
||||
|
||||
set<ResourceId> m_Cubemaps;
|
||||
|
||||
map<ResourceId, string> m_ResourceNames;
|
||||
|
||||
struct SwapPresentInfo
|
||||
@@ -362,6 +364,7 @@ public:
|
||||
ID3D12CommandAllocator *GetAlloc() { return m_Alloc; }
|
||||
void ApplyBarriers(vector<D3D12_RESOURCE_BARRIER> &barriers);
|
||||
|
||||
bool IsCubemap(ResourceId id) { return m_Cubemaps.find(id) != m_Cubemaps.end(); }
|
||||
// returns thread-local temporary memory
|
||||
byte *GetTempMemory(size_t s);
|
||||
template <class T>
|
||||
|
||||
@@ -674,6 +674,14 @@ void WrappedID3D12Device::CreateShaderResourceView(ID3D12Resource *pResource,
|
||||
{
|
||||
GetWrapped(DestDescriptor)->Init(pResource, pDesc);
|
||||
}
|
||||
|
||||
if(m_State < WRITING && pDesc)
|
||||
{
|
||||
if(pDesc->ViewDimension == D3D12_SRV_DIMENSION_TEXTURECUBE ||
|
||||
pDesc->ViewDimension == D3D12_SRV_DIMENSION_TEXTURECUBEARRAY)
|
||||
m_Cubemaps.insert(GetResID(pResource));
|
||||
}
|
||||
|
||||
return m_pDevice->CreateShaderResourceView(Unwrap(pResource), pDesc, Unwrap(DestDescriptor));
|
||||
}
|
||||
|
||||
|
||||
@@ -170,8 +170,7 @@ FetchTexture D3D12Replay::GetTexture(ResourceId id)
|
||||
case 3: ret.resType = eResType_Texture3D; break;
|
||||
}
|
||||
|
||||
D3D12NOTIMP("Texture cubemap-ness from implicit usage");
|
||||
ret.cubemap = false; // eResType_TextureCube, eResType_TextureCubeArray
|
||||
ret.cubemap = m_pDevice->IsCubemap(id);
|
||||
|
||||
ret.creationFlags = eTextureCreate_SRV;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user