diff options
author | Fernando S <fsahmkow27@gmail.com> | 2021-08-08 11:57:40 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-08-08 11:57:40 +0200 |
commit | 859deda3bb1418de434edf75c3bd8cfc32027b5b (patch) | |
tree | 346c5f9542c886af05228ecae617f05da243ec1e /src/video_core/vulkan_common/vulkan_memory_allocator.cpp | |
parent | Merge pull request #6698 from german77/SDL_QoL (diff) | |
parent | vulkan_memory_allocator: Respect bufferImageGranularity (diff) | |
download | yuzu-859deda3bb1418de434edf75c3bd8cfc32027b5b.tar yuzu-859deda3bb1418de434edf75c3bd8cfc32027b5b.tar.gz yuzu-859deda3bb1418de434edf75c3bd8cfc32027b5b.tar.bz2 yuzu-859deda3bb1418de434edf75c3bd8cfc32027b5b.tar.lz yuzu-859deda3bb1418de434edf75c3bd8cfc32027b5b.tar.xz yuzu-859deda3bb1418de434edf75c3bd8cfc32027b5b.tar.zst yuzu-859deda3bb1418de434edf75c3bd8cfc32027b5b.zip |
Diffstat (limited to 'src/video_core/vulkan_common/vulkan_memory_allocator.cpp')
-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; } |