pub trait InteropSynchronizer {
// Required methods
fn producer_complete(
&self,
frame: &NativeFrame,
mechanism: SyncMechanism,
) -> Result<(), InteropError>;
fn consumer_ready(
&self,
texture: &ImportedTexture,
mechanism: SyncMechanism,
) -> Result<(), InteropError>;
}Expand description
Hook points called by WgpuTextureImporter
around each frame import.
Implement this trait to add custom fence/semaphore logic. Two built-in
implementations are provided: NoopSynchronizer and
ImplicitOnlySynchronizer.
Required Methods§
Sourcefn producer_complete(
&self,
frame: &NativeFrame,
mechanism: SyncMechanism,
) -> Result<(), InteropError>
fn producer_complete( &self, frame: &NativeFrame, mechanism: SyncMechanism, ) -> Result<(), InteropError>
Called after the frame is acquired from the producer, before import. Use this to wait on any producer-side signal.
Sourcefn consumer_ready(
&self,
texture: &ImportedTexture,
mechanism: SyncMechanism,
) -> Result<(), InteropError>
fn consumer_ready( &self, texture: &ImportedTexture, mechanism: SyncMechanism, ) -> Result<(), InteropError>
Called after the texture has been imported and is ready for the consumer. Use this to signal any consumer-side fence or semaphore.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".