gpu: internalize BindGroupLayout types

Signed-off-by: Stephen Gutekanst <stephen@hexops.com>
This commit is contained in:
Stephen Gutekanst 2022-07-29 18:58:32 -07:00 committed by Stephen Gutekanst
parent 2ba4b9ff95
commit 3f4ebd68c2
3 changed files with 23 additions and 24 deletions

View file

@ -10,6 +10,24 @@ const StorageTextureBindingLayout = @import("types.zig").StorageTextureBindingLa
const Impl = @import("interface.zig").Impl;
pub const BindGroupLayout = opaque {
pub const Entry = extern struct {
next_in_chain: ?*const ChainedStruct = null,
binding: u32,
visibility: ShaderStageFlags,
buffer: BufferBindingLayout,
sampler: SamplerBindingLayout,
texture: TextureBindingLayout,
storage_texture: StorageTextureBindingLayout,
};
pub const Descriptor = extern struct {
next_in_chain: ?*const ChainedStruct = null,
label: ?[*:0]const u8 = null,
entry_count: u32,
// TODO: file a bug on Dawn, this is not marked as nullable but in fact is.
entries: ?[*]const Entry,
};
pub inline fn setLabel(bind_group_layout: *BindGroupLayout, label: [*:0]const u8) void {
Impl.bindGroupLayoutSetLabel(bind_group_layout, label);
}
@ -22,21 +40,3 @@ pub const BindGroupLayout = opaque {
Impl.bindGroupLayoutRelease(bind_group_layout);
}
};
pub const BindGroupLayoutEntry = extern struct {
next_in_chain: ?*const ChainedStruct = null,
binding: u32,
visibility: ShaderStageFlags,
buffer: BufferBindingLayout,
sampler: SamplerBindingLayout,
texture: TextureBindingLayout,
storage_texture: StorageTextureBindingLayout,
};
pub const BindGroupLayoutDescriptor = extern struct {
next_in_chain: ?*const ChainedStruct = null,
label: ?[*:0]const u8 = null,
entry_count: u32,
// TODO: file a bug on Dawn, this is not marked as nullable but in fact is.
entries: ?[*]const BindGroupLayoutEntry,
};