From 637e0c92d327daa389abb285886c2f539923b4a6 Mon Sep 17 00:00:00 2001 From: Stephen Gutekanst Date: Sat, 16 Jul 2022 20:10:24 -0700 Subject: [PATCH] gpu: add Surface.Descriptor Signed-off-by: Stephen Gutekanst --- gpu/TODO-webgpu.h | 5 ----- gpu/src/surface.zig | 7 +++++++ 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/gpu/TODO-webgpu.h b/gpu/TODO-webgpu.h index 181cf7f4..4020f302 100644 --- a/gpu/TODO-webgpu.h +++ b/gpu/TODO-webgpu.h @@ -1,8 +1,3 @@ -pub const WGPUSurfaceDescriptor = extern struct { - next_in_chain: *const ChainedStruct, - label: ?[*:0]const u8 = null, -}; - pub const WGPUSurfaceDescriptorFromAndroidNativeWindow = extern struct { chain: ChainedStruct, window: *anyopaque, diff --git a/gpu/src/surface.zig b/gpu/src/surface.zig index b1691e2a..120f50aa 100644 --- a/gpu/src/surface.zig +++ b/gpu/src/surface.zig @@ -1,6 +1,13 @@ +const ChainedStruct = @import("types.zig").ChainedStruct; + pub const Surface = enum(usize) { _, // TODO: verify there is a use case for nullable value of this type. pub const none: Surface = @intToEnum(Surface, 0); + + pub const Descriptor = extern struct { + next_in_chain: *const ChainedStruct, + label: ?[*:0]const u8 = null, + }; };