createPipeline method

  1. @override
PipelineHandle createPipeline(
  1. ShaderHandle vertex,
  2. ShaderHandle fragment, {
  3. VertexLayoutSpec? layout,
})

Records the stage pair, its layout and the reflection a bind group will need. Nothing is built: see WebGpuPipeline, and webgpu_encoder.dart for what a draw does with it.

The contract calls this expensive and tells callers to cache. Here it is nearly free and the expense moves to the first draw of each distinct state — which is not a contract change, but it does make the advice describe the other end of the frame.

The two stages' modules are captured, not looked up again. That is what keeps loadShaders's reload promise: a bundle refreshed under a renderer replaces the code behind a ShaderHandle, and a pipeline built before the refresh goes on drawing the code it was built from until Renderer.relinkShaders builds another. A frame in between is the old picture rather than a missing one.

Implementation

@override
PipelineHandle createPipeline(
  ShaderHandle vertex,
  ShaderHandle fragment, {
  VertexLayoutSpec? layout,
}) => createWebGpuPipeline(vertex, fragment, layout: layout);