Skip to content

Commit 8cae08a

Browse files
committed
avnd: use local implementation of reflection as much as possible with clang-22 to fix build issues
1 parent 7178666 commit 8cae08a

11 files changed

Lines changed: 50 additions & 36 deletions

File tree

3rdparty/avendish

Submodule avendish updated 67 files

src/plugins/score-plugin-avnd/Crousti/GppShaders.hpp

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -154,7 +154,7 @@ struct generate_shaders
154154
,
155155
C::binding(), C::name());
156156

157-
boost::pfr::for_each_field(field, write_binding{shader});
157+
avnd::pfr::for_each_field(field, write_binding{shader});
158158

159159
shader += fmt::format("}};\n\n");
160160
}
@@ -166,7 +166,7 @@ struct generate_shaders
166166
,
167167
C::binding(), C::name());
168168

169-
boost::pfr::for_each_field(field, write_binding{shader});
169+
avnd::pfr::for_each_field(field, write_binding{shader});
170170

171171
shader += fmt::format("}};\n\n");
172172
}
@@ -180,24 +180,24 @@ struct generate_shaders
180180
std::string shader = "#version 450\n\n";
181181

182182
if constexpr(requires { lay.vertex_input; })
183-
boost::pfr::for_each_field(lay.vertex_input, write_input{shader});
183+
avnd::pfr::for_each_field(lay.vertex_input, write_input{shader});
184184
else if constexpr(requires { typename T::vertex_input; })
185-
boost::pfr::for_each_field(typename T::vertex_input{}, write_input{shader});
185+
avnd::pfr::for_each_field(typename T::vertex_input{}, write_input{shader});
186186
else
187-
boost::pfr::for_each_field(
187+
avnd::pfr::for_each_field(
188188
DefaultPipeline::layout::vertex_input{}, write_input{shader});
189189

190190
if constexpr(requires { lay.vertex_output; })
191-
boost::pfr::for_each_field(lay.vertex_output, write_output{shader});
191+
avnd::pfr::for_each_field(lay.vertex_output, write_output{shader});
192192
else if constexpr(requires { typename T::vertex_output; })
193-
boost::pfr::for_each_field(typename T::vertex_output{}, write_output{shader});
193+
avnd::pfr::for_each_field(typename T::vertex_output{}, write_output{shader});
194194

195195
shader += "\n";
196196

197197
if constexpr(requires { lay.bindings; })
198-
boost::pfr::for_each_field(lay.bindings, write_bindings{shader});
198+
avnd::pfr::for_each_field(lay.bindings, write_bindings{shader});
199199
else if constexpr(requires { typename T::bindings; })
200-
boost::pfr::for_each_field(typename T::bindings{}, write_bindings{shader});
200+
avnd::pfr::for_each_field(typename T::bindings{}, write_bindings{shader});
201201

202202
return shader;
203203
}
@@ -208,21 +208,21 @@ struct generate_shaders
208208
std::string shader = "#version 450\n\n";
209209

210210
if constexpr(requires { lay.fragment_input; })
211-
boost::pfr::for_each_field(lay.fragment_input, write_input{shader});
211+
avnd::pfr::for_each_field(lay.fragment_input, write_input{shader});
212212
else if constexpr(requires { typename T::fragment_input; })
213-
boost::pfr::for_each_field(typename T::fragment_input{}, write_input{shader});
213+
avnd::pfr::for_each_field(typename T::fragment_input{}, write_input{shader});
214214

215215
if constexpr(requires { lay.fragment_output; })
216-
boost::pfr::for_each_field(lay.fragment_output, write_output{shader});
216+
avnd::pfr::for_each_field(lay.fragment_output, write_output{shader});
217217
else if constexpr(requires { typename T::fragment_output; })
218-
boost::pfr::for_each_field(typename T::fragment_output{}, write_output{shader});
218+
avnd::pfr::for_each_field(typename T::fragment_output{}, write_output{shader});
219219

220220
shader += "\n";
221221

222222
if constexpr(requires { lay.bindings; })
223-
boost::pfr::for_each_field(lay.bindings, write_bindings{shader});
223+
avnd::pfr::for_each_field(lay.bindings, write_bindings{shader});
224224
else if constexpr(requires { typename T::bindings; })
225-
boost::pfr::for_each_field(typename T::bindings{}, write_bindings{shader});
225+
avnd::pfr::for_each_field(typename T::bindings{}, write_bindings{shader});
226226

227227
return shader;
228228
}
@@ -250,7 +250,7 @@ struct generate_shaders
250250
fstr.resize(fstr.size() - 2);
251251
fstr += ") in;\n\n";
252252

253-
boost::pfr::for_each_field(lay.bindings, write_bindings{fstr});
253+
avnd::pfr::for_each_field(lay.bindings, write_bindings{fstr});
254254

255255
return fstr;
256256
}

src/plugins/score-plugin-avnd/Crousti/GpuComputeNode.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -175,7 +175,7 @@ struct GpuComputeRenderer final : ComputeRendererBaseType<Node_T>
175175
QVarLengthArray<QRhiShaderResourceBinding, 8> bindings;
176176

177177
using bindings_type = decltype(Node_T::layout::bindings);
178-
boost::pfr::for_each_field(
178+
avnd::pfr::for_each_field(
179179
bindings_type{}, [&](auto f) { bindings.push_back(initBinding(renderer, f)); });
180180

181181
srb->setBindings(bindings.begin(), bindings.end());

src/plugins/score-plugin-avnd/Crousti/GpuNode.hpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -113,14 +113,14 @@ struct CustomGpuRenderer final : score::gfx::NodeRenderer
113113
if constexpr(requires { decltype(Node_T::layout::bindings){}; })
114114
{
115115
using bindings_type = decltype(Node_T::layout::bindings);
116-
boost::pfr::for_each_field(bindings_type{}, [&](auto f) {
116+
avnd::pfr::for_each_field(bindings_type{}, [&](auto f) {
117117
bindings.push_back(initBinding(renderer, f));
118118
});
119119
}
120120
else if constexpr(requires { sizeof(typename Node_T::layout::bindings); })
121121
{
122122
using bindings_type = typename Node_T::layout::bindings;
123-
boost::pfr::for_each_field(bindings_type{}, [&](auto f) {
123+
avnd::pfr::for_each_field(bindings_type{}, [&](auto f) {
124124
bindings.push_back(initBinding(renderer, f));
125125
});
126126
}

src/plugins/score-plugin-avnd/Crousti/GpuUtils.hpp

Lines changed: 18 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -459,9 +459,25 @@ struct port_to_type_enum
459459
{
460460
using value_type = std::remove_cvref_t<decltype(F::value)>;
461461

462-
if constexpr(std::is_aggregate_v<value_type>)
462+
if constexpr(std::is_array_v<value_type>)
463463
{
464-
constexpr int sz = boost::pfr::tuple_size_v<value_type>;
464+
static constexpr int sz = sizeof(value_type) / sizeof(value_type{}[0]);
465+
if constexpr(sz == 2)
466+
{
467+
return score::gfx::Types::Vec2;
468+
}
469+
else if constexpr(sz == 3)
470+
{
471+
return score::gfx::Types::Vec3;
472+
}
473+
else if constexpr(sz == 4)
474+
{
475+
return score::gfx::Types::Vec4;
476+
}
477+
}
478+
else if constexpr(std::is_aggregate_v<value_type>)
479+
{
480+
static constexpr int sz = avnd::pfr::tuple_size_v<value_type>;
465481
if constexpr(sz == 2)
466482
{
467483
return score::gfx::Types::Vec2;

src/plugins/score-plugin-avnd/Crousti/Layer.hpp

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,8 @@
1515

1616
#include <avnd/concepts/layout.hpp>
1717

18+
#include <avnd/common/aggregates.hpp>
19+
1820
namespace oscr
1921
{
2022
template <typename Item>
@@ -333,13 +335,11 @@ struct LayoutBuilder final : Process::LayoutBuilderBase
333335
createdLayouts.push_back(new_l);
334336

335337
{
336-
using namespace boost::pfr;
337-
using namespace boost::pfr::detail;
338-
static constexpr int N = boost::pfr::tuple_size_v<Item>;
339-
auto t = boost::pfr::structure_tie(item);
338+
static constexpr int N = avnd::pfr::tuple_size_v<Item>;
339+
auto t = avnd::pfr::detail::tie_as_tuple(item);
340340
[&]<std::size_t... I>(std::index_sequence<I...>) {
341341
using namespace std;
342-
using namespace boost::pfr;
342+
using namespace avnd::pfr;
343343

344344
(this->walkLayout(get<I>(t), recursive_members...), ...);
345345
}(std::make_index_sequence<N>{});

src/plugins/score-plugin-avnd/Crousti/MessageBus.hpp

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ struct Serializer
1919
if constexpr(std::is_arithmetic_v<F>)
2020
r.stream().stream << f;
2121
else if constexpr(std::is_aggregate_v<F>)
22-
boost::pfr::for_each_field(f, *this);
22+
avnd::pfr::for_each_field(f, *this);
2323
else if constexpr(avnd::list_ish<F>)
2424
{
2525
r.stream().stream << (int64_t)std::ssize(f);
@@ -115,8 +115,11 @@ struct Deserializer
115115
DataStreamWriter& r;
116116

117117
template <typename F>
118-
requires std::is_aggregate_v<F>
119-
void operator()(F& f) { boost::pfr::for_each_field(f, *this); }
118+
requires std::is_aggregate_v<F>
119+
void operator()(F& f)
120+
{
121+
avnd::pfr::for_each_field(f, *this);
122+
}
120123

121124
template <typename F>
122125
requires(std::is_arithmetic_v<F>)

src/plugins/score-plugin-avnd/Crousti/Metadatas.hpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55
#include <ossia/dataflow/safe_nodes/port.hpp>
66

77
#include <boost/mp11/algorithm.hpp>
8-
#include <boost/pfr.hpp>
98

109
#include <avnd/introspection/input.hpp>
1110
#include <avnd/introspection/output.hpp>

src/plugins/score-plugin-avnd/Crousti/ProcessModel.hpp

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,6 @@
1919
#include <ossia/detail/type_if.hpp>
2020
#include <ossia/detail/typelist.hpp>
2121

22-
#include <boost/pfr.hpp>
23-
2422
#include <QTimer>
2523

2624
#include <avnd/binding/ossia/data_node.hpp>

0 commit comments

Comments
 (0)