# Enable Vulkan hardware profiles in your project

> Follow these steps to set up a Vulkan hardware profiles script.

To use Vulkan hardware profiles in your projects:

1. In Unity, create an `Editor` folder in your `Assets` folder if one doesn’t exist already. (Right click in the `Assets` folder, select **Create** > **Folder**, and rename the folder to `Editor`.)

2. In the `Editor` folder, right click, select **Create** > **Scripting** > **Empty C# Script**, and name the script `MyProfileSettings.cs`. This creates a new script in your folder.

3. Double click the script to open it.

4. Add the following template code to the script:

   ```csharp
   using UnityEditor.Android;
   using UnityEditor.HardwareProfiles;

   public class MyProfileSettings : AndroidHardwareProfiles
   {
       public override void DefineHardwareProfile(ProfileDatabase database)
       {
           // ...
       }
   }
   ```

5. Place code that controls [workarounds](/engine/6000.6/manual/platform-specific/android/developing/graphics/vulkan-hardware-profiles/workarounds.md) and [device filters](/engine/6000.6/manual/platform-specific/android/developing/graphics/vulkan-hardware-profiles/device-filters.md) in the `DefineHardwareProfile` method. Refer to [Full code example](#full-code-example) for a full example.

6. Either build or export your project. For information about how Unity handles hardware profiles when you select these options, refer to [Build or export your project with hardware profiles](/engine/6000.6/manual/platform-specific/android/developing/graphics/vulkan-hardware-profiles/intro.md#build-or-export-your-project-with-hardware-profiles).

7. Once your project builds, check that your application runs as expected.

> **Note:**
>
> Unity validates workaround names at application startup. To view validation errors, build and run your application as a Development Build, then check the [logcat](https://developer.android.com/tools/logcat) output.

## Full code example

The following code is an example of how to create a filter for a device and then change the device's workarounds:

```c#

using UnityEditor.Android;
using UnityEditor.HardwareProfiles;

public class MyProfileSettings : AndroidHardwareProfiles
{
    public override void DefineHardwareProfile(ProfileDatabase database)
    {
        var myDefault = database.GetDefaultFilter();
        
        // Disable every workaround on default profile.
        myDefault.DisableAllWorkarounds();
        
        // o1s is the codename of the S21
        var thatOneSamsung = database.CreateFilter(
            "", "", "Samsung", "o1s");
        
        thatOneSamsung.SetWorkaround("HasBuggyBackBufferCopyImage", State.Disabled);

        thatOneSamsung.SetGraphicsAPI(GraphicsAPI.UseOpenGles);
    }
}
```

When you build your project with this example, check that:

* The mobile device disables all Vulkan workarounds.
* Samsung S21 doesn't use the `HasBuggyBackBufferCopyImage` workaround and uses OpenGL ES.

## Additional resources

* [Vulkan hardware profiles](/engine/6000.6/manual/platform-specific/android/developing/graphics/vulkan-hardware-profiles.md)
* [Introduction to Vulkan hardware profiles](/engine/6000.6/manual/platform-specific/android/developing/graphics/vulkan-hardware-profiles/intro.md)
* [Workarounds](/engine/6000.6/manual/platform-specific/android/developing/graphics/vulkan-hardware-profiles/workarounds.md)
* [Device filters](/engine/6000.6/manual/platform-specific/android/developing/graphics/vulkan-hardware-profiles/device-filters.md)
* [Graphics API hardware profile settings](/engine/6000.6/manual/platform-specific/android/developing/graphics/vulkan-hardware-profiles/graphics-api.md)
