Skip to main content

ImportedTextureExt

Trait ImportedTextureExt 

Source
pub trait ImportedTextureExt {
    // Required method
    fn to_imported_handle(&self) -> Result<ImportedTextureHandle, Error>;
}
Expand description

The producer’s half of the imported-texture path where wgpu is the renderer, which on Linux is the default one. Re-exported here for the same reason gpui_macos re-exports Metal’s: this is the crate an application already reaches the platform through, so it does not have to know that the renderer lives in a crate of its own. Builds an ImportedTextureHandle from a wgpu resource.

Required Methods§

Source

fn to_imported_handle(&self) -> Result<ImportedTextureHandle, Error>

Wrap this view as a handle.

Validates the colour-space and binding invariants up front, at the boundary where the failure is a producer’s mistake and the message can name it. Sampling a non-sRGB view composites with a gamma error rather than crashing, so it has to be rejected here; TEXTURE_BINDING is likewise a property of the view and is what the renderer’s bind group requires.

Dyn Compatibility§

This trait is dyn compatible.

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

Implementations on Foreign Types§

Source§

impl ImportedTextureExt for TextureView

Implementors§