From c09883fbe3951cd77543003ae1c6fdf6e5a11517 Mon Sep 17 00:00:00 2001 From: Egor Yusov Date: Sat, 14 Apr 2018 11:29:09 -0700 Subject: Moved primitive topology from draw attribs to pipeline desc; fixed multiple issue with mismatching types used by Lua parsers --- RenderScript/src/InputLayoutDescParser.cpp | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) (limited to 'RenderScript/src/InputLayoutDescParser.cpp') 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( "Input Index", 0, 32 ) ) - DEFINE_BINDER( m_Bindings, LayoutElement, BufferSlot, Uint32, Validator( "Buffer Slot", 0, MaxBufferSlots ) ) - DEFINE_BINDER( m_Bindings, LayoutElement, NumComponents, Uint32, Validator( "Num Components", 1, 4 ) ) + using InputIndexType = decltype(LayoutElement::InputIndex); + DEFINE_BINDER_EX( m_Bindings, LayoutElement, InputIndex, InputIndexType, Validator( "Input Index", 0, 32 ) ); + using BufferSlotType = decltype(LayoutElement::BufferSlot); + DEFINE_BINDER_EX( m_Bindings, LayoutElement, BufferSlot, BufferSlotType, Validator( "Buffer Slot", 0, MaxBufferSlots ) ); + using NumComponentsType = decltype(LayoutElement::NumComponents); + DEFINE_BINDER_EX( m_Bindings, LayoutElement, NumComponents, NumComponentsType, Validator( "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() ) - DEFINE_BINDER( m_Bindings, LayoutElement, RelativeOffset, Uint32, Validator() ) + 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() ) + DEFINE_BINDER( m_Bindings, LayoutElement, InstanceDataStepRate ); } void MemberBinder :: GetValue( lua_State *L, const void* pBasePointer ) -- cgit v1.2.3