Skip to main content

ICompositionImportableSharedGpuContextImage

Trait ICompositionImportableSharedGpuContextImage 

Source
pub trait ICompositionImportableSharedGpuContextImage: Send + Sync {
    // Required methods
    fn dispose(&self);
    fn as_any(&self) -> &dyn Any;
}
Expand description

An GPU image descriptor obtained from a context from the same share group as one used by the compositor

The image is shared between two threads, as upstream, where that is a convention: the thread of the caller makes it, keeps it and disposes it, and the thread that renders reads it during the import and may dispose it with the imported image. Here the type says so: what both threads read is a plain value or is behind a lock, and what belongs to the context of the caller (the context itself) is bound to its thread inside the implementation and is not touched from the other one.

Required Methods§

Source

fn dispose(&self)

Releases the image. Either thread may call it, more than once.

Source

fn as_any(&self) -> &dyn Any

Lets the backend that made the image recover its concrete type (the cast upstream performs on the image it is asked to import).

Dyn Compatibility§

This trait is dyn compatible.

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

Implementors§