Sitelet https://github.com/gpuweb/gpuweb/pull/1309/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
21 changes: 3 additions & 18 deletions spec/index.bs
Original file line number Diff line number Diff line change
Expand Up @@ -886,6 +886,9 @@ A [=device=] has the following internal slots:
No [=limit/better=] limits can be used, even if the underlying [=adapter=] can support them.
</dl>

Issue: [=device=] is already an internal concept. Having slots be marked as internal is redundant
and adds extra `[[`/`]]` in spec text. Consider removing the brackets.

<div algorithm>
When <dfn dfn>a new device</dfn> |device| is created from [=adapter=] |adapter|
with {{GPUDeviceDescriptor}} |descriptor|:
Expand Down Expand Up @@ -1390,10 +1393,6 @@ To get a {{GPUDevice}}, use {{GPUAdapter/requestDevice()}}.
<script type=idl>
[Exposed=(Window, DedicatedWorker), Serializable]
interface GPUDevice : EventTarget {
[SameObject] readonly attribute GPUAdapter adapter;
readonly attribute FrozenArray<GPUFeatureName> features;
readonly attribute object limits;

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This was a way to know the default limits from WebGPU by looking at what's in device.limits. How do we envision applications should do this?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good question. Perhaps a default constructor to GPUAdapterFeatures? Or a member on navigator.gpu? It would also tell you what limits are understood by the browser without having to request adapters.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

well, we have the default limits in the spec, wouldn't this make the other means of discovery unnecessary?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Other than feature detection, I think so. It would be handy for certain architectures and middlewares but so would a lot of other things we don't provide (like texture size).

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I guess we could the default limits for all the things in a utility library, it just seems slightly unnecessary.


[SameObject] readonly attribute GPUQueue defaultQueue;

GPUBuffer createBuffer(GPUBufferDescriptor descriptor);
Expand Down Expand Up @@ -1421,20 +1420,6 @@ GPUDevice includes GPUObjectBase;
{{GPUDevice}} has the following attributes:

<dl dfn-type=attribute dfn-for=GPUDevice>
: <dfn>adapter</dfn>
::
The {{GPUAdapter}} from which this device was created.

: <dfn>features</dfn>
::
A sequence containing the {{GPUFeatureName}} values of the features
supported by the device (i.e. the ones with which it was created).

: <dfn>limits</dfn>
::
A {{GPULimits}} object exposing the limits
supported by the device (i.e. the ones with which it was created).

: <dfn>defaultQueue</dfn>
::
The default {{GPUQueue}} for this device.
Expand Down