diff --git a/src/gfx_apis/vulkan/descriptor_buffer.rs b/src/gfx_apis/vulkan/descriptor_buffer.rs index 6ea8434a..5efd96b3 100644 --- a/src/gfx_apis/vulkan/descriptor_buffer.rs +++ b/src/gfx_apis/vulkan/descriptor_buffer.rs @@ -63,6 +63,8 @@ impl VulkanDescriptorBufferCache { self: &Rc, capacity: DeviceSize, ) -> Result { + 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,