Add DispatchLoaderDynamic constructor for use with linked vulkan library. (#300)

This commit is contained in:
Andreas Süßenbach 2019-03-13 15:33:33 +01:00 committed by Markus Tavenrath
parent e935e6291e
commit 70c837fba2
2 changed files with 28 additions and 0 deletions

View File

@ -2444,11 +2444,25 @@ void VulkanHppGenerator::writeDispatchLoaderDynamic(std::ostream &os)
public:
DispatchLoaderDynamic() = default;
// This interface is designed to be used for per-device function pointers in combination with a linked vulkan library.
DispatchLoaderDynamic(vk::Instance const& instance, vk::Device const& device = {})
{
init(instance, device);
}
// This interface is designed to be used for per-device function pointers in combination with a linked vulkan library.
void init(vk::Instance const& instance, vk::Device const& device = {})
{
init(instance, ::vkGetInstanceProcAddr, device, device ? ::vkGetDeviceProcAddr : nullptr);
}
// This interface does not require a linked vulkan library.
DispatchLoaderDynamic( VkInstance instance, PFN_vkGetInstanceProcAddr getInstanceProcAddr, VkDevice device = VK_NULL_HANDLE, PFN_vkGetDeviceProcAddr getDeviceProcAddr = nullptr )
{
init( instance, getInstanceProcAddr, device, getDeviceProcAddr );
}
// This interface does not require a linked vulkan library.
void init( VkInstance instance, PFN_vkGetInstanceProcAddr getInstanceProcAddr, VkDevice device = VK_NULL_HANDLE, PFN_vkGetDeviceProcAddr getDeviceProcAddr = nullptr )
{
assert(instance && getInstanceProcAddr);

View File

@ -54998,11 +54998,25 @@ namespace VULKAN_HPP_NAMESPACE
public:
DispatchLoaderDynamic() = default;
// This interface is designed to be used for per-device function pointers in combination with a linked vulkan library.
DispatchLoaderDynamic(vk::Instance const& instance, vk::Device const& device = {})
{
init(instance, device);
}
// This interface is designed to be used for per-device function pointers in combination with a linked vulkan library.
void init(vk::Instance const& instance, vk::Device const& device = {})
{
init(instance, ::vkGetInstanceProcAddr, device, device ? ::vkGetDeviceProcAddr : nullptr);
}
// This interface does not require a linked vulkan library.
DispatchLoaderDynamic( VkInstance instance, PFN_vkGetInstanceProcAddr getInstanceProcAddr, VkDevice device = VK_NULL_HANDLE, PFN_vkGetDeviceProcAddr getDeviceProcAddr = nullptr )
{
init( instance, getInstanceProcAddr, device, getDeviceProcAddr );
}
// This interface does not require a linked vulkan library.
void init( VkInstance instance, PFN_vkGetInstanceProcAddr getInstanceProcAddr, VkDevice device = VK_NULL_HANDLE, PFN_vkGetDeviceProcAddr getDeviceProcAddr = nullptr )
{
assert(instance && getInstanceProcAddr);