Skip to main content

Flow

Struct Flow 

Source
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: u32

Implementations§

Source§

impl<'a> Flow<'a>

Source

pub fn new(enki: &'a Enki) -> Self

Initializes a new Flow, acquiring a command buffer from the ring and resetting query pools.

Source

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.

Source

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]

Source

pub fn end_flow(self)

Finalizes and submits the recorded flow to the GPU queue, halting on failure.

Source

pub fn try_end_flow(self) -> Result<()>

Finalizes and submits the recorded flow to the GPU queue, returning a Result.

Source

pub fn mark(&mut self) -> GpuInstant

Records a hardware timestamp query mark on the GPU timeline for profiling.

Source

pub fn write_timestamp(&mut self, query_index: u32, stage: PipelineStageFlags2)

Records a timestamp query into the active flow.

Source

pub fn push_task(&mut self, task: RawTask<'a>)

Pushes a low-level task onto the internal execution queue.

Trait Implementations§

Source§

impl<'a> Drop for Flow<'a>

Source§

fn drop(&mut self)

Executes the destructor for this type. Read more
Source§

fn pin_drop(self: Pin<&mut Self>)

🔬This is a nightly-only experimental API. (pin_ergonomics)
Execute the destructor for this type, but different to Drop::drop, it requires self to be pinned. Read more

Auto Trait Implementations§

§

impl<'a> !Freeze for Flow<'a>

§

impl<'a> !RefUnwindSafe for Flow<'a>

§

impl<'a> !UnwindSafe for Flow<'a>

§

impl<'a> Send for Flow<'a>

§

impl<'a> Sync for Flow<'a>

§

impl<'a> Unpin for Flow<'a>

§

impl<'a> UnsafeUnpin for Flow<'a>

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.