summaryrefslogtreecommitdiffstats
path: root/RenderScript/src/DeviceContextFuncBindings.cpp
diff options
context:
space:
mode:
authorEgor Yusov <egor.yusov@gmail.com>2018-12-01 19:46:15 +0000
committerEgor Yusov <egor.yusov@gmail.com>2018-12-01 19:46:15 +0000
commita1e21026f83685c356cb9791466aae4118893409 (patch)
treedc16a8e331522d52c1a351067e8fc1866f52eeae /RenderScript/src/DeviceContextFuncBindings.cpp
parentAdded state transition mode to ClearRenderTarget() (diff)
downloadDiligentTools-a1e21026f83685c356cb9791466aae4118893409.tar.gz
DiligentTools-a1e21026f83685c356cb9791466aae4118893409.zip
Added explicit state transition control flags to CLEAR_DEPTH_STENCIL_FLAGS
Diffstat (limited to 'RenderScript/src/DeviceContextFuncBindings.cpp')
-rw-r--r--RenderScript/src/DeviceContextFuncBindings.cpp19
1 files changed, 17 insertions, 2 deletions
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<CLEAR_DEPTH_STENCIL_FLAGS> FlagsLoader(0, "ClearDepthStencilFlags", m_ClearDepthStencilFlagsEnumMapping);
+ FlagsLoader.SetValue( L, CurrArg, &ClearFlags );
+ ++CurrArg;
+ }
+
if( CurrArg <= NumArgs )
{
fDepth = ReadValueFromLua<Float32>( L, CurrArg );