rendy_command/buffer/
reset.rs

1use super::state::*;
2
3/// This flag specify that buffer can be reset individually.
4#[derive(Clone, Copy, Debug, Default)]
5pub struct IndividualReset;
6
7/// This flag specify that buffer cannot be reset individually.
8#[derive(Clone, Copy, Debug, Default)]
9pub struct NoIndividualReset;
10
11/// Specify flags required for command pool creation to allow individual buffer reset.
12pub trait Reset: Copy + Default + std::fmt::Debug + 'static {
13    /// Get flags for reset parameter.
14    fn flags(&self) -> rendy_core::hal::pool::CommandPoolCreateFlags;
15}
16
17impl Reset for IndividualReset {
18    fn flags(&self) -> rendy_core::hal::pool::CommandPoolCreateFlags {
19        rendy_core::hal::pool::CommandPoolCreateFlags::RESET_INDIVIDUAL
20    }
21}
22
23impl Reset for NoIndividualReset {
24    fn flags(&self) -> rendy_core::hal::pool::CommandPoolCreateFlags {
25        rendy_core::hal::pool::CommandPoolCreateFlags::empty()
26    }
27}
28
29/// States in which command buffer can de reset.
30pub trait Resettable {}
31impl Resettable for InitialState {}
32impl<U, P> Resettable for RecordingState<U, P> {}
33impl<U, P> Resettable for ExecutableState<U, P> {}
34impl Resettable for InvalidState {}