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) { }
|
2017-12-11 19:48:00 +01:00
|
|
|
InstanceFn::~InstanceFn() {
|
|
|
|
this->vkDestroyInstance(m_instance, nullptr);
|
|
|
|
}
|
2017-10-10 23:32:13 +02:00
|
|
|
|
|
|
|
|
|
|
|
DeviceFn::DeviceFn(VkInstance instance, VkDevice device)
|
|
|
|
: DeviceLoader(instance, device) { }
|
2017-12-11 19:48:00 +01:00
|
|
|
DeviceFn::~DeviceFn() {
|
|
|
|
this->vkDestroyDevice(m_device, nullptr);
|
|
|
|
}
|
2017-10-10 23:32:13 +02:00
|
|
|
|
|
|
|
}
|