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
//! Material **prep** pass — the shared, material-independent per-pixel resolve
//! that Plan B introduces (`docs/plans/deferred-shared-prep-pass.md`).
//!
//! It runs once over the visibility buffer (after classify, before per-material
//! shading) and materializes everything that is the *same regardless of
//! material*: world position, interpolated UV sets + vertex colors, and the
//! per-pixel shadow-visibility terms. Per-material kernels then read those
//! buffers instead of recomputing them, so the per-material module shrinks.
//!
//! Stage 0 lands [`PrepPassConfig`] — the build-time knobs every later stage
//! keys on. The pass shader scaffold lives in [`shader`]; its buffers, bind
//! groups, and dispatch wiring arrive in the subsequent stages (see the spec's
//! "Implementation stages").
/// Max UV sets materialized by the prep pass (Stage 2a). `prep_uv` is a
/// `texture_2d_array` with this many layers; `cs_prep` writes layers
/// `0..min(uv_set_count, MAX_PREP_UV_SETS)`. glTF content almost never exceeds
/// 2 UV sets, so 4 is generous; a material referencing a set `>= cap` clamps to
/// the last layer on read (slim shader, Stage 2b) — bounded + benign.
pub const MAX_PREP_UV_SETS: u32 = 4;
/// Max vertex-color sets materialized by the prep pass (Stage 2a). `prep_vcolor`
/// is a `texture_2d_array` with this many layers. Vertex colors beyond set 0 are
/// vanishingly rare; 2 is generous.
pub const MAX_PREP_COLOR_SETS: u32 = 2;
/// Build-time configuration for the shared prep + deferred-shadow path.
///
/// Stored on the renderer at construction (mirrors `AntiAliasing` /
/// `BucketConfig`). The shared prep pass is now unconditional; this config
/// only carries the `K` sizing knob.