Skip to main content

RenderAppExt

Trait RenderAppExt 

Source
pub trait RenderAppExt {
    // Required methods
    fn set_frame_target(
        &mut self,
        render_textures: &RenderTextures,
        clear_color: Color,
    );
    fn render_frame(
        &mut self,
        render_textures: &mut RenderTextures,
        clear_color: Color,
        frame: &mut EvaluatedFrame,
    );
    fn take_last_gpu_scopes(&mut self) -> Option<Vec<GpuTimerQueryResult>>;
    fn gpu_timers_supported(&self) -> bool;
    fn gpu_timers_enabled(&self) -> bool;
    fn set_gpu_timers_enabled(&self, on: bool);
}
Expand description

Manual driving of a standalone render sub-app built by build_render_app.

Required Methods§

Source

fn set_frame_target( &mut self, render_textures: &RenderTextures, clear_color: Color, )

Point the render world at the frame’s output target.

Cheap: the frame target clones the textures’ views. Inserted per frame when the output rotates over multiple readback buffers.

Source

fn render_frame( &mut self, render_textures: &mut RenderTextures, clear_color: Color, frame: &mut EvaluatedFrame, )

Extract and render one evaluated frame into render_textures.

The frame is temporarily swapped into the render world, then returned with its input data intact so its batches can be reused or rendered again. Extraction systems should only read the frame.

Source

fn take_last_gpu_scopes(&mut self) -> Option<Vec<GpuTimerQueryResult>>

Take the GPU timer scopes recorded for the most recent processed frame (empty unless GPU timers are enabled and the device supports timestamp queries).

Source

fn gpu_timers_supported(&self) -> bool

Whether the device supports GPU timestamp queries.

Source

fn gpu_timers_enabled(&self) -> bool

Whether GPU timer scopes are currently being recorded.

Source

fn set_gpu_timers_enabled(&self, on: bool)

Enable/disable GPU timer recording at runtime. While enabled, each frame pays a device poll to read the timers back.

Dyn Compatibility§

This trait is dyn compatible.

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

Implementations on Foreign Types§

Source§

impl RenderAppExt for SubApp

Source§

fn set_frame_target( &mut self, render_textures: &RenderTextures, clear_color: Color, )

Source§

fn render_frame( &mut self, render_textures: &mut RenderTextures, clear_color: Color, frame: &mut EvaluatedFrame, )

Source§

fn take_last_gpu_scopes(&mut self) -> Option<Vec<GpuTimerQueryResult>>

Source§

fn gpu_timers_supported(&self) -> bool

Source§

fn gpu_timers_enabled(&self) -> bool

Source§

fn set_gpu_timers_enabled(&self, on: bool)

Implementors§