summaryrefslogtreecommitdiffstats
path: root/RenderScript/src
diff options
context:
space:
mode:
Diffstat (limited to 'RenderScript/src')
-rw-r--r--RenderScript/src/BlendStateDescParser.cpp20
-rw-r--r--RenderScript/src/BufferParser.cpp17
-rw-r--r--RenderScript/src/BufferViewParser.cpp10
-rw-r--r--RenderScript/src/DepthStencilStateDescParser.cpp24
-rw-r--r--RenderScript/src/DrawAttribsParser.cpp67
-rw-r--r--RenderScript/src/InputLayoutDescParser.cpp19
-rw-r--r--RenderScript/src/PSODescParser.cpp99
-rw-r--r--RenderScript/src/RasterizerStateDescParser.cpp18
-rw-r--r--RenderScript/src/ResourceMappingParser.cpp4
-rw-r--r--RenderScript/src/ScissorRectParser.cpp8
-rw-r--r--RenderScript/src/ShaderParser.cpp8
-rw-r--r--RenderScript/src/TextureParser.cpp58
-rw-r--r--RenderScript/src/TextureViewParser.cpp55
-rw-r--r--RenderScript/src/ViewportParser.cpp12
14 files changed, 236 insertions, 183 deletions
diff --git a/RenderScript/src/BlendStateDescParser.cpp b/RenderScript/src/BlendStateDescParser.cpp
index c5a1d98..d5a2d84 100644
--- a/RenderScript/src/BlendStateDescParser.cpp
+++ b/RenderScript/src/BlendStateDescParser.cpp
@@ -45,7 +45,7 @@ namespace Diligent
MemberBinder( size_t MemberOffset, size_t Dummy ) :
MemberBinderBase( MemberOffset )
{
- DEFINE_BINDER( m_Bindings, RenderTargetBlendDesc, BlendEnable, Bool, Validator<Bool>() )
+ DEFINE_BINDER( m_Bindings, RenderTargetBlendDesc, BlendEnable );
DEFINE_ENUM_ELEMENT_MAPPING( m_BlendFactorEnumMapping, BLEND_FACTOR_ZERO);
DEFINE_ENUM_ELEMENT_MAPPING( m_BlendFactorEnumMapping, BLEND_FACTOR_ONE);
@@ -69,10 +69,10 @@ namespace Diligent
VERIFY( m_BlendFactorEnumMapping.m_Val2StrMap.size() == BLEND_FACTOR_NUM_FACTORS - 1,
"Unexpected map size. Did you update BLEND_FACTOR enum?" );
- DEFINE_ENUM_BINDER( m_Bindings, RenderTargetBlendDesc, SrcBlend, BLEND_FACTOR, m_BlendFactorEnumMapping );
- DEFINE_ENUM_BINDER( m_Bindings, RenderTargetBlendDesc, DestBlend, BLEND_FACTOR, m_BlendFactorEnumMapping );
- DEFINE_ENUM_BINDER( m_Bindings, RenderTargetBlendDesc, SrcBlendAlpha, BLEND_FACTOR, m_BlendFactorEnumMapping );
- DEFINE_ENUM_BINDER( m_Bindings, RenderTargetBlendDesc, DestBlendAlpha, BLEND_FACTOR, m_BlendFactorEnumMapping );
+ DEFINE_ENUM_BINDER( m_Bindings, RenderTargetBlendDesc, SrcBlend, m_BlendFactorEnumMapping );
+ DEFINE_ENUM_BINDER( m_Bindings, RenderTargetBlendDesc, DestBlend, m_BlendFactorEnumMapping );
+ DEFINE_ENUM_BINDER( m_Bindings, RenderTargetBlendDesc, SrcBlendAlpha, m_BlendFactorEnumMapping );
+ DEFINE_ENUM_BINDER( m_Bindings, RenderTargetBlendDesc, DestBlendAlpha, m_BlendFactorEnumMapping );
DEFINE_ENUM_ELEMENT_MAPPING( m_BlendOpEnumMapping, BLEND_OPERATION_ADD );
@@ -85,8 +85,8 @@ namespace Diligent
VERIFY( m_BlendOpEnumMapping.m_Val2StrMap.size() == BLEND_OPERATION_NUM_OPERATIONS - 1,
"Unexpected map size. Did you update BLEND_OPERATION enum?" );
- DEFINE_ENUM_BINDER( m_Bindings, RenderTargetBlendDesc, BlendOp, BLEND_OPERATION, m_BlendOpEnumMapping );
- DEFINE_ENUM_BINDER( m_Bindings, RenderTargetBlendDesc, BlendOpAlpha, BLEND_OPERATION, m_BlendOpEnumMapping );
+ DEFINE_ENUM_BINDER( m_Bindings, RenderTargetBlendDesc, BlendOp, m_BlendOpEnumMapping );
+ DEFINE_ENUM_BINDER( m_Bindings, RenderTargetBlendDesc, BlendOpAlpha, m_BlendOpEnumMapping );
DEFINE_ENUM_ELEMENT_MAPPING( m_ColorMaskEnumMapping, COLOR_MASK_RED );
@@ -134,10 +134,10 @@ namespace Diligent
MemberBinder<BlendStateDesc> :: MemberBinder( size_t MemberOffset, size_t Dummy ) :
MemberBinderBase( MemberOffset )
{
- DEFINE_BINDER( m_Bindings, BlendStateDesc, AlphaToCoverageEnable, Bool, Validator<Bool>() )
- DEFINE_BINDER( m_Bindings, BlendStateDesc, IndependentBlendEnable, Bool, Validator<Bool>() )
+ DEFINE_BINDER( m_Bindings, BlendStateDesc, AlphaToCoverageEnable );
+ DEFINE_BINDER( m_Bindings, BlendStateDesc, IndependentBlendEnable );
- DEFINE_BINDER( m_Bindings, BlendStateDesc, RenderTargets, RenderTargetBlendDescArrayParser, 0 )
+ DEFINE_BINDER_EX( m_Bindings, BlendStateDesc, RenderTargets, RenderTargetBlendDescArrayParser, 0 );
}
void MemberBinder<BlendStateDesc> ::GetValue(lua_State *L, const void* pBasePointer)
diff --git a/RenderScript/src/BufferParser.cpp b/RenderScript/src/BufferParser.cpp
index 25ce23c..98e72d0 100644
--- a/RenderScript/src/BufferParser.cpp
+++ b/RenderScript/src/BufferParser.cpp
@@ -36,9 +36,10 @@ namespace Diligent
MemberBinder( size_t MemberOffset, size_t Dummy ) :
MemberBinderBase( MemberOffset )
{
- DEFINE_ENUM_BINDER( m_Bindings, BufferDesc::BufferFormat, ValueType, VALUE_TYPE, m_ValueTypeEnumMapping )
- DEFINE_BINDER( m_Bindings, BufferDesc::BufferFormat, NumComponents, Uint32, Validator<Uint32>( "Num Components", 1, 4 ) )
- DEFINE_BINDER( m_Bindings, BufferDesc::BufferFormat, IsNormalized, Bool, Validator<Bool>() )
+ DEFINE_ENUM_BINDER( m_Bindings, BufferDesc::BufferFormat, ValueType, m_ValueTypeEnumMapping );
+ using NumComponentsType = decltype(BufferDesc::BufferFormat::NumComponents);
+ DEFINE_BINDER_EX( m_Bindings, BufferDesc::BufferFormat, NumComponents, NumComponentsType, Validator<NumComponentsType>( "Num Components", 1, 4 ) );
+ DEFINE_BINDER( m_Bindings, BufferDesc::BufferFormat, IsNormalized );
}
virtual void GetValue( lua_State *L, const void* pBasePointer )
@@ -64,7 +65,7 @@ namespace Diligent
{
DEFINE_BUFFERED_STRING_BINDER( m_Bindings, SBuffDescWrapper, Name, NameBuffer );
- DEFINE_BINDER( m_Bindings, SBuffDescWrapper, uiSizeInBytes, Uint32, Validator<Uint32>() )
+ DEFINE_BINDER( m_Bindings, SBuffDescWrapper, uiSizeInBytes );
DEFINE_ENUM_ELEMENT_MAPPING( m_BindFlagEnumMapping, BIND_VERTEX_BUFFER );
DEFINE_ENUM_ELEMENT_MAPPING( m_BindFlagEnumMapping, BIND_INDEX_BUFFER );
@@ -79,7 +80,7 @@ namespace Diligent
// name conflicts when building for windows store
DEFINE_FLAGS_BINDER( m_Bindings, SBuffDescWrapper, BindFlags, Diligent::BIND_FLAGS, m_BindFlagEnumMapping );
- DEFINE_ENUM_BINDER( m_Bindings, SBuffDescWrapper, Usage, USAGE, m_UsageEnumMapping )
+ DEFINE_ENUM_BINDER( m_Bindings, SBuffDescWrapper, Usage, m_UsageEnumMapping );
DEFINE_FLAGS_BINDER( m_Bindings, SBuffDescWrapper, CPUAccessFlags, CPU_ACCESS_FLAG, m_CpuAccessFlagEnumMapping );
DEFINE_ENUM_ELEMENT_MAPPING( m_BuffModeEnumMapping, BUFFER_MODE_UNDEFINED );
@@ -90,10 +91,10 @@ namespace Diligent
"Unexpected map size. Did you update BUFFER_MODE enum?" );
VERIFY( m_BuffModeEnumMapping.m_Val2StrMap.size() == BUFFER_MODE_NUM_MODES,
"Unexpected map size. Did you update BUFFER_MODE enum?" );
- DEFINE_ENUM_BINDER( m_Bindings, SBuffDescWrapper, Mode, BUFFER_MODE, m_BuffModeEnumMapping );
+ DEFINE_ENUM_BINDER( m_Bindings, SBuffDescWrapper, Mode, m_BuffModeEnumMapping );
- DEFINE_BINDER( m_Bindings, SBuffDescWrapper, Format, BufferDesc::BufferFormat, 0 );
- DEFINE_BINDER( m_Bindings, SBuffDescWrapper, ElementByteStride, Uint32, Validator<Uint32>() );
+ DEFINE_BINDER_EX( m_Bindings, SBuffDescWrapper, Format, decltype(BufferDesc::Format), 0 );
+ DEFINE_BINDER( m_Bindings, SBuffDescWrapper, ElementByteStride );
DEFINE_ENUM_ELEMENT_MAPPING( m_SetVBFlagEnumMapping, SET_VERTEX_BUFFERS_FLAG_RESET );
};
diff --git a/RenderScript/src/BufferViewParser.cpp b/RenderScript/src/BufferViewParser.cpp
index fda2999..cbd7aec 100644
--- a/RenderScript/src/BufferViewParser.cpp
+++ b/RenderScript/src/BufferViewParser.cpp
@@ -31,8 +31,8 @@ namespace Diligent
const Char* BufferViewParser::BufferViewLibName = "BufferView";
BufferViewParser::BufferViewParser( BufferParser *pBufParser,
- IRenderDevice *pRenderDevice,
- lua_State *L ) :
+ IRenderDevice *pRenderDevice,
+ lua_State *L ) :
EngineObjectParserCommon<IBufferView>( pRenderDevice, L, BufferViewLibName ),
m_BufferLibMetatableName(pBufParser->GetMetatableName()),
m_CreateViewBinding( this, L, m_BufferLibMetatableName.c_str(), "CreateView", &BufferViewParser::CreateView ),
@@ -47,10 +47,10 @@ namespace Diligent
"Unexpected map size. Did you update BUFFER_VIEW_TYPE enum?" );
VERIFY( m_ViewTypeEnumMapping.m_Val2StrMap.size() == BUFFER_VIEW_NUM_VIEWS - 1,
"Unexpected map size. Did you update BUFFER_VIEW_TYPE enum?" );
- DEFINE_ENUM_BINDER( m_Bindings, SBuffViewDescWrapper, ViewType, BUFFER_VIEW_TYPE, m_ViewTypeEnumMapping );
+ DEFINE_ENUM_BINDER( m_Bindings, SBuffViewDescWrapper, ViewType, m_ViewTypeEnumMapping );
- DEFINE_BINDER( m_Bindings, SBuffViewDescWrapper, ByteOffset, Uint32, Validator<Uint32>() );
- DEFINE_BINDER( m_Bindings, SBuffViewDescWrapper, ByteWidth, Uint32, Validator<Uint32>() );
+ DEFINE_BINDER( m_Bindings, SBuffViewDescWrapper, ByteOffset);
+ DEFINE_BINDER( m_Bindings, SBuffViewDescWrapper, ByteWidth);
};
void BufferViewParser::CreateObj( lua_State *L )
diff --git a/RenderScript/src/DepthStencilStateDescParser.cpp b/RenderScript/src/DepthStencilStateDescParser.cpp
index 5308316..001e4d2 100644
--- a/RenderScript/src/DepthStencilStateDescParser.cpp
+++ b/RenderScript/src/DepthStencilStateDescParser.cpp
@@ -51,10 +51,10 @@ namespace Diligent
VERIFY( m_StencilOpEnumMapping.m_Val2StrMap.size() == STENCIL_OP_NUM_OPS - 1,
"Unexpected map size. Did you update STENCIL_OP enum?" );
- DEFINE_ENUM_BINDER( m_Bindings, StencilOpDesc, StencilFailOp, STENCIL_OP, m_StencilOpEnumMapping )
- DEFINE_ENUM_BINDER( m_Bindings, StencilOpDesc, StencilDepthFailOp, STENCIL_OP, m_StencilOpEnumMapping )
- DEFINE_ENUM_BINDER( m_Bindings, StencilOpDesc, StencilPassOp, STENCIL_OP, m_StencilOpEnumMapping )
- DEFINE_ENUM_BINDER( m_Bindings, StencilOpDesc, StencilFunc, COMPARISON_FUNCTION, m_CmpFuncEnumMapping )
+ DEFINE_ENUM_BINDER( m_Bindings, StencilOpDesc, StencilFailOp, m_StencilOpEnumMapping );
+ DEFINE_ENUM_BINDER( m_Bindings, StencilOpDesc, StencilDepthFailOp, m_StencilOpEnumMapping );
+ DEFINE_ENUM_BINDER( m_Bindings, StencilOpDesc, StencilPassOp, m_StencilOpEnumMapping );
+ DEFINE_ENUM_BINDER( m_Bindings, StencilOpDesc, StencilFunc, m_CmpFuncEnumMapping );
}
virtual void GetValue( lua_State *L, const void* pBasePointer )
@@ -78,15 +78,15 @@ namespace Diligent
MemberBinder<DepthStencilStateDesc>::MemberBinder( size_t MemberOffset, size_t Dummy ) :
MemberBinderBase( MemberOffset )
{
- DEFINE_BINDER( m_Bindings, DepthStencilStateDesc, DepthEnable, Bool, Validator<Bool>() )
- DEFINE_BINDER( m_Bindings, DepthStencilStateDesc, DepthWriteEnable, Bool, Validator<Bool>() )
- DEFINE_ENUM_BINDER( m_Bindings, DepthStencilStateDesc, DepthFunc, COMPARISON_FUNCTION, m_CmpFuncEnumMapping )
+ DEFINE_BINDER( m_Bindings, DepthStencilStateDesc, DepthEnable );
+ DEFINE_BINDER( m_Bindings, DepthStencilStateDesc, DepthWriteEnable );
+ DEFINE_ENUM_BINDER( m_Bindings, DepthStencilStateDesc, DepthFunc, m_CmpFuncEnumMapping );
- DEFINE_BINDER( m_Bindings, DepthStencilStateDesc, StencilEnable, Bool, Validator<Bool>() )
- DEFINE_BINDER( m_Bindings, DepthStencilStateDesc, StencilReadMask, Uint8, Validator<Uint8>() )
- DEFINE_BINDER( m_Bindings, DepthStencilStateDesc, StencilWriteMask, Uint8, Validator<Uint8>() )
- DEFINE_BINDER( m_Bindings, DepthStencilStateDesc, FrontFace, StencilOpDesc, 0 )
- DEFINE_BINDER( m_Bindings, DepthStencilStateDesc, BackFace, StencilOpDesc, 0 )
+ DEFINE_BINDER( m_Bindings, DepthStencilStateDesc, StencilEnable );
+ DEFINE_BINDER( m_Bindings, DepthStencilStateDesc, StencilReadMask );
+ DEFINE_BINDER( m_Bindings, DepthStencilStateDesc, StencilWriteMask );
+ DEFINE_BINDER_EX( m_Bindings, DepthStencilStateDesc, FrontFace, StencilOpDesc, 0 );
+ DEFINE_BINDER_EX( m_Bindings, DepthStencilStateDesc, BackFace, StencilOpDesc, 0 );
};
void MemberBinder<DepthStencilStateDesc> ::GetValue(lua_State *L, const void* pBasePointer)
diff --git a/RenderScript/src/DrawAttribsParser.cpp b/RenderScript/src/DrawAttribsParser.cpp
index 629c283..c620e02 100644
--- a/RenderScript/src/DrawAttribsParser.cpp
+++ b/RenderScript/src/DrawAttribsParser.cpp
@@ -35,70 +35,29 @@ namespace Diligent
m_DispatchComputeBinding( this, L, "Context", "DispatchCompute", &DrawAttribsParser::DispatchCompute ),
m_BufferMetatableName(pBuffParser->GetMetatableName())
{
- DEFINE_ENUM_ELEMENT_MAPPING( m_PrimTopologyEnumMapping, PRIMITIVE_TOPOLOGY_TRIANGLE_LIST );
- DEFINE_ENUM_ELEMENT_MAPPING( m_PrimTopologyEnumMapping, PRIMITIVE_TOPOLOGY_TRIANGLE_STRIP );
- DEFINE_ENUM_ELEMENT_MAPPING( m_PrimTopologyEnumMapping, PRIMITIVE_TOPOLOGY_POINT_LIST );
- DEFINE_ENUM_ELEMENT_MAPPING( m_PrimTopologyEnumMapping, PRIMITIVE_TOPOLOGY_LINE_LIST );
- DEFINE_ENUM_ELEMENT_MAPPING( m_PrimTopologyEnumMapping, PRIMITIVE_TOPOLOGY_1_CONTROL_POINT_PATCHLIST );
- DEFINE_ENUM_ELEMENT_MAPPING( m_PrimTopologyEnumMapping, PRIMITIVE_TOPOLOGY_2_CONTROL_POINT_PATCHLIST );
- DEFINE_ENUM_ELEMENT_MAPPING( m_PrimTopologyEnumMapping, PRIMITIVE_TOPOLOGY_3_CONTROL_POINT_PATCHLIST );
- DEFINE_ENUM_ELEMENT_MAPPING( m_PrimTopologyEnumMapping, PRIMITIVE_TOPOLOGY_4_CONTROL_POINT_PATCHLIST );
- DEFINE_ENUM_ELEMENT_MAPPING( m_PrimTopologyEnumMapping, PRIMITIVE_TOPOLOGY_5_CONTROL_POINT_PATCHLIST );
- DEFINE_ENUM_ELEMENT_MAPPING( m_PrimTopologyEnumMapping, PRIMITIVE_TOPOLOGY_6_CONTROL_POINT_PATCHLIST );
- DEFINE_ENUM_ELEMENT_MAPPING( m_PrimTopologyEnumMapping, PRIMITIVE_TOPOLOGY_7_CONTROL_POINT_PATCHLIST );
- DEFINE_ENUM_ELEMENT_MAPPING( m_PrimTopologyEnumMapping, PRIMITIVE_TOPOLOGY_8_CONTROL_POINT_PATCHLIST );
- DEFINE_ENUM_ELEMENT_MAPPING( m_PrimTopologyEnumMapping, PRIMITIVE_TOPOLOGY_9_CONTROL_POINT_PATCHLIST );
- DEFINE_ENUM_ELEMENT_MAPPING( m_PrimTopologyEnumMapping, PRIMITIVE_TOPOLOGY_10_CONTROL_POINT_PATCHLIST );
- DEFINE_ENUM_ELEMENT_MAPPING( m_PrimTopologyEnumMapping, PRIMITIVE_TOPOLOGY_11_CONTROL_POINT_PATCHLIST );
- DEFINE_ENUM_ELEMENT_MAPPING( m_PrimTopologyEnumMapping, PRIMITIVE_TOPOLOGY_12_CONTROL_POINT_PATCHLIST );
- DEFINE_ENUM_ELEMENT_MAPPING( m_PrimTopologyEnumMapping, PRIMITIVE_TOPOLOGY_13_CONTROL_POINT_PATCHLIST );
- DEFINE_ENUM_ELEMENT_MAPPING( m_PrimTopologyEnumMapping, PRIMITIVE_TOPOLOGY_14_CONTROL_POINT_PATCHLIST );
- DEFINE_ENUM_ELEMENT_MAPPING( m_PrimTopologyEnumMapping, PRIMITIVE_TOPOLOGY_15_CONTROL_POINT_PATCHLIST );
- DEFINE_ENUM_ELEMENT_MAPPING( m_PrimTopologyEnumMapping, PRIMITIVE_TOPOLOGY_16_CONTROL_POINT_PATCHLIST );
- DEFINE_ENUM_ELEMENT_MAPPING( m_PrimTopologyEnumMapping, PRIMITIVE_TOPOLOGY_17_CONTROL_POINT_PATCHLIST );
- DEFINE_ENUM_ELEMENT_MAPPING( m_PrimTopologyEnumMapping, PRIMITIVE_TOPOLOGY_18_CONTROL_POINT_PATCHLIST );
- DEFINE_ENUM_ELEMENT_MAPPING( m_PrimTopologyEnumMapping, PRIMITIVE_TOPOLOGY_19_CONTROL_POINT_PATCHLIST );
- DEFINE_ENUM_ELEMENT_MAPPING( m_PrimTopologyEnumMapping, PRIMITIVE_TOPOLOGY_20_CONTROL_POINT_PATCHLIST );
- DEFINE_ENUM_ELEMENT_MAPPING( m_PrimTopologyEnumMapping, PRIMITIVE_TOPOLOGY_21_CONTROL_POINT_PATCHLIST );
- DEFINE_ENUM_ELEMENT_MAPPING( m_PrimTopologyEnumMapping, PRIMITIVE_TOPOLOGY_22_CONTROL_POINT_PATCHLIST );
- DEFINE_ENUM_ELEMENT_MAPPING( m_PrimTopologyEnumMapping, PRIMITIVE_TOPOLOGY_23_CONTROL_POINT_PATCHLIST );
- DEFINE_ENUM_ELEMENT_MAPPING( m_PrimTopologyEnumMapping, PRIMITIVE_TOPOLOGY_24_CONTROL_POINT_PATCHLIST );
- DEFINE_ENUM_ELEMENT_MAPPING( m_PrimTopologyEnumMapping, PRIMITIVE_TOPOLOGY_25_CONTROL_POINT_PATCHLIST );
- DEFINE_ENUM_ELEMENT_MAPPING( m_PrimTopologyEnumMapping, PRIMITIVE_TOPOLOGY_26_CONTROL_POINT_PATCHLIST );
- DEFINE_ENUM_ELEMENT_MAPPING( m_PrimTopologyEnumMapping, PRIMITIVE_TOPOLOGY_27_CONTROL_POINT_PATCHLIST );
- DEFINE_ENUM_ELEMENT_MAPPING( m_PrimTopologyEnumMapping, PRIMITIVE_TOPOLOGY_28_CONTROL_POINT_PATCHLIST );
- DEFINE_ENUM_ELEMENT_MAPPING( m_PrimTopologyEnumMapping, PRIMITIVE_TOPOLOGY_29_CONTROL_POINT_PATCHLIST );
- DEFINE_ENUM_ELEMENT_MAPPING( m_PrimTopologyEnumMapping, PRIMITIVE_TOPOLOGY_30_CONTROL_POINT_PATCHLIST );
- DEFINE_ENUM_ELEMENT_MAPPING( m_PrimTopologyEnumMapping, PRIMITIVE_TOPOLOGY_31_CONTROL_POINT_PATCHLIST );
- DEFINE_ENUM_ELEMENT_MAPPING( m_PrimTopologyEnumMapping, PRIMITIVE_TOPOLOGY_32_CONTROL_POINT_PATCHLIST );
- VERIFY( m_PrimTopologyEnumMapping.m_Str2ValMap.size() == PRIMITIVE_TOPOLOGY_NUM_TOPOLOGIES - 1,
- "Unexpected map size. Did you update PRIMITIVE_TOPOLOGY enum?" );
- VERIFY( m_PrimTopologyEnumMapping.m_Val2StrMap.size() == PRIMITIVE_TOPOLOGY_NUM_TOPOLOGIES - 1,
- "Unexpected map size. Did you update PRIMITIVE_TOPOLOGY enum?" );
- DEFINE_ENUM_BINDER( m_Bindings, DrawAttribs, Topology, PRIMITIVE_TOPOLOGY, m_PrimTopologyEnumMapping );
-
// NumVertices and NumIndices are in Union
- DEFINE_BINDER( m_Bindings, DrawAttribs, NumVertices, Uint32, Validator<Uint32>() );
- DEFINE_BINDER( m_Bindings, DrawAttribs, NumIndices, Uint32, Validator<Uint32>() );
+ DEFINE_BINDER( m_Bindings, DrawAttribs, NumVertices );
+ DEFINE_BINDER( m_Bindings, DrawAttribs, NumIndices );
DEFINE_ENUM_ELEMENT_MAPPING( m_ValueTypeEnumMapping, VT_UINT16 );
DEFINE_ENUM_ELEMENT_MAPPING( m_ValueTypeEnumMapping, VT_UINT32 );
- DEFINE_ENUM_BINDER( m_Bindings, DrawAttribs, IndexType, VALUE_TYPE, m_ValueTypeEnumMapping );
+ DEFINE_ENUM_BINDER( m_Bindings, DrawAttribs, IndexType, m_ValueTypeEnumMapping );
+
+ DEFINE_BINDER( m_Bindings, DrawAttribs, IsIndexed );
+ DEFINE_BINDER( m_Bindings, DrawAttribs, NumInstances );
+ DEFINE_BINDER( m_Bindings, DrawAttribs, IsIndirect );
- DEFINE_BINDER( m_Bindings, DrawAttribs, IsIndexed, Bool, Validator<Bool>() );
- DEFINE_BINDER( m_Bindings, DrawAttribs, NumInstances, Uint32, Validator<Uint32>() );
- DEFINE_BINDER( m_Bindings, DrawAttribs, IsIndirect, Bool, Validator<Bool>() );
- DEFINE_BINDER( m_Bindings, DrawAttribs, BaseVertex, Uint32, Validator<Uint32>() );
- DEFINE_BINDER( m_Bindings, DrawAttribs, IndirectDrawArgsOffset, Uint32, Validator<Uint32>() );
+ DEFINE_BINDER( m_Bindings, DrawAttribs, BaseVertex );
+ DEFINE_BINDER( m_Bindings, DrawAttribs, IndirectDrawArgsOffset );
// StartVertexLocation and FirstIndexLocation are in union
- DEFINE_BINDER( m_Bindings, DrawAttribs, StartVertexLocation, Uint32, Validator<Uint32>() );
- DEFINE_BINDER( m_Bindings, DrawAttribs, FirstIndexLocation, Uint32, Validator<Uint32>() );
+ DEFINE_BINDER( m_Bindings, DrawAttribs, StartVertexLocation );
+ DEFINE_BINDER( m_Bindings, DrawAttribs, FirstIndexLocation );
- DEFINE_BINDER( m_Bindings, DrawAttribs, FirstInstanceLocation, Uint32, Validator<Uint32>() );
+ DEFINE_BINDER( m_Bindings, DrawAttribs, FirstInstanceLocation );
std::vector<String> AllowedMetatable = { "Metatables.Buffer" };
- DEFINE_BINDER( m_Bindings, DrawAttribs, pIndirectDrawAttribs, EngineObjectPtrLoader<IBuffer>, AllowedMetatable );
+ DEFINE_BINDER_EX( m_Bindings, DrawAttribs, pIndirectDrawAttribs, EngineObjectPtrLoader<IBuffer>, AllowedMetatable );
};
void DrawAttribsParser::CreateObj( lua_State *L )
diff --git a/RenderScript/src/InputLayoutDescParser.cpp b/RenderScript/src/InputLayoutDescParser.cpp
index 3045cb2..0bf237d 100644
--- a/RenderScript/src/InputLayoutDescParser.cpp
+++ b/RenderScript/src/InputLayoutDescParser.cpp
@@ -30,14 +30,17 @@ namespace Diligent
MemberBinderBase( InputLayoutOffset ),
m_LayoutElementsBufferOffset(ElementsBufferOffset)
{
- DEFINE_BINDER( m_Bindings, LayoutElement, InputIndex, Uint32, Validator<Uint32>( "Input Index", 0, 32 ) )
- DEFINE_BINDER( m_Bindings, LayoutElement, BufferSlot, Uint32, Validator<Uint32>( "Buffer Slot", 0, MaxBufferSlots ) )
- DEFINE_BINDER( m_Bindings, LayoutElement, NumComponents, Uint32, Validator<Uint32>( "Num Components", 1, 4 ) )
+ using InputIndexType = decltype(LayoutElement::InputIndex);
+ DEFINE_BINDER_EX( m_Bindings, LayoutElement, InputIndex, InputIndexType, Validator<InputIndexType>( "Input Index", 0, 32 ) );
+ using BufferSlotType = decltype(LayoutElement::BufferSlot);
+ DEFINE_BINDER_EX( m_Bindings, LayoutElement, BufferSlot, BufferSlotType, Validator<BufferSlotType>( "Buffer Slot", 0, MaxBufferSlots ) );
+ using NumComponentsType = decltype(LayoutElement::NumComponents);
+ DEFINE_BINDER_EX( m_Bindings, LayoutElement, NumComponents, NumComponentsType, Validator<NumComponentsType>( "Num Components", 1, 4 ) );
- DEFINE_ENUM_BINDER( m_Bindings, LayoutElement, ValueType, VALUE_TYPE, m_ValueTypeEnumMapping )
+ DEFINE_ENUM_BINDER( m_Bindings, LayoutElement, ValueType, m_ValueTypeEnumMapping );
- DEFINE_BINDER( m_Bindings, LayoutElement, IsNormalized, Bool, Validator<Bool>() )
- DEFINE_BINDER( m_Bindings, LayoutElement, RelativeOffset, Uint32, Validator<Uint32>() )
+ DEFINE_BINDER( m_Bindings, LayoutElement, IsNormalized );
+ DEFINE_BINDER( m_Bindings, LayoutElement, RelativeOffset );
m_FrequencyEnumMapping.AddMapping( "FREQUENCY_PER_VERTEX", LayoutElement::FREQUENCY_PER_VERTEX );
@@ -46,9 +49,9 @@ namespace Diligent
"Unexpected map size. Did you update LayoutElement::FREQUENCY_PER_VERTEX enum?" );
VERIFY( m_FrequencyEnumMapping.m_Val2StrMap.size() == LayoutElement::FREQUENCY_NUM_FREQUENCIES - 1,
"Unexpected map size. Did you update LayoutElement::FREQUENCY_PER_VERTEX enum?" );
- DEFINE_ENUM_BINDER( m_Bindings, LayoutElement, Frequency, LayoutElement::FREQUENCY, m_FrequencyEnumMapping )
+ DEFINE_ENUM_BINDER( m_Bindings, LayoutElement, Frequency, m_FrequencyEnumMapping );
- DEFINE_BINDER( m_Bindings, LayoutElement, InstanceDataStepRate, Uint32, Validator<Uint32>() )
+ DEFINE_BINDER( m_Bindings, LayoutElement, InstanceDataStepRate );
}
void MemberBinder<InputLayoutDesc> :: GetValue( lua_State *L, const void* pBasePointer )
diff --git a/RenderScript/src/PSODescParser.cpp b/RenderScript/src/PSODescParser.cpp
index b6c17ae..baad900 100644
--- a/RenderScript/src/PSODescParser.cpp
+++ b/RenderScript/src/PSODescParser.cpp
@@ -30,7 +30,7 @@
namespace std
{
- DEFINE_ENUM_HASH( Diligent::PRIMITIVE_TOPOLOGY_TYPE )
+ DEFINE_ENUM_HASH( Diligent::PRIMITIVE_TOPOLOGY )
}
namespace Diligent
@@ -98,8 +98,10 @@ namespace Diligent
MemberBinder( size_t MemberOffset, size_t Dummy ) :
MemberBinderBase( MemberOffset )
{
- DEFINE_BINDER( m_Bindings, SampleDesc, Count, Uint32, Validator<Uint32>("Count", 1,32) );
- DEFINE_BINDER( m_Bindings, SampleDesc, Quality, Uint32, Validator<Uint32>("Quality", 0,std::numeric_limits<Uint32>::max()) );
+ using CountType = decltype(SampleDesc::Count);
+ DEFINE_BINDER_EX( m_Bindings, SampleDesc, Count, CountType, Validator<CountType>("Count", 1,32) );
+ using QualityType = decltype(SampleDesc::Quality);
+ DEFINE_BINDER_EX( m_Bindings, SampleDesc, Quality, QualityType, Validator<QualityType>("Quality", 0,std::numeric_limits<QualityType>::max()) );
}
virtual void GetValue( lua_State *L, const void* pBasePointer )override
@@ -127,18 +129,18 @@ namespace Diligent
{
std::vector<String> AllowedMetatable = { "Metatables.Shader" };
- DEFINE_BINDER( m_Bindings, GraphicsPipelineDesc, pVS, EngineObjectPtrLoader<IShader>, AllowedMetatable );
- DEFINE_BINDER( m_Bindings, GraphicsPipelineDesc, pPS, EngineObjectPtrLoader<IShader>, AllowedMetatable );
- DEFINE_BINDER( m_Bindings, GraphicsPipelineDesc, pDS, EngineObjectPtrLoader<IShader>, AllowedMetatable );
- DEFINE_BINDER( m_Bindings, GraphicsPipelineDesc, pHS, EngineObjectPtrLoader<IShader>, AllowedMetatable );
- DEFINE_BINDER( m_Bindings, GraphicsPipelineDesc, pGS, EngineObjectPtrLoader<IShader>, AllowedMetatable );
+ DEFINE_BINDER_EX( m_Bindings, GraphicsPipelineDesc, pVS, EngineObjectPtrLoader<IShader>, AllowedMetatable );
+ DEFINE_BINDER_EX( m_Bindings, GraphicsPipelineDesc, pPS, EngineObjectPtrLoader<IShader>, AllowedMetatable );
+ DEFINE_BINDER_EX( m_Bindings, GraphicsPipelineDesc, pDS, EngineObjectPtrLoader<IShader>, AllowedMetatable );
+ DEFINE_BINDER_EX( m_Bindings, GraphicsPipelineDesc, pHS, EngineObjectPtrLoader<IShader>, AllowedMetatable );
+ DEFINE_BINDER_EX( m_Bindings, GraphicsPipelineDesc, pGS, EngineObjectPtrLoader<IShader>, AllowedMetatable );
//D3D12_STREAM_OUTPUT_DESC StreamOutput;
- DEFINE_BINDER( m_Bindings, GraphicsPipelineDesc, BlendDesc, BlendStateDesc, 0 )
- DEFINE_BINDER( m_Bindings, GraphicsPipelineDesc, SampleMask, Uint32, Validator<Uint32>() )
- DEFINE_BINDER( m_Bindings, GraphicsPipelineDesc, RasterizerDesc, RasterizerStateDesc, 0 )
- DEFINE_BINDER( m_Bindings, GraphicsPipelineDesc, DepthStencilDesc, DepthStencilStateDesc, 0 )
+ DEFINE_BINDER_EX( m_Bindings, GraphicsPipelineDesc, BlendDesc, BlendStateDesc, 0 );
+ DEFINE_BINDER( m_Bindings, GraphicsPipelineDesc, SampleMask );
+ DEFINE_BINDER_EX( m_Bindings, GraphicsPipelineDesc, RasterizerDesc, RasterizerStateDesc, 0 );
+ DEFINE_BINDER_EX( m_Bindings, GraphicsPipelineDesc, DepthStencilDesc, DepthStencilStateDesc, 0 );
auto *pLayoutElemBinder =
new MemberBinder<InputLayoutDesc>(
@@ -149,21 +151,52 @@ namespace Diligent
//D3D12_INDEX_BUFFER_STRIP_CUT_VALUE IBStripCutValue;
- DEFINE_ENUM_ELEMENT_MAPPING( m_PrimTopologyTypeEnumMapping, PRIMITIVE_TOPOLOGY_TYPE_UNDEFINED );
- DEFINE_ENUM_ELEMENT_MAPPING( m_PrimTopologyTypeEnumMapping, PRIMITIVE_TOPOLOGY_TYPE_POINT );
- DEFINE_ENUM_ELEMENT_MAPPING( m_PrimTopologyTypeEnumMapping, PRIMITIVE_TOPOLOGY_TYPE_LINE );
- DEFINE_ENUM_ELEMENT_MAPPING( m_PrimTopologyTypeEnumMapping, PRIMITIVE_TOPOLOGY_TYPE_TRIANGLE );
- DEFINE_ENUM_ELEMENT_MAPPING( m_PrimTopologyTypeEnumMapping, PRIMITIVE_TOPOLOGY_TYPE_PATCH );
- VERIFY( m_PrimTopologyTypeEnumMapping.m_Str2ValMap.size() == PRIMITIVE_TOPOLOGY_TYPE_NUM_TYPES,
- "Unexpected map size. Did you update PRIMITIVE_TOPOLOGY_TYPE enum?" );
- VERIFY( m_PrimTopologyTypeEnumMapping.m_Val2StrMap.size() == PRIMITIVE_TOPOLOGY_TYPE_NUM_TYPES,
- "Unexpected map size. Did you update PRIMITIVE_TOPOLOGY_TYPE enum?" );
- DEFINE_ENUM_BINDER( m_Bindings, GraphicsPipelineDesc, PrimitiveTopologyType, PRIMITIVE_TOPOLOGY_TYPE, m_PrimTopologyTypeEnumMapping );
-
- DEFINE_BINDER( m_Bindings, GraphicsPipelineDesc, RTVFormats, RTVFormatsParser, 0 );
- DEFINE_ENUM_BINDER( m_Bindings, GraphicsPipelineDesc, DSVFormat, TEXTURE_FORMAT, m_TexFmtEnumMapping );
+ DEFINE_ENUM_ELEMENT_MAPPING( m_PrimTopologyEnumMapping, PRIMITIVE_TOPOLOGY_TRIANGLE_LIST );
+ DEFINE_ENUM_ELEMENT_MAPPING( m_PrimTopologyEnumMapping, PRIMITIVE_TOPOLOGY_TRIANGLE_STRIP );
+ DEFINE_ENUM_ELEMENT_MAPPING( m_PrimTopologyEnumMapping, PRIMITIVE_TOPOLOGY_POINT_LIST );
+ DEFINE_ENUM_ELEMENT_MAPPING( m_PrimTopologyEnumMapping, PRIMITIVE_TOPOLOGY_LINE_LIST );
+ DEFINE_ENUM_ELEMENT_MAPPING( m_PrimTopologyEnumMapping, PRIMITIVE_TOPOLOGY_1_CONTROL_POINT_PATCHLIST );
+ DEFINE_ENUM_ELEMENT_MAPPING( m_PrimTopologyEnumMapping, PRIMITIVE_TOPOLOGY_2_CONTROL_POINT_PATCHLIST );
+ DEFINE_ENUM_ELEMENT_MAPPING( m_PrimTopologyEnumMapping, PRIMITIVE_TOPOLOGY_3_CONTROL_POINT_PATCHLIST );
+ DEFINE_ENUM_ELEMENT_MAPPING( m_PrimTopologyEnumMapping, PRIMITIVE_TOPOLOGY_4_CONTROL_POINT_PATCHLIST );
+ DEFINE_ENUM_ELEMENT_MAPPING( m_PrimTopologyEnumMapping, PRIMITIVE_TOPOLOGY_5_CONTROL_POINT_PATCHLIST );
+ DEFINE_ENUM_ELEMENT_MAPPING( m_PrimTopologyEnumMapping, PRIMITIVE_TOPOLOGY_6_CONTROL_POINT_PATCHLIST );
+ DEFINE_ENUM_ELEMENT_MAPPING( m_PrimTopologyEnumMapping, PRIMITIVE_TOPOLOGY_7_CONTROL_POINT_PATCHLIST );
+ DEFINE_ENUM_ELEMENT_MAPPING( m_PrimTopologyEnumMapping, PRIMITIVE_TOPOLOGY_8_CONTROL_POINT_PATCHLIST );
+ DEFINE_ENUM_ELEMENT_MAPPING( m_PrimTopologyEnumMapping, PRIMITIVE_TOPOLOGY_9_CONTROL_POINT_PATCHLIST );
+ DEFINE_ENUM_ELEMENT_MAPPING( m_PrimTopologyEnumMapping, PRIMITIVE_TOPOLOGY_10_CONTROL_POINT_PATCHLIST );
+ DEFINE_ENUM_ELEMENT_MAPPING( m_PrimTopologyEnumMapping, PRIMITIVE_TOPOLOGY_11_CONTROL_POINT_PATCHLIST );
+ DEFINE_ENUM_ELEMENT_MAPPING( m_PrimTopologyEnumMapping, PRIMITIVE_TOPOLOGY_12_CONTROL_POINT_PATCHLIST );
+ DEFINE_ENUM_ELEMENT_MAPPING( m_PrimTopologyEnumMapping, PRIMITIVE_TOPOLOGY_13_CONTROL_POINT_PATCHLIST );
+ DEFINE_ENUM_ELEMENT_MAPPING( m_PrimTopologyEnumMapping, PRIMITIVE_TOPOLOGY_14_CONTROL_POINT_PATCHLIST );
+ DEFINE_ENUM_ELEMENT_MAPPING( m_PrimTopologyEnumMapping, PRIMITIVE_TOPOLOGY_15_CONTROL_POINT_PATCHLIST );
+ DEFINE_ENUM_ELEMENT_MAPPING( m_PrimTopologyEnumMapping, PRIMITIVE_TOPOLOGY_16_CONTROL_POINT_PATCHLIST );
+ DEFINE_ENUM_ELEMENT_MAPPING( m_PrimTopologyEnumMapping, PRIMITIVE_TOPOLOGY_17_CONTROL_POINT_PATCHLIST );
+ DEFINE_ENUM_ELEMENT_MAPPING( m_PrimTopologyEnumMapping, PRIMITIVE_TOPOLOGY_18_CONTROL_POINT_PATCHLIST );
+ DEFINE_ENUM_ELEMENT_MAPPING( m_PrimTopologyEnumMapping, PRIMITIVE_TOPOLOGY_19_CONTROL_POINT_PATCHLIST );
+ DEFINE_ENUM_ELEMENT_MAPPING( m_PrimTopologyEnumMapping, PRIMITIVE_TOPOLOGY_20_CONTROL_POINT_PATCHLIST );
+ DEFINE_ENUM_ELEMENT_MAPPING( m_PrimTopologyEnumMapping, PRIMITIVE_TOPOLOGY_21_CONTROL_POINT_PATCHLIST );
+ DEFINE_ENUM_ELEMENT_MAPPING( m_PrimTopologyEnumMapping, PRIMITIVE_TOPOLOGY_22_CONTROL_POINT_PATCHLIST );
+ DEFINE_ENUM_ELEMENT_MAPPING( m_PrimTopologyEnumMapping, PRIMITIVE_TOPOLOGY_23_CONTROL_POINT_PATCHLIST );
+ DEFINE_ENUM_ELEMENT_MAPPING( m_PrimTopologyEnumMapping, PRIMITIVE_TOPOLOGY_24_CONTROL_POINT_PATCHLIST );
+ DEFINE_ENUM_ELEMENT_MAPPING( m_PrimTopologyEnumMapping, PRIMITIVE_TOPOLOGY_25_CONTROL_POINT_PATCHLIST );
+ DEFINE_ENUM_ELEMENT_MAPPING( m_PrimTopologyEnumMapping, PRIMITIVE_TOPOLOGY_26_CONTROL_POINT_PATCHLIST );
+ DEFINE_ENUM_ELEMENT_MAPPING( m_PrimTopologyEnumMapping, PRIMITIVE_TOPOLOGY_27_CONTROL_POINT_PATCHLIST );
+ DEFINE_ENUM_ELEMENT_MAPPING( m_PrimTopologyEnumMapping, PRIMITIVE_TOPOLOGY_28_CONTROL_POINT_PATCHLIST );
+ DEFINE_ENUM_ELEMENT_MAPPING( m_PrimTopologyEnumMapping, PRIMITIVE_TOPOLOGY_29_CONTROL_POINT_PATCHLIST );
+ DEFINE_ENUM_ELEMENT_MAPPING( m_PrimTopologyEnumMapping, PRIMITIVE_TOPOLOGY_30_CONTROL_POINT_PATCHLIST );
+ DEFINE_ENUM_ELEMENT_MAPPING( m_PrimTopologyEnumMapping, PRIMITIVE_TOPOLOGY_31_CONTROL_POINT_PATCHLIST );
+ DEFINE_ENUM_ELEMENT_MAPPING( m_PrimTopologyEnumMapping, PRIMITIVE_TOPOLOGY_32_CONTROL_POINT_PATCHLIST );
+ VERIFY( m_PrimTopologyEnumMapping.m_Str2ValMap.size() == PRIMITIVE_TOPOLOGY_NUM_TOPOLOGIES - 1,
+ "Unexpected map size. Did you update PRIMITIVE_TOPOLOGY enum?" );
+ VERIFY( m_PrimTopologyEnumMapping.m_Val2StrMap.size() == PRIMITIVE_TOPOLOGY_NUM_TOPOLOGIES - 1,
+ "Unexpected map size. Did you update PRIMITIVE_TOPOLOGY enum?" );
+ DEFINE_ENUM_BINDER( m_Bindings, GraphicsPipelineDesc, PrimitiveTopology, m_PrimTopologyEnumMapping);
+
+ DEFINE_BINDER_EX( m_Bindings, GraphicsPipelineDesc, RTVFormats, RTVFormatsParser, 0 );
+ DEFINE_ENUM_BINDER( m_Bindings, GraphicsPipelineDesc, DSVFormat, m_TexFmtEnumMapping );
- DEFINE_BINDER( m_Bindings, GraphicsPipelineDesc, SmplDesc, SampleDesc, 0 );
+ DEFINE_BINDER_EX( m_Bindings, GraphicsPipelineDesc, SmplDesc, SampleDesc, 0 );
//Uint32 NodeMask;
}
@@ -181,7 +214,7 @@ namespace Diligent
}
private:
TextureFormatEnumMapping m_TexFmtEnumMapping;
- EnumMapping < PRIMITIVE_TOPOLOGY_TYPE > m_PrimTopologyTypeEnumMapping;
+ EnumMapping < PRIMITIVE_TOPOLOGY > m_PrimTopologyEnumMapping;
BindingsMapType m_Bindings;
};
@@ -194,7 +227,7 @@ namespace Diligent
MemberBinderBase( MemberOffset )
{
std::vector<String> AllowedMetatable = { "Metatables.Shader" };
- DEFINE_BINDER( m_Bindings, ComputePipelineDesc, pCS, EngineObjectPtrLoader<IShader>, AllowedMetatable );
+ DEFINE_BINDER_EX( m_Bindings, ComputePipelineDesc, pCS, EngineObjectPtrLoader<IShader>, AllowedMetatable );
}
virtual void GetValue( lua_State *L, const void* pBasePointer )override
@@ -221,11 +254,13 @@ namespace Diligent
{
DEFINE_BUFFERED_STRING_BINDER( m_Bindings, PSODescWrapper, Name, NameBuffer )
- DEFINE_BINDER( m_Bindings, PSODescWrapper, IsComputePipeline, Bool, Validator<Bool>() )
- DEFINE_BINDER( m_Bindings, PSODescWrapper, SRBAllocationGranularity, Uint32, Validator<Uint32>("SRBAllocationGranularity", 1, 65536) )
+ DEFINE_BINDER( m_Bindings, PSODescWrapper, IsComputePipeline );
+ using SRBAllocationGranularityType = decltype(PSODescWrapper::SRBAllocationGranularity);
+ Validator<SRBAllocationGranularityType> SRBValidator("SRBAllocationGranularity", 1, 65536);
+ DEFINE_BINDER_EX( m_Bindings, PSODescWrapper, SRBAllocationGranularity, SRBAllocationGranularityType, SRBValidator);
- DEFINE_BINDER( m_Bindings, PSODescWrapper, GraphicsPipeline, GraphicsPipelineDesc, 0 )
- DEFINE_BINDER( m_Bindings, PSODescWrapper, ComputePipeline, ComputePipelineDesc, 0 )
+ DEFINE_BINDER_EX( m_Bindings, PSODescWrapper, GraphicsPipeline, GraphicsPipelineDesc, 0 );
+ DEFINE_BINDER_EX( m_Bindings, PSODescWrapper, ComputePipeline, ComputePipelineDesc, 0 );
};
void PSODescParser::CreateObj( lua_State *L )
diff --git a/RenderScript/src/RasterizerStateDescParser.cpp b/RenderScript/src/RasterizerStateDescParser.cpp
index 876ec4a..a2901dd 100644
--- a/RenderScript/src/RasterizerStateDescParser.cpp
+++ b/RenderScript/src/RasterizerStateDescParser.cpp
@@ -36,7 +36,7 @@ namespace Diligent
"Unexpected map size. Did you update FILL_MODE enum?" );
VERIFY( m_FillModeEnumMapping.m_Val2StrMap.size() == FILL_MODE_NUM_MODES-1,
"Unexpected map size. Did you update FILL_MODE enum?" );
- DEFINE_ENUM_BINDER( m_Bindings, RasterizerStateDesc, FillMode, FILL_MODE, m_FillModeEnumMapping );
+ DEFINE_ENUM_BINDER( m_Bindings, RasterizerStateDesc, FillMode, m_FillModeEnumMapping );
DEFINE_ENUM_ELEMENT_MAPPING( m_CullModeEnumMapping, CULL_MODE_NONE );
DEFINE_ENUM_ELEMENT_MAPPING( m_CullModeEnumMapping, CULL_MODE_FRONT );
@@ -45,15 +45,15 @@ namespace Diligent
"Unexpected map size. Did you update CULL_MODE enum?" );
VERIFY( m_CullModeEnumMapping.m_Val2StrMap.size() == CULL_MODE_NUM_MODES-1,
"Unexpected map size. Did you update CULL_MODE enum?" );
- DEFINE_ENUM_BINDER( m_Bindings, RasterizerStateDesc, CullMode, CULL_MODE, m_CullModeEnumMapping );
+ DEFINE_ENUM_BINDER( m_Bindings, RasterizerStateDesc, CullMode, m_CullModeEnumMapping );
- DEFINE_BINDER( m_Bindings, RasterizerStateDesc, FrontCounterClockwise, Bool, Validator<Bool>() );
- DEFINE_BINDER( m_Bindings, RasterizerStateDesc, DepthBias, Int32, Validator<Int32>() );
- DEFINE_BINDER( m_Bindings, RasterizerStateDesc, DepthBiasClamp, Float32, Validator<Float32>() );
- DEFINE_BINDER( m_Bindings, RasterizerStateDesc, SlopeScaledDepthBias, Float32, Validator<Float32>() );
- DEFINE_BINDER( m_Bindings, RasterizerStateDesc, DepthClipEnable, Bool, Validator<Bool>() );
- DEFINE_BINDER( m_Bindings, RasterizerStateDesc, ScissorEnable, Bool, Validator<Bool>() );
- DEFINE_BINDER( m_Bindings, RasterizerStateDesc, AntialiasedLineEnable, Bool, Validator<Bool>() );
+ DEFINE_BINDER( m_Bindings, RasterizerStateDesc, FrontCounterClockwise );
+ DEFINE_BINDER( m_Bindings, RasterizerStateDesc, DepthBias );
+ DEFINE_BINDER( m_Bindings, RasterizerStateDesc, DepthBiasClamp );
+ DEFINE_BINDER( m_Bindings, RasterizerStateDesc, SlopeScaledDepthBias );
+ DEFINE_BINDER( m_Bindings, RasterizerStateDesc, DepthClipEnable );
+ DEFINE_BINDER( m_Bindings, RasterizerStateDesc, ScissorEnable );
+ DEFINE_BINDER( m_Bindings, RasterizerStateDesc, AntialiasedLineEnable );
};
void MemberBinder<RasterizerStateDesc> ::GetValue(lua_State *L, const void* pBasePointer)
diff --git a/RenderScript/src/ResourceMappingParser.cpp b/RenderScript/src/ResourceMappingParser.cpp
index e27f00d..1020635 100644
--- a/RenderScript/src/ResourceMappingParser.cpp
+++ b/RenderScript/src/ResourceMappingParser.cpp
@@ -41,8 +41,8 @@ namespace Diligent
m_pBuffViewParser( pBuffViewParser ),
m_MappedResourceMetatables( { pTexViewParser->GetMetatableName(), pBuffParser->GetMetatableName(), pBuffViewParser->GetMetatableName() } )
{
- DEFINE_BINDER( m_Bindings, ResourceMappingEntry, Name, const Char*, SkipValidationFunc<const Char*> )
- DEFINE_BINDER( m_Bindings, ResourceMappingEntry, pObject, EngineObjectPtrLoader<IDeviceObject>, m_MappedResourceMetatables );
+ DEFINE_BINDER_EX( m_Bindings, ResourceMappingEntry, Name, const Char*, SkipValidationFunc<const Char*> );
+ DEFINE_BINDER_EX( m_Bindings, ResourceMappingEntry, pObject, EngineObjectPtrLoader<IDeviceObject>, m_MappedResourceMetatables );
};
void ResourceMappingParser::CreateObj( lua_State *L )
diff --git a/RenderScript/src/ScissorRectParser.cpp b/RenderScript/src/ScissorRectParser.cpp
index 1123462..b37b75f 100644
--- a/RenderScript/src/ScissorRectParser.cpp
+++ b/RenderScript/src/ScissorRectParser.cpp
@@ -35,10 +35,10 @@ namespace Diligent
m_ScissorRects.reserve( 8 );
// NumVertices and NumIndices are in Union
- DEFINE_BINDER( m_Bindings, Rect, left, Int32, Validator<Int32>() )
- DEFINE_BINDER( m_Bindings, Rect, top, Int32, Validator<Int32>() )
- DEFINE_BINDER( m_Bindings, Rect, right, Int32, Validator<Int32>() )
- DEFINE_BINDER( m_Bindings, Rect, bottom, Int32, Validator<Int32>() )
+ DEFINE_BINDER( m_Bindings, Rect, left );
+ DEFINE_BINDER( m_Bindings, Rect, top );
+ DEFINE_BINDER( m_Bindings, Rect, right );
+ DEFINE_BINDER( m_Bindings, Rect, bottom );
};
void ScissorRectParser::CreateObj( lua_State *L )
diff --git a/RenderScript/src/ShaderParser.cpp b/RenderScript/src/ShaderParser.cpp
index b6dd7e6..fb3e8ff 100644
--- a/RenderScript/src/ShaderParser.cpp
+++ b/RenderScript/src/ShaderParser.cpp
@@ -62,7 +62,7 @@ namespace Diligent
m_VarDescBufferOffset(VarDescBufferOffset),
m_VarNamesBufferOffset(VarNamesBufferOffset)
{
- DEFINE_ENUM_BINDER( m_Bindings, ShaderVariableDesc, Type, SHADER_VARIABLE_TYPE, m_ShaderVarTypeEnumMapping )
+ DEFINE_ENUM_BINDER( m_Bindings, ShaderVariableDesc, Type, m_ShaderVarTypeEnumMapping );
}
virtual void GetValue( lua_State *L, const void* pBasePointer )override
@@ -289,9 +289,9 @@ namespace Diligent
// keep pointer to it
m_Bindings.insert( std::make_pair( "Name", std::unique_ptr<MemberBinderBase>(pNameBinder) ) );
- DEFINE_ENUM_BINDER( m_Bindings, ShaderDesc, ShaderType, SHADER_TYPE, m_ShaderTypeEnumMapping )
+ DEFINE_ENUM_BINDER( m_Bindings, ShaderDesc, ShaderType, m_ShaderTypeEnumMapping );
- DEFINE_ENUM_BINDER( m_Bindings, ShaderDesc, DefaultVariableType, SHADER_VARIABLE_TYPE, m_ShaderVarTypeEnumMapping )
+ DEFINE_ENUM_BINDER( m_Bindings, ShaderDesc, DefaultVariableType, m_ShaderVarTypeEnumMapping );
auto *pShaderDescBinder =
new MemberBinder<ShaderVariableDescArrayParser>(
@@ -343,7 +343,7 @@ namespace Diligent
DEFINE_ENUM_ELEMENT_MAPPING( m_ShaderSourceLangEnumMapping, SHADER_SOURCE_LANGUAGE_DEFAULT );
DEFINE_ENUM_ELEMENT_MAPPING( m_ShaderSourceLangEnumMapping, SHADER_SOURCE_LANGUAGE_HLSL );
DEFINE_ENUM_ELEMENT_MAPPING( m_ShaderSourceLangEnumMapping, SHADER_SOURCE_LANGUAGE_GLSL );
- DEFINE_ENUM_BINDER( m_Bindings, ShaderCreationAttribsWrapper, SourceLanguage, SHADER_SOURCE_LANGUAGE, m_ShaderSourceLangEnumMapping );
+ DEFINE_ENUM_BINDER( m_Bindings, ShaderCreationAttribsWrapper, SourceLanguage, m_ShaderSourceLangEnumMapping );
auto *pShaderDescBinder =
new MemberBinder<ShaderDescLoader>(
diff --git a/RenderScript/src/TextureParser.cpp b/RenderScript/src/TextureParser.cpp
index 168e7d6..2ccd683 100644
--- a/RenderScript/src/TextureParser.cpp
+++ b/RenderScript/src/TextureParser.cpp
@@ -36,8 +36,8 @@ namespace Diligent
MemberBinder(size_t MemberOffset, int /*Dummy*/) :
MemberBinderBase(MemberOffset)
{
- DEFINE_BINDER( m_Bindings, DepthStencilClearValue, Depth, Float32, Validator<Float32>("Depth clear value", 0.f, 1.f) )
- DEFINE_BINDER( m_Bindings, DepthStencilClearValue, Stencil, Uint8, Validator<Uint8>() )
+ DEFINE_BINDER_EX( m_Bindings, DepthStencilClearValue, Depth, Float32, Validator<Float32>("Depth clear value", 0.f, 1.f) );
+ DEFINE_BINDER( m_Bindings, DepthStencilClearValue, Stencil );
}
virtual void GetValue(lua_State *L, const void* pBasePointer)override
@@ -63,9 +63,9 @@ namespace Diligent
MemberBinder(size_t MemberOffset, int /*Dummy*/) :
MemberBinderBase(MemberOffset)
{
- DEFINE_ENUM_BINDER( m_Bindings, OptimizedClearValue, Format, TEXTURE_FORMAT, m_TexFmtEnumMapping );
- DEFINE_BINDER( m_Bindings, OptimizedClearValue, Color, RGBALoader, 0 )
- DEFINE_BINDER( m_Bindings, OptimizedClearValue, DepthStencil, DepthStencilClearValue, 0 )
+ DEFINE_ENUM_BINDER( m_Bindings, OptimizedClearValue, Format, m_TexFmtEnumMapping );
+ DEFINE_BINDER_EX( m_Bindings, OptimizedClearValue, Color, RGBALoader, 0 );
+ DEFINE_BINDER_EX( m_Bindings, OptimizedClearValue, DepthStencil, DepthStencilClearValue, 0 );
}
virtual void GetValue(lua_State *L, const void* pBasePointer)override
@@ -91,17 +91,45 @@ namespace Diligent
{
DEFINE_BUFFERED_STRING_BINDER( m_Bindings, STexDescWrapper, Name, NameBuffer )
- DEFINE_ENUM_BINDER( m_Bindings, STexDescWrapper, Type, RESOURCE_DIMENSION, m_TexTypeEnumMapping );
+ DEFINE_ENUM_BINDER( m_Bindings, STexDescWrapper, Type, m_TexTypeEnumMapping );
- DEFINE_BINDER( m_Bindings, STexDescWrapper, Width, Uint32, Validator<Uint32>( "Width", 1, 16384 ) );
- DEFINE_BINDER( m_Bindings, STexDescWrapper, Height, Uint32, Validator<Uint32>( "Heihght", 1, 16384 ) );
- DEFINE_BINDER( m_Bindings, STexDescWrapper, ArraySize, Uint32, Validator<Uint32>( "ArraySize", 1, 16384 ) );
- DEFINE_BINDER( m_Bindings, STexDescWrapper, Depth, Uint32, Validator<Uint32>( "Depth", 1, 16384 ) );
+ {
+ using WidthType = decltype(STexDescWrapper::Width);
+ Validator<WidthType> WidthValidator("Width", 1, 16384);
+ DEFINE_BINDER_EX( m_Bindings, STexDescWrapper, Width, WidthType, WidthValidator);
+ }
+
+ {
+ using HeightType = decltype(STexDescWrapper::Height);
+ Validator<HeightType> HeightValidator("Heihght", 1, 16384);
+ DEFINE_BINDER_EX( m_Bindings, STexDescWrapper, Height, HeightType, HeightValidator);
+ }
+
+ {
+ using ArraySizeType = decltype(STexDescWrapper::ArraySize);
+ Validator<ArraySizeType> ArraySizeValidator("ArraySize", 1, 16384);
+ DEFINE_BINDER_EX( m_Bindings, STexDescWrapper, ArraySize, ArraySizeType, ArraySizeValidator);
+ }
+
+ {
+ using DepthType = decltype(STexDescWrapper::Depth);
+ Validator<DepthType> DepthValidator("Depth", 1, 16384);
+ DEFINE_BINDER_EX( m_Bindings, STexDescWrapper, Depth, DepthType, DepthValidator);
+ }
+
+ DEFINE_ENUM_BINDER( m_Bindings, STexDescWrapper, Format, m_TexFormatEnumMapping );
- DEFINE_ENUM_BINDER( m_Bindings, STexDescWrapper, Format, TEXTURE_FORMAT, m_TexFormatEnumMapping );
+ {
+ using MipLevelsType = decltype(STexDescWrapper::MipLevels);
+ Validator<MipLevelsType> MipLevelsValidator("MipLevels", 1, 20);
+ DEFINE_BINDER_EX( m_Bindings, STexDescWrapper, MipLevels, MipLevelsType, MipLevelsValidator);
+ }
- DEFINE_BINDER( m_Bindings, STexDescWrapper, MipLevels, Uint32, Validator<Uint32>( "MipLevels", 1, 20 ) );
- DEFINE_BINDER( m_Bindings, STexDescWrapper, SampleCount, Uint32, Validator<Uint32>( "SampleCount", 1, 32 ) );
+ {
+ using SampleCountType = decltype(STexDescWrapper::SampleCount);
+ Validator<SampleCountType> SampleCountValidator("SampleCount", 1, 32);
+ DEFINE_BINDER_EX( m_Bindings, STexDescWrapper, SampleCount, SampleCountType, SampleCountValidator);
+ }
//DEFINE_ENUM_ELEMENT_MAPPING( m_BindFlagEnumMapping, BIND_VERTEX_BUFFER );
//DEFINE_ENUM_ELEMENT_MAPPING( m_BindFlagEnumMapping, BIND_INDEX_BUFFER );
@@ -116,13 +144,13 @@ namespace Diligent
// name conflicts when building for windows store
DEFINE_FLAGS_BINDER( m_Bindings, STexDescWrapper, BindFlags, Diligent::BIND_FLAGS, m_BindFlagEnumMapping );
- DEFINE_ENUM_BINDER( m_Bindings, STexDescWrapper, Usage, USAGE, m_UsageEnumMapping )
+ DEFINE_ENUM_BINDER( m_Bindings, STexDescWrapper, Usage, m_UsageEnumMapping );
DEFINE_FLAGS_BINDER( m_Bindings, STexDescWrapper, CPUAccessFlags, CPU_ACCESS_FLAG, m_CpuAccessFlagEnumMapping );
DEFINE_ENUM_ELEMENT_MAPPING( m_MiscFlagEnumMapping, MISC_TEXTURE_FLAG_GENERATE_MIPS );
DEFINE_FLAGS_BINDER( m_Bindings, STexDescWrapper, MiscFlags, Diligent::MISC_TEXTURE_FLAG, m_MiscFlagEnumMapping );
- DEFINE_BINDER( m_Bindings, STexDescWrapper, ClearValue, OptimizedClearValue, 0 );
+ DEFINE_BINDER_EX( m_Bindings, STexDescWrapper, ClearValue, OptimizedClearValue, 0 );
};
void TextureParser::CreateObj( lua_State *L )
diff --git a/RenderScript/src/TextureViewParser.cpp b/RenderScript/src/TextureViewParser.cpp
index 1abc373..c80fcc4 100644
--- a/RenderScript/src/TextureViewParser.cpp
+++ b/RenderScript/src/TextureViewParser.cpp
@@ -52,21 +52,48 @@ namespace Diligent
"Unexpected map size. Did you update TEXTURE_VIEW_TYPE enum?" );
VERIFY( m_ViewTypeEnumMapping.m_Val2StrMap.size() == TEXTURE_VIEW_NUM_VIEWS - 1,
"Unexpected map size. Did you update TEXTURE_VIEW_TYPE enum?" );
- DEFINE_ENUM_BINDER( m_Bindings, STexViewDescWrapper, ViewType, TEXTURE_VIEW_TYPE, m_ViewTypeEnumMapping );
+ DEFINE_ENUM_BINDER( m_Bindings, STexViewDescWrapper, ViewType, m_ViewTypeEnumMapping );
- DEFINE_ENUM_BINDER( m_Bindings, STexViewDescWrapper, TextureDim, RESOURCE_DIMENSION, m_TexTypeEnumMapping );
- DEFINE_ENUM_BINDER( m_Bindings, STexViewDescWrapper, Format, TEXTURE_FORMAT, m_TexFormatEnumMapping );
-
- DEFINE_BINDER( m_Bindings, STexViewDescWrapper, MostDetailedMip, Uint32, Validator<Uint32>( "MostDetailedMip", 0, 16384 ) );
- DEFINE_BINDER( m_Bindings, STexViewDescWrapper, NumMipLevels, Uint32, Validator<Uint32>( "NumMipLevels", 1, 16384 ) );
-
- // The following two members are in enum
- DEFINE_BINDER( m_Bindings, STexViewDescWrapper, FirstArraySlice, Uint32, Validator<Uint32>( "FirstArraySlice", 0, 16384 ) );
- DEFINE_BINDER( m_Bindings, STexViewDescWrapper, FirstDepthSlice, Uint32, Validator<Uint32>( "FirstDepthSlice", 0, 16384 ) );
-
- // The following two members are in enum
- DEFINE_BINDER( m_Bindings, STexViewDescWrapper, NumArraySlices, Uint32, Validator<Uint32>( "NumArraySlices", 0, 16384 ) );
- DEFINE_BINDER( m_Bindings, STexViewDescWrapper, NumDepthSlices, Uint32, Validator<Uint32>( "NumDepthSlices", 0, 16384 ) );
+ DEFINE_ENUM_BINDER( m_Bindings, STexViewDescWrapper, TextureDim, m_TexTypeEnumMapping );
+ DEFINE_ENUM_BINDER( m_Bindings, STexViewDescWrapper, Format, m_TexFormatEnumMapping );
+
+ {
+ using MostDetailedMipType = decltype(STexViewDescWrapper::MostDetailedMip);
+ Validator<MostDetailedMipType> MostDetailedMipValidator("MostDetailedMip", 0, 16384);
+ DEFINE_BINDER_EX( m_Bindings, STexViewDescWrapper, MostDetailedMip, MostDetailedMipType, MostDetailedMipValidator);
+ }
+
+ {
+ using NumMipLevelsType = decltype(STexViewDescWrapper::NumMipLevels);
+ Validator<NumMipLevelsType> NumMipLevelsValidator("NumMipLevels", 1, 16384);
+ DEFINE_BINDER_EX( m_Bindings, STexViewDescWrapper, NumMipLevels, NumMipLevelsType, NumMipLevelsValidator);
+ }
+
+ // The following two members are in union
+ {
+ using FirstArraySliceType = decltype(STexViewDescWrapper::FirstArraySlice);
+ Validator<FirstArraySliceType> FirstArraySliceValidator("FirstArraySlice", 0, 16384);
+ DEFINE_BINDER_EX( m_Bindings, STexViewDescWrapper, FirstArraySlice, FirstArraySliceType, FirstArraySliceValidator);
+ }
+
+ {
+ using FirstDepthSliceType = decltype(STexViewDescWrapper::FirstDepthSlice);
+ Validator<FirstDepthSliceType> FirstDepthSliceValidator("FirstDepthSlice", 0, 16384);
+ DEFINE_BINDER_EX( m_Bindings, STexViewDescWrapper, FirstDepthSlice, FirstDepthSliceType, FirstDepthSliceValidator);
+ }
+
+ // The following two members are in union
+ {
+ using NumArraySlicesType = decltype(STexViewDescWrapper::NumArraySlices);
+ Validator<NumArraySlicesType> NumArraySlicesValidator("NumArraySlices", 0, 16384);
+ DEFINE_BINDER_EX( m_Bindings, STexViewDescWrapper, NumArraySlices, NumArraySlicesType, NumArraySlicesValidator);
+ }
+
+ {
+ using NumDepthSlicesType = decltype(STexViewDescWrapper::NumDepthSlices);
+ Validator<NumDepthSlicesType> NumDepthSlicesValidator("NumDepthSlices", 0, 16384);
+ DEFINE_BINDER_EX( m_Bindings, STexViewDescWrapper, NumDepthSlices, NumDepthSlicesType, NumDepthSlicesValidator);
+ }
DEFINE_ENUM_ELEMENT_MAPPING( m_UAVAccessFlagEnumMapping, UAV_ACCESS_FLAG_READ );
DEFINE_ENUM_ELEMENT_MAPPING( m_UAVAccessFlagEnumMapping, UAV_ACCESS_FLAG_WRITE );
diff --git a/RenderScript/src/ViewportParser.cpp b/RenderScript/src/ViewportParser.cpp
index 7e23222..9720b0e 100644
--- a/RenderScript/src/ViewportParser.cpp
+++ b/RenderScript/src/ViewportParser.cpp
@@ -35,12 +35,12 @@ namespace Diligent
m_Viewports.reserve( 8 );
// NumVertices and NumIndices are in Union
- DEFINE_BINDER( m_Bindings, Viewport, TopLeftX, Float32, Validator<Float32>() )
- DEFINE_BINDER( m_Bindings, Viewport, TopLeftY, Float32, Validator<Float32>() )
- DEFINE_BINDER( m_Bindings, Viewport, Width, Float32, Validator<Float32>() )
- DEFINE_BINDER( m_Bindings, Viewport, Height, Float32, Validator<Float32>() )
- DEFINE_BINDER( m_Bindings, Viewport, MinDepth, Float32, Validator<Float32>() )
- DEFINE_BINDER( m_Bindings, Viewport, MaxDepth, Float32, Validator<Float32>() )
+ DEFINE_BINDER( m_Bindings, Viewport, TopLeftX );
+ DEFINE_BINDER( m_Bindings, Viewport, TopLeftY );
+ DEFINE_BINDER( m_Bindings, Viewport, Width );
+ DEFINE_BINDER( m_Bindings, Viewport, Height );
+ DEFINE_BINDER( m_Bindings, Viewport, MinDepth );
+ DEFINE_BINDER( m_Bindings, Viewport, MaxDepth );
};
void ViewportParser::CreateObj( lua_State *L )