Skip to main content

RenderControls

Trait RenderControls 

Source
pub trait RenderControls {
    // Required methods
    fn set_quality_controls(
        &self,
        max_filter_samples: u32,
        motion_blur_subframes: u32,
    );
    fn set_texture_budget_bytes(&self, budget_bytes: u64);
    fn content_epoch(&self) -> u64;
    fn record_frame_outcome(&self, presented: bool, repeated: bool);
    fn graph_cache_key(
        &self,
        graph: &RenderGraph<'_>,
    ) -> Result<RenderCacheKey, GraphError>;
}
Expand description

The controls a frame runner sets and reads on whichever renderer draws its frames: quality, the memory budget, and what has changed since.

Required Methods§

Source

fn set_quality_controls( &self, max_filter_samples: u32, motion_blur_subframes: u32, )

Sets the filter sample budget and the motion blur subframe count passes take; the renderer may cap the budget lower.

Source

fn set_texture_budget_bytes(&self, budget_bytes: u64)

Sets the bytes of pooled pictures the renderer keeps for reuse.

Source

fn content_epoch(&self) -> u64

A count that changes whenever results drawn earlier may no longer be what the same graph draws now.

Source

fn record_frame_outcome(&self, presented: bool, repeated: bool)

Records whether a frame was presented, and whether it repeated the one before.

Source

fn graph_cache_key( &self, graph: &RenderGraph<'_>, ) -> Result<RenderCacheKey, GraphError>

A deterministic key for what graph draws on this renderer.

§Errors

Returns crate::GraphError::MissingOutput when no output was selected.

Dyn Compatibility§

This trait is dyn compatible.

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

Implementors§