Skip to content

Commit

Permalink
Allocate buffer memory from memory requirements.
Browse files Browse the repository at this point in the history
  • Loading branch information
zlogic committed Jan 28, 2024
1 parent f4e5640 commit 9bed704
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/correlation/vk.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1127,7 +1127,9 @@ impl Device {
.iter()
.enumerate()
.find(|(memory_type_index, memory_type)| {
if memory_properties.memory_heaps[memory_type.heap_index as usize].size < size {
if memory_properties.memory_heaps[memory_type.heap_index as usize].size
< memory_requirements.size
{
return false;
};
if (1 << memory_type_index) & memory_requirements.memory_type_bits == 0 {
Expand Down Expand Up @@ -1160,7 +1162,7 @@ impl Device {
let host_visible = property_flags.contains(vk::MemoryPropertyFlags::HOST_VISIBLE);
let host_coherent = property_flags.contains(vk::MemoryPropertyFlags::HOST_COHERENT);
let allocate_info = vk::MemoryAllocateInfo {
allocation_size: size,
allocation_size: memory_requirements.size,
memory_type_index,
..Default::default()
};
Expand Down

0 comments on commit 9bed704

Please sign in to comment.