这是indexloc提供的服务,不要输入任何密码
Skip to content

Allow unknown limits to be requested with value undefined #4781

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Aug 28, 2024
Merged
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
13 changes: 9 additions & 4 deletions spec/index.bs
Original file line number Diff line number Diff line change
Expand Up @@ -1329,7 +1329,7 @@ A [=device=] also has the following [=content timeline property=]:
|descriptor|.{{GPUDeviceDescriptor/requiredFeatures}}.
1. Let |limits| be a [=supported limits=] object with all values set to their defaults.
1. For each (|key|, |value|) pair in |descriptor|.{{GPUDeviceDescriptor/requiredLimits}}:
1. If |value| is [=limit/better=] than |limits|[|key|]:
1. If |value| is not `undefined` and |value| is [=limit/better=] than |limits|[|key|]:
1. Set |limits|[|key|] to |value|.
1. Let |device| be a [=device=] object.
1. Set |device|.{{device/[[adapter]]}} to |adapter|.
Expand Down Expand Up @@ -2573,11 +2573,16 @@ interface GPUAdapter {

<div class=validusage>
1. |adapter|.{{adapter/[[state]]}} must not be {{adapter/[[state]]/"consumed"}}.
1. For each [|key|, |value|] in |descriptor|.{{GPUDeviceDescriptor/requiredLimits}}:
1. For each [|key|, |value|] in |descriptor|.{{GPUDeviceDescriptor/requiredLimits}}
for which |value| is not `undefined`:
1. |key| |must| be the name of a member of [=supported limits=].
1. |value| |must| be no [=limit/better=] than |adapter|.{{adapter/[[limits]]}}[|key|].
1. If |key|'s [=limit class|class=] is [=limit class/alignment=],
|value| |must| be a power of 2 less than 2<sup>32</sup>.

Note:
User agents should consider issuing developer-visible warnings when
|key| is not recognized, even when |value| is `undefined`.
</div>

If any are unmet, issue the following steps on <var data-timeline=content>contentTimeline</var>
Expand Down Expand Up @@ -2646,7 +2651,7 @@ interface GPUAdapter {
dictionary GPUDeviceDescriptor
: GPUObjectDescriptorBase {
sequence<GPUFeatureName> requiredFeatures = [];
record<DOMString, GPUSize64> requiredLimits = {};
record<DOMString, (GPUSize64 or undefined)> requiredLimits = {};
GPUQueueDescriptor defaultQueue = {};
};
</script>
Expand All @@ -2667,7 +2672,7 @@ dictionary GPUDeviceDescriptor
Specifies the [=limits=] that are required by the device request.
The request will fail if the adapter cannot provide these limits.

Each key must be the name of a member of [=supported limits=].
Each key with a non-`undefined` value must be the name of a member of [=supported limits=].

API calls on the resulting device perform validation according to the exact limits of the
device (not the adapter; see [[#limits]]).
Expand Down
Loading