rullino
    Preparing search index...

    Interface GpuContextOptions

    interface GpuContextOptions {
        gpu?: GPU;
        onError?: (error: GpuError) => void;
    }

    Hierarchy

    • GPURequestAdapterOptions
      • GpuContextOptions
    Index
    gpu?: GPU

    The WebGPU entry point to use instead of navigator.gpu, e.g. Dawn's create([]) from the webgpu package in Node (@rullino/node does this for you).

    onError?: (error: GpuError) => void

    Called with GPU errors the library can attribute: a shader that does not compile (ShaderCompileError, naming the shader and the lines), validation and out-of-memory errors. They arrive asynchronously, after the call that caused them. Without it they go to console.error.