mwg API
    Preparing search index...

    Function detectWebGpu

    • The real, asynchronous WebGPU/WGSL check inspectGraphicsCapabilities cannot do synchronously: requests an actual adapter and device, then compiles an actual shader module and reads back its compilation diagnostics. Feed the result to inspectGraphicsCapabilities via probe.webgpu/probe.wgsl once resolved.

      Returns Promise<WebGpuDetection>

      import { detectWebGpu, inspectGraphicsCapabilities } from '@datamoc/mw_games/two-d/render';

      const detected = await detectWebGpu();
      const capabilities = inspectGraphicsCapabilities({ webgpu: detected.webgpu, wgsl: detected.wgsl });
      console.log(capabilities.wgsl); // true only if a real WGSL shader actually compiled