investigating memory issues
Build / build (push) Successful in 1m5s
Test / build_and_test (push) Successful in 33m20s

This commit is contained in:
2026-05-06 15:54:59 +02:00
parent 538106cbba
commit a5ff640aeb
2 changed files with 5 additions and 0 deletions
+4
View File
@@ -2,6 +2,7 @@ const std = @import("std");
const vk = @import("vulkan");
const SoftDevice = @import("SoftDevice.zig");
const base = @import("base");
const lib = @import("lib.zig");
const VkError = base.VkError;
@@ -12,6 +13,9 @@ interface: Interface,
data: []u8,
pub fn create(device: *SoftDevice, allocator: std.mem.Allocator, size: vk.DeviceSize, memory_type_index: u32) VkError!*Self {
if (size > lib.MAX_MEMORY_ALLOCATION_SIZE)
return VkError.OutOfDeviceMemory;
const self = allocator.create(Self) catch return VkError.OutOfHostMemory;
errdefer allocator.destroy(self);
+1
View File
@@ -67,6 +67,7 @@ pub const MAX_IMAGE_LEVELS_CUBE = 15;
pub const MAX_IMAGE_ARRAY_LAYERS = 2048;
pub const PHYSICAL_DEVICE_HEAP_SIZE = 0x80000000; // 2 GiB
pub const MAX_MEMORY_ALLOCATION_SIZE = 0x80000000; // 2 GiB
pub const MAX_ALLOCATION_COUNT = 4096;
pub const std_options = base.std_options;