From a63e7f562d6df72472aefd84f60b22954d051b28 Mon Sep 17 00:00:00 2001 From: Egor Yusov Date: Thu, 18 Oct 2018 08:41:45 -0700 Subject: Added support for combined texture samplers --- RenderScript/src/ShaderParser.cpp | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) (limited to 'RenderScript/src/ShaderParser.cpp') diff --git a/RenderScript/src/ShaderParser.cpp b/RenderScript/src/ShaderParser.cpp index fb3e8ff..487efb4 100644 --- a/RenderScript/src/ShaderParser.cpp +++ b/RenderScript/src/ShaderParser.cpp @@ -183,9 +183,9 @@ namespace Diligent // Push the table from the top into the parent table lua_settable( L, -3 ); // Stack: +1 - // Push "TextureName" field - lua_pushstring( L, "TextureName" ); // Stack: +2 - lua_pushstring( L, SamDesc.TextureName); // Stack: +3 + // Push "SamplerOrTextureName" field + lua_pushstring( L, "SamplerOrTextureName" ); // Stack: +2 + lua_pushstring( L, SamDesc.SamplerOrTextureName); // Stack: +3 lua_settable( L, -3 ); // Stack: +1 } ); @@ -233,7 +233,7 @@ namespace Diligent } ); } - else if (strcmp(Key, "TextureName") == 0) + else if (strcmp(Key, "SamplerOrTextureName") == 0) { auto Name = ReadValueFromLua(L, TblStackInd); StaticSamplerTexNamesBuffer[CurrIndex] = Name; @@ -252,7 +252,7 @@ namespace Diligent for(size_t v=0; v < StaticSamplersBuffer.size(); ++v) { - StaticSamplersBuffer[v].TextureName = StaticSamplerTexNamesBuffer[v].c_str(); + StaticSamplersBuffer[v].SamplerOrTextureName = StaticSamplerTexNamesBuffer[v].c_str(); } auto &StaticSamplers = GetMemberByOffest( pBasePointer, m_MemberOffset); @@ -339,6 +339,9 @@ namespace Diligent DEFINE_BUFFERED_STRING_BINDER( m_Bindings, ShaderCreationAttribsWrapper, Source, SourceBuffer ) DEFINE_BUFFERED_STRING_BINDER( m_Bindings, ShaderCreationAttribsWrapper, EntryPoint, EntryPointBuffer ) DEFINE_BUFFERED_STRING_BINDER( m_Bindings, ShaderCreationAttribsWrapper, SearchDirectories, SearchDirectoriesBuffer ) + DEFINE_BUFFERED_STRING_BINDER( m_Bindings, ShaderCreationAttribsWrapper, CombinedSamplerSuffix, CombinedSamplerSuffixBuffer ) + + DEFINE_BINDER(m_Bindings, ShaderCreationAttribsWrapper, UseCombinedTextureSamplers); DEFINE_ENUM_ELEMENT_MAPPING( m_ShaderSourceLangEnumMapping, SHADER_SOURCE_LANGUAGE_DEFAULT ); DEFINE_ENUM_ELEMENT_MAPPING( m_ShaderSourceLangEnumMapping, SHADER_SOURCE_LANGUAGE_HLSL ); -- cgit v1.2.3