adding command pool base

This commit is contained in:
2025-11-12 22:50:41 +01:00
parent d52d6f3ea7
commit e08fba24a6
17 changed files with 177 additions and 71 deletions
+16 -1
View File
@@ -5,9 +5,11 @@ const builtin = @import("builtin");
const Debug = std.builtin.OptimizeMode.Debug;
const SoftQueue = @import("SoftQueue.zig");
const SoftCommandPool = @import("SoftCommandPool.zig");
const SoftDeviceMemory = @import("SoftDeviceMemory.zig");
const SoftFence = @import("SoftFence.zig");
const SoftQueue = @import("SoftQueue.zig");
const VkError = base.VkError;
@@ -33,8 +35,10 @@ pub fn create(physical_device: *base.PhysicalDevice, allocator: std.mem.Allocato
interface.dispatch_table = &.{
.allocateMemory = allocateMemory,
.createCommandPool = createCommandPool,
.createFence = createFence,
.destroy = destroy,
.destroyCommandPool = destroyCommandPool,
.destroyFence = destroyFence,
.freeMemory = freeMemory,
.getFenceStatus = getFenceStatus,
@@ -99,6 +103,17 @@ pub fn waitForFences(_: *Interface, fences: []*base.Fence, waitForAll: bool, tim
}
}
// Command Pool functions ============================================================================================================================
pub fn createCommandPool(interface: *Interface, allocator: std.mem.Allocator, info: *const vk.CommandPoolCreateInfo) VkError!*base.CommandPool {
const pool = try SoftCommandPool.create(interface, allocator, info);
return &pool.interface;
}
pub fn destroyCommandPool(_: *Interface, allocator: std.mem.Allocator, pool: *base.CommandPool) VkError!void {
pool.destroy(allocator);
}
// Memory functions ==================================================================================================================================
pub fn allocateMemory(interface: *Interface, allocator: std.mem.Allocator, info: *const vk.MemoryAllocateInfo) VkError!*base.DeviceMemory {