fixing command pool, adding base command buffer dispatch table

This commit is contained in:
2025-11-16 20:42:08 +01:00
parent c74bc7fb15
commit 5661505bef
7 changed files with 94 additions and 11 deletions

View File

@@ -12,6 +12,7 @@ const SoftDeviceMemory = @import("SoftDeviceMemory.zig");
const SoftFence = @import("SoftFence.zig");
const VkError = base.VkError;
const Dispatchable = base.Dispatchable;
const NonDispatchable = base.NonDispatchable;
const Self = @This();
@@ -42,6 +43,7 @@ pub fn create(physical_device: *base.PhysicalDevice, allocator: std.mem.Allocato
.destroy = destroy,
.destroyCommandPool = destroyCommandPool,
.destroyFence = destroyFence,
.freeCommandBuffers = freeCommandBuffers,
.freeMemory = freeMemory,
.getFenceStatus = getFenceStatus,
.resetFences = resetFences,
@@ -107,7 +109,7 @@ pub fn waitForFences(_: *Interface, fences: []*base.Fence, waitForAll: bool, tim
// Command Pool functions ============================================================================================================================
pub fn allocateCommandBuffers(_: *Interface, info: *const vk.CommandBufferAllocateInfo) VkError![]*base.CommandBuffer {
pub fn allocateCommandBuffers(_: *Interface, info: *const vk.CommandBufferAllocateInfo) VkError![]*Dispatchable(base.CommandBuffer) {
const pool = try NonDispatchable(base.CommandPool).fromHandleObject(info.command_pool);
return pool.allocateCommandBuffers(info);
}
@@ -121,6 +123,10 @@ pub fn destroyCommandPool(_: *Interface, allocator: std.mem.Allocator, pool: *ba
pool.destroy(allocator);
}
pub fn freeCommandBuffers(_: *Interface, pool: *base.CommandPool, cmds: []*Dispatchable(base.CommandBuffer)) VkError!void {
try pool.freeCommandBuffers(cmds);
}
// Memory functions ==================================================================================================================================
pub fn allocateMemory(interface: *Interface, allocator: std.mem.Allocator, info: *const vk.MemoryAllocateInfo) VkError!*base.DeviceMemory {