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
mod lines;
mod triangles;
pub use self::lines::Lines;
pub use self::triangles::Triangles;
use crate::{Pipeline, Target};
#[derive(Copy, Clone, Debug)]
pub enum DepthStrategy {
IfLessWrite,
IfMoreWrite,
IfLessNoWrite,
IfMoreNoWrite,
None,
}
pub trait BackfaceMode {
const ENABLED: bool;
}
pub struct BackfaceCullingDisabled;
impl BackfaceMode for BackfaceCullingDisabled {
const ENABLED: bool = false;
}
pub struct BackfaceCullingEnabled;
impl BackfaceMode for BackfaceCullingEnabled {
const ENABLED: bool = true;
}
pub trait Rasterizer {
type Input;
type Supplement;
fn draw<P: Pipeline, T: Target<Item = P::Pixel>>(
pipeline: &P,
vertices: &[P::Vertex],
target: &mut T,
supplement: &mut Self::Supplement,
);
}