use crate::{EffectDef, EffectId, Renderer};
pub trait EffectCatalog {
fn effect_definition(&self, id: &EffectId) -> Option<&EffectDef>;
fn effect_reads_time(&self, id: &EffectId) -> bool;
fn project_effect_id(&self, id: &str, version: u32) -> Option<&EffectId>;
}
impl EffectCatalog for Renderer {
fn effect_definition(&self, id: &EffectId) -> Option<&EffectDef> {
Renderer::effect_definition(self, id)
}
fn effect_reads_time(&self, id: &EffectId) -> bool {
Renderer::effect_reads_time(self, id)
}
fn project_effect_id(&self, id: &str, version: u32) -> Option<&EffectId> {
Renderer::project_effect_id(self, id, version)
}
}
pub trait RenderControls {
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: &crate::RenderGraph<'_>,
) -> Result<crate::RenderCacheKey, crate::GraphError>;
}
impl RenderControls for Renderer {
fn set_quality_controls(&self, max_filter_samples: u32, motion_blur_subframes: u32) {
Renderer::set_quality_controls(self, max_filter_samples, motion_blur_subframes);
}
fn set_texture_budget_bytes(&self, budget_bytes: u64) {
Renderer::set_texture_budget_bytes(self, budget_bytes);
}
fn content_epoch(&self) -> u64 {
Renderer::content_epoch(self)
}
fn record_frame_outcome(&self, presented: bool, repeated: bool) {
Renderer::record_frame_outcome(self, presented, repeated);
}
fn graph_cache_key(
&self,
graph: &crate::RenderGraph<'_>,
) -> Result<crate::RenderCacheKey, crate::GraphError> {
Renderer::graph_cache_key(self, graph)
}
}