|
MayaFlux 0.4.0
Digital-First Multimedia Processing Framework
|
| void MayaFlux::Nodes::Network::MeshFieldOperator::set_gpu_executor | ( | std::shared_ptr< Yantra::ShaderExecutionContext<> > | executor, |
| bool | continuous = true |
||
| ) |
Attach a GPU executor and switch to async dispatch mode.
Constructs a GpuComputeNode from the executor. On process() calls, compute_frame() is driven on the node instead of the per-slot CPU FieldOperator loop.
The on_complete callback expects gpu_result.primary to contain vertex data for each slot packed sequentially: slot 0 vertices, then slot 1 vertices, etc. Vertex count per slot must match the node's current get_mesh_vertex_count() at the time the callback fires. The callback writes back via slot.node->set_mesh_vertices().
Slot vertex counts are snapshotted at set_gpu_executor() time from the current m_slots state. Call set_gpu_executor() after slots are fully populated. If slot geometry changes after attachment, call set_gpu_executor() again to rebuild the snapshot.
CPU FieldOperator bindings are preserved but ignored while a GPU executor is attached. Passing nullptr clears the GPU path.
| executor | Pre-configured ShaderExecutionContext. nullptr clears. |
| continuous | If true the node re-arms after every completed dispatch. |
Definition at line 117 of file MeshFieldOperator.cpp.
References MayaFlux::Nodes::GpuSync::GpuComputeContext::gpu_result, m_compute_node, m_executor, m_gpu_slot_vertex_counts, MayaFlux::Nodes::Network::MeshOperator::m_slots, and MayaFlux::Yantra::GpuChannelResult::primary.