cyborg/src/phase.rs

33 lines
689 B
Rust
Raw Normal View History

2022-04-18 09:54:29 +00:00
//! Render phase definitions.
2022-04-04 02:31:20 +00:00
2022-04-18 09:54:29 +00:00
/// The main render phase definitions.
///
/// These variants are temporary and for testing purposes.
2022-04-04 02:31:20 +00:00
#[derive(Copy, Clone, Debug, Hash, Eq, Ord, PartialEq, PartialOrd, strum::EnumIter)]
2022-04-18 09:54:29 +00:00
pub enum Phase {
2022-04-19 02:12:10 +00:00
Upload,
2022-05-08 03:48:54 +00:00
Skinning,
Depth,
Opaque,
Transparent,
2022-04-24 01:56:51 +00:00
Overlay,
2022-04-04 02:31:20 +00:00
}
2022-04-18 09:54:29 +00:00
impl Phase {
pub fn get_kind(&self) -> PhaseKind {
use Phase::*;
match self {
2022-04-19 02:12:10 +00:00
Upload => PhaseKind::Command,
2022-05-08 03:48:54 +00:00
Skinning => PhaseKind::Compute,
2022-04-24 01:56:51 +00:00
Depth | Opaque | Transparent | Overlay => PhaseKind::Render,
2022-04-04 02:31:20 +00:00
}
}
2022-04-18 09:54:29 +00:00
}
2022-04-04 02:31:20 +00:00
2022-04-18 09:54:29 +00:00
/// The different kinds of phases.
pub enum PhaseKind {
Command,
Compute,
Render,
2022-04-04 02:31:20 +00:00
}