summaryrefslogtreecommitdiffstats
path: root/RenderScript
diff options
context:
space:
mode:
Diffstat (limited to 'RenderScript')
-rw-r--r--RenderScript/include/PSODescParser.h3
-rw-r--r--RenderScript/src/PSODescParser.cpp21
2 files changed, 23 insertions, 1 deletions
diff --git a/RenderScript/include/PSODescParser.h b/RenderScript/include/PSODescParser.h
index a60155b..8d732af 100644
--- a/RenderScript/include/PSODescParser.h
+++ b/RenderScript/include/PSODescParser.h
@@ -52,5 +52,8 @@ namespace Diligent
int SetPSO( lua_State *L );
ClassMethodCaller<PSODescParser> m_SetPSOBinding;
+
+ int IsCompatibleWith(lua_State *L);
+ ClassMethodCaller<PSODescParser> m_IsCompatibleWithBinding;
};
}
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;
+ }
}