1
0
mirror of https://github.com/doitsujin/dxvk.git synced 2025-01-31 14:52:11 +01:00
dxvk/src/dxvk/vulkan/dxvk_vulkan_loader.cpp

47 lines
1.1 KiB
C++
Raw Normal View History

2017-10-10 23:32:13 +02:00
#include "dxvk_vulkan_loader.h"
namespace dxvk::vk {
PFN_vkVoidFunction LibraryLoader::sym(const char* name) const {
return ::vkGetInstanceProcAddr(nullptr, name);
}
InstanceLoader::InstanceLoader(VkInstance instance)
: m_instance(instance) { }
PFN_vkVoidFunction InstanceLoader::sym(const char* name) const {
return ::vkGetInstanceProcAddr(m_instance, name);
}
DeviceLoader::DeviceLoader(VkInstance instance, VkDevice device)
: m_getDeviceProcAddr(reinterpret_cast<PFN_vkGetDeviceProcAddr>(
::vkGetInstanceProcAddr(instance, "vkGetDeviceProcAddr"))),
m_device(device) { }
PFN_vkVoidFunction DeviceLoader::sym(const char* name) const {
return m_getDeviceProcAddr(m_device, name);
}
LibraryFn::LibraryFn() { }
LibraryFn::~LibraryFn() { }
InstanceFn::InstanceFn(VkInstance instance)
: InstanceLoader(instance) { }
InstanceFn::~InstanceFn() {
this->vkDestroyInstance(m_instance, nullptr);
}
2017-10-10 23:32:13 +02:00
DeviceFn::DeviceFn(VkInstance instance, VkDevice device)
: DeviceLoader(instance, device) { }
DeviceFn::~DeviceFn() {
this->vkDestroyDevice(m_device, nullptr);
}
2017-10-10 23:32:13 +02:00
}