From c03fae535f3e5080906c43690e800ae34572278c Mon Sep 17 00:00:00 2001 From: Egor Yusov Date: Tue, 26 Feb 2019 22:49:28 -0800 Subject: Updating some files to match the new API --- Graphics/GLSLTools/include/GLSLSourceBuilder.h | 2 +- Graphics/GLSLTools/include/SPIRVUtils.h | 2 +- Graphics/GLSLTools/src/GLSLSourceBuilder.cpp | 2 +- Graphics/GLSLTools/src/SPIRVShaderResources.cpp | 12 ++++++++++++ Graphics/GLSLTools/src/SPIRVUtils.cpp | 2 +- 5 files changed, 16 insertions(+), 4 deletions(-) (limited to 'Graphics/GLSLTools') diff --git a/Graphics/GLSLTools/include/GLSLSourceBuilder.h b/Graphics/GLSLTools/include/GLSLSourceBuilder.h index bfd6e55c..958f0faf 100644 --- a/Graphics/GLSLTools/include/GLSLSourceBuilder.h +++ b/Graphics/GLSLTools/include/GLSLSourceBuilder.h @@ -36,7 +36,7 @@ enum TargetGLSLCompiler driver }; -String BuildGLSLSourceString(const ShaderCreationAttribs& CreationAttribs, +String BuildGLSLSourceString(const ShaderCreateInfo& CreationAttribs, const DeviceCaps& deviceCaps, TargetGLSLCompiler TargetCompiler, const char* ExtraDefinitions = nullptr); diff --git a/Graphics/GLSLTools/include/SPIRVUtils.h b/Graphics/GLSLTools/include/SPIRVUtils.h index 75fa8108..3859a587 100644 --- a/Graphics/GLSLTools/include/SPIRVUtils.h +++ b/Graphics/GLSLTools/include/SPIRVUtils.h @@ -33,6 +33,6 @@ namespace Diligent void InitializeGlslang(); void FinalizeGlslang(); std::vector GLSLtoSPIRV(SHADER_TYPE ShaderType, const char* ShaderSource, int SourceCodeLen, IDataBlob** ppCompilerOutput); -std::vector HLSLtoSPIRV(const ShaderCreationAttribs& Attribs, IDataBlob** ppCompilerOutput); +std::vector HLSLtoSPIRV(const ShaderCreateInfo& Attribs, IDataBlob** ppCompilerOutput); } \ No newline at end of file diff --git a/Graphics/GLSLTools/src/GLSLSourceBuilder.cpp b/Graphics/GLSLTools/src/GLSLSourceBuilder.cpp index 905ecfa1..2da42437 100644 --- a/Graphics/GLSLTools/src/GLSLSourceBuilder.cpp +++ b/Graphics/GLSLTools/src/GLSLSourceBuilder.cpp @@ -33,7 +33,7 @@ namespace Diligent { -String BuildGLSLSourceString(const ShaderCreationAttribs& CreationAttribs, +String BuildGLSLSourceString(const ShaderCreateInfo& CreationAttribs, const DeviceCaps& deviceCaps, TargetGLSLCompiler TargetCompiler, const char* ExtraDefinitions) diff --git a/Graphics/GLSLTools/src/SPIRVShaderResources.cpp b/Graphics/GLSLTools/src/SPIRVShaderResources.cpp index 4f733103..8c8f673f 100644 --- a/Graphics/GLSLTools/src/SPIRVShaderResources.cpp +++ b/Graphics/GLSLTools/src/SPIRVShaderResources.cpp @@ -392,6 +392,18 @@ SPIRVShaderResources::SPIRVShaderResources(IMemoryAllocator& Allocator, VERIFY(m_ResourceNames.GetRemainingSize() == 0, "Names pool must be empty"); //LOG_INFO_MESSAGE(DumpResources()); + +#ifdef DEVELOPMENT + if (CombinedSamplerSuffix != nullptr) + { + for (Uint32 n=0; n < GetNumSepSmplrs(); ++n) + { + const auto& SepSmplr = GetSepSmplr(n); + if (!SepSmplr.IsValidSepImageAssigned()) + LOG_ERROR_MESSAGE("Shader '", shaderDesc.Name, "' uses combined texture samplers, but separate sampler '", SepSmplr.Name, "' is not assigned to any texture"); + } + } +#endif } void SPIRVShaderResources::Initialize(IMemoryAllocator& Allocator, diff --git a/Graphics/GLSLTools/src/SPIRVUtils.cpp b/Graphics/GLSLTools/src/SPIRVUtils.cpp index 9f9a7d88..894560fe 100644 --- a/Graphics/GLSLTools/src/SPIRVUtils.cpp +++ b/Graphics/GLSLTools/src/SPIRVUtils.cpp @@ -411,7 +411,7 @@ private: std::unordered_map> m_DataBlobs; }; -std::vector HLSLtoSPIRV(const ShaderCreationAttribs& Attribs, IDataBlob** ppCompilerOutput) +std::vector HLSLtoSPIRV(const ShaderCreateInfo& Attribs, IDataBlob** ppCompilerOutput) { EShLanguage ShLang = ShaderTypeToShLanguage(Attribs.Desc.ShaderType); glslang::TShader Shader(ShLang); -- cgit v1.2.3