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
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
//! `BuildAsset` is the build-time counterpart to `Component`. Components whose
//! `PAYLOAD = AssetPayload::Compiled` implement this trait to turn their args
//! into a binary payload (mesh vertices, shader bytecode, decoded image, etc.).
//! The build pipeline calls `<T as BuildAsset>::compile_payload` for each
//! declared asset and packs the resulting bytes into a blob.
//!
//! `BuildCtx` is the build-time context handed to each impl. It lives here
//! because it is build-only: the runtime never compiles a payload. `Platform`
//! and the `SourceBacked` trait stay in concinnity-core, since the engine reads
//! a Shader stage's current-platform source at runtime.
use Path;
use crateComponent;
use crateWorldJsonlAsset;
// The on-disk inputs an asset's `compile_payload` reads, and how they relate to
// the payload cache's generic walk of the args JSON.
//
// `Extra` adds to what the walk finds: the walk stays a conservative safety net
// that over-approximates the input set, and the asset contributes only the
// paths the walk would miss.
//
// `Only` replaces the walk entirely and is the complete input set. Use it when
// the walk over-approximates in a way that matters -- a Shader stage declaring
// both an `.hlsl` and a `.glsl` source reads exactly one of them, so hashing
// both makes an edit to the unused variant invalidate the other backend's
// cached payload. The tradeoff is that the safety net is gone: an input this
// list omits is not hashed at all, and a stale payload replays silently. Cover
// each `Only` impl with a test asserting the set it reports.
pub
// Build-time context handed to each `BuildAsset` impl.
pub
// A component that compiles to a binary payload at build time.
//
// Only types whose `Component::PAYLOAD` is `AssetPayload::Compiled` should
// implement this. The build pipeline dispatches via a match on
// `RegisteredType` in [`crate::pipeline`].
pub
// An asset's contribution to its payload cache key: the inputs its compile
// reads, plus whether the compile target affects the output. Paired so the
// dispatch that builds one builds the other, keeping a new platform-dependent
// asset from silently inheriting `TARGET_DEPENDENT = false`.
pub