From 48dbfc9f5509900f0071fb586e23e3b9f760796b Mon Sep 17 00:00:00 2001 From: Stephen Gutekanst Date: Sun, 24 Jul 2022 14:46:04 -0700 Subject: [PATCH] gpu: convert BindGroupLayout from enum(usize) to *opaque Signed-off-by: Stephen Gutekanst --- gpu/src/bind_group_layout.zig | 37 +++++++++++++++-------------------- 1 file changed, 16 insertions(+), 21 deletions(-) diff --git a/gpu/src/bind_group_layout.zig b/gpu/src/bind_group_layout.zig index 700079ec..9eb6c095 100644 --- a/gpu/src/bind_group_layout.zig +++ b/gpu/src/bind_group_layout.zig @@ -5,26 +5,21 @@ const Sampler = @import("sampler.zig").Sampler; const Texture = @import("texture.zig").Texture; const StorageTextureBindingLayout = @import("types.zig").StorageTextureBindingLayout; -pub const BindGroupLayout = enum(usize) { - _, +pub const BindGroupLayout = *opaque {}; - // TODO: verify there is a use case for nullable value of this type. - pub const none: BindGroupLayout = @intToEnum(BindGroupLayout, 0); - - pub const Entry = extern struct { - next_in_chain: *const ChainedStruct, - binding: u32, - visibility: ShaderStageFlags, - buffer: Buffer.BindingLayout, - sampler: Sampler.BindingLayout, - texture: Texture.BindingLayout, - storage_texture: StorageTextureBindingLayout, - }; - - pub const Descriptor = extern struct { - next_in_chain: *const ChainedStruct, - label: ?[*:0]const u8 = null, - entry_count: u32, - entries: [*]const Entry, - }; +pub const BindGroupLayoutEntry = extern struct { + next_in_chain: *const ChainedStruct, + binding: u32, + visibility: ShaderStageFlags, + buffer: Buffer.BindingLayout, + sampler: Sampler.BindingLayout, + texture: Texture.BindingLayout, + storage_texture: StorageTextureBindingLayout, +}; + +pub const BindGroupLayoutDescriptor = extern struct { + next_in_chain: *const ChainedStruct, + label: ?[*:0]const u8 = null, + entry_count: u32, + entries: [*]const BindGroupLayoutEntry, };