GPUAdapter

  • GPU.requestAdapter(options: GPURequestAdapterOptions): Promise<GPUAdapter>

    GPURequestAdapterOptions

    • powerPreference: GPUPowerPreference
    • forceFallbackAdapter: boolean

    GPUPowerPreference

    'low-power', 'high-performance'
  • isFallbackAdapter: boolean
  • requestDevice(descriptor: GPUDeviceDescriptor): Promise<GPUDevice>

    GPUDeviceDescriptor

    • label: USVString
    • requiredFeatures: sequence<GPUFeatureName>= []
    • requiredLimits: record<DOMString, GPUSize64>= { … }
    • defaultQueue: GPUQueueDescriptor= { … }

    GPUFeatureName

    'depth-clip-control', 'depth32float-stencil8', 'texture-compression-bc', 'texture-compression-etc2', 'texture-compression-astc', 'timestamp-query', 'indirect-first-instance', 'shader-f16', 'bgra8unorm-storage', 'rg11b10ufloat-renderable'

    GPUSize64

    typedef GPUSize64 = unsigned long long

    GPUQueueDescriptor

    • label: USVString
  • requestAdapterInfo(unmaskHints: sequence<DOMString>): Promise<GPUAdapterInfo>