euv-core 0.48.2

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
/// Active mobile presentation channel distinguishing zero-CPU-mirror GPU direct draw from upload and CPU fallbacks.
#[repr(u8)]
#[derive(Clone, Copy, Debug, Default, Eq, Hash, Ord, PartialEq, PartialOrd)]
pub enum MobilePresentPath {
    /// Primary direct GPU uber-shader rendering onto native `EGLSurface` or `CAMetalDrawable` (`cpu_mirror_active = false`).
    #[default]
    GpuDirect = 0,
    /// Verified fallback uploading CPU-rendered dirty rectangles to a GLES 3.0 or Metal texture (`cpu_mirror_active = true`).
    GpuUpload = 1,
    /// Verified CPU fallback via `ANativeWindow_lock` or `CGImage`/`CALayer` (`cpu_mirror_active = true`).
    Software = 2,
}

/// Adaptive pixel/primitive upload strategy selected for the current mobile presentation frame.
#[repr(u8)]
#[derive(Clone, Copy, Debug, Default, Eq, Hash, Ord, PartialEq, PartialOrd)]
pub enum MobileUploadStrategy {
    /// Zero full-frame CPU mirror; uploads only packed 64-byte `GpuPrimitiveInstance` streams and dirty atlas updates.
    #[default]
    DirectGpu = 0,
    /// Uploads each disjoint dirty rectangle independently when bounding-box merge would waste bandwidth.
    MultiRect = 1,
    /// Uploads a single merged bounding box covering clustered dirty rectangles.
    MergedBbox = 2,
    /// Uploads the entire framebuffer texture on resize, first frame, or high dirty coverage.
    FullFrame = 3,
    /// Skips upload because the frame has zero damaged pixels.
    None = 4,
}

/// Honest provenance classification for mobile frame presentation timestamps.
#[repr(u8)]
#[derive(Clone, Copy, Debug, Default, Eq, Hash, Ord, PartialEq, PartialOrd)]
pub enum MobilePresentTimingSource {
    /// Measured directly from OS compositor hooks (`eglPresentationTimeANDROID` / swap or physical-device `MTLDrawable.presentedTime`).
    CompositorMeasured = 0,
    /// Submission or VSync callback timing proxy (used when compositor timestamps are unavailable, such as iOS Simulator).
    SubmissionProxy = 1,
    /// Presentation timing cannot be observed on the active host or surface.
    #[default]
    Unobservable = 2,
}

/// Mobile graphics context or presentation fault driving immediate failover without waiting for perf comparisons.
#[repr(u8)]
#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
pub enum MobileSurfaceFault {
    /// EGL context lost (`EGL_CONTEXT_LOST`) or Metal GPU device reset/hang.
    ContextLost = 0,
    /// Native window surface lost or `CAMetalLayer` drawable unavailable.
    SurfaceLost = 1,
    /// GLES 3.0 or MSL uber-shader compilation or pipeline creation failed.
    ShaderCompileFailed = 2,
    /// Frame swap, command buffer commit, or surface post failed.
    SubmitFailed = 3,
}

/// Deterministic failover action emitted on mobile graphics faults while guaranteeing zero blank frames.
#[derive(Clone, Copy, Debug, Eq, PartialEq)]
pub enum MobileFailoverAction {
    /// Retains the last valid presented frame while immediately switching to a visually equivalent fallback path.
    KeepLastFrameAndSwitch(MobilePresentPath),
    /// Retains the last valid presented frame and retries submission on the next VSync callback.
    KeepLastFrameAndRetry,
    /// Halts presentation cleanly until the host attaches a fresh valid native surface.
    WaitForNewSurface,
}