Skip to main content

Enki

Struct Enki 

Source
pub struct Enki {
    pub window_context: Option<Arc<dyn Any + Send + Sync>>,
    pub gpu_window: Option<Mutex<GpuWindow>>,
    pub engine: Arc<EnkiEngine>,
}
Expand description

The central handle to the Enki heterogeneous GPU runtime.

Manages Vulkan instance lifecycle, hardware devices, memory allocation heaps, and execution flows across host CPU and GPU silicon.

Fields§

§window_context: Option<Arc<dyn Any + Send + Sync>>§gpu_window: Option<Mutex<GpuWindow>>§engine: Arc<EnkiEngine>

Implementations§

Source§

impl Enki

Source

pub fn builder() -> EnkiBuilder

Returns a new EnkiBuilder to configure runtime options before initialization.

Source

pub fn init() -> Arc<Self> ⓘ

Initializes a headless GPU compute context with default settings.

Source

pub fn init_windowed<W>(window: Arc<W>, width: u32, height: u32) -> Arc<Self> ⓘ
where W: HasWindowHandle + HasDisplayHandle + Send + Sync + 'static,

Initializes a windowed GPU context with swapchain presentation support.

Source

pub fn active() -> Arc<Self> ⓘ

Returns an Arc clone of the currently active global Enki runtime instance.

Source

pub fn begin_flow(&self) -> Flow<'_>

Source

pub fn flow<R, F>(&self, f: F) -> R
where F: FnOnce(&mut Flow<'_>) -> R,

Records and executes an atomic compute and presentation flow, halting on execution error.

Source

pub fn try_flow<R, F>(&self, f: F) -> Result<R>
where F: FnOnce(&mut Flow<'_>) -> R,

Records and executes an atomic flow, returning an explicit Result on failure.

Source

pub fn resize(&self, width: u32, height: u32) -> Result<()>

Resizes the underlying presentation window swapchain dimensions.

Source

pub fn wait_idle(&self) -> Result<()>

Blocks the host CPU until all in-flight GPU timeline tasks are completely idle.

Auto Trait Implementations§

§

impl !Freeze for Enki

§

impl !RefUnwindSafe for Enki

§

impl !UnwindSafe for Enki

§

impl Send for Enki

§

impl Sync for Enki

§

impl Unpin for Enki

§

impl UnsafeUnpin for Enki

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.