Expand description
The built-in lit pipeline and the WESL composition behind it.
SpecializedLitPipeline composes an LitVariant’s entry shader —
the built-in lit.wesl, or the caller’s own when
LitOptions::shader carries one — builds the layouts the shader
expects, and exposes the vertex-buffer layouts the caller declares when
creating meshes. Each variant contains exactly the bindings and attributes
the selected channels need, so nothing unused reaches the GPU.
Re-exports§
use crate::mesh::ChannelEncoding;🔒use crate::mesh::PositionStreamChannels;🔒use crate::mesh::PositionStreamWriter;🔒use crate::mesh::SecondaryFlags;🔒use crate::mesh::SecondaryStreamWriter;🔒use crate::specialize::PipelineDescriptor;🔒use crate::specialize::PipelineVariant;🔒use crate::specialize::SurfaceKey;🔒use crate::specialize::VertexBufferLayoutDesc;🔒use crate::util::Hashed;🔒use std::sync::Arc;🔒
Modules§
- location
- Vertex attribute locations declared by the built-in shader.
Structs§
- Depth
Stencil Policy - The depth-test policy of a lit pipeline, without the attachment’s format.
- Global
Bindings - Which of a source’s global buffers a pipeline reads.
- LitBind
Group Layouts - The bind-group layouts a
SpecializedLitPipelinevariant declares. - LitOptions
- The policy a caller decides about a built-in lit pipeline.
- LitShader
- A caller’s own shader code, spliced into the built-in
lit.wesl. - LitVariant
- The complete identity of a built-in lit pipeline, and its blueprint.
- LitVertex
Channels - The per-vertex channels the built-in shader variant reads.
Enums§
- Base
Color Channels - How a sampled base-color texel expands into the fragment’s color.
Constants§
- BASE_
COLOR_ SAMPLER_ BINDING - Binding slot of the base-color sampler in the material group.
- BASE_
COLOR_ TEXTURE_ BINDING - Binding slot of the base-color texture in the material group.
- BUILT_
IN_ 🔒MODULE - Name of the WESL module the built-in entry shader is composed from: the file
shaders/lit.weslof this crate’s package. - BUILT_
IN_ 🔒SHADER_ LABEL - Label of the built-in entry shader: its shader module’s label, and the name a composition error is reported under.
- CAMERA_
BINDING - Binding slot of the camera uniform in the global bind group.
- CLUSTER_
BINDING - Binding slot of the cluster uniform in the global bind group.
- FRAME_
BINDING - Binding slot of the frame-globals uniform in the global bind group.
- FS_MAIN
- Entry point name of the built-in shader’s fragment stage.
- GLOBAL_
GROUP - Bind-group index of the global group.
- INSTANCE_
SLOT - Vertex-buffer slot carrying per-instance data.
- JOINTS_
BINDING - Binding slot of the frame’s joint matrices in the global bind group.
- LIGHTING_
BINDING - Binding slot of the frame-wide lighting uniform in the global bind group.
- LIGHTS_
BINDING - Binding slot of the frame’s lights in the global bind group.
- LIGHT_
CELLS_ BINDING - Binding slot of the frame’s cluster cells in the global bind group.
- LIGHT_
VERTICES_ BINDING - Binding slot of the frame’s polygon-light vertices in the global bind group.
- MATERIAL_
GROUP - Bind-group index of the material group.
- MESH_
GROUP - Bind-group index of the mesh group.
- MESH_
METADATA_ BINDING - Binding slot of the mesh-metadata storage buffer in the global bind group.
- MORPH_
DELTAS_ BINDING - Binding slot of the frame’s morph position displacements in the global bind group.
- MORPH_
WEIGHTS_ BINDING - Binding slot of the frame’s morph weights in the global bind group.
- PRIMARY_
SLOT - Vertex-buffer slot carrying the primary stream: positions and, for a skinned mesh, the joint indices and weights that deform them.
- SECONDARY_
SLOT - Vertex-buffer slot carrying the secondary stream: the UV, color and normal a mesh carries beside its position.
- VIEW_
BINDING - Binding slot of the pass’s view uniform in the global bind group.
- VS_MAIN
- Entry point name of the built-in shader’s vertex stage.
Functions§
- array_
entry - The layout entry binding an array of
element_size-byte elements. - compose_
shader 🔒 - Compose
variant’s entry shader into one WGSL module. - global_
bind_ group_ layout - Build the global bind-group layout a pipeline with
bindingsdeclares. - supports_
storage_ buffers - Whether
devicecan read a storage buffer from a shader.
Type Aliases§
- Specialized
LitPipeline - The built-in lit pipeline: a compiled [wgpu::RenderPipeline] together
with the
LitVariantit was built from.