forked from amkovkov/GranuSightSoftware2
feat: GSS2.Test Vulkan render image
This commit is contained in:
@@ -1,14 +1,17 @@
|
||||
// Основан на примере 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)
|
||||
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}\"");
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user