Skip to main content

TextureImporter

Trait TextureImporter 

Source
pub trait TextureImporter {
    // Required method
    fn import_frame(
        &self,
        frame: &NativeFrame,
        options: &ImportOptions,
    ) -> Result<ImportedTexture, InteropError>;
}
Expand description

Imports a NativeFrame into a wgpu::Texture.

Required Methods§

Source

fn import_frame( &self, frame: &NativeFrame, options: &ImportOptions, ) -> Result<ImportedTexture, InteropError>

Import frame into a wgpu::Texture owned by the host device.

Returns InteropError::Unsupported if the frame kind is not supported on the current platform/backend. Check HostWgpuContext::capabilities first to get a descriptive error before calling this.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§