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

◆ write_aggregate()

void MayaFlux::Portal::Forma::Bridge::write_aggregate ( Layer &  layer,
std::vector< std::function< float()> >  readers,
std::function< void(std::span< const float >)>  sink 
)
private

Definition at line 473 of file Bridge.cpp.

477{
478 auto name = make_layer_task_name("bulk_sink");
479 m_layer_tasks[layer.weak_from_this()].push_back(name);
480
481 auto routine = [](Vruta::TaskScheduler&,
482 std::vector<std::function<float()>> sources,
483 std::function<void(std::span<const float>)> target)
484 -> Vruta::GraphicsRoutine {
485 auto& p = co_await Kriya::GetGraphicsPromise {};
486 std::vector<float> values(sources.size());
487 while (!p.should_terminate) {
488 for (size_t i = 0; i < sources.size(); ++i)
489 values[i] = sources[i]();
490 target(values);
491 co_await Kriya::FrameDelay { .frames_to_wait = 1 };
492 }
493 };
494
496 std::make_shared<Vruta::GraphicsRoutine>(
497 routine(m_scheduler, std::move(readers), std::move(sink))),
498 name, false);
499}
std::vector< std::byte > values
Definition VDBWriter.cpp:26
std::string name
Definition VKDevice.cpp:123
std::map< std::weak_ptr< Layer >, std::vector< std::string >, std::owner_less<> > m_layer_tasks
Definition Bridge.hpp:699
Vruta::TaskScheduler & m_scheduler
Definition Bridge.hpp:693
std::string make_layer_task_name(const char *suffix) const
Definition Bridge.cpp:422
void add_task(const std::shared_ptr< Routine > &routine, const std::string &name="", bool initialize=false)
Add a routine to the scheduler based on its processing token.
Definition Scheduler.cpp:94
GetPromiseBase< Vruta::graphics_promise > GetGraphicsPromise
Graphics domain promise accessor.

References MayaFlux::Vruta::TaskScheduler::add_task(), MayaFlux::Kriya::FrameDelay::frames_to_wait, m_layer_tasks, m_scheduler, make_layer_task_name(), name, and values.

Referenced by write().

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