From 8f80cdc321ef785ffb91045928d0caa5722f30fc Mon Sep 17 00:00:00 2001 From: Stephen Gutekanst Date: Sat, 16 Jul 2022 00:28:53 -0700 Subject: [PATCH] gpu: add Instance.Descriptor Signed-off-by: Stephen Gutekanst --- gpu/TODO-webgpu.h | 4 ---- gpu/src/instance.zig | 6 ++++++ 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/gpu/TODO-webgpu.h b/gpu/TODO-webgpu.h index 90461e2f..36a58ac4 100644 --- a/gpu/TODO-webgpu.h +++ b/gpu/TODO-webgpu.h @@ -1,7 +1,3 @@ -typedef struct WGPUInstanceDescriptor { - next_in_chain: *const ChainedStruct, -} WGPUInstanceDescriptor; - typedef struct WGPUMultisampleState { next_in_chain: *const ChainedStruct, count: u32, diff --git a/gpu/src/instance.zig b/gpu/src/instance.zig index 52e1890b..dfa1851b 100644 --- a/gpu/src/instance.zig +++ b/gpu/src/instance.zig @@ -1,6 +1,12 @@ +pub const ChainedStruct = @import("types.zig").ChainedStruct; + pub const Instance = enum(usize) { _, // TODO: verify there is a use case for nullable value of this type. pub const none: Instance = @intToEnum(Instance, 0); + + pub const Descriptor = extern struct { + next_in_chain: *const ChainedStruct, + }; };