Skip to main content

ExternalTextureLease

Trait ExternalTextureLease 

Source
pub trait ExternalTextureLease:
    Debug
    + Send
    + Sync
    + 'static {
    // Required method
    fn retained_bytes(&self) -> u64;

    // Provided methods
    fn prepare_submission(&self) -> bool { ... }
    fn flush_submission(&self) -> Result<(), RenderError> { ... }
    fn submitted(&self) { ... }
    fn staged_signals(&self) -> usize { ... }
}
Expand description

Keeps an imported native texture and its decoder surface alive until the queue has completed the submission that samples it.

Required Methods§

Source

fn retained_bytes(&self) -> u64

Approximate native allocation bytes retained by this lease.

Provided Methods§

Source

fn prepare_submission(&self) -> bool

Stages native waits or signals on the renderer’s next queue submission.

Source

fn flush_submission(&self) -> Result<(), RenderError>

Flushes any native work accumulated by prepare_submission.

§Errors

The error the frame fails with, normally RenderError::ExternalTextureSync carrying what the native synchronization’s status said about the device.

Source

fn submitted(&self)

Called immediately after the command buffer that uses the resource is submitted.

Source

fn staged_signals(&self) -> usize

Native signals this lease has already staged on the renderer’s queue.

Staging is idempotent per frame and cleared when the submission it belongs to completes, so a lease that still carries one when the next frame begins staging has leaked a signal from the previous frame onto this one’s submission. Only the debug assertion in stage_source_submissions reads this.

Dyn Compatibility§

This trait is dyn compatible.

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

Implementors§