-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathGpuQueue.cs
More file actions
36 lines (31 loc) · 1.08 KB
/
GpuQueue.cs
File metadata and controls
36 lines (31 loc) · 1.08 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
using System.Collections.Concurrent;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using Coplt.Dropping;
using Coplt.Graphics.Native;
using Coplt.Graphics.Utilities;
namespace Coplt.Graphics.Core;
public enum GpuQueueType : byte
{
Direct,
Compute,
Copy,
VideoEncode,
VideoDecode,
VideoProcess,
}
public static partial class GraphicsExtensions
{
public static FGpuQueueType ToFFI(this GpuQueueType value) => (FGpuQueueType)value;
public static GpuQueueType FromFFI(this FGpuQueueType value) => (GpuQueueType)value;
public static ReadOnlySpan<byte> ToUtf8String(this GpuQueueType value) => value switch
{
GpuQueueType.Direct => "Direct"u8,
GpuQueueType.Compute => "Compute"u8,
GpuQueueType.Copy => "Copy"u8,
GpuQueueType.VideoEncode => "VideoEncode"u8,
GpuQueueType.VideoDecode => "VideoDecode"u8,
GpuQueueType.VideoProcess => "VideoProcess"u8,
_ => throw new ArgumentOutOfRangeException(nameof(value), value, null)
};
}