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
//! Material references in draw data: what a command draws with and where its uniforms are.
//!
//! A material replaces the color stage of the fragment shader. The geometry, vertex layout,
//! clip rectangle and blending of a command that uses one are those of any other command.
use ;
/// Stable key of a registered material: a hash of its source, parameter schema and flags.
///
/// The same description always gets the same id, so registering it every frame is cheap and
/// grows nothing. Ids are only meaningful with the [`SharedResources`](crate::SharedResources)
/// that issued them, and in [`DrawData`](super::DrawData) next to the matching
/// [`MaterialSource`].
;
/// The material and uniform data one command is drawn with.
/// A material a frame uses, complete enough to compile it again on a new device. Backends
/// cache pipelines by `id`; a changed `wgsl` under an old id replaces the cached pipeline.