From fa7dbbfaf8819f55926285a27f92dfac3fd62a10 Mon Sep 17 00:00:00 2001 From: Egor Yusov Date: Thu, 25 Oct 2018 20:58:06 -0700 Subject: Fixed false warning about missing static samplers in VK --- Graphics/GLSLTools/src/SPIRVShaderResources.cpp | 19 +++++++++---------- 1 file changed, 9 insertions(+), 10 deletions(-) (limited to 'Graphics/GLSLTools') diff --git a/Graphics/GLSLTools/src/SPIRVShaderResources.cpp b/Graphics/GLSLTools/src/SPIRVShaderResources.cpp index 6b348981..b0b7055f 100644 --- a/Graphics/GLSLTools/src/SPIRVShaderResources.cpp +++ b/Graphics/GLSLTools/src/SPIRVShaderResources.cpp @@ -330,22 +330,21 @@ SPIRVShaderResources::SPIRVShaderResources(IMemoryAllocator& Allocator, { const auto* SamName = shaderDesc.StaticSamplers[s].SamplerOrTextureName; bool SamplerFound = false; - if (CombinedSamplerSuffix != nullptr) + + for (Uint32 i = 0; i < GetNumSmpldImgs(); ++i) { - for (Uint32 i = 0; i < GetNumSmpldImgs(); ++i) - { - const auto& SmplImg = GetSmpldImg(i); - SamplerFound = (strcmp(SmplImg.Name, SamName) == 0); - if (SamplerFound) - break; - } + const auto& SmplImg = GetSmpldImg(i); + SamplerFound = (strcmp(SmplImg.Name, SamName) == 0); + if (SamplerFound) + break; } - else + + if (!SamplerFound) { for (Uint32 i = 0; i < GetNumSepSmplrs(); ++i) { const auto& SepSmpl = GetSepSmplr(i); - SamplerFound = (strcmp(SepSmpl.Name, SamName) == 0); + SamplerFound = StreqSuff(SepSmpl.Name, SamName, CombinedSamplerSuffix); if (SamplerFound) break; } -- cgit v1.2.3