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
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
//! The layer contract: what a crate implements to add a layer type that the
//! renderer draws.
//!
//! A layer type has two halves, which
//! [`RegistryBuilder::add_layer_type::<L>()`](crate::RegistryBuilder::add_layer_type)
//! registers together under the style half's name:
//!
//! - **The style half**, a marker type that implements `mln_style`'s
//! [`StyleLayerType`](mln_style::layer::StyleLayerType): the type's name,
//! its kind of source and its properties.
//! - **The render half**, a struct that implements [`Layer`], one value per
//! style layer of the type, which names its style half
//! ([`Layer::Style`]).
//!
//! # What a layer type writes
//!
//! 1. What it draws from, its [`Layer::Input`]: a geometry source's tiles,
//! whose features a [`Layout`] lays out into a [`Bucket`] per tile on a
//! tile worker ([`Features`]); a raster or image source's tiles, each
//! tile's image ([`RasterTiles`](crate::source::RasterTiles), [`RasterTile`]); a raster-dem source's
//! tiles, each tile's elevations ([`DemTiles`](crate::source::DemTiles), [`DemContents`]); or
//! nothing, for a layer without a source ([`NoTiles`]). The registration
//! doesn't compile for an input of another kind of source than the style
//! half names.
//! 2. Its tile values. [`Layer::tile`] makes what the layer keeps of a frame
//! tile that has data for it, typically the meshes it draws the tile
//! with. The engine keeps the value with the tile until the tile shows
//! the layer something else, leaves the frame, or the layer's draws drop
//! for a restyle or a switch between Mercator and the globe; it then
//! hands the next [`tile`](Layer::tile) of the tile the previous value,
//! so that a layer carries over what it made of contents that are still
//! the tile's, such as a texture of its image.
//! 3. Its draws. [`Layer::prepare`] pushes the frame's draws of the layer's
//! meshes into [`Draws`](crate::draw::Draws), with the values of their
//! programs' blocks: the engine writes, orders, uploads and draws them in
//! the frame's passes, at the layer's place in the layers' order and
//! depth, so a layer never sees a pass, a stencil or a uniform buffer. A
//! layer may draw into targets of its own first
//! ([`Draws::target`](crate::draw::Draws::target)), or ask for the
//! backend's own commands ([`Draws::lend`](crate::draw::Draws::lend),
//! [`Layer::lend`]), and free what it makes with them once the GPU is
//! done with it ([`AfterGpu`](crate::draw::AfterGpu)).
//!
//! [`Layer::evaluate`] says whether and how the layer draws with its freshly
//! evaluated values ([`Evaluation`]); [`Layer::update`] brings up to date
//! what the layer keeps for all its tiles in the frame's update.
//!
//! # Terrain
//!
//! A type says how its layers meet terrain ([`Layer::TERRAIN`],
//! [`OnTerrain`]). One that drapes draws flat into the textures of the
//! terrain's tiles rather than onto the frame: the engine prepares the layer
//! again for each drape it draws, with the drape's frame
//! ([`LayerFrame`](crate::draw::LayerFrame)) and the tiles that overlap the
//! drape, which draw the same tile values as the map's frame, so a tile's
//! value holds nothing of the frame or the world copy it is first drawn in.
//! The engine draws a drape again only when what it shows changed. One that
//! stands on terrain draws the terrain variant of its programs, whose points
//! read the ground's height, and one that hides behind the ground reads its
//! depth ([`draw::ground`](crate::draw::ground)).
//!
//! # Shared targets
//!
//! An extension can route the draws of other layers, of any type, into
//! textures of the frame's size that several layers share, and process them:
//! a [`Router`], which it registers
//! ([`RegistryBuilder::add_router`](crate::RegistryBuilder::add_router)),
//! declares the frames' shared targets from the style, such as from its
//! extension members ([`mln_style::member`]), and routes layers into them,
//! and a layer reads one in its [`prepare`](Layer::prepare) for the map's
//! frame ([`PrepareCx::read_target`]). The engine draws each target's pass before
//! the frame's, after the passes of the targets its layers read, and refuses
//! the routes that don't fit, whose layers draw on the map.
//!
//! # Queries
//!
//! A rendered-feature query finds a tile's features near its geometry in the
//! tile's feature index, padded by the layer's
//! [`query_radius`](Layer::query_radius), and keeps those the layer
//! [`hit`](Layer::hit)s. A layer that draws other than its tiles'
//! features, such as one without a source, answers from the last frame
//! ([`Layer::hit_frame`], [`FrameQuery`]): its hits come with the tiled
//! layers', in the layers' order, and the query's filter places them, for
//! `within`, in a tile that holds their geometry.
//!
//! # Buckets
//!
//! A bucket keeps its vertices and indexes in [`GeometryVec`]s and its
//! data-driven paint values in binders ([`binders`], declared with
//! `paint_property_binders!`), which it names in its
//! [`upload`](Bucket::upload): the engine moves them into the context's
//! stores, where a layer's tile value reads them
//! ([`bucket_vertices`], [`bucket_indexes`], [`paint_vertices`]), and
//! rewrites the binders' values where feature state changes.
//!
//! The layer and every hook but the layout's run on the renderer's thread;
//! the layout and the bucket are `Send`, and a bucket crosses to a tile
//! worker with memory of its own through the worker codec.
/// The binders of a layer type's data-driven paint values: what a bucket
/// keeps of each feature's values for its layers' draws, which feature
/// state rewrites, and the macro that declares a type's binders.
pub
pub
pub
pub
pub
pub
pub
pub
pub
pub
pub
pub
pub use crate;
pub use crate;
pub use crateBucketChanges;
pub use crateEvaluatedLayer;
pub use crate;
pub use crate;
pub use crate;
pub use crateQueryRegion;
pub use crate;
pub use crateSurfaceLight;
pub use crateFrameTile;
pub use crateImageQuad;
pub use crateTileOrder;
pub use crateDemContents;