Version: Unity 6.6 (6000.6)
Language : English
Introduction to Vulkan hardware profiles
Workarounds

Device filters

Use device filters to select devices that match given criteria, then tailor which workarounds to apply or remove from those devices.

When a device matches a filter, Unity applies the profile settings attached to that filter. Devices that don’t match any custom filter use the default hardware profile.

You can filter for groups of devices with something in common, or for specific devices.

Filter for a specific device

You can use device-specific flags so that default behaviors apply to all devices except the ones you want to override. Otherwise, if you apply default behavior on every device this might break functionality on devices that depend on critical workarounds.

For example, the following code stores the Samsung S21 device as a filter:

var thatOneSamsung = database.CreateFilter( "", "", "Samsung", "o1s");

Then, you can change the settings of that specific device.

Create a device filter

To create a device filter, you can use the CreateFilter method. This method provides the following parameters for you to find all devices that match your criteria:

public ProfileDeviceFilter CreateFilter(string vendor, string device, string brand, string product)
Parameter Description
vendor Use the vendor name of the GPU hardware used in the Android device to filter devices. For example, Qualcomm, ARM.
device Use the name of the GPU model reported by the Android device to filter for devices. For example, Adreno (TM) 740.
brand Find devices that have the same manufacturer name. For example, Google, Samsung.
product Use the device’s product codename to filter for devices. For example, barbet, mermaid.

You only need to fill in the parameters that you want to filter. For example, if you only want to target a specific phone model, you can provide a name for brand and product and leave the rest empty.

For example, this code only targets Samsung S21 devices:

var thatOneSamsung = database.CreateFilter( "", "", "Samsung", "o1s");

You can also use match patterns in filter fields to match upper- and lower-case variants or multiple values in a single filter. For example, this code targets Google devices whose product name matches oriole, raven, or bluejay, which are Google Pixel 6 devices:

var googlePixel6Family = database.CreateFilter( "", "", "((G|g)oogle)", "(oriole|raven|bluejay)");

Additional resources

Introduction to Vulkan hardware profiles
Workarounds
Copyright © 2023 Unity Technologies
优美缔软件(上海)有限公司 版权所有
"Unity"、Unity 徽标及其他 Unity 商标是 Unity Technologies 或其附属机构在美国及其他地区的商标或注册商标。其他名称或品牌是其各自所有者的商标。
公安部备案号:
31010902002961