vulkan: don't equate buffer size with allocation size
This commit is contained in:
parent
74da02c1ec
commit
84a4d1eb2d
1 changed files with 3 additions and 1 deletions
|
|
@ -63,6 +63,8 @@ impl VulkanDescriptorBufferCache {
|
||||||
self: &Rc<Self>,
|
self: &Rc<Self>,
|
||||||
capacity: DeviceSize,
|
capacity: DeviceSize,
|
||||||
) -> Result<VulkanDescriptorBuffer, VulkanError> {
|
) -> Result<VulkanDescriptorBuffer, VulkanError> {
|
||||||
|
const MIN_ALLOCATION: DeviceSize = 1024;
|
||||||
|
let capacity = capacity.max(MIN_ALLOCATION);
|
||||||
let mut smallest = None;
|
let mut smallest = None;
|
||||||
let mut smallest_size = DeviceSize::MAX;
|
let mut smallest_size = DeviceSize::MAX;
|
||||||
let mut fitting = None;
|
let mut fitting = None;
|
||||||
|
|
@ -128,7 +130,7 @@ impl VulkanDescriptorBufferCache {
|
||||||
cache: self.clone(),
|
cache: self.clone(),
|
||||||
buffer: ManuallyDrop::new(VulkanDescriptorBufferUnused {
|
buffer: ManuallyDrop::new(VulkanDescriptorBufferUnused {
|
||||||
device: self.device.clone(),
|
device: self.device.clone(),
|
||||||
size: allocation.size,
|
size,
|
||||||
buffer,
|
buffer,
|
||||||
allocation,
|
allocation,
|
||||||
address,
|
address,
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue