Skip to content

Commit

Permalink
Dynamically load vulkan functions?
Browse files Browse the repository at this point in the history
  • Loading branch information
Dextinfire committed Oct 7, 2024
1 parent 7df9283 commit 62550ea
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/renderer/vulkan/utils.cpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
#include "utils.h"

#define VMA_STATIC_VULKAN_FUNCTIONS 0
#define VMA_DYNAMIC_VULKAN_FUNCTIONS 1
#define VMA_IMPLEMENTATION
#include "../../vendor/vma/vk_mem_alloc.h"

Expand All @@ -9,6 +11,10 @@ namespace Vulkan {
void CreateAllocator(VkPhysicalDevice physicalDevice, VkDevice device,
VkInstance instance) {
VmaAllocatorCreateInfo allocatorInfo = {};
VmaVulkanFunctions func = {};
func.vkGetInstanceProcAddr = vkGetInstanceProcAddr;
func.vkGetDeviceProcAddr = vkGetDeviceProcAddr;
allocatorInfo.pVulkanFunctions = &func;
allocatorInfo.physicalDevice = physicalDevice;
allocatorInfo.device = device;
allocatorInfo.instance = instance;
Expand Down

0 comments on commit 62550ea

Please sign in to comment.