Skip to content

Commit 7a7a635

Browse files
Editorial review: GPUAdapter.requestDevice() consumes adapter (mdn#41825)
GPUAdapter.requestDevice() consumes adapter
1 parent a73569a commit 7a7a635

File tree

1 file changed

+4
-2
lines changed
  • files/en-us/web/api/gpuadapter/requestdevice

1 file changed

+4
-2
lines changed

files/en-us/web/api/gpuadapter/requestdevice/index.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,12 +39,14 @@ Not all features and limits will be available to WebGPU in all browsers that sup
3939

4040
A {{jsxref("Promise")}} that fulfills with a {{domxref("GPUDevice")}} object instance.
4141

42-
If you make a duplicate call, i.e., call `requestDevice()` on a {{domxref("GPUAdapter")}} that `requestDevice()` was already called on, the promise fulfills with a device that is immediately lost. You can then get information on how the device was lost via {{domxref("GPUDevice.lost")}}.
42+
If you make a duplicate call, i.e., call `requestDevice()` on a {{domxref("GPUAdapter")}} that `requestDevice()` was already called on, the promise rejects with an `OperationError` because the associated `GPUAdapter` is consumed when a `GPUDevice` is created.
4343

4444
### Exceptions
4545

4646
- `OperationError` {{domxref("DOMException")}}
47-
- : The promise rejects with an `OperationError` if the limits included in the `requiredLimits` property are not supported by the {{domxref("GPUAdapter")}}, either because they are not valid limits, or because their values are higher than the adapter's values for those limits.
47+
- : The promise rejects with an `OperationError` if either:
48+
- The limits included in the `requiredLimits` property are not supported by the {{domxref("GPUAdapter")}}, either because they are not valid limits, or because their values are higher than the adapter's values for those limits.
49+
- The `GPUAdapter` has been consumed by having `requestDevice()` called on it previously.
4850
- `TypeError` {{domxref("DOMException")}}
4951
- : The promise rejects with a `TypeError` if the features included in the `requiredFeatures` property are not supported by the {{domxref("GPUAdapter")}}.
5052

0 commit comments

Comments
 (0)