From e28959c1cfa63959b9dc196b5e506c00f9488709 Mon Sep 17 00:00:00 2001 From: Stephen Gutekanst Date: Fri, 15 Jul 2022 20:27:59 -0700 Subject: [PATCH] gpu: add CommandEncoder.Descriptor Signed-off-by: Stephen Gutekanst --- gpu/TODO-webgpu.h | 5 ----- gpu/src/command_encoder.zig | 7 +++++++ 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/gpu/TODO-webgpu.h b/gpu/TODO-webgpu.h index 2c8d51d3..1979c70f 100644 --- a/gpu/TODO-webgpu.h +++ b/gpu/TODO-webgpu.h @@ -1,8 +1,3 @@ -typedef struct WGPUCommandEncoderDescriptor { - next_in_chain: *const ChainedStruct, - label: ?[*:0]const u8 = null, -} WGPUCommandEncoderDescriptor; - typedef struct WGPUCompilationMessage { next_in_chain: *const ChainedStruct, char const * message; // nullable diff --git a/gpu/src/command_encoder.zig b/gpu/src/command_encoder.zig index 06794114..0fe51c85 100644 --- a/gpu/src/command_encoder.zig +++ b/gpu/src/command_encoder.zig @@ -1,6 +1,13 @@ +const ChainedStruct = @import("types.zig").ChainedStruct; + pub const CommandEncoder = enum(usize) { _, // TODO: verify there is a use case for nullable value of this type. pub const none: CommandEncoder = @intToEnum(CommandEncoder, 0); + + pub const Descriptor = struct { + next_in_chain: *const ChainedStruct, + label: ?[*:0]const u8 = null, + }; };