Expand description
WGSL helper catalog.
Each helper is a &'static str of WGSL that a plugin shader prefixes (or
concatenates into its own shader source) to gain access to the lib’s
shared bindings, shading helpers, and target conventions.
Versioning: each helper carries a // @viewport-wgsl-version: N
comment. The version is bumped whenever a function signature, struct
field, or binding number changes. Plugins compare against
WGSL_VERSION at build time to detect breakage early. Function bodies
and private fields are not part of the contract and may change between
patch releases.
Composition: plugin shaders typically build their source as:
ⓘ
let src = format!(
"{bindings}\n{pbr}\n{this_pipeline_specific_wgsl}",
bindings = viewport_lib::plugin_api::shared_wgsl::SHARED_BINDINGS_WGSL,
pbr = viewport_lib::plugin_api::shared_wgsl::SHARED_PBR_WGSL,
this_pipeline_specific_wgsl = include_str!("my_shader.wgsl"),
);Constants§
- SHARED_
BINDINGS_ WGSL - Group-0 bind declarations and shared scene-data structs.
- SHARED_
MASK_ WGSL - Fragment helper for the outline mask pass.
- SHARED_
OIT_ WGSL - Fragment-output struct and packing helper for the OIT pass.
- SHARED_
PBR_ WGSL - Shared PBR shading helper.
- SHARED_
PICK_ WGSL - Fragment helper for the pick-id pass.
- WGSL_
VERSION - Catalog version. Bumped on any breaking change to a helper signature, struct field, or binding number. Plugins should assert against this at build time: