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

◆ apply_runs()

void MayaFlux::Buffers::FormaProcessor::apply_runs ( const std::shared_ptr< VKBuffer > &  buffer)
private

Definition at line 176 of file FormaProcessor.cpp.

177{
178 const auto total = m_slices.vertex_count();
179 const auto run_count = m_pending_runs->size();
180 const Portal::Graphics::DrawRun first = run_count == 1 ? m_pending_runs->front() : Portal::Graphics::DrawRun {};
181 const bool whole = run_count == 1 && first.vertex_offset == 0 && first.vertex_count == total;
182
183 if (auto layout = buffer->get_vertex_layout()) {
184 layout->vertex_count = run_count == 0 ? 0U : total;
185 buffer->set_vertex_layout(*layout);
186 }
187
188 auto render = buffer->get_render_processor();
189 if (!render) {
190 if (whole || run_count == 0) {
191 m_pending_runs.reset();
192 }
193 return;
194 }
195
196 if (run_count > 1) {
197 render->set_runs(std::move(*m_pending_runs));
198 render->set_vertex_range(0, 0);
199 } else {
200 if (run_count == 1 && first.topology != m_topology) {
201 render->set_runs({ first });
202 } else {
203 render->set_runs({});
204 }
205 if (run_count == 1 && !whole) {
206 render->set_vertex_range(first.vertex_offset, first.vertex_count);
207 } else {
208 render->set_vertex_range(0, 0);
209 }
210 }
211
212 m_pending_runs.reset();
213}
std::shared_ptr< NetworkGeometryBuffer > buffer
uint32_t total
uint32_t run_count
Portal::Graphics::PrimitiveTopology m_topology
std::optional< std::vector< Portal::Graphics::DrawRun > > m_pending_runs
uint32_t vertex_count() const noexcept
Vertices in the mirror, hidden blocks included.
Definition SliceSet.cpp:133

References buffer, m_pending_runs, m_slices, m_topology, run_count, MayaFlux::Portal::Graphics::DrawRun::topology, total, MayaFlux::Buffers::SliceSet::vertex_count(), MayaFlux::Portal::Graphics::DrawRun::vertex_count, and MayaFlux::Portal::Graphics::DrawRun::vertex_offset.

Referenced by processing_function().

+ Here is the call graph for this function:
+ Here is the caller graph for this function: