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:
-
Create a WebGPU Device Filter asset. The asset displays two filter lists in the InspectorA Unity window that displays information about the currently selected GameObject, asset or project settings, allowing you to inspect and edit the values. More info
See in Glossary window.
- Expand the Allow Filters list.
- Select Add (+). This action adds a new entry to the list.
- 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.
- 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 will always use WebGPU API for Unity applications.
Allow Filters list example
The Allow Filters list uses your chosen comparison operators to identify browsers that match the specified parameter values for browser version, WebGPU feature or limit value.
For example, if you set up the following:
-
Browser Name: Chrome
-
Comparison Operator: Greater Than or Equal To
-
Browser Version: 140
In this case, the Allow Filters list includes all Chrome browsers with a version greater than or equal to 140.0.0.0.
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.
Deny Filters list example
The Deny Filters list uses your chosen comparison operators to restrict devices that match the specified parameter values for browser version, WebGPU feature and limit.
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 ShaderA program that runs on the GPU. More info
See in Glossary 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