Sitelet https://github.com/gpuweb/gpuweb/pull/4550/files
Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
48 changes: 41 additions & 7 deletions spec/index.bs
Original file line number Diff line number Diff line change
Expand Up @@ -1955,11 +1955,28 @@ 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 info;
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 info exposed by a {{GPUAdapter}} is immutable: for a given adapter, each {{GPUAdapterInfo}}
attribute will return the same value every time it's accessed.
If multiple {{GPUAdapterInfo}} objects have been retrieved from a given adapter
(via either {{GPUAdapter/info|GPUAdapter.info}} or {{GPUAdapter/requestAdapterInfo()}}),
they must all expose the same contents.

Note:
Though the adapter info is 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 adapter info values. However, they **should** expose the same values unless a specific
event has increased the amount of adapter info the page is allowed to access.
(No such events are defined by this specification.)

<p tracking-vector>
For privacy considerations, see [[#privacy-adapter-identifiers]].
</p>
Expand Down Expand Up @@ -2595,6 +2612,7 @@ 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<GPUDevice> requestDevice(optional GPUDeviceDescriptor descriptor = {});
Expand All @@ -2613,6 +2631,15 @@ interface GPUAdapter {
::
The limits in `this`.{{GPUAdapter/[[adapter]]}}.{{adapter/[[limits]]}}.

: <dfn>info</dfn>
::
The {{GPUAdapterInfo}} for this adapter. Returns the same object each time.

Synchronous version of the deprecated {{GPUAdapter/requestAdapterInfo()}} method.

For a given adapter, its adapter info is constant over time, and all {{GPUAdapterInfo}}
objects from that adapter produce the same contents.

: <dfn>isFallbackAdapter</dfn>
::
Returns the value of {{GPUAdapter/[[adapter]]}}.{{adapter/[[fallback]]}}.
Expand Down Expand Up @@ -2737,10 +2764,19 @@ interface GPUAdapter {

: <dfn>requestAdapterInfo()</dfn>
::
Requests the {{GPUAdapterInfo}} for this {{GPUAdapter}}.
Requests {{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.
Returns a new object each time, whereas <code>adapter.{{GPUAdapter/info}}</code>
returns the same object each time.

<div class=note heading>
This is deprecated (but not planned for removal) in favor of the newer, synchronous
Comment thread
kainino0x marked this conversation as resolved.
{{GPUAdapter/info|GPUAdapter.info}} property, which reports the same info.
Both entry points expose the same information.

This async entry point always returns an already-resolved promise.
It will not perform long-running tasks (such as user permission prompts).
</div>

<div algorithm=GPUAdapter.requestAdapterInfo>
<div data-timeline=content>
Expand All @@ -2752,9 +2788,7 @@ interface GPUAdapter {

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. [=Resolve=] |promise| with a [$new adapter info$] for |adapter|.
1. Return |promise|.
</div>
</div>
Expand Down