31 lines
779 B
Zig
31 lines
779 B
Zig
const BindGroupLayout = @This();
|
|
|
|
/// The type erased pointer to the BindGroupLayout implementation
|
|
/// Equal to c.WGPUBindGroupLayout for NativeInstance.
|
|
ptr: *anyopaque,
|
|
vtable: *const VTable,
|
|
|
|
pub const VTable = struct {
|
|
reference: fn (ptr: *anyopaque) void,
|
|
release: fn (ptr: *anyopaque) void,
|
|
setLabel: fn (ptr: *anyopaque, label: [:0]const u8) void,
|
|
};
|
|
|
|
pub inline fn reference(layout: BindGroupLayout) void {
|
|
layout.vtable.reference(layout.ptr);
|
|
}
|
|
|
|
pub inline fn release(layout: BindGroupLayout) void {
|
|
layout.vtable.release(layout.ptr);
|
|
}
|
|
|
|
pub inline fn setLabel(group: BindGroupLayout, label: [:0]const u8) void {
|
|
group.vtable.setLabel(group.ptr, label);
|
|
}
|
|
|
|
test "syntax" {
|
|
_ = VTable;
|
|
_ = reference;
|
|
_ = release;
|
|
_ = setLabel;
|
|
}
|