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
//! Plugin substrate: target descriptors, shared bind layouts, WGSL helpers,
//! and pipeline builders.
//!
//! This module publishes the pieces a plugin needs to build pipelines that
//! drop into the lib's existing render passes. A plugin reuses:
//!
//! - Target descriptors ([`OpaqueTargetDesc`], [`OitTargetDesc`],
//! [`MaskTargetDesc`], [`PickTargetDesc`], [`ShadowTargetDesc`]) describe
//! the render-target formats, blend states, and depth-stencil state each
//! lib pass expects. Pipelines built against these are compatible with the
//! corresponding pass.
//! - [`SharedBindings`] is the group-0 bind layout (camera, lights, shadows,
//! clip, IBL) shared by every scene pipeline. Plugin pipeline layouts list
//! it as group 0.
//! - [`shared_wgsl`] holds string constants with the standard bind
//! declarations and shading helpers (`viewport_pbr_shade`,
//! `viewport_oit_pack`, `viewport_sample_csm`, etc.) so plugin shaders stay
//! in lockstep with the lib's lighting and transparency contracts.
//! - Pipeline builders on [`crate::resources::DeviceResources`]
//! (`build_opaque_pipeline`, `build_oit_pipeline`, ...) construct the
//! common variants in one call. Plugins ship one shader and call a
//! builder per variant.
//!
//! All accessors live on [`crate::resources::DeviceResources`].
//!
//! # Compatibility policy
//!
//! Pre-1.0, this surface evolves more freely than a stable crate would, but
//! the policy below describes what plugins can rely on within a given minor
//! version and how breakage is signalled.
//!
//! Plugins are expected to track `viewport-lib` minor versions. The
//! convention is that a minor bump may rename or remove items the audit
//! flags as non-additive; a patch bump never does.
//!
//! - **Group-0 binding indices ([`SharedBindings`]) are additive-only.**
//! The constants in `SharedBindings` (`CAMERA_BINDING`, ...) keep their
//! numeric values forever. New bindings are appended at the next free
//! index. This is the strongest guarantee in the API: a plugin pipeline
//! built once stays valid as new bindings are added.
//!
//! - **WGSL helper strings in [`shared_wgsl`] are stable within a minor
//! version.** Helper *function signatures* (`viewport_pbr_shade`,
//! `viewport_oit_pack`, `viewport_sample_csm`, ...) and the struct
//! layouts they declare may change with a minor bump. When a helper's
//! signature changes in an incompatible way, the helper is renamed (the
//! old name is removed) so a plugin shader that referenced the old name
//! fails to compile loudly rather than silently producing wrong output.
//! Additive changes (new helpers, new optional fields appended to
//! structs) ride patch bumps.
//!
//! - **Target descriptors and pipeline builder signatures are stable within
//! a minor version.** Format constants (`HDR_COLOR_FORMAT`, blend
//! states, depth-stencil state) follow the same rule: any change rides a
//! minor bump and is noted in the CHANGELOG.
//!
//! - **The deformer registry hook contract is additive-only.** The
//! `DeformVertex` and `DeformContext` struct shapes (see
//! [`crate::resources::mesh_sidecar::registry::DeformerDesc`]) keep
//! existing fields stable across releases; new fields may be appended.
//! The composition-order policy (ObjectSpace before WorldSpace, priority
//! ascending within stage) is part of the contract and will not change.
//!
//! - **Builder methods on [`crate::resources::DeviceResources`] that
//! construct pipelines for plugins** (`build_opaque_pipeline`,
//! `build_oit_pipeline`, ...) keep their behaviour stable within a minor
//! version. Signature changes ride minor bumps and are listed in the
//! CHANGELOG.
//!
//! Anything not listed above is internal: a plugin that reaches past the
//! published surface (private modules, undocumented constants) may break at
//! any release.
pub use ;
pub use ;
pub use ;
/// Group-0 bind layout shared by every scene pipeline.
///
/// Plugin pipeline layouts must list this layout as group 0 so the lib's bound
/// camera / lights / shadow / clip / IBL resources are visible to the plugin's
/// shader. Bindings 0-13 match [`shared_wgsl::SHARED_BINDINGS_WGSL`]; do not
/// re-declare them in plugin WGSL.
///
/// Obtain a reference via
/// [`DeviceResources::shared_bindings`](crate::resources::DeviceResources::shared_bindings).