From b1bac52d792f348c8a5be7d85bae070d2322479d Mon Sep 17 00:00:00 2001 From: Egor Yusov Date: Thu, 25 Oct 2018 08:44:11 -0700 Subject: Some improvements D3D shader resource management --- Graphics/GraphicsEngineD3D12/src/ShaderResourceLayoutD3D12.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'Graphics/GraphicsEngineD3D12') diff --git a/Graphics/GraphicsEngineD3D12/src/ShaderResourceLayoutD3D12.cpp b/Graphics/GraphicsEngineD3D12/src/ShaderResourceLayoutD3D12.cpp index 8d167663..c1f29af4 100644 --- a/Graphics/GraphicsEngineD3D12/src/ShaderResourceLayoutD3D12.cpp +++ b/Graphics/GraphicsEngineD3D12/src/ShaderResourceLayoutD3D12.cpp @@ -271,7 +271,11 @@ void ShaderResourceLayoutD3D12::Initialize(ID3D12Device* if (strcmp(Sampler.Attribs.Name, SamplerAttribs.Name) == 0) break; } - VERIFY(SamplerId < SamplerCount, "Unable to find assigned sampler"); + if (SamplerId == SamplerCount) + { + LOG_ERROR("Unable to find sampler '", SamplerAttribs.Name, "' assigned to texture SRV '", TexSRV.Name, "' in the list of already created resources. This seems to be a bug."); + SamplerId = D3D12Resource::InvalidSamplerId; + } VERIFY(SamplerId <= D3D12Resource::MaxSamplerId, "Sampler index excceeds allowed limit"); } } -- cgit v1.2.3