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");
82 "GpuComputeNode: dispatch complete, {} primary floats, {} aux bindings",
92 "GpuComputeNode: failed to create GpuComputeContext");
#define MF_ERROR(comp, ctx,...)
#define MF_DEBUG(comp, ctx,...)
Core::GlobalInputConfig input
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
void on_complete(const TypedHook< GpuComputeContext > &callback)
Register a callback fired once per completed dispatch.
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.
std::vector< TypedHook< GpuComputeContext > > m_complete_callbacks
void update_context(double value) override
Updates the context object with the current node state.
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.
std::function< void(ContextT &)> TypedHook
Callback function type for node processing events, parameterised on context type.
bool safe_remove_callback(std::vector< TypedHook< ContextT > > &callbacks, const TypedHook< ContextT > &callback)
Removes all callbacks whose target_type() matches that of the supplied callback.
bool safe_add_callback(std::vector< TypedHook< ContextT > > &callbacks, const TypedHook< ContextT > &callback)
Adds a callback to the collection if an equivalent one is not already present.
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