GPUAdapter: requestAdapterInfo() method
MDN Web Docs · نسخهٔ df622a2a1c1e · CC BY-SA 2.5 و مجوز جداگانهٔ ناشر برای نمونهکد
{{APIRef("WebGPU API")}}{{SecureContext_Header}}{{non-standard_header}}{{AvailableInWorkers}}
The **requestAdapterInfo()** method of the {{domxref("GPUAdapter")}} interface returns a {{jsxref("Promise")}} that fulfills with a {{domxref("GPUAdapterInfo")}} object containing identifying information about an adapter.
requestAdapterInfo() has been removed from the WebGPU specification. Use {{domxref("GPUAdapter.info")}} to access adapter information instead.
Syntax
js-nolint
requestAdapterInfo()Parameters
None.
Return value
A {{jsxref("Promise")}} that fulfills with a {{domxref("GPUAdapterInfo")}} object instance.
Examples
js
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 adapterInfo = await adapter.requestAdapterInfo();
console.log(adapterInfo.vendor);
console.log(adapterInfo.architecture);
// …
}Specifications
No longer part of the WebGPU specification.
Browser compatibility
{{Compat}}
See also
- The WebGPU API