web api interface
GPUAdapter
Secure contextAvailable in workers
The GPUAdapter interface of the WebGPU API represents a GPU adapter. From this you can request a GPUDevice, adapter info, features, and limits.
A GPUAdapter object is requested using the requestAdapter() method.
Instance properties
featuresRead only- : A
GPUSupportedFeaturesobject that describes additional functionality supported by the adapter.
- : A
infoRead only- : A
GPUAdapterInfoobject containing identifying information about the adapter.
- : A
limitsRead only- : A
GPUSupportedLimitsobject that describes the limits supported by the adapter.
- : A
Deprecated properties
isFallbackAdapterRead only Deprecated- : A boolean value. Returns
trueif the adapter is a fallback adapter, andfalseif not. This property has been removed from the web platform. UseisFallbackAdapterinstead.
- : A boolean value. Returns
Instance methods
requestAdapterInfo()Deprecated- : Returns a
Promisethat fulfills with aGPUAdapterInfoobject containing identifying information about the adapter.
- : Returns a
requestDevice()
Examples
async 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
SpecificationsStandards references are available on the canonical MDN page.
Browser compatibility
Browser compatibilityCompatibility data is available on the canonical MDN page.
See also
- The WebGPU API