From efae1c2b91bc45312e2529d9e2b4ade5cfc86b06 Mon Sep 17 00:00:00 2001 From: Stephen Gutekanst Date: Sat, 16 Jul 2022 20:07:07 -0700 Subject: [PATCH] gpu: add ShaderModule.Descriptor Signed-off-by: Stephen Gutekanst --- gpu/TODO-webgpu.h | 5 ----- gpu/src/shader_module.zig | 7 +++++++ 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/gpu/TODO-webgpu.h b/gpu/TODO-webgpu.h index e3c8f898..ff434cfd 100644 --- a/gpu/TODO-webgpu.h +++ b/gpu/TODO-webgpu.h @@ -1,8 +1,3 @@ -pub const WGPUShaderModuleDescriptor = extern struct { - next_in_chain: *const ChainedStruct, - label: ?[*:0]const u8 = null, -}; - pub const WGPUShaderModuleSPIRVDescriptor = extern struct { chain: ChainedStruct, code_size: u32, diff --git a/gpu/src/shader_module.zig b/gpu/src/shader_module.zig index 4a06fe18..b04ba081 100644 --- a/gpu/src/shader_module.zig +++ b/gpu/src/shader_module.zig @@ -1,6 +1,13 @@ +const ChainedStruct = @import("types.zig").ChainedStruct; + pub const ShaderModule = enum(usize) { _, // TODO: verify there is a use case for nullable value of this type. pub const none: ShaderModule = @intToEnum(ShaderModule, 0); + + pub const Descriptor = extern struct { + next_in_chain: *const ChainedStruct, + label: ?[*:0]const u8 = null, + }; };