pub trait RutabagaContext {
    // Required methods
    fn submit_cmd(
        &mut self,
        _commands: &mut [u8],
        _fence_ids: &[u64],
        shareable_fences: Vec<RutabagaHandle>
    ) -> RutabagaResult<()>;
    fn attach(&mut self, _resource: &mut RutabagaResource);
    fn detach(&mut self, _resource: &RutabagaResource);
    fn component_type(&self) -> RutabagaComponentType;

    // Provided methods
    fn context_create_blob(
        &mut self,
        _resource_id: u32,
        _resource_create_blob: ResourceCreateBlob,
        _handle_opt: Option<RutabagaHandle>
    ) -> RutabagaResult<RutabagaResource> { ... }
    fn context_create_fence(
        &mut self,
        _fence: RutabagaFence
    ) -> RutabagaResult<Option<RutabagaHandle>> { ... }
}

Required Methods§

source

fn submit_cmd( &mut self, _commands: &mut [u8], _fence_ids: &[u64], shareable_fences: Vec<RutabagaHandle> ) -> RutabagaResult<()>

Implementations must handle the context-specific command stream.

source

fn attach(&mut self, _resource: &mut RutabagaResource)

Implementations may use resource in this context’s command stream.

source

fn detach(&mut self, _resource: &RutabagaResource)

Implementations must stop using resource in this context’s command stream.

source

fn component_type(&self) -> RutabagaComponentType

Implementations must return the component type associated with the context.

Provided Methods§

source

fn context_create_blob( &mut self, _resource_id: u32, _resource_create_blob: ResourceCreateBlob, _handle_opt: Option<RutabagaHandle> ) -> RutabagaResult<RutabagaResource>

Implementations must return a RutabagaResource given the resource_create_blob parameters.

source

fn context_create_fence( &mut self, _fence: RutabagaFence ) -> RutabagaResult<Option<RutabagaHandle>>

Implementations must create a fence on specified ring_idx in fence. This allows for multiple synchronizations timelines per RutabagaContext.

If RUTABAGA_FLAG_FENCE_HOST_SHAREABLE is set, a rutabaga handle must be returned on success.

Implementors§