Movatterモバイル変換


[0]ホーム

URL:


  1. Web
  2. Web APIs
  3. WorkerNavigator
  4. gpu

WorkerNavigator: gpu property

Limited availability

This feature is not Baseline because it does not work in some of the most widely-used browsers.

Secure context: This feature is available only insecure contexts (HTTPS), in some or allsupporting browsers.

Note: This feature is only available inWeb Workers.

Thegpu read-only property of theWorkerNavigator interface returns theGPU object for the current worker context, which is the entry point for theWebGPU API.

Value

AGPU object.

Examples

js
// Can be run inside a web workerasync function init() {  if (!navigator.gpu) {    throw Error("WebGPU not supported.");  }  const adapter = await navigator.gpu.requestAdapter();  if (!adapter) {    throw Error("Couldn't request WebGPU adapter.");  }  const device = await adapter.requestDevice();  // …}

Specifications

Specification
WebGPU
# navigator-gpu

Browser compatibility

See also

Help improve MDN

Learn how to contribute

This page was last modified on byMDN contributors.


[8]ページ先頭

©2009-2025 Movatter.jp