Skip to main content

euv_core/render/config/
struct.rs

1use super::*;
2
3/// Complete rendering pipeline configuration shared across all 7 platforms.
4#[derive(Clone, Copy, Data, Debug, Eq, Hash, PartialEq)]
5pub struct RenderConfig {
6    /// Requested rendering mode (`Auto`, `Software`, `Hardware`, `Hybrid`).
7    #[get(type(copy))]
8    pub(crate) mode: RenderMode,
9    /// Optional explicit graphics backend override.
10    #[get(skip)]
11    pub(crate) preferred_backend: Option<GraphicsBackend>,
12    /// Swapchain synchronization mode.
13    #[get(type(copy))]
14    pub(crate) present_mode: PresentMode,
15    /// Anti-aliasing mode.
16    #[get(type(copy))]
17    pub(crate) antialiasing: AntialiasingMode,
18    /// Target color space.
19    #[get(type(copy))]
20    pub(crate) color_space: ColorSpace,
21    /// Enables damage-region dirty-rect clipping to skip clean pixels.
22    #[get(type(copy))]
23    pub(crate) dirty_rect_optimization: bool,
24    /// Tile edge size in pixels for CPU tile rasterization.
25    #[get(type(copy))]
26    pub(crate) tile_size: u32,
27    /// Target maximum frame rate cap.
28    #[get(type(copy))]
29    pub(crate) max_fps: u32,
30    /// Whether high dynamic range presentation is requested when supported.
31    #[get(type(copy))]
32    pub(crate) hdr: bool,
33}
34
35/// Per-frame performance and rendering telemetry snapshot.
36#[derive(Clone, Copy, Data, Debug, Default, Eq, Hash, PartialEq)]
37pub struct FrameStats {
38    /// Monotonic rendered frame counter.
39    #[get(type(copy))]
40    pub(crate) frame_index: u64,
41    /// Active resolved render mode.
42    #[get(type(copy))]
43    pub(crate) active_mode: RenderMode,
44    /// Active resolved graphics backend.
45    #[get(type(copy))]
46    pub(crate) active_backend: GraphicsBackend,
47    /// Number of scene nodes laid out this frame.
48    #[get(type(copy))]
49    pub(crate) layout_nodes: usize,
50    /// Number of clean subtrees skipped during layout.
51    #[get(type(copy))]
52    pub(crate) layout_skipped: usize,
53    /// Number of display-list commands emitted.
54    #[get(type(copy))]
55    pub(crate) draw_commands: usize,
56    /// Number of GPU instanced draw batches submitted (or software dirty tiles rasterized).
57    #[get(type(copy))]
58    pub(crate) draw_batches: usize,
59    /// Total pixels updated in the framebuffer this frame.
60    #[get(type(copy))]
61    pub(crate) pixels_shaded: usize,
62    /// Deterministic 64-bit FNV-1a hash of the rendered framebuffer (when software/readback active).
63    #[get(type(copy))]
64    pub(crate) frame_hash: u64,
65}