rendy_command/buffer/
usage.rsuse super::SecondaryLevel;
#[derive(Clone, Copy, Debug, Default)]
pub struct OneShot;
#[derive(Clone, Copy, Debug, Default)]
pub struct MultiShot<S = NoSimultaneousUse>(pub S);
#[derive(Clone, Copy, Debug, Default)]
pub struct SimultaneousUse;
#[derive(Clone, Copy, Debug, Default)]
pub struct NoSimultaneousUse;
#[derive(Clone, Copy, Debug, Default)]
pub struct RenderPassContinue;
#[derive(Clone, Copy, Debug, Default)]
pub struct OutsideRenderPass;
pub trait Usage: Copy + Default + std::fmt::Debug + 'static {
fn flags(&self) -> rendy_core::hal::command::CommandBufferFlags;
}
impl Usage for OneShot {
fn flags(&self) -> rendy_core::hal::command::CommandBufferFlags {
rendy_core::hal::command::CommandBufferFlags::ONE_TIME_SUBMIT
}
}
impl Usage for MultiShot {
fn flags(&self) -> rendy_core::hal::command::CommandBufferFlags {
rendy_core::hal::command::CommandBufferFlags::empty()
}
}
impl Usage for MultiShot<SimultaneousUse> {
fn flags(&self) -> rendy_core::hal::command::CommandBufferFlags {
rendy_core::hal::command::CommandBufferFlags::SIMULTANEOUS_USE
}
}
impl Usage for NoSimultaneousUse {
fn flags(&self) -> rendy_core::hal::command::CommandBufferFlags {
rendy_core::hal::command::CommandBufferFlags::empty()
}
}
pub trait RenderPassRelation<L>: Copy + Default + std::fmt::Debug + 'static {
fn flags(&self) -> rendy_core::hal::command::CommandBufferFlags;
}
impl RenderPassRelation<SecondaryLevel> for RenderPassContinue {
fn flags(&self) -> rendy_core::hal::command::CommandBufferFlags {
rendy_core::hal::command::CommandBufferFlags::RENDER_PASS_CONTINUE
}
}
impl<L> RenderPassRelation<L> for OutsideRenderPass {
fn flags(&self) -> rendy_core::hal::command::CommandBufferFlags {
rendy_core::hal::command::CommandBufferFlags::empty()
}
}