bindingsFor method
The bind group layouts pipeline's stage pair needs, made once.
Keyed on the pair's compiled modules rather than on the pipeline object, because the layouts come out of the two stages' reflection and nothing else: two pipelines over one pair with different vertex layouts are two pipelines and one set of bind group layouts.
Not on the pair's name. A reload replaces the code and the reflection behind a name, and a layered library answers a name the engine's library also answers; a name-keyed cache handed either of those the layouts of whichever pair was drawn first.
Implementation
WebGpuBindingLayouts bindingsFor(WebGpuPipeline pipeline) =>
_bindingLayouts[_StagePairKey(
pipeline.vertexModule,
pipeline.fragmentModule,
)] ??= guard(
'the bind group layouts of ${pipeline.name}',
() => WebGpuBindingLayouts.of(gpuDevice, pipeline),
);