1
0
Fork 0
forked from wry/wry

vulkan: don't equate buffer size with allocation size

This commit is contained in:
Julian Orth 2025-02-19 11:03:30 +01:00
parent 74da02c1ec
commit 84a4d1eb2d

View file

@ -63,6 +63,8 @@ impl VulkanDescriptorBufferCache {
self: &Rc<Self>,
capacity: DeviceSize,
) -> Result<VulkanDescriptorBuffer, VulkanError> {
const MIN_ALLOCATION: DeviceSize = 1024;
let capacity = capacity.max(MIN_ALLOCATION);
let mut smallest = None;
let mut smallest_size = DeviceSize::MAX;
let mut fitting = None;
@ -128,7 +130,7 @@ impl VulkanDescriptorBufferCache {
cache: self.clone(),
buffer: ManuallyDrop::new(VulkanDescriptorBufferUnused {
device: self.device.clone(),
size: allocation.size,
size,
buffer,
allocation,
address,