11 : m_executor(
std::move(executor))
12 , m_continuous(continuous)
15 error<std::invalid_argument>(
17 std::source_location::current(),
18 "GpuComputeNode: null ShaderExecutionContext");
34 const auto result =
m_executor->collect_result();
59 "GpuComputeNode: dispatch_async returned INVALID_FENCE");
83 "GpuComputeNode: dispatch complete, {} primary floats, {} aux bindings",
93 "GpuComputeNode: failed to create GpuComputeContext");
#define MF_ERROR(comp, ctx,...)
#define MF_DEBUG(comp, ctx,...)
Core::GlobalInputConfig input
HookId on_complete(const TypedHook< GpuComputeContext > &callback)
Register a callback fired once per completed dispatch.
std::shared_ptr< Yantra::ShaderExecutionContext<> > m_executor
Yantra::GpuChannelResult m_last_result
bool remove_complete_hook(const TypedHook< GpuComputeContext > &callback)
Remove a previously registered on_complete callback.
GpuComputeNode(std::shared_ptr< Yantra::ShaderExecutionContext<> > executor, bool continuous=false)
Construct with a configured ShaderExecutionContext.
std::unique_ptr< GpuComputeContext > m_context_storage
Portal::Graphics::FenceID m_pending_fence
void compute_frame() override
Drive the async dispatch lifecycle.
void notify_tick(double value) override
Notifies all registered callbacks with the current context.
HookList m_complete_callbacks
void update_context(double value) override
Updates the context object with the current node state.
bool remove_by_key(const std::type_info &key)
Removes every entry registered with this callable type.
void fire(NodeContext &ctx) const
Calls every entry whose condition, if any, holds.
HookId add_unique(NodeHook hook, const std::type_info &key, uint8_t tag=0, std::array< double, 2 > params={})
Appends unless an entry with the same key and params exists, in which case that entry's id is returne...
HookList m_conditional_callbacks
Hooks fired on a tick only while their condition holds.
HookList m_callbacks
Hooks fired on every tick.
Concrete GpuExecutionContext for a single fixed shader with fixed bindings.
@ NodeProcessing
Node graph processing (Nodes::NodeGraphManager)
@ Init
Engine/subsystem initialization.
@ Nodes
DSP Generator and Filter Nodes, graph pipeline, node management.
uint64_t HookId
Identifies one registration inside a HookList.
std::function< void(ContextT &)> TypedHook
Callback function type for node processing events, parameterised on context type.
NodeHook adapt_hook(const TypedHook< ContextT > &hook)
Wraps a context-typed hook into a NodeHook.
constexpr FenceID INVALID_FENCE
MAYAFLUX_API ShaderFoundry & get_shader_foundry()
Get the global shader compiler instance.
Input/Output container for computation pipeline data flow with structure preservation.
std::unordered_map< size_t, std::vector< uint8_t > > aux
std::vector< float > primary