-
Notifications
You must be signed in to change notification settings - Fork 329
Closed
Labels
apiWebGPU APIWebGPU APIpotentially breakingCould require a breaking change to the APICould require a breaking change to the API
Milestone
Description
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:
- It's easy to prefetch this info along with the adapter - no reason for a round trip.
- Unless browsers need to keep fingerprintable (but not otherwise secure or private) data out of the content process?
- Any dynamic measurement or modulation of the adapter info, done by the browser, does not need to 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.) - If we make
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:
- Add a
[SameObject] readonly attribute GPUAdapterInfo info;
toGPUAdapter
. - It returns the same JS object every time you access it.
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
).- If the info available to the page changes, the attributes on the
GPUAdapterInfo
object start returning different values (like an empty string gets changed to a non-empty string).
greggman, lvyitian and Dot32Dev
Metadata
Metadata
Assignees
Labels
apiWebGPU APIWebGPU APIpotentially breakingCould require a breaking change to the APICould require a breaking change to the API