diff options
author | Robin Kertels <robin.kertels@gmail.com> | 2021-08-07 15:15:01 +0200 |
---|---|---|
committer | Robin Kertels <robin.kertels@gmail.com> | 2021-08-07 15:28:05 +0200 |
commit | bb29dcb7f2dad1e0ed67b32387912d56e40a5e5d (patch) | |
tree | d9acd207c966c23cc35af721a3e53f8ae4a0d049 /src/video_core/vulkan_common/vulkan_memory_allocator.cpp | |
parent | Merge pull request #6795 from sankasan/cmd-remove-cursor-fullscreen (diff) | |
download | yuzu-bb29dcb7f2dad1e0ed67b32387912d56e40a5e5d.tar yuzu-bb29dcb7f2dad1e0ed67b32387912d56e40a5e5d.tar.gz yuzu-bb29dcb7f2dad1e0ed67b32387912d56e40a5e5d.tar.bz2 yuzu-bb29dcb7f2dad1e0ed67b32387912d56e40a5e5d.tar.lz yuzu-bb29dcb7f2dad1e0ed67b32387912d56e40a5e5d.tar.xz yuzu-bb29dcb7f2dad1e0ed67b32387912d56e40a5e5d.tar.zst yuzu-bb29dcb7f2dad1e0ed67b32387912d56e40a5e5d.zip |
Diffstat (limited to '')
-rw-r--r-- | src/video_core/vulkan_common/vulkan_memory_allocator.cpp | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/src/video_core/vulkan_common/vulkan_memory_allocator.cpp b/src/video_core/vulkan_common/vulkan_memory_allocator.cpp index aa173d19e..300a61205 100644 --- a/src/video_core/vulkan_common/vulkan_memory_allocator.cpp +++ b/src/video_core/vulkan_common/vulkan_memory_allocator.cpp @@ -228,7 +228,9 @@ void MemoryCommit::Release() { MemoryAllocator::MemoryAllocator(const Device& device_, bool export_allocations_) : device{device_}, properties{device_.GetPhysical().GetMemoryProperties()}, - export_allocations{export_allocations_} {} + export_allocations{export_allocations_}, + buffer_image_granularity{ + device_.GetPhysical().GetProperties().limits.bufferImageGranularity} {} MemoryAllocator::~MemoryAllocator() = default; @@ -258,7 +260,9 @@ MemoryCommit MemoryAllocator::Commit(const vk::Buffer& buffer, MemoryUsage usage } MemoryCommit MemoryAllocator::Commit(const vk::Image& image, MemoryUsage usage) { - auto commit = Commit(device.GetLogical().GetImageMemoryRequirements(*image), usage); + VkMemoryRequirements requirements = device.GetLogical().GetImageMemoryRequirements(*image); + requirements.size = Common::AlignUp(requirements.size, buffer_image_granularity); + auto commit = Commit(requirements, usage); image.BindMemory(commit.Memory(), commit.Offset()); return commit; } |