MayaFlux 1.0.0
Digital-First Multimedia Processing Framework
Loading...
Searching...
No Matches

◆ topology_runs()

std::vector< DrawRun > MayaFlux::Nodes::Network::AssemblyOperator::topology_runs ( ) const
nodiscardoverridevirtual

Coalesces adjacent items sharing a concatenable topology into one run; strip/fan items are always reported separately.

Reimplemented from MayaFlux::Nodes::Network::GraphicsOperator.

Definition at line 180 of file AssemblyOperator.cpp.

181{
182 std::vector<DrawRun> runs;
183 uint32_t offset = 0;
184
185 for (const auto& item : m_items) {
186 const auto count = static_cast<uint32_t>(item->get_vertex_count());
187 const auto topo = item->get_primitive_topology();
188
189 if (!runs.empty() && runs.back().topology == topo && is_concatenable_topology(topo)) {
190 runs.back().vertex_count += count;
191 } else {
192 runs.push_back(DrawRun { .topology = topo, .vertex_offset = offset, .vertex_count = count });
193 }
194
195 offset += count;
196 }
197
198 return runs;
199}
std::vector< std::shared_ptr< GpuSync::GeometryWriterNode > > m_items
std::vector< double > count(std::span< const double > data, size_t n_windows, uint32_t hop_size, uint32_t window_size)
Sample count per window (as double for pipeline uniformity).
Definition Analysis.cpp:506
constexpr bool is_concatenable_topology(PrimitiveTopology topology) noexcept
Whether two adjacent spans of this topology can be concatenated without altering the primitives they ...
Portal::Graphics::DrawRun DrawRun

References MayaFlux::Nodes::Network::is_concatenable_topology(), and m_items.

Here is the call graph for this function: