Skip to main content

RenderableResource

Trait RenderableResource 

Source
pub trait RenderableResource {
    // Required method
    fn as_any(&self) -> &dyn Any;

    // Provided methods
    fn bind(&self) { ... }
    fn swap(&self) { ... }
    fn get_color_texture_view(&self) -> Option<TextureView> { ... }
    fn get_color_texture_format(&self) -> Option<TextureFormat> { ... }
    fn get_depth_stencil_texture_view(&self) -> Option<TextureView> { ... }
    fn get_depth_stencil_texture_format(&self) -> Option<TextureFormat> { ... }
}

Required Methods§

Source

fn as_any(&self) -> &dyn Any

Provided Methods§

Source

fn bind(&self)

WebGPU binding happens at the command encoder level; a no-op.

Source

fn swap(&self)

Renderable resources that require a swap function to be called explicitly can override this method.

Source

fn get_color_texture_view(&self) -> Option<TextureView>

The color attachment view for render passes targeting this resource, or None if the backend supplies it (swapchain).

Source

fn get_color_texture_format(&self) -> Option<TextureFormat>

Source

fn get_depth_stencil_texture_view(&self) -> Option<TextureView>

The depth/stencil view, if the resource manages one.

Source

fn get_depth_stencil_texture_format(&self) -> Option<TextureFormat>

Dyn Compatibility§

This trait is dyn compatible.

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

Implementors§