fixing fences implementation

This commit is contained in:
2025-11-09 02:19:02 +01:00
parent e89d1ff8d9
commit b4b88ac2db
4 changed files with 116 additions and 31 deletions

View File

@@ -36,23 +36,6 @@ pub fn destroy(self: *Self, allocator: std.mem.Allocator) VkError!void {
try self.dispatch_table.destroy(self, allocator);
}
pub inline fn getFenceStatus(self: *Self, fence: *Fence) VkError!void {
try self.dispatch_table.getFenceStatus(fence);
}
pub inline fn resetFences(_: *Self, fences: []*Fence) VkError!void {
for (fences) |fence| {
try fence.reset();
}
}
pub inline fn waitForFences(_: *Self, fences: []*Fence, waitForAll: bool, timeout: u64) VkError!void {
for (fences) |fence| {
try fence.wait(timeout);
if (!waitForAll) return;
}
}
// Fence functions ===================================================================================================================================
pub inline fn createFence(self: *Self, allocator: std.mem.Allocator, info: *const vk.FenceCreateInfo) VkError!*Fence {
@@ -63,6 +46,18 @@ pub inline fn destroyFence(self: *Self, allocator: std.mem.Allocator, fence: *Fe
try self.dispatch_table.destroyFence(self, allocator, fence);
}
pub inline fn getFenceStatus(self: *Self, fence: *Fence) VkError!void {
try self.dispatch_table.getFenceStatus(self, fence);
}
pub inline fn resetFences(self: *Self, fences: []*Fence) VkError!void {
try self.dispatch_table.resetFences(self, fences);
}
pub inline fn waitForFences(self: *Self, fences: []*Fence, waitForAll: bool, timeout: u64) VkError!void {
try self.dispatch_table.waitForFences(self, fences, waitForAll, timeout);
}
// Memory functions ==================================================================================================================================
pub inline fn allocateMemory(self: *Self, allocator: std.mem.Allocator, info: *const vk.MemoryAllocateInfo) VkError!*DeviceMemory {