diff options
| author | assiduous <assiduous@diligentgraphics.com> | 2020-12-23 21:25:55 +0000 |
|---|---|---|
| committer | assiduous <assiduous@diligentgraphics.com> | 2020-12-23 21:25:55 +0000 |
| commit | 05367bccb78991c4540e486d72eac84373d59dfd (patch) | |
| tree | e830386954168cd75c17f0a3d1fe97c3e830d7e7 /Graphics/GraphicsEngineVulkan | |
| parent | ShaderResourceLayoutVk: a number of minor updates (diff) | |
| download | DiligentCore-05367bccb78991c4540e486d72eac84373d59dfd.tar.gz DiligentCore-05367bccb78991c4540e486d72eac84373d59dfd.zip | |
ShaderResourceLayoutVk: fixed debug check for immutable samplers
Diffstat (limited to 'Graphics/GraphicsEngineVulkan')
| -rw-r--r-- | Graphics/GraphicsEngineVulkan/src/ShaderResourceLayoutVk.cpp | 14 |
1 files changed, 4 insertions, 10 deletions
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<SamplerVkImpl>()->GetVkSampler(); } } |
