Skip to content

Commit

Permalink
Address feedback from Kai
Browse files Browse the repository at this point in the history
  • Loading branch information
toji committed Apr 4, 2022
1 parent 15f5fa4 commit dcc8ee0
Showing 1 changed file with 37 additions and 13 deletions.
50 changes: 37 additions & 13 deletions spec/index.bs
Expand Up @@ -1431,10 +1431,10 @@ but which the user agent has not been updated to recognize yet. If the [=set ent

{{GPUAdapterInfo}} exposes various identifying information about an adapter.

Note: None of the values in {{GPUAdapterInfo}} are guaranteed to be populated. It is at the user
None of the members in {{GPUAdapterInfo}} are guaranteed to be populated. 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 should not be dependent on any values from {{GPUAdapterInfo}}
to function.
will be populated. As such, applications **must** be able to handle any possible {{GPUAdapterInfo}} values,
including the absence of those values.

<script type=idl>
[Exposed=(Window, DedicatedWorker), SecureContext]
Expand Down Expand Up @@ -1487,23 +1487,39 @@ interface GPUAdapterInfo {
1. If |unmaskedValues| [=set/contains=] `"vendor"` and the vendor is known:
1. Set |adapterInfo|.{{GPUAdapterInfo/vendor}} to the name of |adapter|'s vendor as a
[$normalized identifier string$].
1. Otherwise set |adapterInfo|.{{GPUAdapterInfo/vendor}} to the empty string or a

Otherwise:

1. Set |adapterInfo|.{{GPUAdapterInfo/vendor}} to the empty string or a
reasonable approximation of the vendor as a [$normalized identifier string$].

1. If |unmaskedValues| [=set/contains=] `"architecture"` and the architecture is known:
1. Set |adapterInfo|.{{GPUAdapterInfo/architecture}} to a [$normalized identifier string$]
representing the family or class of adapters to which |adapter| belongs.
1. Otherwise set |adapterInfo|.{{GPUAdapterInfo/architecture}} to the empty string or a

Otherwise:

1. Set |adapterInfo|.{{GPUAdapterInfo/architecture}} to the empty string or a
reasonable approximation of the architecture as a [$normalized identifier string$].

1. If |unmaskedValues| [=set/contains=] `"deviceId"` and the deviceId is known:
1. Set |adapterInfo|.{{GPUAdapterInfo/deviceId}} to a vendor-specific numeric ID for
|adapter|.
1. Otherwise set |adapterInfo|.{{GPUAdapterInfo/deviceId}} to `0` or a reasonable

Otherwise:

1. Set |adapterInfo|.{{GPUAdapterInfo/deviceId}} to `0` or a reasonable
approximation of the vendor-specific numeric ID for |adapter|.

1. If |unmaskedValues| [=set/contains=] `"description"` and a description is known:
1. Set |adapterInfo|.{{GPUAdapterInfo/description}} to a description of the |adapter| as
reported by the driver.
1. Otherwise set |adapterInfo|.{{GPUAdapterInfo/vendor}} to the empty string or a

Otherwise:

1. Set |adapterInfo|.{{GPUAdapterInfo/description}} to the empty string or a
reasonable approximation of a description.

1. Return |adapterInfo|.
</div>

Expand Down Expand Up @@ -1796,9 +1812,9 @@ interface GPUAdapter {
[SameObject] readonly attribute GPUSupportedFeatures features;
[SameObject] readonly attribute GPUSupportedLimits limits;
readonly attribute boolean isFallbackAdapter;
readonly attribute GPUAdapterInfo info;

Promise<GPUDevice> requestDevice(optional GPUDeviceDescriptor descriptor = {});
GPUAdapterInfo getAdapterInfo();
Promise<GPUAdapterInfo> requestUnmaskedAdapterInfo(sequence<DOMString> hints);
};
</script>
Expand All @@ -1817,11 +1833,6 @@ interface GPUAdapter {
: <dfn>isFallbackAdapter</dfn>
::
Returns the value of {{GPUAdapter/[[adapter]]}}.{{adapter/[[fallback]]}}.

: <dfn>info</dfn>
::
Returns a [$new adapter info$] for `this`.{{GPUAdapter/[[adapter]]}}.

</dl>

{{GPUAdapter}} has the following internal slots:
Expand Down Expand Up @@ -1905,6 +1916,19 @@ interface GPUAdapter {

</div>

: <dfn>getAdapterInfo()</dfn>
::
Returns the currently available {{GPUAdapterInfo}} for this {{GPUAdapter}}.

<div algorithm=GPUAdapter.getAdapterInfo>
**Called on:** {{GPUAdapter}} |this|.

**Returns:** {{Promise}}&lt;{{GPUAdapterInfo}}&gt;

1. Return a [$new adapter info$] for |this|.{{GPUAdapter/[[adapter]]}}.

</div>

: <dfn>requestUnmaskedAdapterInfo(hints)</dfn>
::
Requests additional {{GPUAdapterInfo}} detail.
Expand Down

0 comments on commit dcc8ee0

Please sign in to comment.