gpu: convert BindGroup from enum(usize) to *opaque
Signed-off-by: Stephen Gutekanst <stephen@hexops.com>
This commit is contained in:
parent
48dbfc9f55
commit
9b28403d9d
1 changed files with 17 additions and 22 deletions
|
|
@ -4,27 +4,22 @@ const TextureView = @import("texture_view.zig").TextureView;
|
|||
const ChainedStruct = @import("types.zig").ChainedStruct;
|
||||
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 none: BindGroup = @intToEnum(BindGroup, 0);
|
||||
|
||||
pub const Entry = extern struct {
|
||||
next_in_chain: *const ChainedStruct,
|
||||
binding: u32,
|
||||
buffer: Buffer = Buffer.none, // nullable
|
||||
offset: u64,
|
||||
size: u64,
|
||||
sampler: Sampler = Sampler.none, // nullable
|
||||
texture_view: TextureView = TextureView.none, // nullable
|
||||
};
|
||||
|
||||
pub const Descriptor = extern struct {
|
||||
next_in_chain: *const ChainedStruct,
|
||||
label: ?[*:0]const u8 = null,
|
||||
layout: BindGroupLayout,
|
||||
entry_count: u32,
|
||||
entries: [*]const Entry,
|
||||
};
|
||||
pub const BindGroupEntry = extern struct {
|
||||
next_in_chain: *const ChainedStruct,
|
||||
binding: u32,
|
||||
buffer: Buffer = Buffer.none, // nullable
|
||||
offset: u64,
|
||||
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,
|
||||
layout: BindGroupLayout,
|
||||
entry_count: u32,
|
||||
entries: [*]const BindGroupEntry,
|
||||
};
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue