@squareys/webdecks-sdk - v0.0.0
    Preparing search index...

    Class GpuDevice

    The engine's WebGPU device, adapter, and queue, plus its readiness lifecycle. The device comes up asynchronously after the engine boots; listen for ready, lost, and slowbackend rather than polling.

    engine.device.addEventListener("lost", (event) => showReloadBanner(event.detail.reason));
    if (engine.device.isSlowBackend) console.warn("WebGPU is running on a slow backend");

    Hierarchy (View Summary)

    Index
    • get isReady(): boolean

      Whether the device and swapchain are up and a frame can be presented.

      Returns boolean

    • get isSlowBackend(): boolean

      Whether the device is a slow backend (SwiftShader software / ANGLE GLES compatibility).

      Returns boolean

    • get maxTextureDimension(): number

      The device's maxTextureDimension2D limit, or 0 until the device is ready.

      Returns number

    • get device(): GPUDevice | null

      The engine's live GPUDevice as a real JavaScript object, or null until ready. When the host shared its own device (EngineModule.attach(wasm, { device })), that device is returned directly; otherwise the engine's numeric handle is resolved through Emscripten's WebGPU object manager.

      Returns GPUDevice | null

    • get queue(): GPUQueue | null

      The engine's live GPUQueue, or the device's queue, or null until ready.

      Returns GPUQueue | null

    • Type Parameters

      • K extends "ready" | "lost" | "slowbackend"

      Parameters

      Returns void

    • Parameters

      • type: string
      • listener: EventListenerOrEventListenerObject | null
      • Optionaloptions: boolean | AddEventListenerOptions

      Returns void

    • Type Parameters

      • K extends "ready" | "lost" | "slowbackend"

      Parameters

      Returns void

    • Parameters

      • type: string
      • listener: EventListenerOrEventListenerObject | null
      • Optionaloptions: boolean | EventListenerOptions

      Returns void

    • Dispatch a typed CustomEvent for type carrying detail.

      Type Parameters

      • K extends "ready" | "lost" | "slowbackend"

      Parameters

      Returns void

    • The dispatchEvent() method of the EventTarget sends an Event to the object, (synchronously) invoking the affected event listeners in the appropriate order.

      MDN Reference

      Parameters

      • event: Event

      Returns boolean