diff options
author | lat9nq <22451773+lat9nq@users.noreply.github.com> | 2023-06-18 10:59:12 +0200 |
---|---|---|
committer | GPUCode <geoster3d@gmail.com> | 2023-06-18 11:45:12 +0200 |
commit | 6448eade2ef126a88068cde66b77e7788c3fab08 (patch) | |
tree | ac7ff6d8d31defedca403be72068dcdfb07e48ff /src/video_core/vulkan_common/vulkan_device.cpp | |
parent | Merge pull request #10797 from lat9nq/tzdb-patch (diff) | |
download | yuzu-6448eade2ef126a88068cde66b77e7788c3fab08.tar yuzu-6448eade2ef126a88068cde66b77e7788c3fab08.tar.gz yuzu-6448eade2ef126a88068cde66b77e7788c3fab08.tar.bz2 yuzu-6448eade2ef126a88068cde66b77e7788c3fab08.tar.lz yuzu-6448eade2ef126a88068cde66b77e7788c3fab08.tar.xz yuzu-6448eade2ef126a88068cde66b77e7788c3fab08.tar.zst yuzu-6448eade2ef126a88068cde66b77e7788c3fab08.zip |
Diffstat (limited to 'src/video_core/vulkan_common/vulkan_device.cpp')
-rw-r--r-- | src/video_core/vulkan_common/vulkan_device.cpp | 23 |
1 files changed, 22 insertions, 1 deletions
diff --git a/src/video_core/vulkan_common/vulkan_device.cpp b/src/video_core/vulkan_common/vulkan_device.cpp index 3d2e9a16a..631d5e378 100644 --- a/src/video_core/vulkan_common/vulkan_device.cpp +++ b/src/video_core/vulkan_common/vulkan_device.cpp @@ -22,6 +22,10 @@ #include <adrenotools/bcenabler.h> #endif +#define VMA_STATIC_VULKAN_FUNCTIONS 0 +#define VMA_DYNAMIC_VULKAN_FUNCTIONS 1 +#include <vk_mem_alloc.h> + namespace Vulkan { using namespace Common::Literals; namespace { @@ -592,9 +596,26 @@ Device::Device(VkInstance instance_, vk::PhysicalDevice physical_, VkSurfaceKHR graphics_queue = logical.GetQueue(graphics_family); present_queue = logical.GetQueue(present_family); + + const VmaVulkanFunctions functions = { + .vkGetInstanceProcAddr = dld.vkGetInstanceProcAddr, + .vkGetDeviceProcAddr = dld.vkGetDeviceProcAddr, + }; + + const VmaAllocatorCreateInfo allocator_info = { + .physicalDevice = physical, + .device = *logical, + .pVulkanFunctions = &functions, + .instance = instance, + .vulkanApiVersion = VK_API_VERSION_1_1, + }; + + vk::Check(vmaCreateAllocator(&allocator_info, &allocator)); } -Device::~Device() = default; +Device::~Device() { + vmaDestroyAllocator(allocator); +} VkFormat Device::GetSupportedFormat(VkFormat wanted_format, VkFormatFeatureFlags wanted_usage, FormatType format_type) const { |