MaterialStageBudget class abstract final

The textures, samplers and uniform blocks one stage of a pipeline may bind, the engine's own bindings and a material's together (M3).

WebGPU's guaranteed minimums, the tightest of the four backends. A WebGPU device may report more, and the engine asks the adapter for what it has, but a bundle built for any browser can count only on what every device gives: 16 sampled textures, 16 samplers and 12 uniform buffers in a stage. A texture the material language binds is a texture and a sampler on WebGPU, so a stage's textures count against both.

The build refuses a stage over the budget, naming it and the count (wgslSectionDocument, which every writer of a WebGPU section calls), so a material that would fail to make its pipeline on somebody's device fails on the author's machine instead. The engine's stages leave a lit model's own bindings what docs/CONTRACTS.md ("A material's own blocks and textures") says.

Properties

hashCode → int
The hash code for this object.
no setterinherited
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() → String
A string representation of this object.
inherited

Operators

operator ==(Object other) → bool
The equality operator.
inherited

Static Methods

problem(String stage, {required int textures, required int samplers, required int uniformBlocks}) → String?
Why a stage named stage that binds textures textures, samplers samplers and uniformBlocks uniform blocks is over the budget, or null when it is within it.
problemOfGlsl(String stage, String glsl) → String?
Why stage, whose GLSL with its includes resolved is glsl, is over the budget, or null when it is within it: the same answer problem gives, counted from the source every backend's path has, so the build and RuntimeShaders refuse it on every backend and not only where a WGSL compiler is installed. Counted as declared, after #ifdef, which the engine's headers keep in step with what the compiler keeps.

Constants

materialTextures → const int
Textures a lighting model of a plugin's own may bind of its own, through all of 1.x: what the engine's bindings in a material-language lit stage leave it with every feature on (binding_budget_test.dart holds the engine to it). A minor that wants one more texture in the lit headers packs it into one the stage already reads instead, so a material at this edge builds in every 1.x.
materialUniformBlocks → const int
Uniform blocks a lighting model of a plugin's own may declare of its own through all of 1.x, MaterialParams included; see materialTextures.
samplers → const int
Samplers in one stage.
textures → const int
Sampled textures in one stage.
uniformBlocks → const int
Uniform blocks in one stage.