mirror of
https://github.com/ryujinx-mirror/ryujinx.git
synced 2025-02-15 02:22:36 +01:00
* Change TargetFramework to net8.0 * Disable info messages * Fix warings * Disable additional analyzer messages * Fix typo * Add whitespace * Fix ref vs in warnings * Use explicit [In] on array parameters * No need to guard Remove with Contains * Use 'ArgumentOutOfRangeException.ThrowIf...' instead of explicitly throwing a new exception instance * Bump .NET SDK version * Enable JsonSerializerIsReflectionEnabledByDefault * Use 8.0.100 GA release * Bump System package versions --------- Co-authored-by: Zoltan Csizmadia <Zoltan.Csizmadia@vericast.com>
38 lines
852 B
C#
38 lines
852 B
C#
using Silk.NET.Vulkan;
|
|
using System;
|
|
using System.Runtime.Serialization;
|
|
|
|
namespace Ryujinx.Graphics.Vulkan
|
|
{
|
|
static class ResultExtensions
|
|
{
|
|
public static void ThrowOnError(this Result result)
|
|
{
|
|
// Only negative result codes are errors.
|
|
if ((int)result < (int)Result.Success)
|
|
{
|
|
throw new VulkanException(result);
|
|
}
|
|
}
|
|
}
|
|
|
|
class VulkanException : Exception
|
|
{
|
|
public VulkanException()
|
|
{
|
|
}
|
|
|
|
public VulkanException(Result result) : base($"Unexpected API error \"{result}\".")
|
|
{
|
|
}
|
|
|
|
public VulkanException(string message) : base(message)
|
|
{
|
|
}
|
|
|
|
public VulkanException(string message, Exception innerException) : base(message, innerException)
|
|
{
|
|
}
|
|
}
|
|
}
|