rendy_command/buffer/
level.rs

1/// Command buffers of this level can be submitted to the command queues.
2#[derive(Clone, Copy, Debug, Default)]
3pub struct PrimaryLevel;
4
5/// Command buffers of this level can be executed as part of the primary buffers.
6#[derive(Clone, Copy, Debug, Default)]
7pub struct SecondaryLevel;
8
9/// Type-level buffer level flag.
10/// It defines whether buffer can be submitted to the command queues
11/// or executed as part of the primary buffers.
12pub trait Level: Copy + Default + std::fmt::Debug + 'static {
13    /// Get raw level value for command buffer allocation.
14    fn raw_level(&self) -> rendy_core::hal::command::Level;
15}
16
17impl Level for PrimaryLevel {
18    fn raw_level(&self) -> rendy_core::hal::command::Level {
19        rendy_core::hal::command::Level::Primary
20    }
21}
22
23impl Level for SecondaryLevel {
24    fn raw_level(&self) -> rendy_core::hal::command::Level {
25        rendy_core::hal::command::Level::Secondary
26    }
27}