gpu: add CommandBuffer, Queue.submit
Signed-off-by: Stephen Gutekanst <stephen@hexops.com>
This commit is contained in:
parent
ad6cfbb0c9
commit
bf93ae0f81
4 changed files with 46 additions and 2 deletions
25
gpu/src/CommandBuffer.zig
Normal file
25
gpu/src/CommandBuffer.zig
Normal 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;
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue