gpu: convert BindGroupLayout from enum(usize) to *opaque

Signed-off-by: Stephen Gutekanst <stephen@hexops.com>
This commit is contained in:
Stephen Gutekanst 2022-07-24 14:46:04 -07:00 committed by Stephen Gutekanst
parent f7df77e2d2
commit 48dbfc9f55

View file

@ -5,13 +5,9 @@ const Sampler = @import("sampler.zig").Sampler;
const Texture = @import("texture.zig").Texture; const Texture = @import("texture.zig").Texture;
const StorageTextureBindingLayout = @import("types.zig").StorageTextureBindingLayout; 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 BindGroupLayoutEntry = extern struct {
pub const none: BindGroupLayout = @intToEnum(BindGroupLayout, 0);
pub const Entry = extern struct {
next_in_chain: *const ChainedStruct, next_in_chain: *const ChainedStruct,
binding: u32, binding: u32,
visibility: ShaderStageFlags, visibility: ShaderStageFlags,
@ -19,12 +15,11 @@ pub const BindGroupLayout = enum(usize) {
sampler: Sampler.BindingLayout, sampler: Sampler.BindingLayout,
texture: Texture.BindingLayout, texture: Texture.BindingLayout,
storage_texture: StorageTextureBindingLayout, storage_texture: StorageTextureBindingLayout,
}; };
pub const Descriptor = extern struct { pub const BindGroupLayoutDescriptor = extern struct {
next_in_chain: *const ChainedStruct, next_in_chain: *const ChainedStruct,
label: ?[*:0]const u8 = null, label: ?[*:0]const u8 = null,
entry_count: u32, entry_count: u32,
entries: [*]const Entry, entries: [*]const BindGroupLayoutEntry,
};
}; };