vulkan: fix build on machines without vulkan 1.3

This commit is contained in:
nikeinikei
2022-08-21 02:08:01 +02:00
parent deb2ea9435
commit dfa9b7da34
3 changed files with 16 additions and 9 deletions
+4 -1
View File
@@ -901,7 +901,10 @@ void Graphics::initVMA() {
allocatorCreateInfo.pVulkanFunctions = &vulkanFunctions; allocatorCreateInfo.pVulkanFunctions = &vulkanFunctions;
#else #else
allocatorCreateInfo.pVulkanFunctions = nullptr; VmaVulkanFunctions vulkanFunctions{};
vulkanFunctions.vkGetInstanceProcAddr = &vkGetInstanceProcAddr;
vulkanFunctions.vkGetDeviceProcAddr = &vkGetDeviceProcAddr;
allocatorCreateInfo.pVulkanFunctions = &vulkanFunctions;
#endif #endif
if (vmaCreateAllocator(&allocatorCreateInfo, &vmaAllocator) != VK_SUCCESS) { if (vmaCreateAllocator(&allocatorCreateInfo, &vmaAllocator) != VK_SUCCESS) {
+2
View File
@@ -1,2 +1,4 @@
#include "VulkanWrapper.h"
#define VMA_IMPLEMENTATION #define VMA_IMPLEMENTATION
#include "vk_mem_alloc.h" #include "vk_mem_alloc.h"
@@ -9,6 +9,8 @@
#define VMA_DYNAMIC_VULKAN_FUNCTIONS 0 #define VMA_DYNAMIC_VULKAN_FUNCTIONS 0
#else #else
#include <vulkan/vulkan.h> #include <vulkan/vulkan.h>
#define VMA_STATIC_VULKAN_FUNCTIONS 0
#define VMA_DYNAMIC_VULKAN_FUNCTIONS 1
#endif #endif
#endif //LOVE_GRAPHICS_VULKAN_VULKANWRAPPER_H #endif //LOVE_GRAPHICS_VULKAN_VULKANWRAPPER_H