Luxar Viewer API Documentation - v2026.9.22
    Preparing search index...

    Function probeWebGPUBackend

    • Probe which graphics backend is physically running behind ?renderer=webgpu, for specs that must skip on the WebGL2 fallback.

      capabilities.apiSurface === 'webgpu' does NOT answer this: it is 'webgpu' for any active WebGPURenderer, including one whose internal backend has fallen back to WebGL2 — the headless-chromium norm. That field means "which method-signature contract should I follow?", not "which GPU backend is running?" (#1449). So isNative reads the backend's own flag and nothing else, which also leaves apiSurface free to be asserted by callers rather than assumed.

      The tell is deliberately POSITIVE (isWebGPUBackend === true, set by three's WebGPUBackend constructor): a negative isWebGLBackend !== true check fails OPEN under structural drift — a renamed flag, a third backend, a wrapped backend — silently restoring the very fail-open behaviour #1449 fixed. The positive form fails closed (skip), mirroring isWebGLRenderer in rendering/renderer-capabilities.ts.

      Call this only AFTER waitForLuxarReady. WebGPURenderer constructs a WebGPUBackend eagerly and replaces this.backend with a WebGLBackend from inside init() when no adapter can be acquired, so a probe that races the viewer's await renderer.init() reads the optimistic pre-fallback value and reports a native backend that isn't there.

      Parameters

      • page: Page

      Returns Promise<WebGPUBackendProbe>