Skip to main content

WgpuCallback

Trait WgpuCallback 

Source
pub trait WgpuCallback:
    Send
    + Sync
    + 'static {
    // Required method
    fn paint(
        &self,
        info: PaintCallbackInfo,
        render_pass: &mut RenderPass<'static>,
        resources: &CallbackResources,
    );

    // Provided methods
    fn prepare(
        &self,
        _device: &Device,
        _queue: &Queue,
        _encoder: &mut CommandEncoder,
        _screen_descriptor: &ScreenDescriptor,
        _resources: &mut CallbackResources,
    ) -> Vec<CommandBuffer> { ... }
    fn finish_prepare(
        &self,
        _device: &Device,
        _queue: &Queue,
        _encoder: &mut CommandEncoder,
        _screen_descriptor: &ScreenDescriptor,
        _resources: &mut CallbackResources,
    ) -> Vec<CommandBuffer> { ... }
}
Expand description

Trait for custom wgpu rendering inside a repose layout rect.

Required Methods§

Source

fn paint( &self, info: PaintCallbackInfo, render_pass: &mut RenderPass<'static>, resources: &CallbackResources, )

Provided Methods§

Source

fn prepare( &self, _device: &Device, _queue: &Queue, _encoder: &mut CommandEncoder, _screen_descriptor: &ScreenDescriptor, _resources: &mut CallbackResources, ) -> Vec<CommandBuffer>

Called before the main repose render pass, with access to device/queue/encoder for buffer uploads. Can return extra command buffers to be submitted.

Source

fn finish_prepare( &self, _device: &Device, _queue: &Queue, _encoder: &mut CommandEncoder, _screen_descriptor: &ScreenDescriptor, _resources: &mut CallbackResources, ) -> Vec<CommandBuffer>

Called after all prepare calls, before paint. For cross-callback sync.

Dyn Compatibility§

This trait is dyn compatible.

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

Implementors§