From a1e21026f83685c356cb9791466aae4118893409 Mon Sep 17 00:00:00 2001 From: Egor Yusov Date: Sat, 1 Dec 2018 11:46:15 -0800 Subject: Added explicit state transition control flags to CLEAR_DEPTH_STENCIL_FLAGS --- RenderScript/src/DeviceContextFuncBindings.cpp | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) (limited to 'RenderScript/src/DeviceContextFuncBindings.cpp') diff --git a/RenderScript/src/DeviceContextFuncBindings.cpp b/RenderScript/src/DeviceContextFuncBindings.cpp index 76129f7..18662e6 100644 --- a/RenderScript/src/DeviceContextFuncBindings.cpp +++ b/RenderScript/src/DeviceContextFuncBindings.cpp @@ -59,6 +59,12 @@ namespace Diligent DEFINE_ENUM_ELEMENT_MAPPING( m_ClearRTStateTransitionModeMapping, CLEAR_RENDER_TARGET_NO_TRANSITION ); DEFINE_ENUM_ELEMENT_MAPPING( m_ClearRTStateTransitionModeMapping, CLEAR_RENDER_TARGET_TRANSITION_STATE ); DEFINE_ENUM_ELEMENT_MAPPING( m_ClearRTStateTransitionModeMapping, CLEAR_RENDER_TARGET_VERIFY_STATE ); + + DEFINE_ENUM_ELEMENT_MAPPING( m_ClearDepthStencilFlagsEnumMapping, CLEAR_DEPTH_FLAG_NONE ); + DEFINE_ENUM_ELEMENT_MAPPING( m_ClearDepthStencilFlagsEnumMapping, CLEAR_DEPTH_FLAG ); + DEFINE_ENUM_ELEMENT_MAPPING( m_ClearDepthStencilFlagsEnumMapping, CLEAR_STENCIL_FLAG ); + DEFINE_ENUM_ELEMENT_MAPPING( m_ClearDepthStencilFlagsEnumMapping, CLEAR_DEPTH_STENCIL_TRANSITION_STATE_FLAG ); + DEFINE_ENUM_ELEMENT_MAPPING( m_ClearDepthStencilFlagsEnumMapping, CLEAR_DEPTH_STENCIL_VERIFY_STATE_FLAG ); }; int DeviceContextFuncBindings::SetRenderTargets( lua_State *L ) @@ -156,8 +162,7 @@ namespace Diligent ITextureView *pView = nullptr; Float32 fDepth = 1.f; Uint8 Stencil = 0; - CLEAR_DEPTH_STENCIL_FLAGS ClearFlags = CLEAR_DEPTH_FLAG_NONE; - + int CurrArg = 1; if( CurrArg <= NumArgs ) { @@ -168,6 +173,16 @@ namespace Diligent } } + CLEAR_DEPTH_STENCIL_FLAGS ClearFlags = CLEAR_DEPTH_FLAG_NONE; + if( CurrArg <= NumArgs && + (lua_type( L, CurrArg ) == LUA_TSTRING || + lua_type( L, CurrArg ) == LUA_TTABLE ) ) + { + FlagsLoader FlagsLoader(0, "ClearDepthStencilFlags", m_ClearDepthStencilFlagsEnumMapping); + FlagsLoader.SetValue( L, CurrArg, &ClearFlags ); + ++CurrArg; + } + if( CurrArg <= NumArgs ) { fDepth = ReadValueFromLua( L, CurrArg ); -- cgit v1.2.3