gpu: add CommandBuffer; CommandBuffer.setLabel

Signed-off-by: Stephen Gutekanst <stephen@hexops.com>
This commit is contained in:
Stephen Gutekanst 2022-03-11 08:48:36 -07:00 committed by Stephen Gutekanst
parent a397631045
commit 5547594fd7
2 changed files with 32 additions and 2 deletions

View file

@ -8,8 +8,7 @@ vtable: *const VTable,
pub const VTable = struct {
reference: fn (ptr: *anyopaque) void,
release: fn (ptr: *anyopaque) void,
// TODO:
// WGPU_EXPORT void wgpuCommandBufferSetLabel(WGPUCommandBuffer commandBuffer, char const * label);
setLabel: fn (ptr: *anyopaque, label: [:0]const u8) void,
};
pub inline fn reference(buf: CommandBuffer) void {
@ -20,8 +19,13 @@ pub inline fn release(buf: CommandBuffer) void {
buf.vtable.release(buf.ptr);
}
pub inline fn setLabel(group: CommandBuffer, label: [:0]const u8) void {
group.vtable.setLabel(group.ptr, label);
}
test "syntax" {
_ = VTable;
_ = reference;
_ = release;
_ = setLabel;
}