1use crate::{EffectDef, EffectId, Renderer};
2
3pub trait EffectCatalog {
7 fn effect_definition(&self, id: &EffectId) -> Option<&EffectDef>;
9
10 fn effect_reads_time(&self, id: &EffectId) -> bool;
12
13 fn project_effect_id(&self, id: &str, version: u32) -> Option<&EffectId>;
16}
17
18impl EffectCatalog for Renderer {
19 fn effect_definition(&self, id: &EffectId) -> Option<&EffectDef> {
20 Renderer::effect_definition(self, id)
21 }
22
23 fn effect_reads_time(&self, id: &EffectId) -> bool {
24 Renderer::effect_reads_time(self, id)
25 }
26
27 fn project_effect_id(&self, id: &str, version: u32) -> Option<&EffectId> {
28 Renderer::project_effect_id(self, id, version)
29 }
30}
31
32pub trait RenderControls {
34 fn set_quality_controls(&self, max_filter_samples: u32, motion_blur_subframes: u32);
36
37 fn set_texture_budget_bytes(&self, budget_bytes: u64);
39
40 fn content_epoch(&self) -> u64;
42
43 fn record_frame_outcome(&self, presented: bool, repeated: bool);
45
46 fn graph_cache_key(
51 &self,
52 graph: &crate::RenderGraph<'_>,
53 ) -> Result<crate::RenderCacheKey, crate::GraphError>;
54}
55
56impl RenderControls for Renderer {
57 fn set_quality_controls(&self, max_filter_samples: u32, motion_blur_subframes: u32) {
58 Renderer::set_quality_controls(self, max_filter_samples, motion_blur_subframes);
59 }
60
61 fn set_texture_budget_bytes(&self, budget_bytes: u64) {
62 Renderer::set_texture_budget_bytes(self, budget_bytes);
63 }
64
65 fn content_epoch(&self) -> u64 {
66 Renderer::content_epoch(self)
67 }
68
69 fn record_frame_outcome(&self, presented: bool, repeated: bool) {
70 Renderer::record_frame_outcome(self, presented, repeated);
71 }
72
73 fn graph_cache_key(
74 &self,
75 graph: &crate::RenderGraph<'_>,
76 ) -> Result<crate::RenderCacheKey, crate::GraphError> {
77 Renderer::graph_cache_key(self, graph)
78 }
79}