bindPipeline method

  1. @override
void bindPipeline(
  1. PipelineHandle pipeline
)

Binds the pair of stages the following draws run.

Bindings do not survive this call. A backend is free to drop every buffer, uniform and texture binding when the pipeline changes — the flutter_gpu backend must, because its pass replays every binding it has ever been handed at each draw, keyed by the shader that bound it, and a stale block from the previous pipeline's shader can land on a slot the new pipeline reads. Every site in this engine therefore binds what a draw needs after binding its pipeline, never before.

Implementation

@override
void bindPipeline(PipelineHandle pipeline) {
  _pipeline = pipeline.backend as WebGpuPipeline;
  // Bindings do not survive a pipeline change — the contract states it, and
  // this honours it literally rather than by accident.
  _forgetBindings();
}