diff options
author | Pedro J. Estébanez <pedrojrulez@gmail.com> | 2021-08-13 00:02:20 +0200 |
---|---|---|
committer | Pedro J. Estébanez <pedrojrulez@gmail.com> | 2021-08-13 00:05:41 +0200 |
commit | 7b7e17a626392aee0850889e3487b282f0bbc9b6 (patch) | |
tree | aa5b201de2b668679786e6454e9feec955b78377 /drivers | |
parent | 554312a3b2aeb6d4080912064658d755991228d5 (diff) |
Upgrade Vulkan memory allocator
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/vulkan/SCsub | 4 | ||||
-rw-r--r-- | drivers/vulkan/rendering_device_vulkan.cpp | 1 | ||||
-rw-r--r-- | drivers/vulkan/vulkan_context.h | 5 |
3 files changed, 6 insertions, 4 deletions
diff --git a/drivers/vulkan/SCsub b/drivers/vulkan/SCsub index ab45863f5b..8fe75367a8 100644 --- a/drivers/vulkan/SCsub +++ b/drivers/vulkan/SCsub @@ -36,6 +36,10 @@ if env["use_volk"]: thirdparty_sources_volk = [thirdparty_volk_dir + "/volk.c"] env_thirdparty_volk.add_source_files(thirdparty_obj, thirdparty_sources_volk) +elif env["platform"] == "android": + # Our current NDK version only provides old Vulkan headers, + # so we have to limit VMA. + env_thirdparty_vma.AppendUnique(CPPDEFINES=["VMA_VULKAN_VERSION=1000000"]) env_thirdparty_vma.add_source_files(thirdparty_obj, thirdparty_sources_vma) diff --git a/drivers/vulkan/rendering_device_vulkan.cpp b/drivers/vulkan/rendering_device_vulkan.cpp index f6677e2da4..dbe932f74c 100644 --- a/drivers/vulkan/rendering_device_vulkan.cpp +++ b/drivers/vulkan/rendering_device_vulkan.cpp @@ -8794,6 +8794,7 @@ void RenderingDeviceVulkan::initialize(VulkanContext *p_context, bool p_local_de memset(&allocatorInfo, 0, sizeof(VmaAllocatorCreateInfo)); allocatorInfo.physicalDevice = p_context->get_physical_device(); allocatorInfo.device = device; + allocatorInfo.instance = p_context->get_instance(); vmaCreateAllocator(&allocatorInfo, &allocator); } diff --git a/drivers/vulkan/vulkan_context.h b/drivers/vulkan/vulkan_context.h index 1690b853e3..fe09d4c497 100644 --- a/drivers/vulkan/vulkan_context.h +++ b/drivers/vulkan/vulkan_context.h @@ -233,10 +233,6 @@ protected: Error _get_preferred_validation_layers(uint32_t *count, const char *const **names); - VkInstance _get_instance() { - return inst; - } - public: uint32_t get_vulkan_major() const { return vulkan_major; }; uint32_t get_vulkan_minor() const { return vulkan_minor; }; @@ -245,6 +241,7 @@ public: VkDevice get_device(); VkPhysicalDevice get_physical_device(); + VkInstance get_instance() { return inst; } int get_swapchain_image_count() const; uint32_t get_graphics_queue() const; |