diff --git a/libs/gfx/include/psemek/gfx/attribs.hpp b/libs/gfx/include/psemek/gfx/attribs.hpp index a3d9efab..bc2a13d4 100644 --- a/libs/gfx/include/psemek/gfx/attribs.hpp +++ b/libs/gfx/include/psemek/gfx/attribs.hpp @@ -85,6 +85,13 @@ namespace psemek::gfx using type = T; }; + template + struct instanced> + { + using type = padding; + static constexpr std::size_t size = N; + }; + template attribs_description make_attribs_description(); @@ -275,6 +282,10 @@ namespace psemek::gfx struct is_padding> : std::true_type {}; + template + struct is_padding>> : std::true_type + {}; + template struct is_instanced : std::false_type {}; @@ -359,7 +370,10 @@ namespace psemek::gfx } else if constexpr (is_padding::value) { - make_attribs_description_impl::make_impl(result, index, Instance ? offset : offset + Attr1::size); + if constexpr (is_instanced::value == Instance) + make_attribs_description_impl::make_impl(result, index, offset + Attr1::size); + else + make_attribs_description_impl::make_impl(result, index, offset); } else if constexpr (is_instanced::value == Instance) {