From 05367bccb78991c4540e486d72eac84373d59dfd Mon Sep 17 00:00:00 2001 From: assiduous Date: Wed, 23 Dec 2020 13:25:55 -0800 Subject: ShaderResourceLayoutVk: fixed debug check for immutable samplers --- .../GraphicsEngineVulkan/src/ShaderResourceLayoutVk.cpp | 14 ++++---------- 1 file changed, 4 insertions(+), 10 deletions(-) (limited to 'Graphics/GraphicsEngineVulkan') diff --git a/Graphics/GraphicsEngineVulkan/src/ShaderResourceLayoutVk.cpp b/Graphics/GraphicsEngineVulkan/src/ShaderResourceLayoutVk.cpp index 2a7c64d9..ab90fd0f 100644 --- a/Graphics/GraphicsEngineVulkan/src/ShaderResourceLayoutVk.cpp +++ b/Graphics/GraphicsEngineVulkan/src/ShaderResourceLayoutVk.cpp @@ -632,16 +632,10 @@ void ShaderResourceLayoutVk::Initialize(IRenderDevice* pRende { // NB: for immutable separate samplers we still allocate VkResource instances, but they are never exposed to the app auto& ImmutableSampler = ResLayout.GetImmutableSampler(CurrImmutableSamplerInd[ShaderInd]++); - if (!ImmutableSampler) // There may be multiple immutable samplers with the same name in ray tracing shaders - { - const auto& ImmutableSamplerDesc = ResourceLayoutDesc.ImmutableSamplers[SrcImmutableSamplerInd].Desc; - pRenderDevice->CreateSampler(ImmutableSamplerDesc, &ImmutableSampler); - } - else - { - VERIFY((ShaderType & RAY_TRACING_SHADER_TYPES) != 0, - "Multiple immutable samplers with the same name in one stage are only possible in ray tracing pipeliens."); - } + VERIFY(!ImmutableSampler, "Immutable sampler has already been initialized. This is unexpected " + "as all resources are deduplicated and should only be initialized once."); + const auto& ImmutableSamplerDesc = ResourceLayoutDesc.ImmutableSamplers[SrcImmutableSamplerInd].Desc; + pRenderDevice->CreateSampler(ImmutableSamplerDesc, &ImmutableSampler); vkImmutableSampler = ImmutableSampler.RawPtr()->GetVkSampler(); } } -- cgit v1.2.3