diff options
| author | Egor Yusov <egor.yusov@gmail.com> | 2018-11-24 16:19:06 +0000 |
|---|---|---|
| committer | Egor Yusov <egor.yusov@gmail.com> | 2018-11-24 16:19:06 +0000 |
| commit | e12d5ea9b35feb985c2756789d2e739dd4d9d781 (patch) | |
| tree | ed17ffaa2f1d12264c4f679a10cef6a93817ec42 /RenderScript/src/ShaderResourceBindingParser.cpp | |
| parent | Fixing linux/mac build - another attempt (diff) | |
| download | DiligentTools-e12d5ea9b35feb985c2756789d2e739dd4d9d781.tar.gz DiligentTools-e12d5ea9b35feb985c2756789d2e739dd4d9d781.zip | |
Added GetShaderResourceBindingByName() function
Added InitStaticResources parameter to CreateShaderResourceBinding lua function
Diffstat (limited to 'RenderScript/src/ShaderResourceBindingParser.cpp')
| -rw-r--r-- | RenderScript/src/ShaderResourceBindingParser.cpp | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/RenderScript/src/ShaderResourceBindingParser.cpp b/RenderScript/src/ShaderResourceBindingParser.cpp index 0613f59..80a5092 100644 --- a/RenderScript/src/ShaderResourceBindingParser.cpp +++ b/RenderScript/src/ShaderResourceBindingParser.cpp @@ -51,8 +51,15 @@ namespace Diligent // Shader should be the first argument auto *pPSO = *GetUserData<IPipelineState**>( L, 1, m_PSOLibMetatableName.c_str() ); + bool InitStaticResources = false; + auto NumArgs = lua_gettop( L ); + if( NumArgs >= 2 ) + { + InitStaticResources = ReadValueFromLua<Bool>( L, 2 ); + } + auto pNewShaderResBndngLuaObj = reinterpret_cast<IShaderResourceBinding**>(lua_newuserdata( L, sizeof( IShaderResourceBinding* ) )); - pPSO->CreateShaderResourceBinding(pNewShaderResBndngLuaObj); + pPSO->CreateShaderResourceBinding(pNewShaderResBndngLuaObj, InitStaticResources); CHECK_LUA_STACK_HEIGHT( +1 ); } |
