From 8cae08a26bb3f9c6874d8a55f18c993a4a359198 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jean-Micha=C3=ABl=20Celerier?= Date: Thu, 25 Jun 2026 23:04:59 -0400 Subject: [PATCH] avnd: use local implementation of reflection as much as possible with clang-22 to fix build issues --- 3rdparty/avendish | 2 +- 3rdparty/libossia | 2 +- .../score-plugin-avnd/Crousti/GppShaders.hpp | 32 +++++++++---------- .../Crousti/GpuComputeNode.hpp | 2 +- .../score-plugin-avnd/Crousti/GpuNode.hpp | 4 +-- .../score-plugin-avnd/Crousti/GpuUtils.hpp | 20 ++++++++++-- .../score-plugin-avnd/Crousti/Layer.hpp | 10 +++--- .../score-plugin-avnd/Crousti/MessageBus.hpp | 9 ++++-- .../score-plugin-avnd/Crousti/Metadatas.hpp | 1 - .../Crousti/ProcessModel.hpp | 2 -- src/plugins/score-plugin-fx/Fx/VelToNote.hpp | 2 -- 11 files changed, 50 insertions(+), 36 deletions(-) diff --git a/3rdparty/avendish b/3rdparty/avendish index 7eafe1735a..77be36e03b 160000 --- a/3rdparty/avendish +++ b/3rdparty/avendish @@ -1 +1 @@ -Subproject commit 7eafe1735a2c6c20891ead7404333884a6e15971 +Subproject commit 77be36e03b7d327f6f2bee38c63b4abf63f41a2d diff --git a/3rdparty/libossia b/3rdparty/libossia index 476e6e50d2..b335062f52 160000 --- a/3rdparty/libossia +++ b/3rdparty/libossia @@ -1 +1 @@ -Subproject commit 476e6e50d2ac11298b9ea2f6e4d9372973a52db0 +Subproject commit b335062f524775ad9a5ef094eec5bdcb8fd20e8d diff --git a/src/plugins/score-plugin-avnd/Crousti/GppShaders.hpp b/src/plugins/score-plugin-avnd/Crousti/GppShaders.hpp index 9456a45446..c4d8951803 100644 --- a/src/plugins/score-plugin-avnd/Crousti/GppShaders.hpp +++ b/src/plugins/score-plugin-avnd/Crousti/GppShaders.hpp @@ -154,7 +154,7 @@ struct generate_shaders , C::binding(), C::name()); - boost::pfr::for_each_field(field, write_binding{shader}); + avnd::pfr::for_each_field(field, write_binding{shader}); shader += fmt::format("}};\n\n"); } @@ -166,7 +166,7 @@ struct generate_shaders , C::binding(), C::name()); - boost::pfr::for_each_field(field, write_binding{shader}); + avnd::pfr::for_each_field(field, write_binding{shader}); shader += fmt::format("}};\n\n"); } @@ -180,24 +180,24 @@ struct generate_shaders std::string shader = "#version 450\n\n"; if constexpr(requires { lay.vertex_input; }) - boost::pfr::for_each_field(lay.vertex_input, write_input{shader}); + avnd::pfr::for_each_field(lay.vertex_input, write_input{shader}); else if constexpr(requires { typename T::vertex_input; }) - boost::pfr::for_each_field(typename T::vertex_input{}, write_input{shader}); + avnd::pfr::for_each_field(typename T::vertex_input{}, write_input{shader}); else - boost::pfr::for_each_field( + avnd::pfr::for_each_field( DefaultPipeline::layout::vertex_input{}, write_input{shader}); if constexpr(requires { lay.vertex_output; }) - boost::pfr::for_each_field(lay.vertex_output, write_output{shader}); + avnd::pfr::for_each_field(lay.vertex_output, write_output{shader}); else if constexpr(requires { typename T::vertex_output; }) - boost::pfr::for_each_field(typename T::vertex_output{}, write_output{shader}); + avnd::pfr::for_each_field(typename T::vertex_output{}, write_output{shader}); shader += "\n"; if constexpr(requires { lay.bindings; }) - boost::pfr::for_each_field(lay.bindings, write_bindings{shader}); + avnd::pfr::for_each_field(lay.bindings, write_bindings{shader}); else if constexpr(requires { typename T::bindings; }) - boost::pfr::for_each_field(typename T::bindings{}, write_bindings{shader}); + avnd::pfr::for_each_field(typename T::bindings{}, write_bindings{shader}); return shader; } @@ -208,21 +208,21 @@ struct generate_shaders std::string shader = "#version 450\n\n"; if constexpr(requires { lay.fragment_input; }) - boost::pfr::for_each_field(lay.fragment_input, write_input{shader}); + avnd::pfr::for_each_field(lay.fragment_input, write_input{shader}); else if constexpr(requires { typename T::fragment_input; }) - boost::pfr::for_each_field(typename T::fragment_input{}, write_input{shader}); + avnd::pfr::for_each_field(typename T::fragment_input{}, write_input{shader}); if constexpr(requires { lay.fragment_output; }) - boost::pfr::for_each_field(lay.fragment_output, write_output{shader}); + avnd::pfr::for_each_field(lay.fragment_output, write_output{shader}); else if constexpr(requires { typename T::fragment_output; }) - boost::pfr::for_each_field(typename T::fragment_output{}, write_output{shader}); + avnd::pfr::for_each_field(typename T::fragment_output{}, write_output{shader}); shader += "\n"; if constexpr(requires { lay.bindings; }) - boost::pfr::for_each_field(lay.bindings, write_bindings{shader}); + avnd::pfr::for_each_field(lay.bindings, write_bindings{shader}); else if constexpr(requires { typename T::bindings; }) - boost::pfr::for_each_field(typename T::bindings{}, write_bindings{shader}); + avnd::pfr::for_each_field(typename T::bindings{}, write_bindings{shader}); return shader; } @@ -250,7 +250,7 @@ struct generate_shaders fstr.resize(fstr.size() - 2); fstr += ") in;\n\n"; - boost::pfr::for_each_field(lay.bindings, write_bindings{fstr}); + avnd::pfr::for_each_field(lay.bindings, write_bindings{fstr}); return fstr; } diff --git a/src/plugins/score-plugin-avnd/Crousti/GpuComputeNode.hpp b/src/plugins/score-plugin-avnd/Crousti/GpuComputeNode.hpp index 8f5d2b6308..876ce60ac3 100644 --- a/src/plugins/score-plugin-avnd/Crousti/GpuComputeNode.hpp +++ b/src/plugins/score-plugin-avnd/Crousti/GpuComputeNode.hpp @@ -175,7 +175,7 @@ struct GpuComputeRenderer final : ComputeRendererBaseType QVarLengthArray bindings; using bindings_type = decltype(Node_T::layout::bindings); - boost::pfr::for_each_field( + avnd::pfr::for_each_field( bindings_type{}, [&](auto f) { bindings.push_back(initBinding(renderer, f)); }); srb->setBindings(bindings.begin(), bindings.end()); diff --git a/src/plugins/score-plugin-avnd/Crousti/GpuNode.hpp b/src/plugins/score-plugin-avnd/Crousti/GpuNode.hpp index c202ab2d27..66387766da 100644 --- a/src/plugins/score-plugin-avnd/Crousti/GpuNode.hpp +++ b/src/plugins/score-plugin-avnd/Crousti/GpuNode.hpp @@ -113,14 +113,14 @@ struct CustomGpuRenderer final : score::gfx::NodeRenderer if constexpr(requires { decltype(Node_T::layout::bindings){}; }) { using bindings_type = decltype(Node_T::layout::bindings); - boost::pfr::for_each_field(bindings_type{}, [&](auto f) { + avnd::pfr::for_each_field(bindings_type{}, [&](auto f) { bindings.push_back(initBinding(renderer, f)); }); } else if constexpr(requires { sizeof(typename Node_T::layout::bindings); }) { using bindings_type = typename Node_T::layout::bindings; - boost::pfr::for_each_field(bindings_type{}, [&](auto f) { + avnd::pfr::for_each_field(bindings_type{}, [&](auto f) { bindings.push_back(initBinding(renderer, f)); }); } diff --git a/src/plugins/score-plugin-avnd/Crousti/GpuUtils.hpp b/src/plugins/score-plugin-avnd/Crousti/GpuUtils.hpp index a18b24f0fa..366d1850b7 100644 --- a/src/plugins/score-plugin-avnd/Crousti/GpuUtils.hpp +++ b/src/plugins/score-plugin-avnd/Crousti/GpuUtils.hpp @@ -459,9 +459,25 @@ struct port_to_type_enum { using value_type = std::remove_cvref_t; - if constexpr(std::is_aggregate_v) + if constexpr(std::is_array_v) { - constexpr int sz = boost::pfr::tuple_size_v; + static constexpr int sz = sizeof(value_type) / sizeof(value_type{}[0]); + if constexpr(sz == 2) + { + return score::gfx::Types::Vec2; + } + else if constexpr(sz == 3) + { + return score::gfx::Types::Vec3; + } + else if constexpr(sz == 4) + { + return score::gfx::Types::Vec4; + } + } + else if constexpr(std::is_aggregate_v) + { + static constexpr int sz = avnd::pfr::tuple_size_v; if constexpr(sz == 2) { return score::gfx::Types::Vec2; diff --git a/src/plugins/score-plugin-avnd/Crousti/Layer.hpp b/src/plugins/score-plugin-avnd/Crousti/Layer.hpp index da0ee9ef5d..74f84bffd5 100644 --- a/src/plugins/score-plugin-avnd/Crousti/Layer.hpp +++ b/src/plugins/score-plugin-avnd/Crousti/Layer.hpp @@ -15,6 +15,8 @@ #include +#include + namespace oscr { template @@ -333,13 +335,11 @@ struct LayoutBuilder final : Process::LayoutBuilderBase createdLayouts.push_back(new_l); { - using namespace boost::pfr; - using namespace boost::pfr::detail; - static constexpr int N = boost::pfr::tuple_size_v; - auto t = boost::pfr::structure_tie(item); + static constexpr int N = avnd::pfr::tuple_size_v; + auto t = avnd::pfr::detail::tie_as_tuple(item); [&](std::index_sequence) { using namespace std; - using namespace boost::pfr; + using namespace avnd::pfr; (this->walkLayout(get(t), recursive_members...), ...); }(std::make_index_sequence{}); diff --git a/src/plugins/score-plugin-avnd/Crousti/MessageBus.hpp b/src/plugins/score-plugin-avnd/Crousti/MessageBus.hpp index f358ccfbde..4bc8fb57a3 100644 --- a/src/plugins/score-plugin-avnd/Crousti/MessageBus.hpp +++ b/src/plugins/score-plugin-avnd/Crousti/MessageBus.hpp @@ -19,7 +19,7 @@ struct Serializer if constexpr(std::is_arithmetic_v) r.stream().stream << f; else if constexpr(std::is_aggregate_v) - boost::pfr::for_each_field(f, *this); + avnd::pfr::for_each_field(f, *this); else if constexpr(avnd::list_ish) { r.stream().stream << (int64_t)std::ssize(f); @@ -115,8 +115,11 @@ struct Deserializer DataStreamWriter& r; template - requires std::is_aggregate_v - void operator()(F& f) { boost::pfr::for_each_field(f, *this); } + requires std::is_aggregate_v + void operator()(F& f) + { + avnd::pfr::for_each_field(f, *this); + } template requires(std::is_arithmetic_v) diff --git a/src/plugins/score-plugin-avnd/Crousti/Metadatas.hpp b/src/plugins/score-plugin-avnd/Crousti/Metadatas.hpp index f617a3ede6..f591246b74 100644 --- a/src/plugins/score-plugin-avnd/Crousti/Metadatas.hpp +++ b/src/plugins/score-plugin-avnd/Crousti/Metadatas.hpp @@ -5,7 +5,6 @@ #include #include -#include #include #include diff --git a/src/plugins/score-plugin-avnd/Crousti/ProcessModel.hpp b/src/plugins/score-plugin-avnd/Crousti/ProcessModel.hpp index f019937881..5a1cd5be99 100644 --- a/src/plugins/score-plugin-avnd/Crousti/ProcessModel.hpp +++ b/src/plugins/score-plugin-avnd/Crousti/ProcessModel.hpp @@ -19,8 +19,6 @@ #include #include -#include - #include #include diff --git a/src/plugins/score-plugin-fx/Fx/VelToNote.hpp b/src/plugins/score-plugin-fx/Fx/VelToNote.hpp index 7e93b8ed3e..547fa06ebe 100644 --- a/src/plugins/score-plugin-fx/Fx/VelToNote.hpp +++ b/src/plugins/score-plugin-fx/Fx/VelToNote.hpp @@ -4,8 +4,6 @@ #include #include -#include - #include #include #include