gled-core 2.32.0

The engine of gled without a user interface: inputs, timing, rendering, Art-Net/DMX output and storage
Documentation
//! Messages exchanged between the engine thread and the render thread.

use std::sync::Arc;

use crate::{
    pipeline::extract_output::OutputConfig,
    storage::{
        asset::{animation::Animation, project::Project},
        asset_id::AssetId,
    },
};

/// Everything the render thread needs to render one frame, sent by the
/// engine once per tick. The project is the engine's shared one, a new value
/// only when it changed, so a snapshot costs no copy of it. Snapshots are
/// dropped when the render thread is behind; the next one supersedes them
/// anyway, so each one carries all the render thread needs and nothing relies
/// on a dropped one.
#[derive(Debug)]
pub(crate) struct RenderSnapshot {
    pub(crate) project: Option<Arc<Project>>,
    pub(crate) blackout: bool,
    pub(crate) output_config: OutputConfig,
    pub(crate) fps_limit: f32,
    /// Changes whenever the engine derived the patch's lamp layout again; the
    /// render thread then uploads the lamp positions of every effect anew.
    pub(crate) layout_generation: u64,
}

/// One-shot requests that must not be dropped.
#[derive(Debug)]
pub(crate) enum RenderCommand {
    /// Rebuild the output pipelines of all effects using this animation, or of
    /// all effects for `None`. Sent after the animation was saved to the collections.
    ReloadShaderCode(Option<AssetId<Animation>>),
}

/// Reports from the render thread to the engine thread.
#[derive(Debug)]
pub(crate) enum RenderFeedback {
    /// Frame rate and worst frame over the last second.
    FrameStats(gled_protocol::state::RenderStats),
}