From 05362d27cef0eae217d399e8fca90396fa76ea75 Mon Sep 17 00:00:00 2001 From: Egor Yusov Date: Sun, 13 Jan 2019 17:27:05 -0800 Subject: Fixed bug in ShaderResourceLayoutD3D12::D3D12Resource::IsBound() --- Graphics/GraphicsEngineD3D12/src/ShaderResourceLayoutD3D12.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'Graphics/GraphicsEngineD3D12') diff --git a/Graphics/GraphicsEngineD3D12/src/ShaderResourceLayoutD3D12.cpp b/Graphics/GraphicsEngineD3D12/src/ShaderResourceLayoutD3D12.cpp index 4e75557c..eada5310 100644 --- a/Graphics/GraphicsEngineD3D12/src/ShaderResourceLayoutD3D12.cpp +++ b/Graphics/GraphicsEngineD3D12/src/ShaderResourceLayoutD3D12.cpp @@ -675,7 +675,9 @@ bool ShaderResourceLayoutD3D12::D3D12Resource::IsBound(Uint32 ArrayIndex, const const auto& RootTable = ResourceCache.GetRootTable(RootIndex); if(OffsetFromTableStart + ArrayIndex < RootTable.GetSize()) { - const auto& CachedRes = RootTable.GetResource(OffsetFromTableStart + ArrayIndex, D3D12_DESCRIPTOR_HEAP_TYPE_CBV_SRV_UAV, ParentResLayout.m_pResources->GetShaderType()); + const auto& CachedRes = RootTable.GetResource(OffsetFromTableStart + ArrayIndex, + GetResType() == CachedResourceType::Sampler ? D3D12_DESCRIPTOR_HEAP_TYPE_SAMPLER : D3D12_DESCRIPTOR_HEAP_TYPE_CBV_SRV_UAV, + ParentResLayout.m_pResources->GetShaderType()); if( CachedRes.pObject != nullptr ) { VERIFY(CachedRes.CPUDescriptorHandle.ptr != 0 || CachedRes.pObject.RawPtr()->GetDesc().Usage == USAGE_DYNAMIC, "No relevant descriptor handle"); -- cgit v1.2.3