pub struct Flow<'a> {
pub enki: &'a Enki,
pub queue: TaskQueue<'a>,
pub cmd: CommandBuffer,
pub slot_idx: usize,
pub timeline_value: u64,
pub submitted: AtomicBool,
pub sticky_error: Option<Error>,
pub borrow_ledger: FrameBorrowLedger,
pub timestamp_count: u32,
}Expand description
An active, coherent GPU compute and presentation execution stream.
A Flow batches nam (kernel) dispatches and display presentation tasks into an atomic
command buffer sequence synchronized by timeline semaphores.
Fields§
§enki: &'a Enki§queue: TaskQueue<'a>§cmd: CommandBuffer§slot_idx: usize§timeline_value: u64§submitted: AtomicBool§sticky_error: Option<Error>§borrow_ledger: FrameBorrowLedger§timestamp_count: u32Implementations§
Source§impl<'a> Flow<'a>
impl<'a> Flow<'a>
Sourcepub fn new(enki: &'a Enki) -> Self
pub fn new(enki: &'a Enki) -> Self
Initializes a new Flow, acquiring a command buffer from the ring and resetting query pools.
Sourcepub fn present<T: Copy + Send + Sync + 'static>(&mut self, pixels: &GpuVec<T>)
pub fn present<T: Copy + Send + Sync + 'static>(&mut self, pixels: &GpuVec<T>)
Queues an owned GPU vector for direct presentation to the display window.
§Temporal Presentation Hazard
Once queued for presentation, any subsequent dispatch (.run() or .run_unchecked()) within the same flow that
attempts to mutate (&mut) this buffer halts execution with diagnostic error[E1010].
Read-only access (&) after presentation remains permitted.
§Diagnostics
Halts execution with diagnostic error[E2002] if element count is less than width * height.
Sourcepub fn present_slice<T: Copy + Send + Sync + 'static>(
&mut self,
pixels: &Slice<'_, T>,
)
pub fn present_slice<T: Copy + Send + Sync + 'static>( &mut self, pixels: &Slice<'_, T>, )
Queues a contiguous GPU slice for direct presentation to the display window.
§Temporal Presentation Hazard
Once queued for presentation, any subsequent dispatch (.run() or .run_unchecked()) within the same flow that
attempts to mutate (&mut) this buffer halts execution with diagnostic error[E1010].
Read-only access (&) after presentation remains permitted.
§Diagnostics
Halts execution with diagnostic error[E2002] if element count is less than width * height. #[track_caller]
Sourcepub fn end_flow(self)
pub fn end_flow(self)
Finalizes and submits the recorded flow to the GPU queue, halting on failure.
Sourcepub fn try_end_flow(self) -> Result<()>
pub fn try_end_flow(self) -> Result<()>
Finalizes and submits the recorded flow to the GPU queue, returning a Result.
Sourcepub fn mark(&mut self) -> GpuInstant
pub fn mark(&mut self) -> GpuInstant
Records a hardware timestamp query mark on the GPU timeline for profiling.
Sourcepub fn write_timestamp(&mut self, query_index: u32, stage: PipelineStageFlags2)
pub fn write_timestamp(&mut self, query_index: u32, stage: PipelineStageFlags2)
Records a timestamp query into the active flow.