1use crate::{EffectDef, EffectId, Renderer};
2
3pub trait EffectCatalog {
8 fn effect_definition(&self, id: &EffectId) -> Option<&EffectDef>;
10
11 fn effect_reads_time(&self, id: &EffectId) -> bool;
14
15 fn project_effect_id(&self, id: &str, version: u32) -> Option<&EffectId>;
18}
19
20impl EffectCatalog for Renderer {
21 fn effect_definition(&self, id: &EffectId) -> Option<&EffectDef> {
22 Renderer::effect_definition(self, id)
23 }
24
25 fn effect_reads_time(&self, id: &EffectId) -> bool {
26 Renderer::effect_reads_time(self, id)
27 }
28
29 fn project_effect_id(&self, id: &str, version: u32) -> Option<&EffectId> {
30 Renderer::project_effect_id(self, id, version)
31 }
32}
33
34pub trait RenderControls {
37 fn set_quality_controls(&self, max_filter_samples: u32, motion_blur_subframes: u32);
40
41 fn set_texture_budget_bytes(&self, budget_bytes: u64);
43
44 fn content_epoch(&self) -> u64;
47
48 fn record_frame_outcome(&self, presented: bool, repeated: bool);
51
52 fn graph_cache_key(
57 &self,
58 graph: &crate::RenderGraph<'_>,
59 ) -> Result<crate::RenderCacheKey, crate::GraphError>;
60}
61
62impl RenderControls for Renderer {
63 fn set_quality_controls(&self, max_filter_samples: u32, motion_blur_subframes: u32) {
64 Renderer::set_quality_controls(self, max_filter_samples, motion_blur_subframes);
65 }
66
67 fn set_texture_budget_bytes(&self, budget_bytes: u64) {
68 Renderer::set_texture_budget_bytes(self, budget_bytes);
69 }
70
71 fn content_epoch(&self) -> u64 {
72 Renderer::content_epoch(self)
73 }
74
75 fn record_frame_outcome(&self, presented: bool, repeated: bool) {
76 Renderer::record_frame_outcome(self, presented, repeated);
77 }
78
79 fn graph_cache_key(
80 &self,
81 graph: &crate::RenderGraph<'_>,
82 ) -> Result<crate::RenderCacheKey, crate::GraphError> {
83 Renderer::graph_cache_key(self, graph)
84 }
85}