Revert "Update VMA to latest version."

This reverts commit f33cf451a2.

Reason for revert: breaking the android roller

Original change's description:
> Update VMA to latest version.
>
> This is needed so that we can use non skia supplied vk_mem_alloc.h on
> clients that have already updated to newest version. As we transition
> to Bazel builds this helps to make it so we can set the rules for
> specific clients around VMA without things breaking
>
> Bug: skia:13211
> Change-Id: I5d38a3a91a44f6b3fdf75894a3248ee3991dd5d9
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/531157
> Reviewed-by: Kevin Lubick <kjlubick@google.com>

Bug: skia:13211
Change-Id: Ibd621aa2f07359f9b72e1a35df0f50ca3c063e86
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/531543
Auto-Submit: Derek Sollenberger <djsollen@google.com>
Commit-Queue: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
This commit is contained in:
Derek Sollenberger 2022-04-19 14:48:53 +00:00 committed by SkCQ
parent 2d8f4c76fa
commit d5c047004d
3 changed files with 19041 additions and 19615 deletions

View File

@ -76,11 +76,12 @@ sk_sp<GrVkMemoryAllocator> GrVkAMDMemoryAllocator::Make(VkInstance instance,
info.preferredLargeHeapBlockSize = 4*1024*1024; info.preferredLargeHeapBlockSize = 4*1024*1024;
info.pAllocationCallbacks = nullptr; info.pAllocationCallbacks = nullptr;
info.pDeviceMemoryCallbacks = nullptr; info.pDeviceMemoryCallbacks = nullptr;
info.frameInUseCount = 0;
info.pHeapSizeLimit = nullptr; info.pHeapSizeLimit = nullptr;
info.pVulkanFunctions = &functions; info.pVulkanFunctions = &functions;
info.pRecordSettings = nullptr;
info.instance = instance; info.instance = instance;
info.vulkanApiVersion = physicalDeviceVersion; info.vulkanApiVersion = physicalDeviceVersion;
info.pTypeExternalMemoryHandleTypes = nullptr;
VmaAllocator allocator; VmaAllocator allocator;
vmaCreateAllocator(&info, &allocator); vmaCreateAllocator(&info, &allocator);
@ -264,15 +265,15 @@ VkResult GrVkAMDMemoryAllocator::invalidateMemory(const GrVkBackendMemory& memor
} }
uint64_t GrVkAMDMemoryAllocator::totalUsedMemory() const { uint64_t GrVkAMDMemoryAllocator::totalUsedMemory() const {
VmaTotalStatistics stats; VmaStats stats;
vmaCalculateStatistics(fAllocator, &stats); vmaCalculateStats(fAllocator, &stats);
return stats.total.statistics.allocationBytes; return stats.total.usedBytes;
} }
uint64_t GrVkAMDMemoryAllocator::totalAllocatedMemory() const { uint64_t GrVkAMDMemoryAllocator::totalAllocatedMemory() const {
VmaTotalStatistics stats; VmaStats stats;
vmaCalculateStatistics(fAllocator, &stats); vmaCalculateStats(fAllocator, &stats);
return stats.total.statistics.blockBytes; return stats.total.usedBytes + stats.total.unusedBytes;
} }
#endif // SK_USE_VMA #endif // SK_USE_VMA

View File

@ -16,19 +16,6 @@
#ifndef VULKAN_CORE_H_ #ifndef VULKAN_CORE_H_
#error "vulkan_core.h has not been included before trying to include the GrVulkanMemoryAllocator" #error "vulkan_core.h has not been included before trying to include the GrVulkanMemoryAllocator"
#endif #endif
// vk_mem_alloc.h checks to see if VULKAN_H_ has been included before trying to include vulkan.h.
// However, some builds of Skia may not have access to vulkan.h and just have access to
// vulkan_core.h. So we pretend we've already included vulkan.h (if it already hasn't been) which
// will be fine for building internal skia files. If we do fake it out by defining VULKAN_H_ we
// need to make sure to undefine it incase outside client code does later try to include the
// real vulkan.h
#ifndef VULKAN_H_
#define VULKAN_H_
#define GR_NEEDED_TO_DEFINE_VULKAN_H
#endif
#include "include/vk_mem_alloc.h" #include "include/vk_mem_alloc.h"
#ifdef GR_NEEDED_TO_DEFINE_VULKAN_H
#undef VULKAN_H_
#endif
#endif #endif

File diff suppressed because it is too large Load Diff