diff --git a/rvk/device.cpp b/rvk/device.cpp index 9c2edb5..3dcfe0e 100644 --- a/rvk/device.cpp +++ b/rvk/device.cpp @@ -552,11 +552,19 @@ Device::Device(Arc P, VkSurfaceKHR surface, bool ray_tra // Find heaps { - if(auto idx = physical_device->largest_heap(VK_MEMORY_PROPERTY_DEVICE_LOCAL_BIT); - idx.ok()) { + u32 device_heap_type = 0; + if(physical_device->properties().is_discrete()) { + device_heap_type = VK_MEMORY_PROPERTY_DEVICE_LOCAL_BIT; + } else { + info("[rvk] GPU is integrated, using host coherent heap as device heap."); + device_heap_type = + VK_MEMORY_PROPERTY_HOST_VISIBLE_BIT | VK_MEMORY_PROPERTY_HOST_COHERENT_BIT; + } + + if(auto idx = physical_device->largest_heap(device_heap_type); idx.ok()) { device_memory_index = *idx; } else { - die("[rvk] No device local heap found."); + die("[rvk] No device heap found."); } if(auto idx = physical_device->largest_heap(VK_MEMORY_PROPERTY_HOST_VISIBLE_BIT | @@ -565,7 +573,7 @@ Device::Device(Arc P, VkSurfaceKHR surface, bool ray_tra idx.ok()) { host_memory_index = *idx; } else { - die("[rvk] No host visible heap found."); + die("[rvk] No host cached heap found."); } info("[rvk] Found device and host heaps (%: %mb, %: %mb).", device_memory_index, diff --git a/rvk/rvk.cpp b/rvk/rvk.cpp index bc07da2..85586f2 100644 --- a/rvk/rvk.cpp +++ b/rvk/rvk.cpp @@ -181,14 +181,14 @@ Vk::Vk(Config config) { { u64 heap_size = device->heap_size(Heap::host); if(heap_size < Math::MB(64)) { - die("Host heap is too small: %mb / 64mb.", heap_size / Math::MB(1)); + die("[rvk] Host heap is too small: %mb / 64mb.", heap_size / Math::MB(1)); } if(config.host_heap > max_allocation) { - warn("Requested host heap is larger than the max allocation size, using max."); + warn("[rvk] Requested host heap is larger than the max allocation size, using max."); config.host_heap = max_allocation; } if(config.host_heap > heap_size) { - warn("Requested host heap is larger than available, using entire heap."); + warn("[rvk] Requested host heap is larger than available, using entire heap."); config.host_heap = heap_size; } host_memory = Arc::make(physical_device, device.dup(), Heap::host, @@ -197,10 +197,10 @@ Vk::Vk(Config config) { { u64 heap_size = device->heap_size(Heap::device); if(heap_size < Math::MB(128)) { - die("Device heap is too small: %mb / 128mb.", heap_size / Math::MB(1)); + die("[rvk] Device heap is too small: %mb / 128mb.", heap_size / Math::MB(1)); } if(config.device_heap_margin > heap_size) { - warn("Requested device heap margin is larger than the heap, using 64mb margin."); + warn("[rvk] Requested device heap margin is larger than the heap, using 64mb margin."); config.device_heap_margin = Math::MB(64); }