-
Notifications
You must be signed in to change notification settings - Fork 303
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
Synchronously query GPUAdapterInfo #4536
Labels
api
WebGPU API
Milestone
Comments
^ FWIW the thing that prompted looking at this was designing the C API for RequestAdapterInfo. In the C API we may make it synchronous even if it remains async in the JS API - unless we come up with a reason in this issue that it would be bad for Wasm bindings to call requestAdapterInfo ahead-of-time during C's RequestAdapter. |
GPU Web WG 2024-03-27
|
More meeting notes posted in #4550 (comment) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Right now it is only possible to get GPUAdapterInfo by calling requestAdapterInfo, which is async.
However, in #4316 we removed the possibility that it would trigger a permission prompt, and I think we should consider it a breaking change to add a prompt - that is, we shouldn't do it (see #3962).
Because of this I don't think there is any reason that
requestAdapterInfo
as it exists today should be async:GPUAdapterInfo
has 4 separate getters that can do that stuff. (In fact, this is already necessary: browsers shouldn't assume that just callingrequestAdapterInfo
gives the page everything in theGPUAdapterInfo
struct. They don't get it until they access the properties.)requestAdapterInfo
actually do anything extra (like via a flag that says "please give me everything you're willing to give me with a permission prompt"), the synchronously accessed GPUAdapterInfo can dynamically update to provide that data.Strawperson proposal:
[SameObject] readonly attribute GPUAdapterInfo info;
toGPUAdapter
.requestAdapterInfo
still returns a new one each time for minor backward-compatibility reasons (unless we think it's better to change this and return the same one asadapter.info
).GPUAdapterInfo
object start returning different values (like an empty string gets changed to a non-empty string).The text was updated successfully, but these errors were encountered: