1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
use 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) -> gfx_hal::command::CommandBufferFlags;
}
impl Usage for OneShot {
fn flags(&self) -> gfx_hal::command::CommandBufferFlags {
gfx_hal::command::CommandBufferFlags::ONE_TIME_SUBMIT
}
}
impl Usage for MultiShot {
fn flags(&self) -> gfx_hal::command::CommandBufferFlags {
gfx_hal::command::CommandBufferFlags::empty()
}
}
impl Usage for MultiShot<SimultaneousUse> {
fn flags(&self) -> gfx_hal::command::CommandBufferFlags {
gfx_hal::command::CommandBufferFlags::SIMULTANEOUS_USE
}
}
impl Usage for NoSimultaneousUse {
fn flags(&self) -> gfx_hal::command::CommandBufferFlags {
gfx_hal::command::CommandBufferFlags::empty()
}
}
pub trait RenderPassRelation<L>: Copy + Default + std::fmt::Debug + 'static {
fn flags(&self) -> gfx_hal::command::CommandBufferFlags;
}
impl RenderPassRelation<SecondaryLevel> for RenderPassContinue {
fn flags(&self) -> gfx_hal::command::CommandBufferFlags {
gfx_hal::command::CommandBufferFlags::RENDER_PASS_CONTINUE
}
}
impl<L> RenderPassRelation<L> for OutsideRenderPass {
fn flags(&self) -> gfx_hal::command::CommandBufferFlags {
gfx_hal::command::CommandBufferFlags::empty()
}
}