From 532ac6fdf57b759dd705a10ad4e683a7315545a2 Mon Sep 17 00:00:00 2001 From: lisyarus Date: Sun, 30 Aug 2020 08:45:44 +0300 Subject: [PATCH] Fix mesh attribute stride calculation --- libs/gfx/include/psemek/gfx/mesh.hpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/libs/gfx/include/psemek/gfx/mesh.hpp b/libs/gfx/include/psemek/gfx/mesh.hpp index d77b0f60..47522534 100644 --- a/libs/gfx/include/psemek/gfx/mesh.hpp +++ b/libs/gfx/include/psemek/gfx/mesh.hpp @@ -157,7 +157,7 @@ namespace psemek::gfx } else { - return sizeof(Attr); + return sizeof(typename attrib_traits::attrib_type); } } @@ -181,7 +181,7 @@ namespace psemek::gfx { static std::size_t setup() { - std::size_t const stride = (0 + ... + attr_size()); + std::size_t const stride = attr_size() + (0 + ... + attr_size()); setup_impl(0, 0, stride); return stride; }