diff --git a/design/AdapterIdentifiers.md b/design/AdapterIdentifiers.md index 9a90e4c098..6a3360100b 100644 --- a/design/AdapterIdentifiers.md +++ b/design/AdapterIdentifiers.md @@ -1,5 +1,10 @@ # WebGPU Adapter Identifiers +**This document is outdated. `adapter.requestAdapterInfo()` has been replaced with +`adapter.info` and `unmaskHints` doesn't exist anymore. See: +[#4536](https://github.com/gpuweb/gpuweb/issues/4536), +[#4316](https://github.com/gpuweb/gpuweb/pull/4316). + ## Introduction The WebGL extension [WEBGL_debug_renderer_info](https://www.khronos.org/registry/webgl/extensions/WEBGL_debug_renderer_info/) reports identifying information about a device's graphics driver for the purposes of debugging or detection and avoidance of bugs or performance pitfalls on a particular driver or piece of hardware. diff --git a/spec/index.bs b/spec/index.bs index 63b4b34441..9484d49084 100644 --- a/spec/index.bs +++ b/spec/index.bs @@ -737,7 +737,6 @@ Several operations in WebGPU return promises. - {{GPU}}.{{GPU/requestAdapter()}} - {{GPUAdapter}}.{{GPUAdapter/requestDevice()}} -- {{GPUAdapter}}.{{GPUAdapter/requestAdapterInfo()}} - {{GPUDevice}}.{{GPUDevice/createComputePipelineAsync()}} - {{GPUDevice}}.{{GPUDevice/createRenderPipelineAsync()}} - {{GPUBuffer}}.{{GPUBuffer/mapAsync()}} @@ -1699,11 +1698,26 @@ interface WGSLLanguageFeatures { {{GPUAdapterInfo}} exposes various identifying information about an adapter. -None of the members in {{GPUAdapterInfo}} are guaranteed to be populated. It is at the user +None of the members in {{GPUAdapterInfo}} are guaranteed to be populated with any particular value; +if no value is provided, the attribute will return the empty string `""`. It is at the user agent's discretion which values to reveal, and it is likely that on some devices none of the values will be populated. As such, applications **must** be able to handle any possible {{GPUAdapterInfo}} values, including the absence of those values. +The information exposed by a {{GPUAdapter}} is immutable: for a given adapter, each {{GPUAdapterInfo}} +attribute will return the same value every time it's accessed. + +Note: +Though the {{GPUAdapterInfo}} attributes are immutable *once accessed*, an implementation may delay the decision on +what to expose for each attribute until the first time it is accessed. + +Note: +Other {{GPUAdapter}} instances, even if they represent the same physical adapter, may expose +different values in {{GPUAdapterInfo}}. +However, they **should** expose the same values unless a specific +event has increased the amount of identifying information the page is allowed to access. +(No such events are defined by this specification.) +

For privacy considerations, see [[#privacy-adapter-identifiers]].

@@ -2337,10 +2351,10 @@ To get a {{GPUAdapter}}, use {{GPU/requestAdapter()}}. interface GPUAdapter { [SameObject] readonly attribute GPUSupportedFeatures features; [SameObject] readonly attribute GPUSupportedLimits limits; + [SameObject] readonly attribute GPUAdapterInfo info; readonly attribute boolean isFallbackAdapter; Promise requestDevice(optional GPUDeviceDescriptor descriptor = {}); - Promise requestAdapterInfo(); }; @@ -2355,6 +2369,26 @@ interface GPUAdapter { :: The limits in `this`.{{GPUAdapter/[[adapter]]}}.{{adapter/[[limits]]}}. + : info + :: + Information about the physical adapter underlying this {{GPUAdapter}}. + + For a given {{GPUAdapter}}, the {{GPUAdapterInfo}} values exposed are constant over time. + + The same object is returned each time. To create that object for the first time: + +
+
+ **Called on:** {{GPUAdapter}} |this|. + + **Returns:** {{GPUAdapterInfo}} + + [=Content timeline=] steps: + + 1. Return a [$new adapter info$] for |this|.{{GPUAdapter/[[adapter]]}}. +
+
+ : isFallbackAdapter :: Returns the value of {{GPUAdapter/[[adapter]]}}.{{adapter/[[fallback]]}}. @@ -2476,30 +2510,6 @@ interface GPUAdapter { |device|.{{GPUDevice/lost}} has already resolved before |promise| resolves. - - : requestAdapterInfo() - :: - Requests the {{GPUAdapterInfo}} for this {{GPUAdapter}}. - - Note: Adapter info values are returned with a Promise to give user agents an - opportunity to perform potentially long-running checks in the future. - -
-
- **Called on:** {{GPUAdapter}} |this|. - - **Returns:** {{Promise}}<{{GPUAdapterInfo}}> - - [=Content timeline=] steps: - - 1. Let |promise| be [=a new promise=]. - 1. Let |adapter| be |this|.{{GPUAdapter/[[adapter]]}}. - 1. Run the following steps [=in parallel=]: - 1. [=Resolve=] |promise| with a [$new adapter info$] for |adapter|. - - 1. Return |promise|. -
-