gpu: internalize BindGroup types
Signed-off-by: Stephen Gutekanst <stephen@hexops.com>
This commit is contained in:
parent
e6f3d3c2f0
commit
e10432834b
3 changed files with 23 additions and 24 deletions
|
|
@ -6,6 +6,25 @@ const BindGroupLayout = @import("bind_group_layout.zig").BindGroupLayout;
|
|||
const Impl = @import("interface.zig").Impl;
|
||||
|
||||
pub const BindGroup = opaque {
|
||||
pub const Entry = extern struct {
|
||||
next_in_chain: ?*const ChainedStruct = null,
|
||||
binding: u32,
|
||||
buffer: ?*Buffer,
|
||||
offset: u64 = 0,
|
||||
size: u64,
|
||||
sampler: ?*Sampler,
|
||||
texture_view: ?*TextureView,
|
||||
};
|
||||
|
||||
pub const Descriptor = extern struct {
|
||||
next_in_chain: ?*const ChainedStruct = null,
|
||||
label: ?[*:0]const u8 = null,
|
||||
layout: *BindGroupLayout,
|
||||
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: *BindGroup, label: [*:0]const u8) void {
|
||||
Impl.bindGroupSetLabel(bind_group, label);
|
||||
}
|
||||
|
|
@ -18,22 +37,3 @@ pub const BindGroup = opaque {
|
|||
Impl.bindGroupRelease(bind_group);
|
||||
}
|
||||
};
|
||||
|
||||
pub const BindGroupEntry = extern struct {
|
||||
next_in_chain: ?*const ChainedStruct = null,
|
||||
binding: u32,
|
||||
buffer: ?*Buffer,
|
||||
offset: u64 = 0,
|
||||
size: u64,
|
||||
sampler: ?*Sampler,
|
||||
texture_view: ?*TextureView,
|
||||
};
|
||||
|
||||
pub const BindGroupDescriptor = extern struct {
|
||||
next_in_chain: ?*const ChainedStruct = null,
|
||||
label: ?[*:0]const u8 = null,
|
||||
layout: *BindGroupLayout,
|
||||
entry_count: u32,
|
||||
// TODO: file a bug on Dawn, this is not marked as nullable but in fact is.
|
||||
entries: ?[*]const BindGroupEntry,
|
||||
};
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue