1
0
Fork 0
forked from wry/wry

vulkan/anv: align descriptor buffers to 4KB

https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/33903
This commit is contained in:
Julian Orth 2025-03-05 18:39:08 +01:00
parent 3fa3b020c3
commit 4bba7b7c5d
3 changed files with 32 additions and 19 deletions

View file

@ -73,7 +73,7 @@ impl VulkanBufferCache {
align: DeviceSize,
) -> Result<VulkanBuffer, VulkanError> {
const MIN_ALLOCATION: DeviceSize = 1024;
let capacity = capacity.max(MIN_ALLOCATION);
let capacity = (capacity.max(MIN_ALLOCATION) + align - 1) & !(align - 1);
let mut smallest = None;
let mut smallest_size = DeviceSize::MAX;
let mut fitting = None;