Trait Adapter
pub trait Adapter: WasmNotSendSync {
type A: Api;
// Required methods
unsafe fn open(
&self,
features: Features,
limits: &Limits,
memory_hints: &MemoryHints,
) -> Result<OpenDevice<Self::A>, DeviceError>;
unsafe fn texture_format_capabilities(
&self,
format: TextureFormat,
) -> TextureFormatCapabilities;
unsafe fn surface_capabilities(
&self,
surface: &<Self::A as Api>::Surface,
) -> Option<SurfaceCapabilities>;
unsafe fn get_presentation_timestamp(&self) -> PresentationTimestamp;
fn get_ordered_buffer_usages(&self) -> BufferUses;
fn get_ordered_texture_usages(&self) -> TextureUses;
}unstable-wgpu-29 only.Required Associated Types§
Required Methods§
unsafe fn open( &self, features: Features, limits: &Limits, memory_hints: &MemoryHints, ) -> Result<OpenDevice<Self::A>, DeviceError>
unsafe fn texture_format_capabilities(
&self,
format: TextureFormat,
) -> TextureFormatCapabilities
unsafe fn texture_format_capabilities( &self, format: TextureFormat, ) -> TextureFormatCapabilities
Return the set of supported capabilities for a texture format.
unsafe fn surface_capabilities(
&self,
surface: &<Self::A as Api>::Surface,
) -> Option<SurfaceCapabilities>
unsafe fn surface_capabilities( &self, surface: &<Self::A as Api>::Surface, ) -> Option<SurfaceCapabilities>
Returns the capabilities of working with a specified surface.
None means presentation is not supported for it.
unsafe fn get_presentation_timestamp(&self) -> PresentationTimestamp
unsafe fn get_presentation_timestamp(&self) -> PresentationTimestamp
Creates a PresentationTimestamp using the adapter’s WSI.
fn get_ordered_buffer_usages(&self) -> BufferUses
fn get_ordered_buffer_usages(&self) -> BufferUses
The combination of all usages that the are guaranteed to be be ordered by the hardware. If a usage is ordered, then if the buffer state doesn’t change between draw calls, there are no barriers needed for synchronization.
fn get_ordered_texture_usages(&self) -> TextureUses
fn get_ordered_texture_usages(&self) -> TextureUses
The combination of all usages that the are guaranteed to be be ordered by the hardware. If a usage is ordered, then if the buffer state doesn’t change between draw calls, there are no barriers needed for synchronization.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".