mirror of
https://github.com/baldurk/renderdoc.git
synced 2026-07-28 10:21:48 +00:00
Use resource class as part of key for caching resource info
This commit is contained in:
@@ -1947,10 +1947,11 @@ bool D3D12APIWrapper::QueuedOpsHasSpace() const
|
||||
}
|
||||
|
||||
// Called from any thread
|
||||
bool D3D12APIWrapper::IsResourceInfoCached(const DXDebug::BindingSlot &slot, uint32_t mipLevel)
|
||||
bool D3D12APIWrapper::IsResourceInfoCached(DXIL::ResourceClass resClass,
|
||||
const DXDebug::BindingSlot &slot, uint32_t mipLevel)
|
||||
{
|
||||
SCOPED_READLOCK(m_ResourceInfosLock);
|
||||
ResourceInfoMiplevel resInfoMip = {slot, mipLevel};
|
||||
ResourceInfoMiplevel resInfoMip = {resClass, slot, mipLevel};
|
||||
return m_ResourceInfos.find(resInfoMip) != m_ResourceInfos.end();
|
||||
}
|
||||
|
||||
@@ -1959,7 +1960,7 @@ bool D3D12APIWrapper::IsResourceInfoCached(const DXDebug::BindingSlot &slot, uin
|
||||
ShaderVariable D3D12APIWrapper::GetResourceInfo(DXIL::ResourceClass resClass,
|
||||
const DXDebug::BindingSlot &slot, uint32_t mipLevel)
|
||||
{
|
||||
ResourceInfoMiplevel resInfoMip = {slot, mipLevel};
|
||||
ResourceInfoMiplevel resInfoMip = {resClass, slot, mipLevel};
|
||||
{
|
||||
SCOPED_READLOCK(m_ResourceInfosLock);
|
||||
auto it = m_ResourceInfos.find(resInfoMip);
|
||||
|
||||
@@ -80,7 +80,8 @@ public:
|
||||
bool IsCBVCached(const DXDebug::BindingSlot &slot) const override;
|
||||
bool IsSRVCached(const DXDebug::BindingSlot &slot) const override;
|
||||
bool IsUAVCached(const DXDebug::BindingSlot &slot) const override;
|
||||
bool IsResourceInfoCached(const DXDebug::BindingSlot &slot, uint32_t mipLevel) override;
|
||||
bool IsResourceInfoCached(DXIL::ResourceClass resClass, const DXDebug::BindingSlot &slot,
|
||||
uint32_t mipLevel) override;
|
||||
bool IsSampleInfoCached(const DXDebug::BindingSlot &slot) override;
|
||||
bool IsRenderTargetSampleInfoCached() override;
|
||||
bool IsResourceReferenceInfoCached(const DXDebug::BindingSlot &slot) override;
|
||||
@@ -166,19 +167,22 @@ private:
|
||||
|
||||
struct ResourceInfoMiplevel
|
||||
{
|
||||
DXIL::ResourceClass resClass;
|
||||
BindingSlot slot;
|
||||
uint32_t mipLevel;
|
||||
|
||||
bool operator<(const ResourceInfoMiplevel &o) const
|
||||
{
|
||||
if(mipLevel == o.mipLevel)
|
||||
if(resClass != o.resClass)
|
||||
return resClass < o.resClass;
|
||||
if(!(slot == o.slot))
|
||||
return slot < o.slot;
|
||||
return mipLevel < o.mipLevel;
|
||||
}
|
||||
|
||||
bool operator==(const ResourceInfoMiplevel &o) const
|
||||
{
|
||||
return slot == o.slot && mipLevel == o.mipLevel;
|
||||
return resClass == o.resClass && slot == o.slot && mipLevel == o.mipLevel;
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
@@ -10600,7 +10600,7 @@ DeviceOpResult Debugger::GetResourceInfo(DXIL::ResourceClass resClass,
|
||||
const DXDebug::BindingSlot &slot, uint32_t mipLevel,
|
||||
ShaderVariable &result) const
|
||||
{
|
||||
if(!IsDeviceThread() && !m_ApiWrapper->IsResourceInfoCached(slot, mipLevel))
|
||||
if(!IsDeviceThread() && !m_ApiWrapper->IsResourceInfoCached(resClass, slot, mipLevel))
|
||||
return DeviceOpResult::NeedsDevice;
|
||||
|
||||
result = m_ApiWrapper->GetResourceInfo(resClass, slot, mipLevel);
|
||||
|
||||
@@ -343,7 +343,8 @@ public:
|
||||
virtual bool IsCBVCached(const DXDebug::BindingSlot &slot) const = 0;
|
||||
virtual bool IsSRVCached(const DXDebug::BindingSlot &slot) const = 0;
|
||||
virtual bool IsUAVCached(const DXDebug::BindingSlot &slot) const = 0;
|
||||
virtual bool IsResourceInfoCached(const DXDebug::BindingSlot &slot, uint32_t mipLevel) = 0;
|
||||
virtual bool IsResourceInfoCached(DXIL::ResourceClass resClass, const DXDebug::BindingSlot &slot,
|
||||
uint32_t mipLevel) = 0;
|
||||
virtual bool IsSampleInfoCached(const DXDebug::BindingSlot &slot) = 0;
|
||||
virtual bool IsRenderTargetSampleInfoCached() = 0;
|
||||
virtual bool IsResourceReferenceInfoCached(const DXDebug::BindingSlot &slot) = 0;
|
||||
|
||||
Reference in New Issue
Block a user