Trait rutabaga_gfx::rutabaga_core::RutabagaContext
source · 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§
sourcefn submit_cmd(
&mut self,
_commands: &mut [u8],
_fence_ids: &[u64],
shareable_fences: Vec<RutabagaHandle>
) -> RutabagaResult<()>
fn submit_cmd( &mut self, _commands: &mut [u8], _fence_ids: &[u64], shareable_fences: Vec<RutabagaHandle> ) -> RutabagaResult<()>
Implementations must handle the context-specific command stream.
sourcefn attach(&mut self, _resource: &mut RutabagaResource)
fn attach(&mut self, _resource: &mut RutabagaResource)
Implementations may use resource
in this context’s command stream.
sourcefn detach(&mut self, _resource: &RutabagaResource)
fn detach(&mut self, _resource: &RutabagaResource)
Implementations must stop using resource
in this context’s command stream.
sourcefn component_type(&self) -> RutabagaComponentType
fn component_type(&self) -> RutabagaComponentType
Implementations must return the component type associated with the context.
Provided Methods§
sourcefn context_create_blob(
&mut self,
_resource_id: u32,
_resource_create_blob: ResourceCreateBlob,
_handle_opt: Option<RutabagaHandle>
) -> RutabagaResult<RutabagaResource>
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.
sourcefn context_create_fence(
&mut self,
_fence: RutabagaFence
) -> RutabagaResult<Option<RutabagaHandle>>
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.