gpu: add CommandBuffer, Queue.submit

Signed-off-by: Stephen Gutekanst <stephen@hexops.com>
This commit is contained in:
Stephen Gutekanst 2022-03-08 00:54:56 -07:00 committed by Stephen Gutekanst
parent ad6cfbb0c9
commit bf93ae0f81
4 changed files with 46 additions and 2 deletions

25
gpu/src/CommandBuffer.zig Normal file
View file

@ -0,0 +1,25 @@
const CommandBuffer = @This();
/// The type erased pointer to the CommandBuffer implementation
/// Equal to c.WGPUCommandBuffer for NativeInstance.
ptr: *anyopaque,
vtable: *const VTable,
pub const VTable = struct {
reference: fn (ptr: *anyopaque) void,
release: fn (ptr: *anyopaque) void,
};
pub inline fn reference(buf: CommandBuffer) void {
buf.vtable.reference(buf.ptr);
}
pub inline fn release(buf: CommandBuffer) void {
buf.vtable.release(buf.ptr);
}
test "syntax" {
_ = VTable;
_ = reference;
_ = release;
}