Files
VulkanDriver/src/soft/SoftQueryPool.zig
T
kbz_8 90b93a69e0
Build / build (push) Successful in 1m6s
Test / build_and_test (push) Successful in 50s
implementing queries
2026-06-05 18:18:38 +02:00

34 lines
894 B
Zig

const std = @import("std");
const vk = @import("vulkan");
const base = @import("base");
const VkError = base.VkError;
const Device = base.Device;
const Self = @This();
pub const Interface = base.QueryPool;
interface: Interface,
pub fn create(device: *base.Device, allocator: std.mem.Allocator, info: *const vk.QueryPoolCreateInfo) VkError!*Self {
const self = allocator.create(Self) catch return VkError.OutOfHostMemory;
errdefer allocator.destroy(self);
var interface = try Interface.init(device, allocator, info);
interface.vtable = &.{
.destroy = destroy,
};
self.* = .{
.interface = interface,
};
return self;
}
pub fn destroy(interface: *Interface, allocator: std.mem.Allocator) void {
const self: *Self = @alignCast(@fieldParentPtr("interface", interface));
allocator.free(interface.queries);
allocator.destroy(self);
}