ombre 0.6.7

Shadowy game and graphics library for Rust
Documentation
use super::*;

#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash)]
pub struct PassId(id::Id);

impl PassId {
    /// Get the next pipeline id.
    pub fn next() -> Self {
        Self(id::next())
    }
}

#[derive(Debug, Clone)]
pub enum PassAction {
    Nothing,
    Clear {
        color: Option<color::Rgba<f32>>,
        depth: Option<f32>,
        stencil: Option<i32>,
    },
}

impl PassAction {
    pub fn clear(color: impl Into<Rgba<f32>>) -> PassAction {
        PassAction::Clear {
            color: Some(color.into()),
            depth: Some(1.),
            stencil: None,
        }
    }
}

impl Default for PassAction {
    fn default() -> PassAction {
        PassAction::Clear {
            color: Some(Rgba::TRANSPARENT),
            depth: Some(1.),
            stencil: None,
        }
    }
}

/// Describes a render pass.
#[derive(Debug, Clone)]
pub struct PassDescriptor {
    /// Texture in which to render color.
    pub color_attachment: Option<TextureId>,
    /// Texture in which to render depth.
    pub depth_attachment: Option<TextureId>,
}