From 0ddbfaf2b3733cfe340ea9cd0862ec2e72b98f4f Mon Sep 17 00:00:00 2001 From: Stephen Gutekanst Date: Wed, 9 Mar 2022 10:11:30 -0700 Subject: [PATCH] gpu: add BufferBindingType enum Signed-off-by: Stephen Gutekanst --- gpu/src/TODO | 8 -------- gpu/src/enums.zig | 8 ++++++++ gpu/src/main.zig | 1 + 3 files changed, 9 insertions(+), 8 deletions(-) diff --git a/gpu/src/TODO b/gpu/src/TODO index 22ab9c7e..67447b91 100644 --- a/gpu/src/TODO +++ b/gpu/src/TODO @@ -27,14 +27,6 @@ typedef struct WGPUSamplerImpl* WGPUSampler; typedef struct WGPUTextureImpl* WGPUTexture; typedef struct WGPUTextureViewImpl* WGPUTextureView; -typedef enum WGPUBufferBindingType { - WGPUBufferBindingType_Undefined = 0x00000000, - WGPUBufferBindingType_Uniform = 0x00000001, - WGPUBufferBindingType_Storage = 0x00000002, - WGPUBufferBindingType_ReadOnlyStorage = 0x00000003, - WGPUBufferBindingType_Force32 = 0x7FFFFFFF -} WGPUBufferBindingType; - typedef enum WGPUBufferMapAsyncStatus { WGPUBufferMapAsyncStatus_Success = 0x00000000, WGPUBufferMapAsyncStatus_Error = 0x00000001, diff --git a/gpu/src/enums.zig b/gpu/src/enums.zig index a896f606..0e91b95d 100644 --- a/gpu/src/enums.zig +++ b/gpu/src/enums.zig @@ -167,6 +167,13 @@ pub const BlendOperation = enum(u32) { max = 0x00000004, }; +pub const BufferBindingType = enum(u32) { + none = 0x00000000, + uniform = 0x00000001, + storage = 0x00000002, + read_only_storage = 0x00000003, +}; + test "name" { try std.testing.expect(std.mem.eql(u8, @tagName(Feature.timestamp_query), "timestamp_query")); } @@ -178,4 +185,5 @@ test "syntax" { _ = AlphaMode; _ = BlendFactor; _ = BlendOperation; + _ = BufferBindingType; } diff --git a/gpu/src/main.zig b/gpu/src/main.zig index 9c42db33..c086fbfa 100644 --- a/gpu/src/main.zig +++ b/gpu/src/main.zig @@ -44,6 +44,7 @@ pub const AddressMode = @import("enums.zig").AddressMode; pub const AlphaMode = @import("enums.zig").AlphaMode; pub const BlendFactor = @import("enums.zig").BlendFactor; pub const BlendOperation = @import("enums.zig").BlendOperation; +pub const BufferBindingType = @import("enums.zig").BufferBindingType; test "syntax" { _ = Interface;