Update comment on vulkan allocator.
Change-Id: I70991d5727172f72a61f073d0cd684da6ca43780
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/209413
Commit-Queue: Greg Daniel <egdaniel@google.com>
Commit-Queue: Mike Klein <mtklein@google.com>
Auto-Submit: Greg Daniel <egdaniel@google.com>
Reviewed-by: Mike Klein <mtklein@google.com>
diff --git a/src/gpu/vk/GrVkAMDMemoryAllocator.cpp b/src/gpu/vk/GrVkAMDMemoryAllocator.cpp
index 4ee457f..db93e4f 100644
--- a/src/gpu/vk/GrVkAMDMemoryAllocator.cpp
+++ b/src/gpu/vk/GrVkAMDMemoryAllocator.cpp
@@ -43,9 +43,10 @@
info.flags = 0;
info.physicalDevice = physicalDevice;
info.device = device;
- // 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.
+ // 4MB was picked for the size here by looking at memory usage of Android apps and runs of DM.
+ // It seems to be a good compromise of not wasting unused allocated space and not making too
+ // many small allocations. The AMD allocator will start making blocks at 1/8 the max size and
+ // builds up block size as needed before capping at the max set here.
info.preferredLargeHeapBlockSize = 4*1024*1024;
info.pAllocationCallbacks = nullptr;
info.pDeviceMemoryCallbacks = nullptr;