gpu: update to latest webgpu.h API

Signed-off-by: Stephen Gutekanst <stephen@hexops.com>
This commit is contained in:
Stephen Gutekanst 2023-06-18 20:18:39 -07:00 committed by Stephen Gutekanst
parent 74067bebed
commit fdd3270a0f
22 changed files with 201 additions and 161 deletions

View file

@ -6,7 +6,7 @@ pub const PipelineLayout = opaque {
pub const Descriptor = extern struct {
next_in_chain: ?*const ChainedStruct = null,
label: ?[*:0]const u8 = null,
bind_group_layout_count: u32 = 0,
bind_group_layout_count: usize = 0,
bind_group_layouts: ?[*]const *BindGroupLayout = null,
/// Provides a slightly friendlier Zig API to initialize this structure.
@ -18,7 +18,7 @@ pub const PipelineLayout = opaque {
return .{
.next_in_chain = v.next_in_chain,
.label = v.label,
.bind_group_layout_count = if (v.bind_group_layouts) |e| @intCast(u32, e.len) else 0,
.bind_group_layout_count = if (v.bind_group_layouts) |e| e.len else 0,
.bind_group_layouts = if (v.bind_group_layouts) |e| e.ptr else null,
};
}