Skip to content

Feature detection for new core API capabilities #6337

Description

@kainino0x

We don't have a design pattern for feature detection of new core API capabilities.

This has come up recently:

IMO we should just expose these as device features that are enabled automatically. That is:

  • If the browser has it, it'll appear in GPUAdapter.features.
  • You can request it, but regardless of whether you do, you will always get a device that has it (at least if you have a Core-defaulting adapter). Similar to "core-features-and-limits" today.

This is the pattern that we'll necessarily use in the future if we move any currently-optional feature to be required by core, because we have to keep the existing feature name but will want to turn it on automatically.

Another option would be to just add something like navigator.gpu.apiFeatures however this would only really make sense for things that are in both core and compat, which is not usually the case.

Metadata

Metadata

Assignees

No one assigned

    Labels

    apiWebGPU APIapi resolvedResolved - waiting for a change to the API specification

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions