euv_core/render/pipeline/struct.rs
1use super::*;
2
3/// Fluent per-frame parameter bundle for `Renderer::render_with`.
4#[derive(Clone, Copy, Data, Debug, PartialEq)]
5pub struct FrameRenderParams {
6 /// Logical viewport size.
7 #[get(type(copy))]
8 pub(crate) viewport: Size,
9 /// Active physical DPI scale factor.
10 #[get(type(copy))]
11 pub(crate) scale_factor: f32,
12 /// Surface background clear color.
13 #[get(type(copy))]
14 pub(crate) clear_color: Color,
15 /// Layout pass telemetry from the current frame.
16 #[get(type(copy))]
17 pub(crate) layout_stats: LayoutStats,
18 /// Damaged screen region requiring rasterization.
19 #[get(type(copy))]
20 pub(crate) damage: DamageRegion,
21}
22
23/// Unified multi-mode rendering facade orchestrating Auto, Software, Hardware, and Hybrid execution.
24#[derive(Data, Debug)]
25pub struct Renderer {
26 /// Active render configuration.
27 #[get(type(copy))]
28 pub(crate) config: RenderConfig,
29 /// Resolved active render mode (never `Auto`).
30 #[get(type(copy))]
31 pub(crate) active_mode: RenderMode,
32 /// Resolved active graphics backend.
33 #[get(type(copy))]
34 pub(crate) active_backend: GraphicsBackend,
35 /// Dedicated CPU software renderer instance.
36 pub(crate) software: SoftwareRenderer,
37 /// Dedicated hardware GPU instanced renderer instance.
38 pub(crate) hardware: HardwareRenderer,
39 /// Dedicated hybrid CPU-tile + GPU-compositor renderer instance.
40 pub(crate) hybrid: HybridRenderer,
41 /// Reusable scene-to-display-list compiler handle.
42 #[get(skip)]
43 #[get_mut(skip)]
44 #[set(skip)]
45 pub(crate) paint_pass: PaintPass,
46 /// Cross-frame retained `DisplayList` and subtree `DrawCommand` fragment cache.
47 #[get(pub(crate))]
48 #[get_mut(skip)]
49 #[set(skip)]
50 pub(crate) paint_fragment_cache: PaintFragmentCache,
51 /// Reusable frame display list.
52 pub(crate) display_list: DisplayList,
53 /// Monotonic frame counter.
54 #[get(type(copy))]
55 pub(crate) frame_index: u64,
56 /// Whether to compute full-framebuffer FNV-1a pixel hashes on each frame (enabled for headless parity tests).
57 #[get(type(copy))]
58 pub(crate) compute_pixel_hash: bool,
59 /// Active render mode of the most recent hashed frame (`None` before first render or after mode switch).
60 #[get(skip)]
61 #[get_mut(skip)]
62 #[set(skip)]
63 pub(crate) last_hashed_mode: Option<RenderMode>,
64 /// Physical framebuffer dimensions `(phys_w, phys_h)` of the most recent hashed frame.
65 #[get(skip)]
66 #[get_mut(skip)]
67 #[set(skip)]
68 pub(crate) last_hashed_dims: (u32, u32),
69 /// Telemetry from the most recent frame.
70 #[get(type(copy))]
71 pub(crate) last_stats: FrameStats,
72 /// Non-degrading runtime fallback policy engine (never downgrades shadows, blur, AA, clipping, or resolution).
73 pub(crate) fallback_policy: FallbackPolicyEngine,
74 /// Cumulative frames executed via the composite-only fast path without relayout or full repaint.
75 #[get(type(copy))]
76 #[get_mut(skip)]
77 #[set(skip)]
78 pub(crate) composite_fast_path_frames: u64,
79 /// Cumulative frames routed to full CPU reference rasterization by `FallbackPolicyEngine`.
80 #[get(type(copy))]
81 #[get_mut(skip)]
82 #[set(skip)]
83 pub(crate) cpu_fallback_frames: u64,
84}