Set VMA version define to limit it to vulkan 1.1.

Bug: b/231953246
Change-Id: Ib2b6ae50bfd13c7aff0e0c656bc61e5f8a6e4345
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/539038
Reviewed-by: Derek Sollenberger <djsollen@google.com>
Commit-Queue: Greg Daniel <egdaniel@google.com>
This commit is contained in:
Greg Daniel 2022-05-10 10:45:16 -04:00 committed by SkCQ
parent 6079423e54
commit 2eddf1a560
2 changed files with 10 additions and 0 deletions

View File

@ -36,6 +36,10 @@ sk_sp<GrVkMemoryAllocator> GrVkAMDMemoryAllocator::Make(VkInstance instance,
#define GR_COPY_FUNCTION_KHR(NAME) functions.vk##NAME##KHR = interface->fFunctions.f##NAME
VmaVulkanFunctions functions;
// We should be setting all the required functions (at least through vulkan 1.1), but this is
// just extra belt and suspenders to make sure there isn't unitialized values here.
memset(&functions, 0, sizeof(VmaVulkanFunctions));
// We don't use dynamic function getting in the allocator so we set the getProc functions to
// null.
functions.vkGetInstanceProcAddr = nullptr;

View File

@ -16,6 +16,12 @@
#ifndef VULKAN_CORE_H_
#error "vulkan_core.h has not been included before trying to include the GrVulkanMemoryAllocator"
#endif
// TODO: We currently lock down our API to Vulkan 1.1. When we update Skia to support 1.3 then we
// can remove this macro. We should also update the setting of the API level in the vma createInfo
// struct when we do this
#define VMA_VULKAN_VERSION 1001000
// 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