get available memory when assert() is disabled via NDEBUG

problem spotted by Jason Ekstrand reviewing proposed patches upstream
This commit is contained in:
jsg 2020-09-01 06:42:24 +00:00
parent 46d4aeacf0
commit eb922cd93f

View File

@ -2105,7 +2105,9 @@ anv_get_memory_budget(VkPhysicalDevice physicalDevice,
{ {
ANV_FROM_HANDLE(anv_physical_device, device, physicalDevice); ANV_FROM_HANDLE(anv_physical_device, device, physicalDevice);
uint64_t sys_available; uint64_t sys_available;
assert(os_get_available_system_memory(&sys_available)); ASSERTED bool has_available_memory =
os_get_available_system_memory(&sys_available);
assert(has_available_memory);
VkDeviceSize total_heaps_size = 0; VkDeviceSize total_heaps_size = 0;
for (size_t i = 0; i < device->memory.heap_count; i++) for (size_t i = 0; i < device->memory.heap_count; i++)