radv: make sure the heap budget is less than or equal to the heap size

Reported by Hans-Kristian.

Cc: mesa-stable
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/28575>
This commit is contained in:
Samuel Pitoiset
2024-04-04 17:55:52 +02:00
committed by Marge Bot
parent a29fda1ba0
commit 14ba56718f
+5
View File
@@ -2518,6 +2518,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.