diff options
| author | Egor Yusov <egor.yusov@gmail.com> | 2019-08-11 02:39:09 +0000 |
|---|---|---|
| committer | Egor Yusov <egor.yusov@gmail.com> | 2019-08-11 02:39:09 +0000 |
| commit | 1e2632939aa072ca549416aaa57f767f34d28b1b (patch) | |
| tree | de6ee9ef11860af9e01fc2d7e114cc587fe629ad /Graphics/GLSLTools | |
| parent | OpenGL backend: fixed formatted buffer views not addressing the entire buffer (diff) | |
| download | DiligentCore-1e2632939aa072ca549416aaa57f767f34d28b1b.tar.gz DiligentCore-1e2632939aa072ca549416aaa57f767f34d28b1b.zip | |
Fixed issue with reflecting Uniform Texel Buffers in Vulkan backend
Diffstat (limited to 'Graphics/GLSLTools')
| -rw-r--r-- | Graphics/GLSLTools/src/SPIRVShaderResources.cpp | 17 |
1 files changed, 15 insertions, 2 deletions
diff --git a/Graphics/GLSLTools/src/SPIRVShaderResources.cpp b/Graphics/GLSLTools/src/SPIRVShaderResources.cpp index 10752550..5d701294 100644 --- a/Graphics/GLSLTools/src/SPIRVShaderResources.cpp +++ b/Graphics/GLSLTools/src/SPIRVShaderResources.cpp @@ -402,6 +402,11 @@ SPIRVShaderResources::SPIRVShaderResources(IMemoryAllocator& Allocator, Uint32 CurrSepImg = 0; for (const auto& SepImg : resources.separate_images) { + const auto& type = Compiler.get_type(SepImg.type_id); + auto ResType = type.image.dim == spv::DimBuffer ? + SPIRVShaderResourceAttribs::ResourceType::UniformTexelBuffer : + SPIRVShaderResourceAttribs::ResourceType::SeparateImage; + Uint32 SamplerInd = SPIRVShaderResourceAttribs::InvalidSepSmplrOrImgInd; if (CombinedSamplerSuffix != nullptr) { @@ -417,14 +422,22 @@ SPIRVShaderResources::SPIRVShaderResources(IMemoryAllocator& Allocator, } if (SamplerInd == NumSepSmpls) SamplerInd = SPIRVShaderResourceAttribs::InvalidSepSmplrOrImgInd; + else + { + if (ResType == SPIRVShaderResourceAttribs::ResourceType::UniformTexelBuffer) + { + LOG_WARNING_MESSAGE("Combined image sampler assigned to uniform texel buffer '", SepImg.name, "' will be ignored"); + SamplerInd = SPIRVShaderResourceAttribs::InvalidSepSmplrOrImgInd; + } + } } auto* pNewSepImg = new (&GetSepImg(CurrSepImg++)) SPIRVShaderResourceAttribs(Compiler, SepImg, m_ResourceNames.CopyString(SepImg.name), - SPIRVShaderResourceAttribs::ResourceType::SeparateImage, + ResType, SamplerInd); - if (pNewSepImg->IsValidSepSamplerAssigned()) + if (ResType == SPIRVShaderResourceAttribs::ResourceType::SeparateImage && pNewSepImg->IsValidSepSamplerAssigned()) { #ifdef DEVELOPMENT const auto& SepSmplr = GetSepSmplr(pNewSepImg->GetAssignedSepSamplerInd()); |
