aboutsummaryrefslogtreecommitdiff
path: root/Ryujinx.Ava/Ui/Backend/Vulkan/ResultExtensions.cs
blob: 2a1cd2293a35bef4a034b41e617fe2085e695515 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
using System;
using Silk.NET.Vulkan;

namespace Ryujinx.Ava.Ui.Vulkan
{
    public static class ResultExtensions
    {
        public static void ThrowOnError(this Result result)
        {
            // Only negative result codes are errors.
            if ((int)result < (int)Result.Success)
            {
                throw new Exception($"Unexpected API error \"{result}\".");
            }
        }
    }
}