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

◆ compute_frame()

void MayaFlux::Nodes::GpuSync::GpuComputeNode::compute_frame ( )
overridevirtual

Drive the async dispatch lifecycle.

If dirty and no dispatch is pending: arms a new dispatch via dispatch_core_async, clears dirty, clears ready. If a dispatch is pending: polls the fence. On signal, collects the result, fires on_complete callbacks, sets ready. If continuous, arms the next dispatch immediately.

Implements MayaFlux::Nodes::GpuSync::GpuSync.

Definition at line 26 of file GpuComputeNode.cpp.

27{
29
31 if (!foundry.is_fence_signaled(m_pending_fence))
32 return;
33
34 const auto result = m_executor->collect_result();
35
37 m_ready = true;
38
39 m_last_result = result;
40 notify_tick(0.0);
41
42 if (m_continuous)
43 m_dirty = true;
44
45 return;
46 }
47
48 if (!m_dirty)
49 return;
50
51 m_dirty = false;
52 m_ready = false;
53
54 Yantra::Datum<std::vector<Kakshya::DataVariant>> input;
55 m_pending_fence = m_executor->dispatch_async(input);
56
59 "GpuComputeNode: dispatch_async returned INVALID_FENCE");
60 m_dirty = true;
61 }
62}
#define MF_ERROR(comp, ctx,...)
Core::GlobalInputConfig input
Definition Config.cpp:36
std::shared_ptr< Yantra::ShaderExecutionContext<> > m_executor
void notify_tick(double value) override
Notifies all registered callbacks with the current context.
@ NodeProcessing
Node graph processing (Nodes::NodeGraphManager)
@ Nodes
DSP Generator and Filter Nodes, graph pipeline, node management.
constexpr FenceID INVALID_FENCE
MAYAFLUX_API ShaderFoundry & get_shader_foundry()
Get the global shader compiler instance.

References MayaFlux::Portal::Graphics::get_shader_foundry(), input, MayaFlux::Portal::Graphics::INVALID_FENCE, m_continuous, m_dirty, m_executor, m_last_result, m_pending_fence, m_ready, MF_ERROR, MayaFlux::Journal::NodeProcessing, MayaFlux::Journal::Nodes, and notify_tick().

+ Here is the call graph for this function: