createPipelineAsync method

Future<PipelineHandle> createPipelineAsync(
  1. ShaderHandle vertex,
  2. ShaderHandle fragment, {
  3. VertexLayoutDescriptor? layout,
})
inherited

createPipeline without holding up the caller: the future completes when the pipeline is linked.

Where a backend can compile off the thread, this is where it does. WebGPU's createRenderPipelineAsync is the model. The default links in the calling turn and hands back a completed future, which is what a backend without asynchronous compilation (Impeller, WebGL2 without KHR_parallel_shader_compile, the software rasteriser) can honestly do. A refused link completes the future with the error instead of throwing.

Implementation

Future<PipelineHandle> createPipelineAsync(
  ShaderHandle vertex,
  ShaderHandle fragment, {
  VertexLayoutDescriptor? layout,
}) async => createPipeline(vertex, fragment, layout: layout);