fixing some tests
This commit is contained in:
@@ -3,8 +3,12 @@ const vk = @import("vulkan");
|
||||
const base = @import("base");
|
||||
|
||||
const VkError = base.VkError;
|
||||
const VulkanAllocator = base.VulkanAllocator;
|
||||
|
||||
const Device = base.Device;
|
||||
|
||||
const SoftDescriptorSet = @import("SoftDescriptorSet.zig");
|
||||
|
||||
const Self = @This();
|
||||
pub const Interface = base.DescriptorPool;
|
||||
|
||||
@@ -17,8 +21,9 @@ pub fn create(device: *base.Device, allocator: std.mem.Allocator, info: *const v
|
||||
var interface = try Interface.init(device, allocator, info);
|
||||
|
||||
interface.vtable = &.{
|
||||
.allocateDescriptorSet = allocateDescriptorSet,
|
||||
.destroy = destroy,
|
||||
.freeDescriptorSets = freeDescriptorSets,
|
||||
.freeDescriptorSet = freeDescriptorSet,
|
||||
};
|
||||
|
||||
self.* = .{
|
||||
@@ -27,12 +32,19 @@ pub fn create(device: *base.Device, allocator: std.mem.Allocator, info: *const v
|
||||
return self;
|
||||
}
|
||||
|
||||
pub fn allocateDescriptorSet(interface: *Interface, layout: *base.DescriptorSetLayout) VkError!*base.DescriptorSet {
|
||||
const allocator = VulkanAllocator.init(null, .object).allocator();
|
||||
const set = try SoftDescriptorSet.create(interface.owner, allocator, layout);
|
||||
return &set.interface;
|
||||
}
|
||||
|
||||
pub fn destroy(interface: *Interface, allocator: std.mem.Allocator) void {
|
||||
const self: *Self = @alignCast(@fieldParentPtr("interface", interface));
|
||||
allocator.destroy(self);
|
||||
}
|
||||
|
||||
pub fn freeDescriptorSets(interface: *Interface, sets: []*base.Dispatchable(base.DescriptorSet)) VkError!void {
|
||||
pub fn freeDescriptorSet(interface: *Interface, set: *base.DescriptorSet) VkError!void {
|
||||
_ = interface;
|
||||
_ = sets;
|
||||
const allocator = VulkanAllocator.init(null, .object).allocator();
|
||||
allocator.destroy(set);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user