diff --git a/gpu/TODO-webgpu.h b/gpu/TODO-webgpu.h index 5e417628..57982a0f 100644 --- a/gpu/TODO-webgpu.h +++ b/gpu/TODO-webgpu.h @@ -1,17 +1,5 @@ typedef uint32_t WGPUFlags; -typedef enum WGPUBackendType { - WGPUBackendType_Null = 0x00000000, - WGPUBackendType_WebGPU = 0x00000001, - WGPUBackendType_D3D11 = 0x00000002, - WGPUBackendType_D3D12 = 0x00000003, - WGPUBackendType_Metal = 0x00000004, - WGPUBackendType_Vulkan = 0x00000005, - WGPUBackendType_OpenGL = 0x00000006, - WGPUBackendType_OpenGLES = 0x00000007, - WGPUBackendType_Force32 = 0x7FFFFFFF -} WGPUBackendType; - typedef enum WGPUBlendFactor { WGPUBlendFactor_Zero = 0x00000000, WGPUBlendFactor_One = 0x00000001, diff --git a/gpu/src/types.zig b/gpu/src/types.zig index 4915560d..7c96e4f4 100644 --- a/gpu/src/types.zig +++ b/gpu/src/types.zig @@ -2,3 +2,27 @@ pub const AlphaMode = enum(u32) { premultiplied = 0x00000000, unpremultiplied = 0x00000001, }; + +pub const BackendType = enum(u32) { + nul, + webgpu, + d3d11, + d3d12, + metal, + vulkan, + opengl, + opengles, +}; + +pub fn backendTypeName(t: BackendType) []const u8 { + return switch (t) { + .nul => "Null", + .webgpu => "WebGPU", + .d3d11 => "D3D11", + .d3d12 => "D3D12", + .metal => "Metal", + .vulkan => "Vulkan", + .opengl => "OpenGL", + .opengles => "OpenGLES", + }; +}