working on queues

This commit is contained in:
2025-11-09 21:06:33 +01:00
parent b4b88ac2db
commit b2d964c96a
10 changed files with 84 additions and 39 deletions

View File

@@ -16,7 +16,30 @@ flags: vk.DeviceQueueCreateFlags,
dispatch_table: *const DispatchTable,
pub const DispatchTable = struct {
bindSparse: *const fn (*Self, u32, *const vk.BindSparseInfo, ?*Fence) VkError!void,
submit: *const fn (*Self, u32, *const vk.SubmitInfo, ?*Fence) VkError!void,
bindSparse: *const fn (*Self, []*const vk.BindSparseInfo, ?*Fence) VkError!void,
submit: *const fn (*Self, []*const vk.SubmitInfo, ?*Fence) VkError!void,
waitIdle: *const fn (*Self) VkError!void,
};
pub fn init(allocator: std.mem.Allocator, device: *const Device, index: u32, info: vk.DeviceQueueCreateInfo) VkError!Self {
_ = allocator;
return .{
.owner = device,
.family_index = info.queueFamilyIndex,
.index = index,
.flags = info.flags,
.dispatch_table = undefined,
};
}
pub inline fn bindSparse(self: *Self, info: []*const vk.BindSparseInfo, fence: ?*Fence) VkError!void {
try self.dispatch_table.bindSparse(self, info, fence);
}
pub inline fn submit(self: *Self, info: []*const vk.SubmitInfo, fence: ?*Fence) VkError!void {
try self.dispatch_table.submit(self, info, fence);
}
pub inline fn waitIdle(self: *Self) VkError!void {
try self.dispatch_table.waitIdle(self);
}