diff options
author | Greg Daniel <egdaniel@google.com> | 2019-04-19 14:48:04 -0400 |
---|---|---|
committer | Skia Commit-Bot <skia-commit-bot@chromium.org> | 2019-04-22 14:36:51 +0000 |
commit | ec62a21fd704efd36ab0f019c00c654ad1cefa68 (patch) | |
tree | 59f56661e457dfb1471a3e63dde1642c95bf5785 | |
parent | 1343576dee215bc9e214a6034dd506756a2b6662 (diff) | |
download | skia-ec62a21fd704efd36ab0f019c00c654ad1cefa68.tar.gz |
Adjust vulkan memory allocation block size knobs to better match the type of draws we do.
We were allocating blocks significantly larger than the amount of memory we actually using
which caused us to end up wasting a lot of unused memory. This brings our allocation
sizes more inline with our uses.
Bug: b/116505627
Change-Id: I1b00670cfdfdb21884a4a203a1c35e183d83dbcf
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/209402
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Greg Daniel <egdaniel@google.com>
(cherry picked from commit 865dc5604dcfd7921b0ce8e273825228e7f2bc1d)
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/209410
-rw-r--r-- | src/gpu/vk/GrVkAMDMemoryAllocator.cpp | 2 | ||||
-rw-r--r-- | src/gpu/vk/GrVkMemory.cpp | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/src/gpu/vk/GrVkAMDMemoryAllocator.cpp b/src/gpu/vk/GrVkAMDMemoryAllocator.cpp index ebecbad431..4ee457f7a9 100644 --- a/src/gpu/vk/GrVkAMDMemoryAllocator.cpp +++ b/src/gpu/vk/GrVkAMDMemoryAllocator.cpp @@ -46,7 +46,7 @@ GrVkAMDMemoryAllocator::GrVkAMDMemoryAllocator(VkPhysicalDevice physicalDevice, // Manually testing runs of dm using 64 here instead of the default 256 shows less memory usage // on average. Also dm seems to run faster using 64 so it doesn't seem to be trading off speed // for memory. - info.preferredLargeHeapBlockSize = 64*1024*1024; + info.preferredLargeHeapBlockSize = 4*1024*1024; info.pAllocationCallbacks = nullptr; info.pDeviceMemoryCallbacks = nullptr; info.frameInUseCount = 0; diff --git a/src/gpu/vk/GrVkMemory.cpp b/src/gpu/vk/GrVkMemory.cpp index 546e8d7f9c..ea6e97ccea 100644 --- a/src/gpu/vk/GrVkMemory.cpp +++ b/src/gpu/vk/GrVkMemory.cpp @@ -84,7 +84,7 @@ void GrVkMemory::FreeBufferMemory(const GrVkGpu* gpu, GrVkBuffer::Type type, } } -const VkDeviceSize kMaxSmallImageSize = 16 * 1024; +const VkDeviceSize kMaxSmallImageSize = 256 * 1024; bool GrVkMemory::AllocAndBindImageMemory(const GrVkGpu* gpu, VkImage image, |