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§
Sourcefn set_frame_target(
&mut self,
render_textures: &RenderTextures,
clear_color: Color,
)
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.
Sourcefn render_frame(
&mut self,
render_textures: &mut RenderTextures,
clear_color: Color,
frame: &mut EvaluatedFrame,
)
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.
Sourcefn take_last_gpu_scopes(&mut self) -> Option<Vec<GpuTimerQueryResult>>
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).
Sourcefn gpu_timers_supported(&self) -> bool
fn gpu_timers_supported(&self) -> bool
Whether the device supports GPU timestamp queries.
Sourcefn gpu_timers_enabled(&self) -> bool
fn gpu_timers_enabled(&self) -> bool
Whether GPU timer scopes are currently being recorded.
Sourcefn set_gpu_timers_enabled(&self, on: bool)
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".