pub struct WgpuTextureImporter { /* private fields */ }Expand description
The main entry point for importing frames into wgpu textures.
Create one per wgpu device and reuse it across frames.
ⓘ
let host = HostWgpuContext::new(device, queue);
let importer = WgpuTextureImporter::new(host);
// each frame:
let frame = producer.acquire_frame()?;
let imported = importer.import_frame(&frame, &ImportOptions::default())?;
// use imported.texture in your render pipelineImplementations§
Source§impl WgpuTextureImporter
impl WgpuTextureImporter
Sourcepub fn new(host: HostWgpuContext) -> Self
pub fn new(host: HostWgpuContext) -> Self
Create a new importer with the default ImplicitOnlySynchronizer.
Sourcepub fn with_synchronizer(
host: HostWgpuContext,
synchronizer: Box<dyn InteropSynchronizer>,
) -> Self
pub fn with_synchronizer( host: HostWgpuContext, synchronizer: Box<dyn InteropSynchronizer>, ) -> Self
Create a new importer with a custom InteropSynchronizer.
Sourcepub fn host(&self) -> &HostWgpuContext
pub fn host(&self) -> &HostWgpuContext
Returns the underlying HostWgpuContext.
Trait Implementations§
Source§impl TextureImporter for WgpuTextureImporter
impl TextureImporter for WgpuTextureImporter
Source§fn import_frame(
&self,
frame: &NativeFrame,
options: &ImportOptions,
) -> Result<ImportedTexture, InteropError>
fn import_frame( &self, frame: &NativeFrame, options: &ImportOptions, ) -> Result<ImportedTexture, InteropError>
Auto Trait Implementations§
impl !RefUnwindSafe for WgpuTextureImporter
impl !Send for WgpuTextureImporter
impl !Sync for WgpuTextureImporter
impl !UnwindSafe for WgpuTextureImporter
impl Freeze for WgpuTextureImporter
impl Unpin for WgpuTextureImporter
impl UnsafeUnpin for WgpuTextureImporter
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more