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

View file

@ -17,6 +17,7 @@ const Device = @import("Device.zig");
const Surface = @import("Surface.zig");
const Limits = @import("Limits.zig");
const Queue = @import("Queue.zig");
const CommandBuffer = @import("CommandBuffer.zig");
const NativeInstance = @This();
@ -352,6 +353,15 @@ const queue_vtable = Queue.VTable{
c.wgpuQueueRelease(@ptrCast(c.WGPUQueue, ptr));
}
}).release,
.submit = (struct {
pub fn submit(ptr: *anyopaque, command_count: u32, commands: *const CommandBuffer) void {
c.wgpuQueueSubmit(
@ptrCast(c.WGPUQueue, ptr),
command_count,
@ptrCast(*c.WGPUCommandBuffer, @alignCast(@alignOf(*c.WGPUCommandBuffer), commands.ptr)),
);
}
}).submit,
};
test "syntax" {