gpu: add BindGroupLayout.setLabel
Signed-off-by: Stephen Gutekanst <stephen@hexops.com>
This commit is contained in:
parent
57bee4f0c4
commit
705289b79d
2 changed files with 11 additions and 2 deletions
|
|
@ -8,8 +8,7 @@ vtable: *const VTable,
|
||||||
pub const VTable = struct {
|
pub const VTable = struct {
|
||||||
reference: fn (ptr: *anyopaque) void,
|
reference: fn (ptr: *anyopaque) void,
|
||||||
release: fn (ptr: *anyopaque) void,
|
release: fn (ptr: *anyopaque) void,
|
||||||
// TODO:
|
setLabel: fn (ptr: *anyopaque, label: [:0]const u8) void,
|
||||||
// WGPU_EXPORT void wgpuBindGroupLayoutSetLabel(WGPUBindGroupLayout bindGroupLayout, char const * label);
|
|
||||||
};
|
};
|
||||||
|
|
||||||
pub inline fn reference(layout: BindGroupLayout) void {
|
pub inline fn reference(layout: BindGroupLayout) void {
|
||||||
|
|
@ -20,8 +19,13 @@ pub inline fn release(layout: BindGroupLayout) void {
|
||||||
layout.vtable.release(layout.ptr);
|
layout.vtable.release(layout.ptr);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
pub inline fn setLabel(group: BindGroupLayout, label: [:0]const u8) void {
|
||||||
|
group.vtable.setLabel(group.ptr, label);
|
||||||
|
}
|
||||||
|
|
||||||
test "syntax" {
|
test "syntax" {
|
||||||
_ = VTable;
|
_ = VTable;
|
||||||
_ = reference;
|
_ = reference;
|
||||||
_ = release;
|
_ = release;
|
||||||
|
_ = setLabel;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -756,6 +756,11 @@ const bind_group_layout_vtable = BindGroupLayout.VTable{
|
||||||
c.wgpuBindGroupLayoutRelease(@ptrCast(c.WGPUBindGroupLayout, ptr));
|
c.wgpuBindGroupLayoutRelease(@ptrCast(c.WGPUBindGroupLayout, ptr));
|
||||||
}
|
}
|
||||||
}).release,
|
}).release,
|
||||||
|
.setLabel = (struct {
|
||||||
|
pub fn setLabel(ptr: *anyopaque, label: [:0]const u8) void {
|
||||||
|
c.wgpuBindGroupLayoutSetLabel(@ptrCast(c.WGPUBindGroupLayout, ptr), label);
|
||||||
|
}
|
||||||
|
}).setLabel,
|
||||||
};
|
};
|
||||||
|
|
||||||
fn wrapBuffer(buffer: c.WGPUBuffer) Buffer {
|
fn wrapBuffer(buffer: c.WGPUBuffer) Buffer {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue