summaryrefslogtreecommitdiffstats
path: root/RenderScript/src/PSODescParser.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'RenderScript/src/PSODescParser.cpp')
-rw-r--r--RenderScript/src/PSODescParser.cpp21
1 files changed, 20 insertions, 1 deletions
diff --git a/RenderScript/src/PSODescParser.cpp b/RenderScript/src/PSODescParser.cpp
index 36c298f..b8a9109 100644
--- a/RenderScript/src/PSODescParser.cpp
+++ b/RenderScript/src/PSODescParser.cpp
@@ -216,7 +216,8 @@ namespace Diligent
const Char* PSODescParser::PSODescLibName = "PipelineState";
PSODescParser::PSODescParser( IRenderDevice *pRenderDevice, lua_State *L ) :
EngineObjectParserCommon<IPipelineState>( pRenderDevice, L, PSODescLibName ),
- m_SetPSOBinding( this, L, "Context", "SetPipelineState", &PSODescParser::SetPSO )
+ m_SetPSOBinding( this, L, "Context", "SetPipelineState", &PSODescParser::SetPSO ),
+ m_IsCompatibleWithBinding(this, L, m_MetatableRegistryName.c_str(), "IsCompatibleWith", &PSODescParser::IsCompatibleWith)
{
DEFINE_BUFFERED_STRING_BINDER( m_Bindings, PSODescWrapper, Name, NameBuffer )
@@ -254,4 +255,22 @@ namespace Diligent
return 0;
}
+
+ int PSODescParser::IsCompatibleWith(lua_State *L)
+ {
+ INIT_LUA_STACK_TRACKING(L);
+
+ auto *pThisPSO = *GetUserData<IPipelineState**>(L, 1, m_MetatableRegistryName.c_str());
+
+ // Buffer should be the first argument
+ auto *pPSO = *GetUserData<IPipelineState**>(L, 2, m_MetatableRegistryName.c_str());
+
+ auto IsCompatible = pThisPSO->IsCompatibleWith(pPSO);
+
+ // Push existing object
+ PushValue(L, IsCompatible);
+
+ // Returning one value to Lua
+ return 1;
+ }
}