diff --git a/.pick_status.json b/.pick_status.json index b900c297083..da9a1b6171d 100644 --- a/.pick_status.json +++ b/.pick_status.json @@ -1984,7 +1984,7 @@ "description": "radv: make sure the heap budget is less than or equal to the heap size", "nominated": true, "nomination_type": 0, - "resolution": 0, + "resolution": 1, "main_sha": null, "because_sha": null, "notes": null diff --git a/src/amd/vulkan/radv_physical_device.c b/src/amd/vulkan/radv_physical_device.c index c9e276efa71..793bb09bb30 100644 --- a/src/amd/vulkan/radv_physical_device.c +++ b/src/amd/vulkan/radv_physical_device.c @@ -2380,6 +2380,11 @@ radv_get_memory_budget_properties(VkPhysicalDevice physicalDevice, assert(heap == memory_properties->memoryHeapCount); } + /* The heapBudget value must be less than or equal to VkMemoryHeap::size for each heap. */ + for (uint32_t i = 0; i < memory_properties->memoryHeapCount; i++) { + memoryBudget->heapBudget[i] = MIN2(memory_properties->memoryHeaps[i].size, memoryBudget->heapBudget[i]); + } + /* The heapBudget and heapUsage values must be zero for array elements * greater than or equal to * VkPhysicalDeviceMemoryProperties::memoryHeapCount.