euv-core 0.46.0

Core cross-platform runtime for euv featuring arena-based fine-grained reactivity, deterministic layout, flat scene graph, multi-mode rendering, and direct OS platform adapters.
Documentation
use super::*;

/// Complete rendering pipeline configuration shared across all 7 platforms.
#[derive(Clone, Copy, Data, Debug, Eq, Hash, PartialEq)]
pub struct RenderConfig {
    /// Requested rendering mode (`Auto`, `Software`, `Hardware`, `Hybrid`).
    #[get(type(copy))]
    pub(crate) mode: RenderMode,
    /// Optional explicit graphics backend override.
    #[get(skip)]
    pub(crate) preferred_backend: Option<GraphicsBackend>,
    /// Swapchain synchronization mode.
    #[get(type(copy))]
    pub(crate) present_mode: PresentMode,
    /// Anti-aliasing mode.
    #[get(type(copy))]
    pub(crate) antialiasing: AntialiasingMode,
    /// Target color space.
    #[get(type(copy))]
    pub(crate) color_space: ColorSpace,
    /// Enables damage-region dirty-rect clipping to skip clean pixels.
    #[get(type(copy))]
    pub(crate) dirty_rect_optimization: bool,
    /// Tile edge size in pixels for CPU tile rasterization.
    #[get(type(copy))]
    pub(crate) tile_size: u32,
    /// Target maximum frame rate cap.
    #[get(type(copy))]
    pub(crate) max_fps: u32,
    /// Whether high dynamic range presentation is requested when supported.
    #[get(type(copy))]
    pub(crate) hdr: bool,
    /// When `true` on `Hardware` mode, skips steady-state CPU RGBA readback mirroring and draws directly via GPU commands.
    #[get(type(copy))]
    pub(crate) direct_gpu_present: bool,
}

/// Per-frame performance and rendering telemetry snapshot.
#[derive(Clone, Copy, Data, Debug, Default, Eq, Hash, PartialEq)]
pub struct FrameStats {
    /// Monotonic rendered frame counter.
    #[get(type(copy))]
    pub(crate) frame_index: u64,
    /// Active resolved render mode.
    #[get(type(copy))]
    pub(crate) active_mode: RenderMode,
    /// Active resolved graphics backend.
    #[get(type(copy))]
    pub(crate) active_backend: GraphicsBackend,
    /// Number of scene nodes laid out this frame.
    #[get(type(copy))]
    pub(crate) layout_nodes: usize,
    /// Number of clean subtrees skipped during layout.
    #[get(type(copy))]
    pub(crate) layout_skipped: usize,
    /// Number of display-list commands emitted.
    #[get(type(copy))]
    pub(crate) draw_commands: usize,
    /// Number of GPU instanced draw batches submitted (or software dirty tiles rasterized).
    #[get(type(copy))]
    pub(crate) draw_batches: usize,
    /// Total pixels updated in the framebuffer this frame.
    #[get(type(copy))]
    pub(crate) pixels_shaded: usize,
    /// Deterministic 64-bit FNV-1a hash of the rendered framebuffer (when software/readback active).
    #[get(type(copy))]
    pub(crate) frame_hash: u64,
    /// True when the frame took the composite-only fast path (scroll/transform/opacity with zero relayout/repaint).
    #[get(type(copy))]
    pub(crate) composite_only: bool,
    /// True when the frame executed on the GPU direct-draw path with zero CPU RGBA mirror generation.
    #[get(type(copy))]
    pub(crate) gpu_direct_draw: bool,
    /// Total full-frame CPU RGBA bytes generated/uploaded on this frame (`0` on steady-state GPU direct-draw).
    #[get(type(copy))]
    pub(crate) cpu_rgba_upload_bytes: usize,
    /// Explicit submission outcome separating idle skip, successful submit, and retryable submit failure.
    #[get(type(copy))]
    pub(crate) submit_outcome: FrameSubmitOutcome,
}