pub trait GraphicsAdapter {
// Required methods
fn api(&self) -> GraphicsApi;
fn context_identity(&self) -> ContextIdentity;
fn execution_owner(&self) -> ExecutionOwner;
fn is_current(&self) -> bool;
fn is_context_lost(&self) -> bool;
fn capability(
&self,
source: FrameSource<'_>,
destination: &FrameDestination<'_>,
) -> TransferMode;
fn upload(
&mut self,
source: CpuFrameSource<'_>,
destination: GraphicsResource,
stages: &[TransferStage],
) -> Result<()>;
fn readback(
&mut self,
source: GraphicsResource,
destination: CpuFrameDestination<'_>,
stages: &[TransferStage],
) -> Result<()>;
fn copy(
&mut self,
source: GraphicsResource,
destination: GraphicsResource,
stages: &[TransferStage],
) -> Result<()>;
fn delete(&mut self, resource: GraphicsResource) -> Result<()>;
}Expand description
Platform adapter that performs native GL or WebGL operations.
Implementations must not retain borrowed CPU memory after a call returns. The portable layer invokes these methods only after checking context identity, execution owner, current state, context loss, API identity, and policy.
Required Methods§
fn api(&self) -> GraphicsApi
fn context_identity(&self) -> ContextIdentity
fn execution_owner(&self) -> ExecutionOwner
fn is_current(&self) -> bool
fn is_context_lost(&self) -> bool
fn capability( &self, source: FrameSource<'_>, destination: &FrameDestination<'_>, ) -> TransferMode
fn upload( &mut self, source: CpuFrameSource<'_>, destination: GraphicsResource, stages: &[TransferStage], ) -> Result<()>
fn readback( &mut self, source: GraphicsResource, destination: CpuFrameDestination<'_>, stages: &[TransferStage], ) -> Result<()>
fn copy( &mut self, source: GraphicsResource, destination: GraphicsResource, stages: &[TransferStage], ) -> Result<()>
fn delete(&mut self, resource: GraphicsResource) -> Result<()>
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".