Skip to main content

Module pipeline

Module pipeline 

Source
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§

DepthStencilPolicy
The depth-test policy of a lit pipeline, without the attachment’s format.
GlobalBindings
Which of a source’s global buffers a pipeline reads.
LitBindGroupLayouts
The bind-group layouts a SpecializedLitPipeline variant 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.
LitVertexChannels
The per-vertex channels the built-in shader variant reads.

Enums§

BaseColorChannels
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.wesl of 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 bindings declares.
supports_storage_buffers
Whether device can read a storage buffer from a shader.

Type Aliases§

SpecializedLitPipeline
The built-in lit pipeline: a compiled [wgpu::RenderPipeline] together with the LitVariant it was built from.