fixing debug allocator
This commit is contained in:
@@ -93,9 +93,12 @@ pub fn destroy(interface: *Interface, allocator: std.mem.Allocator) VkError!void
|
||||
|
||||
if (config.debug_allocator) {
|
||||
// All device memory allocations should've been freed by now
|
||||
if (!self.device_allocator.detectLeaks()) {
|
||||
const leaks = self.device_allocator.detectLeaks();
|
||||
if (leaks != 0)
|
||||
std.log.scoped(.vkDestroyDevice).err("Device was destroyed leaking {d}KB", .{@divTrunc(leaks, 1000)})
|
||||
else
|
||||
std.log.scoped(.vkDestroyDevice).debug("No device memory leaks detected", .{});
|
||||
}
|
||||
self.device_allocator.deinitWithoutLeakChecks();
|
||||
}
|
||||
|
||||
allocator.destroy(self);
|
||||
|
||||
@@ -44,6 +44,7 @@ pub fn create(allocator: std.mem.Allocator, instance: *base.Instance) VkError!*S
|
||||
.getFormatProperties = getFormatProperties,
|
||||
.getImageFormatProperties = getImageFormatProperties,
|
||||
.getSparseImageFormatProperties = getSparseImageFormatProperties,
|
||||
.enumerateLayerProperties = enumerateLayerProperties,
|
||||
.enumerateExtensionProperties = enumerateExtensionProperties,
|
||||
.release = destroy,
|
||||
|
||||
@@ -248,6 +249,11 @@ pub fn createDevice(interface: *Interface, allocator: std.mem.Allocator, infos:
|
||||
return &device.interface;
|
||||
}
|
||||
|
||||
pub fn enumerateLayerProperties(_: *const Interface, count: *u32, p_properties: ?[*]vk.LayerProperties) VkError!void {
|
||||
count.* = 0;
|
||||
_ = p_properties;
|
||||
}
|
||||
|
||||
pub fn enumerateExtensionProperties(_: *const Interface, layer_name: ?[]const u8, count: *u32, p_properties: ?[*]vk.ExtensionProperties) VkError!void {
|
||||
if (layer_name) |_| {
|
||||
return VkError.LayerNotPresent;
|
||||
|
||||
Reference in New Issue
Block a user