summaryrefslogtreecommitdiffstats
path: root/Graphics/GLSLTools
diff options
context:
space:
mode:
authorEgor Yusov <egor.yusov@gmail.com>2018-10-17 16:26:27 +0000
committerEgor Yusov <egor.yusov@gmail.com>2018-10-17 16:26:27 +0000
commit435f70be7aebd9a669d6a276df67e8eb814a45e3 (patch)
tree040377c1ac3201fef75c01e9e3535a172babbcb1 /Graphics/GLSLTools
parentImproved StrCmpSuff() to allow optional suffix (diff)
downloadDiligentCore-435f70be7aebd9a669d6a276df67e8eb814a45e3.tar.gz
DiligentCore-435f70be7aebd9a669d6a276df67e8eb814a45e3.zip
Implemented separate samplers in D3D11
Diffstat (limited to 'Graphics/GLSLTools')
-rw-r--r--Graphics/GLSLTools/src/GLSLSourceBuilder.cpp4
-rw-r--r--Graphics/GLSLTools/src/SPIRVShaderResources.cpp4
2 files changed, 6 insertions, 2 deletions
diff --git a/Graphics/GLSLTools/src/GLSLSourceBuilder.cpp b/Graphics/GLSLTools/src/GLSLSourceBuilder.cpp
index d08eafb8..b8c4a95d 100644
--- a/Graphics/GLSLTools/src/GLSLSourceBuilder.cpp
+++ b/Graphics/GLSLTools/src/GLSLSourceBuilder.cpp
@@ -230,6 +230,10 @@ String BuildGLSLSourceString(const ShaderCreationAttribs& CreationAttribs, Targe
if (CreationAttribs.SourceLanguage == SHADER_SOURCE_LANGUAGE_HLSL)
{
+ if (!CreationAttribs.UseCombinedTextureSamplers)
+ {
+ LOG_ERROR_AND_THROW("Combined texture samplers are required to convert HLSL source to GLSL");
+ }
// Convert HLSL to GLSL
const auto &Converter = HLSL2GLSLConverterImpl::GetInstance();
HLSL2GLSLConverterImpl::ConversionAttribs Attribs;
diff --git a/Graphics/GLSLTools/src/SPIRVShaderResources.cpp b/Graphics/GLSLTools/src/SPIRVShaderResources.cpp
index eda4a18f..45a63b07 100644
--- a/Graphics/GLSLTools/src/SPIRVShaderResources.cpp
+++ b/Graphics/GLSLTools/src/SPIRVShaderResources.cpp
@@ -80,7 +80,7 @@ static Int32 FindStaticSampler(const ShaderDesc& shaderDesc, const std::string&
for(Uint32 s=0; s < shaderDesc.NumStaticSamplers; ++s)
{
const auto& StSam = shaderDesc.StaticSamplers[s];
- if(SamplerName.compare(StSam.TextureName) == 0)
+ if (SamplerName.compare(StSam.SamplerOrTextureName) == 0)
return s;
}
@@ -282,7 +282,7 @@ SPIRVShaderResources::SPIRVShaderResources(IMemoryAllocator& Allocator,
for (Uint32 s = 0; s < shaderDesc.NumStaticSamplers; ++s)
{
bool SamplerFound = false;
- const auto *SamName = shaderDesc.StaticSamplers[s].TextureName;
+ const auto* SamName = shaderDesc.StaticSamplers[s].SamplerOrTextureName;
for (Uint32 i = 0; i < GetNumSmplImgs(); ++i)
{
const auto &SmplImg = GetSmplImg(i);