diff --git a/CMakeLists.txt b/CMakeLists.txt index ac9535b..10c9210 100755 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -157,7 +157,6 @@ add_executable(z3d main.cpp include/assets/prefetch_queue.hpp include/util/string_list.hpp include/assets/data_stores/material_library_store.hpp - source/assets/data_stores/generic/generic_dynamic_component_array_store.ipp include/assets/data/material_library_data.hpp include/assets/data_loaders/material_library_loader.hpp include/assets/prefetch_lookups/material_library_prefetch_lookup.hpp diff --git a/include/assets/data_views/mesh_view.hpp b/include/assets/data_views/mesh_view.hpp index 6210315..57fbd3e 100644 --- a/include/assets/data_views/mesh_view.hpp +++ b/include/assets/data_views/mesh_view.hpp @@ -18,6 +18,7 @@ struct generic_mesh_view mesh_vertex_components::flags component_flags; std::span indices; std::tuple...> vertex_component_arrays; + std::size_t vertex_count; material_store::id_type material_id; }; diff --git a/include/assets/data_views/point_cloud_view.hpp b/include/assets/data_views/point_cloud_view.hpp index 3af6fc8..2da41e7 100644 --- a/include/assets/data_views/point_cloud_view.hpp +++ b/include/assets/data_views/point_cloud_view.hpp @@ -13,8 +13,9 @@ namespace detail template struct generic_point_cloud_view { - point_cloud_vertex_components::flags vertex_components; + point_cloud_vertex_components::flags vertex_component_flags; std::tuple...> vertex_component_arrays; + std::size_t point_count; }; } diff --git a/include/opengl/data/point_cloud_data.hpp b/include/opengl/data/point_cloud_data.hpp index c100dc1..b571dda 100644 --- a/include/opengl/data/point_cloud_data.hpp +++ b/include/opengl/data/point_cloud_data.hpp @@ -39,7 +39,7 @@ public: [[nodiscard]] point_cloud_handle handle() const; - [[nodiscard]] point_cloud_vertex_components::flags components() const; + [[nodiscard]] assets::point_cloud_vertex_components::flags components() const; private: point_cloud_handle m_handle{}; diff --git a/include/opengl/vertex_buffer_utils.hpp b/include/opengl/vertex_buffer_utils.hpp index 82a0d8c..175dada 100644 --- a/include/opengl/vertex_buffer_utils.hpp +++ b/include/opengl/vertex_buffer_utils.hpp @@ -100,7 +100,10 @@ void interlace( buffers... ); - const auto vertex_count = std::min({ buffers.size()... }); + const auto vertex_count = std::min({ + + buffers.size()... + }); const auto buffer_size = stride * vertex_count; vertex_buffer.resize(buffer_size); diff --git a/source/assets/data_stores/generic/generic_dynamic_component_array_store.ipp b/source/assets/data_stores/generic/generic_dynamic_component_array_store.ipp deleted file mode 100644 index fbd7493..0000000 --- a/source/assets/data_stores/generic/generic_dynamic_component_array_store.ipp +++ /dev/null @@ -1,394 +0,0 @@ -#ifndef INCLUDE_GENERIC_DYNAMIC_COMPONENT_ARRAY_STORE_IMPLEMENTATION -# error Never include this file directly include 'generic_dynamic_component_array_store.hpp' -#endif -#include - -template -component_array_iterator::component_array_iterator( - id_array_pointer_type ids, - const component_array_pointer_type& components, - flag_count_pointer_type flags, - std::size_t index, - const offsets_type& offsets -) : - m_ids{ ids }, - m_components{ components }, - m_flag_counts{ flags }, - m_index{ index }, - m_offsets{ offsets } {} - - -template -typename component_array_iterator::reference component_array_iterator::operator*() const { - return dereference(std::index_sequence_for{}); -} - -template -component_array_iterator& component_array_iterator::operator++() { - adjust_offsets(std::index_sequence_for{}, 1); - ++m_index; - return *this; -} - -template -component_array_iterator component_array_iterator::operator++(int) { - component_array_iterator tmp = *this; - ++(*this); - return tmp; -} - -template -component_array_iterator& component_array_iterator::operator--() { - adjust_offsets(std::index_sequence_for{}, -1); - --m_index; - return *this; -} - -template -component_array_iterator component_array_iterator::operator--(int) { - auto tmp = *this; - --(*this); - return tmp; -} - -template -component_array_iterator& component_array_iterator::operator+=(const difference_type n) -{ - adjust_offsets(std::index_sequence_for{}, n); - m_index += n; - return *this; -} - -template -component_array_iterator& component_array_iterator::operator-=(const difference_type n) -{ - return (*this) += -n; -} - -template -component_array_iterator component_array_iterator::operator+(const difference_type n) const -{ - auto tmp = *this; - return tmp += n; // TODO clion says n is unused -} - -template -component_array_iterator component_array_iterator::operator-(const difference_type n) const -{ - auto tmp = *this; - return tmp -= n; // TODO clion says n is unused -} - -template -typename component_array_iterator::difference_type -component_array_iterator::operator-(const component_array_iterator& other) const -{ - return static_cast(m_index) - static_cast(other.m_index); -} - -template -typename component_array_iterator::reference component_array_iterator::operator[]( - const difference_type n -) const { - return *((*this) + n); -} - -template -bool component_array_iterator::operator==(const component_array_iterator& other) const -{ - return m_ids == other.m_ids and m_index == other.m_index; -} - -template -bool component_array_iterator::operator!=(const component_array_iterator& other) const -{ - return not (*this == other); -} - -template -bool component_array_iterator::operator<(const component_array_iterator& other) const -{ - return m_index < other.m_index; -} - -template -bool component_array_iterator::operator<=(const component_array_iterator& other) const -{ - return m_index <= other.m_index; -} - -template -bool component_array_iterator::operator>(const component_array_iterator& other) const -{ - return m_index > other.m_index; -} - -template -bool component_array_iterator::operator>=(const component_array_iterator& other) const -{ - return m_index >= other.m_index; -} - -template -template -bool component_array_iterator::is_component_enabled(C flag) -{ - return (flag & (C{1} << I)) != C{}; -} - -template -template -void component_array_iterator::calc_offsets(std::index_sequence, difference_type n) -{ - - const auto negative = n < difference_type{ 0 }; - const auto positive = n > difference_type{ 0 }; - const auto step = difference_type{ positive } - difference_type{ negative }; - n = negative ? -n : n; - - // TODO template optimize for single steps - - while (n--) - { - const auto& [ flags, count ] = m_flag_counts[m_index]; - - ([&] { - if (is_component_enabled(flags)) - { - std::get(m_offsets) += step * count; - } - }(), ...); - - m_index += step; - } -} - -template -template -typename component_array_iterator::reference -component_array_iterator::dereference(std::index_sequence) const -{ - const auto& [ flags, component_count ] = m_flag_counts[m_index]; - - return std::make_pair( - m_ids[m_index], - std::make_tuple( - flags, - std::make_tuple( - std::span( - &std::get(m_components)[m_offsets[Is]], - is_component_enabled(flags) ? component_count : 0 - )... - ) - ) - ); -} - -template -std::tuple...> generic_dynamic_component_array_store::component_array_ptrs() -{ - return [&](std::index_sequence) - { - return std::make_tuple(std::get(m_component_arrays).data()...); - } - (std::index_sequence_for{}); -} - -template -std::tuple>...> generic_dynamic_component_array_store::component_array_ptrs() const -{ - return [&](std::index_sequence) - { - return std::make_tuple(std::get(m_component_arrays).data()...); - } - (std::index_sequence_for{}); -} - -template -std::array generic_dynamic_component_array_store::array_counts() const -{ - return [&](std::index_sequence) - { - return std::array{ std::get(m_component_arrays).size()... }; - } - (std::index_sequence_for{}); -} - -template -typename generic_dynamic_component_array_store::id_type generic_dynamic_component_array_store::add( - const std::tuple...>& component_arrays -) { - - auto component_flags = C{}; - auto min_component_count = count_type{}; - - [&](std::integer_sequence) - { - const auto& component_array = std::get(component_arrays); - if (not component_array.empty()) - { - const auto component_count = static_cast(component_array.size()); - if (min_component_count != 0 and component_count < min_component_count) - { - min_component_count = component_count; - } - component_flags |= C{ 1 } << Is; - } - } - (std::index_sequence_for{}); - - [&](std::integer_sequence) - { - const auto& src_array = std::get(component_arrays); - auto& dst_array = std::get(m_component_arrays); - - if (not src_array.empty()) - { - dst_array.insert(dst_array.end(), src_array.begin(), src_array.begin() + count); - } - } - (std::index_sequence_for{}); - - m_component_flag_counts.emplace_back(component_flags, min_component_count); - - const auto id = id_type{ m_next_data_id.index++ }; - m_ids.push_back(id); - - return id; -} - -template -std::pair::iterator_type, bool> generic_dynamic_component_array_store::find(id_type id) -{ - const auto id_it = std::ranges::upper_bound(m_ids, id); - - const auto match = ( - id_it != m_ids.begin() and - *std::prev(id_it) == id - ); - - const auto index = id_it - m_ids.begin() - match; - - auto it = begin(); - it += index; - - return { it, match }; -} - -template -std::pair::const_iterator, bool> generic_dynamic_component_array_store::find(id_type id) const -{ - const auto id_it = std::ranges::upper_bound(m_ids, id); - - const auto match = ( - id_it != m_ids.begin() and - *std::prev(id_it) == id - ); - - const auto index = id_it - m_ids.begin() - match; - - auto it = begin(); - it += index; - - return { it, match }; -} - - -template -void generic_dynamic_component_array_store::remove(const iterator_type& it) -{ - [&](std::index_sequence) - { - ([&]{ - auto& component_vector = std::get(m_component_arrays); - const auto begin = component_vector.begin() + it.m_offsets[Is]; - const auto end = begin + it.m_flag_counts[it.m_index]; - component_vector.erase(begin, end); - }(), ...); - } (std::index_sequence_for{}); - - m_component_flag_counts.erase(m_component_flag_counts.begin() + it.m_index); - m_ids.erase(m_ids.begin() + it.m_index); -} - -template -void generic_dynamic_component_array_store::clear() -{ - [&](std::index_sequence) - { - std::get(m_component_arrays).clear(); - } (std::index_sequence_for{}); - m_component_flag_counts.clear(); - m_ids.clear(); -} - -template -typename generic_dynamic_component_array_store::iterator_type generic_dynamic_component_array_store::begin() -{ - return iterator_type{ - m_ids.data(), - component_array_ptrs(), - m_component_flag_counts.data(), - 0, - {} - }; -} - -template -typename generic_dynamic_component_array_store::iterator_type generic_dynamic_component_array_store::end() -{ - return iterator_type{ - m_ids.data(), - component_array_ptrs(), - m_component_flag_counts.data(), - m_component_flag_counts.size(), - array_counts() - }; -} - -template -typename generic_dynamic_component_array_store::const_iterator generic_dynamic_component_array_store::begin() const -{ - return iterator_type{ - m_ids.data(), - component_array_ptrs(), - m_component_flag_counts.data(), - 0, - {} - }; -} - -template -typename generic_dynamic_component_array_store::const_iterator generic_dynamic_component_array_store::end() const -{ - return iterator_type{ - m_ids.data(), - component_array_ptrs(), - m_component_flag_counts.data(), - m_component_flag_counts.size(), - array_counts() - }; -} - -template -typename generic_dynamic_component_array_store::const_iterator generic_dynamic_component_array_store::cbegin() const -{ - return const_cast(this)->begin(); -} - -template -typename generic_dynamic_component_array_store::const_iterator generic_dynamic_component_array_store::cend() const -{ - return const_cast(this)->end(); -} - -template -typename generic_dynamic_component_array_store::view_type generic_dynamic_component_array_store::view() -{ - return { begin(), end() }; -} -template -typename generic_dynamic_component_array_store::const_view_type generic_dynamic_component_array_store::view() const -{ - return { begin(), end() }; -} diff --git a/source/assets/data_stores/generic/generic_dynamic_indexed_component_array_store.ipp b/source/assets/data_stores/generic/generic_dynamic_indexed_component_array_store.ipp deleted file mode 100644 index 49dab5b..0000000 --- a/source/assets/data_stores/generic/generic_dynamic_indexed_component_array_store.ipp +++ /dev/null @@ -1,424 +0,0 @@ -#ifndef INCLUDE_GENERIC_DYNAMIC_INDEXED_COMPONENT_ARRAY_STORE_IMPLEMENTATION -# error Never include this file directly include 'generic_dynamic_indexed_component_array_store.hpp' -#endif - - -#include -#include -#include -#include -#include -#include - -template -indexed_component_array_iterator::indexed_component_array_iterator( - id_array_pointer_type ids, - const index_array_pointer_type indices, - const component_array_pointer_type& components, - const flag_count_pointer_type flag_counts, - std::size_t index, - const offsets_type& offsets -) : - m_ids{ ids }, - m_indices{ indices }, - m_components{ components }, - m_flag_counts{ flag_counts }, - m_index{ index }, - m_offsets{ offsets } {} - - -template -typename indexed_component_array_iterator::reference indexed_component_array_iterator::operator*() const { - return dereference(std::index_sequence_for{}); -} - -template -indexed_component_array_iterator& indexed_component_array_iterator::operator++() { - adjust_offsets(std::index_sequence_for{}, 1); - ++m_index; - return *this; -} - -template -indexed_component_array_iterator indexed_component_array_iterator::operator++(int) { - indexed_component_array_iterator tmp = *this; - ++(*this); - return tmp; -} - -template -indexed_component_array_iterator& indexed_component_array_iterator::operator--() { - adjust_offsets(std::index_sequence_for{}, -1); - --m_index; - return *this; -} - -template -indexed_component_array_iterator indexed_component_array_iterator::operator--(int) { - auto tmp = *this; - --(*this); - return tmp; -} - -template -indexed_component_array_iterator& indexed_component_array_iterator::operator+=(const difference_type n) -{ - adjust_offsets(std::index_sequence_for{}, n); - m_index += n; - return *this; -} - -template -indexed_component_array_iterator& indexed_component_array_iterator::operator-=(const difference_type n) -{ - return (*this) += -n; -} - -template -indexed_component_array_iterator indexed_component_array_iterator::operator+(const difference_type n) const -{ - auto tmp = *this; - return tmp += n; // TODO clion says n is unused -} - -template -indexed_component_array_iterator indexed_component_array_iterator::operator-(const difference_type n) const -{ - auto tmp = *this; - return tmp -= n; // TODO clion says n is unused -} - -template -typename indexed_component_array_iterator::difference_type -indexed_component_array_iterator::operator-(const indexed_component_array_iterator& other) const -{ - return static_cast(m_index) - static_cast(other.m_index); -} - -template -typename indexed_component_array_iterator::reference indexed_component_array_iterator::operator[]( - const difference_type n -) const { - return *(*this + n); -} - -template -bool indexed_component_array_iterator::operator==(const indexed_component_array_iterator& other) const -{ - return m_ids == other.m_ids and m_index == other.m_index; -} - -template -bool indexed_component_array_iterator::operator!=(const indexed_component_array_iterator& other) const -{ - return not (*this == other); -} - -template -bool indexed_component_array_iterator::operator<(const indexed_component_array_iterator& other) const -{ - return m_index < other.m_index; -} - -template -bool indexed_component_array_iterator::operator<=(const indexed_component_array_iterator& other) const -{ - return m_index <= other.m_index; -} - -template -bool indexed_component_array_iterator::operator>(const indexed_component_array_iterator& other) const -{ - return m_index > other.m_index; -} - -template -bool indexed_component_array_iterator::operator>=(const indexed_component_array_iterator& other) const -{ - return m_index >= other.m_index; -} - -template -template -bool indexed_component_array_iterator::is_component_enabled(C flag) -{ - return (flag & (C{1} << N)) != C{}; -} - -template -template -void indexed_component_array_iterator::calc_offsets( - std::index_sequence, - difference_type n -) { - - const auto negative = n < difference_type{ 0 }; - const auto positive = n > difference_type{ 0 }; - const auto step = difference_type{ positive } - difference_type{ negative }; - n = negative ? -n : n; - - // TODO template optimize for single steps - - while (n--) - { - const auto& [ flags, index_count, component_count ] = m_flag_counts[m_index]; - - std::get<0>(m_offsets) += step * index_count; - - ([&] { - if (is_component_enabled(flags)) - { - std::get<1 + Is>(m_offsets) += step * component_count; - } - }(), ...); - - m_index += step; - } -} - -template -template -typename indexed_component_array_iterator::reference -indexed_component_array_iterator::dereference(std::index_sequence) const -{ - const auto& [ flags, index_count, component_count ] = m_flag_counts[m_index]; - - return std::make_pair( - m_ids[m_index], - std::make_tuple( - flags, - std::span( - m_indices[m_offsets[0]], - index_count - ), - std::make_tuple( - std::span( - &std::get(m_components)[m_offsets[1 + Is]], - is_component_enabled(flags) ? component_count : 0 - )... - ) - ) - ); -} - -template -std::tuple...> generic_dynamic_indexed_component_array_store::component_array_ptrs() -{ - return [&](std::index_sequence) - { - return std::make_tuple(std::get(m_component_arrays).data()...); - } - (std::index_sequence_for{}); -} - -template -std::tuple>...> generic_dynamic_indexed_component_array_store::component_array_ptrs() const -{ - return [&](std::index_sequence) - { - return std::make_tuple(std::get(m_component_arrays).data()...); - } - (std::index_sequence_for{}); -} - -template -std::array generic_dynamic_indexed_component_array_store::array_counts() const -{ - return [&](std::index_sequence) - { - return std::array{ - m_indices.size(), - std::get(m_component_arrays).size()... - }; - } - (std::index_sequence_for{}); -} - -template -typename generic_dynamic_indexed_component_array_store::id_type generic_dynamic_indexed_component_array_store::add( - std::span indices, - const std::tuple...>& component_arrays -) { - - auto component_flags = C{}; - auto min_component_count = count_type{}; - - [&](std::integer_sequence) - { - const auto& component_array = std::get(component_arrays); - if (not component_array.empty()) - { - const auto component_count = static_cast(component_array.size()); - if (min_component_count != 0 and component_count < min_component_count) - { - min_component_count = component_count; - } - component_flags |= C{ 1 } << Is; - } - } - (std::index_sequence_for{}); - - m_indices.insert(m_indices.end(), indices.begin(), indices.end()); - - [&](std::integer_sequence) - { - const auto& src_array = std::get(component_arrays); - auto& dst_array = std::get(m_component_arrays); - - if (not src_array.empty()) - { - dst_array.insert(dst_array.end(), src_array.begin(), src_array.begin() + min_component_count); - } - } - (std::index_sequence_for{}); - - m_component_flag_counts.emplace_back(component_flags, indices.size(), min_component_count); - - const auto id = id_type{ m_next_data_id.index++ }; - m_ids.push_back(id); - - return id; -} - -template -std::pair::iterator_type, bool> generic_dynamic_indexed_component_array_store::find(id_type id) -{ - const auto id_it = std::ranges::upper_bound(m_ids, id); - - const auto match = ( - id_it != m_ids.begin() and - *std::prev(id_it) == id - ); - - const auto index = id_it - m_ids.begin() - match; - - auto it = begin(); - it += index; - - return { it, match }; -} - -template -std::pair::const_iterator, bool> generic_dynamic_indexed_component_array_store::find(id_type id) const -{ - const auto id_it = std::ranges::upper_bound(m_ids, id); - - const auto match = ( - id_it != m_ids.begin() and - *std::prev(id_it) == id - ); - - const auto index = id_it - m_ids.begin() - match; - - auto it = begin(); - it += index; - - return { it, match }; -} - - -template -void generic_dynamic_indexed_component_array_store::remove(const iterator_type& it) -{ - m_indices.erase(m_indices.begin() + it.m_offsets[0]); - - [&](std::index_sequence) - { - ([&]{ - auto& component_vector = std::get(m_component_arrays); - const auto begin = component_vector.begin() + it.m_offsets[1 + Is]; - const auto end = begin + it.m_flag_counts[it.m_index]; - component_vector.erase(begin, end); - }(), ...); - } (std::index_sequence_for{}); - - m_component_flag_counts.erase(m_component_flag_counts.begin() + it.m_index); - m_ids.erase(m_ids.begin() + it.m_index); -} - -template -void generic_dynamic_indexed_component_array_store::clear() -{ - m_indices.clear(); - [&](std::index_sequence) - { - std::get(m_component_arrays).clear(); - } (std::index_sequence_for{}); - m_component_flag_counts.clear(); - m_ids.clear(); -} - -template -typename generic_dynamic_indexed_component_array_store::iterator_type generic_dynamic_indexed_component_array_store::begin() -{ - return iterator_type{ - m_ids.data(), - m_indices.data(), - component_array_ptrs(), - m_component_flag_counts.data(), - 0, - {} - }; -} - -template -typename generic_dynamic_indexed_component_array_store::iterator_type generic_dynamic_indexed_component_array_store::end() -{ - return iterator_type{ - m_ids.data(), - m_indices.data(), - component_array_ptrs(), - m_component_flag_counts.data(), - m_component_flag_counts.size(), - array_counts() - }; -} - -template -typename generic_dynamic_indexed_component_array_store::const_iterator generic_dynamic_indexed_component_array_store::begin() const -{ - return iterator_type{ - m_ids.data(), - m_indices.data(), - component_array_ptrs(), - m_component_flag_counts.data(), - 0, - {} - }; -} - -template -typename generic_dynamic_indexed_component_array_store::const_iterator generic_dynamic_indexed_component_array_store::end() const -{ - return iterator_type{ - m_ids.data(), - m_indices.data(), - component_array_ptrs(), - m_component_flag_counts.data(), - m_component_flag_counts.size(), - array_counts() - }; -} - -template -typename generic_dynamic_indexed_component_array_store::const_iterator generic_dynamic_indexed_component_array_store::cbegin() const -{ - return const_cast(this)->begin(); -} - -template -typename generic_dynamic_indexed_component_array_store::const_iterator generic_dynamic_indexed_component_array_store::cend() const -{ - return const_cast(this)->end(); -} - -template -typename generic_dynamic_indexed_component_array_store::view_type generic_dynamic_indexed_component_array_store::view() -{ - return { begin(), end() }; -} -template -typename generic_dynamic_indexed_component_array_store::const_view_type generic_dynamic_indexed_component_array_store::view() const -{ - return { begin(), end() }; -} diff --git a/source/assets/data_stores/generic/generic_mesh_store.ipp b/source/assets/data_stores/generic/generic_mesh_store.ipp index 330ecdb..8aea46b 100644 --- a/source/assets/data_stores/generic/generic_mesh_store.ipp +++ b/source/assets/data_stores/generic/generic_mesh_store.ipp @@ -197,7 +197,8 @@ assets::detail::generic_mesh_store_iterator::dereference(std::index_seque &std::get(m_components)[m_offsets[1 + Is]], is_component_enabled(flags) ? component_count : 0 )... - ) + ), + .vertex_count = component_count, .material_id = m_material_ids[m_index] } ); diff --git a/source/assets/data_stores/generic/generic_point_cloud_store.ipp b/source/assets/data_stores/generic/generic_point_cloud_store.ipp index 0a0bbd1..4b9913c 100644 --- a/source/assets/data_stores/generic/generic_point_cloud_store.ipp +++ b/source/assets/data_stores/generic/generic_point_cloud_store.ipp @@ -183,13 +183,14 @@ assets::detail::generic_point_cloud_store_iterator::dereference(std::inde return std::make_pair( m_ids[m_index], point_cloud_view{ - .vertex_components = flags, + .vertex_component_flags = flags, .vertex_component_arrays = std::make_tuple( std::span( &std::get(m_components)[m_offsets[1 + Is]], is_component_enabled(flags) ? component_count : 0 )... ) + .point_count = component_count } ); } diff --git a/source/opengl/data_managers/point_cloud_vertex_buffer_manager.cpp b/source/opengl/data_managers/point_cloud_vertex_buffer_manager.cpp index 8c1a864..8f029ad 100644 --- a/source/opengl/data_managers/point_cloud_vertex_buffer_manager.cpp +++ b/source/opengl/data_managers/point_cloud_vertex_buffer_manager.cpp @@ -28,17 +28,14 @@ void zgl::point_cloud_vertex_buffer_manager::process(store_type& store) { auto [ store_id, point_cloud ] = entry; - const auto& [ components, buffers ] = point_cloud; - m_byte_buffer.clear(); - const auto meta = std::apply( + std::apply( [&](const auto&... component_buffers) { - vertex_buffer_utils::interlace(m_byte_buffer, components, component_buffers...); - return vertex_buffer_utils::generate_metadata(components, component_buffers...); + vertex_buffer_utils::interlace(m_byte_buffer, point_cloud.vertex_component_flags, component_buffers...); }, - buffers + point_cloud.vertex_component_arrays ); glBindBuffer(GL_ARRAY_BUFFER, buffer_id); @@ -60,6 +57,11 @@ void zgl::point_cloud_vertex_buffer_manager::process(store_type& store) continue; } + const auto meta = point_cloud_vertex_buffer_metadata{ + .component_flags = point_cloud.vertex_component_flags, + .point_count = point_cloud.point_count + }; + m_resource_manager.add_resource(store_id, buffer_id, meta); buffer_id = {};