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
use { Resources, Slice, PipelineState, Encoder, CommandBuffer };
use super::PipelineData;
pub struct Bundle<R: Resources, Data: PipelineData<R>> {
pub slice: Slice<R>,
pub pso: PipelineState<R, Data::Meta>,
pub data: Data,
}
impl<R: Resources, Data: PipelineData<R>> Bundle<R, Data> {
pub fn new(slice: Slice<R>, pso: PipelineState<R, Data::Meta>, data: Data) -> Self
{
Bundle {
slice: slice,
pso: pso,
data: data,
}
}
pub fn encode<C>(&self, encoder: &mut Encoder<R, C>) where
C: CommandBuffer<R> {
encoder.draw(&self.slice, &self.pso, &self.data);
}
}