Version: Unity 6.7 Alpha (6000.7)
Language : English
Create a WebGPU Device Filter asset
WebGPU Device Filter asset reference

Configure WebGPU API usage

Use Allow Filters and Deny Filters lists to fine tune which browsers you want to allow to run your application with the WebGPU API.

First, you need to set up a WebGPU Device Filter asset. Refer to Create a WebGPU Device Filter asset for instructions.

Allow browsers to always use WebGPU API

To allow browsers to always use the WebGPU API, use the following steps:

  1. Create a WebGPU Device Filter asset. The asset displays two filter lists in the Inspector window.
  2. Expand the Allow Filters list.
  3. Select Add (+). This action adds a new entry to the list.
  4. In the new list entry, enter the specifications of the browser you want to allow to use the WebGPU API. This displays a list of parameters.
  5. Enter the browser specifications in the available parameters. All the parameters are optional. For the description of parameters, refer to WebGPU Device Filter asset reference.

Browsers that meet the specifications defined in the parameter values use the WebGPU API for Unity applications.

When the Allow Filters list has any entries, a browser must match an Allow entry to use WebGPU. Any browser that doesn’t match falls back to the next graphics API. Filter by Browser Engine to match every browser built on that engine. Use Browser Name only to target a specific brand. For details, refer to Filter list parameters.

Allow Filters list example

For example, if you set up the following:

  • Browser Engine: Chromium-based
  • Comparison Operator: Greater Than or Equal To
  • Engine Version: 146

In this case, the Allow Filters list includes all Chromium-based browsers (Chrome, Edge, Opera, and so on) whose engine version is 146 or newer.

Restrict browsers from using WebGPU API

To restrict browsers from using the WebGPU API, follow the steps in Allow browsers to always use WebGPU API but use the Deny Filters list instead of the Allow Filters list. Because Browser Name rules take precedence over Browser Engine rules, you can allow a whole engine and still deny a specific browser brand that has a known issue.

Deny Filters list example

For example, if you specify:

  • Browser Name: Firefox
  • Comparison Operator: Less Than Or Equal To
  • Browser Version: 141
  • Required Features: Subgroups
  • Limit: “Max Sampled Textures Per Shader Stage”, “Less Than Or Equal To”, 17

In this case, the Deny Filters list restricts all devices that have all of the following:

  • Uses a Firefox browser that’s version 141 or older.
  • Requires the Subgroups feature.
  • Has a maximum sampled texture limit of 17 or fewer.

Additional resources

Create a WebGPU Device Filter asset
WebGPU Device Filter asset reference