diff options
| author | Egor Yusov <egor.yusov@gmail.com> | 2018-10-18 15:41:45 +0000 |
|---|---|---|
| committer | Egor Yusov <egor.yusov@gmail.com> | 2018-10-18 15:41:45 +0000 |
| commit | a63e7f562d6df72472aefd84f60b22954d051b28 (patch) | |
| tree | b43b7a7724829aeb439e01be9f320a39d0b4007f /RenderScript/src | |
| parent | Updated SCRIPT_PARSING_ERROR macro (diff) | |
| download | DiligentTools-a63e7f562d6df72472aefd84f60b22954d051b28.tar.gz DiligentTools-a63e7f562d6df72472aefd84f60b22954d051b28.zip | |
Added support for combined texture samplers
Diffstat (limited to 'RenderScript/src')
| -rw-r--r-- | RenderScript/src/ShaderParser.cpp | 13 |
1 files changed, 8 insertions, 5 deletions
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<const Char*>(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<StaticSamplerDesc*>( 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 ); |
