forked from amkovkov/GranuSightSoftware2
18 lines
740 B
C#
18 lines
740 B
C#
// Основан на примере GpuInterop Avalonia
|
|
// https://github.com/AvaloniaUI/Avalonia/blob/5f3dbae22244e830b464fc680c6c28ca124be41a/samples/GpuInterop/VulkanDemo/VulkanExtensions.cs
|
|
|
|
using System.Runtime.CompilerServices;
|
|
|
|
using Silk.NET.Vulkan;
|
|
|
|
namespace GSS2.Vulkan;
|
|
|
|
public static class VulkanExtensions
|
|
{
|
|
public static void ThrowOnError(this Result result, [CallerMemberName] string callerMemberName = "", [CallerFilePath] string callerFilePath = "", [CallerLineNumber] int callerLineNumber = -1)
|
|
{
|
|
// Console.WriteLine($"{callerFilePath} {callerMemberName} {callerLineNumber} {result}");
|
|
if (result != Result.Success)
|
|
throw new Exception($"Unexpected API error \"{result}\"");
|
|
}
|
|
} |