fixing some tests

This commit is contained in:
2025-12-09 00:09:02 +01:00
parent c67cb86dff
commit 8b33e61903
10 changed files with 542 additions and 62 deletions
+10 -4
View File
@@ -2,11 +2,12 @@ const std = @import("std");
const vk = @import("vulkan");
const VkError = @import("error_set.zig").VkError;
const Dispatchable = @import("Dispatchable.zig").Dispatchable;
const NonDispatchable = @import("NonDispatchable.zig").NonDispatchable;
const Device = @import("Device.zig");
const DescriptorSet = @import("DescriptorSet.zig");
const DescriptorSetLayout = @import("DescriptorSetLayout.zig");
const Self = @This();
pub const ObjectType: vk.ObjectType = .descriptor_pool;
@@ -17,8 +18,9 @@ flags: vk.DescriptorPoolCreateFlags,
vtable: *const VTable,
pub const VTable = struct {
allocateDescriptorSet: *const fn (*Self, *DescriptorSetLayout) VkError!*DescriptorSet,
destroy: *const fn (*Self, std.mem.Allocator) void,
freeDescriptorSets: *const fn (*Self, []*Dispatchable(DescriptorSet)) VkError!void,
freeDescriptorSet: *const fn (*Self, *DescriptorSet) VkError!void,
};
pub fn init(device: *Device, allocator: std.mem.Allocator, info: *const vk.DescriptorPoolCreateInfo) VkError!Self {
@@ -30,10 +32,14 @@ pub fn init(device: *Device, allocator: std.mem.Allocator, info: *const vk.Descr
};
}
pub inline fn allocateDescriptorSet(self: *Self, layout: *DescriptorSetLayout) VkError!*DescriptorSet {
return self.vtable.allocateDescriptorSet(self, layout);
}
pub inline fn destroy(self: *Self, allocator: std.mem.Allocator) void {
self.vtable.destroy(self, allocator);
}
pub inline fn freeDescriptorSets(self: *Self, sets: []*Dispatchable(DescriptorSet)) VkError!void {
try self.vtable.freeDescriptorSets(self, sets);
pub inline fn freeDescriptorSet(self: *Self, set: *DescriptorSet) VkError!void {
try self.vtable.freeDescriptorSet(self, set);
}