gpu: convert BindGroup 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:38 -07:00 committed by Stephen Gutekanst
parent 48dbfc9f55
commit 9b28403d9d

View file

@ -4,27 +4,22 @@ const TextureView = @import("texture_view.zig").TextureView;
const ChainedStruct = @import("types.zig").ChainedStruct; const ChainedStruct = @import("types.zig").ChainedStruct;
const BindGroupLayout = @import("bind_group_layout.zig").BindGroupLayout; const BindGroupLayout = @import("bind_group_layout.zig").BindGroupLayout;
pub const BindGroup = enum(usize) { pub const BindGroup = *opaque {};
_,
// TODO: verify there is a use case for nullable value of this type. pub const BindGroupEntry = extern struct {
pub const none: BindGroup = @intToEnum(BindGroup, 0); next_in_chain: *const ChainedStruct,
binding: u32,
pub const Entry = extern struct { buffer: Buffer = Buffer.none, // nullable
next_in_chain: *const ChainedStruct, offset: u64,
binding: u32, size: u64,
buffer: Buffer = Buffer.none, // nullable sampler: Sampler = Sampler.none, // nullable
offset: u64, texture_view: TextureView = TextureView.none, // nullable
size: u64, };
sampler: Sampler = Sampler.none, // nullable
texture_view: TextureView = TextureView.none, // nullable pub const BindGroupDescriptor = extern struct {
}; next_in_chain: *const ChainedStruct,
label: ?[*:0]const u8 = null,
pub const Descriptor = extern struct { layout: BindGroupLayout,
next_in_chain: *const ChainedStruct, entry_count: u32,
label: ?[*:0]const u8 = null, entries: [*]const BindGroupEntry,
layout: BindGroupLayout,
entry_count: u32,
entries: [*]const Entry,
};
}; };