pub struct WgpuExternalTextureRegistry { /* private fields */ }Expand description
Shared registry for app-owned textures sampled by SUI’s normal image draw path.
This contract is intentionally media-agnostic. The application owns the producer, update cadence, pixel conversion, and texture contents. SUI owns only the renderer device handoff and sampled-texture lifetime needed to compose the resource with ordinary scene transforms and clips.
Implementations§
Source§impl WgpuExternalTextureRegistry
impl WgpuExternalTextureRegistry
pub fn new() -> WgpuExternalTextureRegistry
Sourcepub fn context(&self) -> Option<WgpuExternalTextureContext>
pub fn context(&self) -> Option<WgpuExternalTextureContext>
Returns the renderer device once the first render target initializes.
Sourcepub fn wait_for_context(
&self,
timeout: Duration,
) -> Option<WgpuExternalTextureContext>
pub fn wait_for_context( &self, timeout: Duration, ) -> Option<WgpuExternalTextureContext>
Wait for renderer initialization without tying the registry to a platform event-loop type.
Sourcepub fn upload_rgba8(
&self,
handle: ImageHandle,
width: u32,
height: u32,
pixels: Arc<[u8]>,
revision: u64,
) -> Result<RegisteredExternalImage, Error>
pub fn upload_rgba8( &self, handle: ImageHandle, width: u32, height: u32, pixels: Arc<[u8]>, revision: u64, ) -> Result<RegisteredExternalImage, Error>
Upload tightly packed sRGB RGBA8 pixels into a persistent texture.
Reusing handle and dimensions updates the existing allocation.
Sourcepub fn register_texture(
&self,
handle: ImageHandle,
texture: Texture,
) -> Result<RegisteredExternalImage, Error>
pub fn register_texture( &self, handle: ImageHandle, texture: Texture, ) -> Result<RegisteredExternalImage, Error>
Register a sampled texture created from this registry’s renderer context. This supports app-owned GPU conversion/render passes without exposing backend-native shared-handle policy in SUI.
pub fn unregister(&self, handle: ImageHandle) -> bool
pub fn contains(&self, handle: ImageHandle) -> bool
pub fn len(&self) -> usize
pub fn is_empty(&self) -> bool
Trait Implementations§
Source§impl Clone for WgpuExternalTextureRegistry
impl Clone for WgpuExternalTextureRegistry
Source§fn clone(&self) -> WgpuExternalTextureRegistry
fn clone(&self) -> WgpuExternalTextureRegistry
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for WgpuExternalTextureRegistry
impl Debug for WgpuExternalTextureRegistry
Source§impl Default for WgpuExternalTextureRegistry
impl Default for WgpuExternalTextureRegistry
Source§fn default() -> WgpuExternalTextureRegistry
fn default() -> WgpuExternalTextureRegistry
Auto Trait Implementations§
impl Forget for WgpuExternalTextureRegistry
impl Freeze for WgpuExternalTextureRegistry
impl Move for WgpuExternalTextureRegistry
impl RefUnwindSafe for WgpuExternalTextureRegistry
impl Send for WgpuExternalTextureRegistry
impl Sync for WgpuExternalTextureRegistry
impl Unpin for WgpuExternalTextureRegistry
impl UnsafeUnpin for WgpuExternalTextureRegistry
impl UnwindSafe for WgpuExternalTextureRegistry
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can
then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.Source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait.Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.