From 97724b877904d36aa3553c36f2ac186ba3676241 Mon Sep 17 00:00:00 2001 From: Stephen Gutekanst Date: Fri, 15 Jul 2022 01:06:19 -0700 Subject: [PATCH] gpu: add CommandBuffer.Descriptor Signed-off-by: Stephen Gutekanst --- gpu/TODO-webgpu.h | 5 ----- gpu/src/command_buffer.zig | 7 +++++++ 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/gpu/TODO-webgpu.h b/gpu/TODO-webgpu.h index 4c17603e..fa2c63c4 100644 --- a/gpu/TODO-webgpu.h +++ b/gpu/TODO-webgpu.h @@ -1,8 +1,3 @@ -typedef struct WGPUCommandBufferDescriptor { - next_in_chain: *const ChainedStruct, - label: ?[*:0]const u8 = null, -} WGPUCommandBufferDescriptor; - typedef struct WGPUCommandEncoderDescriptor { next_in_chain: *const ChainedStruct, label: ?[*:0]const u8 = null, diff --git a/gpu/src/command_buffer.zig b/gpu/src/command_buffer.zig index f8354a07..23b5ac0c 100644 --- a/gpu/src/command_buffer.zig +++ b/gpu/src/command_buffer.zig @@ -1,6 +1,13 @@ +const ChainedStruct = @import("types.zig").ChainedStruct; + pub const CommandBuffer = enum(usize) { _, // TODO: verify there is a use case for nullable value of this type. pub const none: CommandBuffer = @intToEnum(CommandBuffer, 0); + + pub const Descriptor = struct { + next_in_chain: *const ChainedStruct, + label: ?[*:0]const u8 = null, + }; };