Change init functions of DispatchLoaderDynamic to use a DynamicLoader specified by a template argument. (#503)
This commit is contained in:
committed by
GitHub
parent
d0e3b3a5e1
commit
8c9e881dfe
@@ -1241,18 +1241,24 @@ void VulkanHppGenerator::appendDispatchLoaderDynamic(std::string & str)
|
|||||||
|
|
||||||
#if !defined(VK_NO_PROTOTYPES)
|
#if !defined(VK_NO_PROTOTYPES)
|
||||||
// This interface is designed to be used for per-device function pointers in combination with a linked vulkan library.
|
// This interface is designed to be used for per-device function pointers in combination with a linked vulkan library.
|
||||||
DispatchLoaderDynamic(VULKAN_HPP_NAMESPACE::Instance const& instance, VULKAN_HPP_NAMESPACE::Device const& device) VULKAN_HPP_NOEXCEPT
|
template <typename DynamicLoader>
|
||||||
|
void init(VULKAN_HPP_NAMESPACE::Instance const& instance, VULKAN_HPP_NAMESPACE::Device const& device, DynamicLoader const& dl) VULKAN_HPP_NOEXCEPT
|
||||||
{
|
{
|
||||||
init(instance, device);
|
PFN_vkGetInstanceProcAddr getInstanceProcAddr = dl.template getProcAddress<PFN_vkGetInstanceProcAddr>("vkGetInstanceProcAddr");
|
||||||
|
PFN_vkGetDeviceProcAddr getDeviceProcAddr = dl.template getProcAddress<PFN_vkGetDeviceProcAddr>("vkGetDeviceProcAddr");
|
||||||
|
init(static_cast<VkInstance>(instance), getInstanceProcAddr, static_cast<VkDevice>(device), device ? getDeviceProcAddr : nullptr);
|
||||||
}
|
}
|
||||||
|
|
||||||
// This interface is designed to be used for per-device function pointers in combination with a linked vulkan library.
|
// This interface is designed to be used for per-device function pointers in combination with a linked vulkan library.
|
||||||
|
template <typename DynamicLoader
|
||||||
|
#if VULKAN_HPP_ENABLE_DYNAMIC_LOADER_TOOL
|
||||||
|
= vk::DynamicLoader
|
||||||
|
#endif
|
||||||
|
>
|
||||||
void init(VULKAN_HPP_NAMESPACE::Instance const& instance, VULKAN_HPP_NAMESPACE::Device const& device) VULKAN_HPP_NOEXCEPT
|
void init(VULKAN_HPP_NAMESPACE::Instance const& instance, VULKAN_HPP_NAMESPACE::Device const& device) VULKAN_HPP_NOEXCEPT
|
||||||
{
|
{
|
||||||
static vk::DynamicLoader dl;
|
static DynamicLoader dl;
|
||||||
PFN_vkGetInstanceProcAddr getInstanceProcAddr = dl.getProcAddress<PFN_vkGetInstanceProcAddr>("vkGetInstanceProcAddr");
|
init(instance, device, dl);
|
||||||
PFN_vkGetDeviceProcAddr getDeviceProcAddr = dl.getProcAddress<PFN_vkGetDeviceProcAddr>("vkGetDeviceProcAddr");
|
|
||||||
init(static_cast<VkInstance>(instance), getInstanceProcAddr, static_cast<VkDevice>(device), device ? getDeviceProcAddr : nullptr);
|
|
||||||
}
|
}
|
||||||
#endif // !defined(VK_NO_PROTOTYPES)
|
#endif // !defined(VK_NO_PROTOTYPES)
|
||||||
|
|
||||||
|
|||||||
@@ -68558,18 +68558,24 @@ namespace VULKAN_HPP_NAMESPACE
|
|||||||
|
|
||||||
#if !defined(VK_NO_PROTOTYPES)
|
#if !defined(VK_NO_PROTOTYPES)
|
||||||
// This interface is designed to be used for per-device function pointers in combination with a linked vulkan library.
|
// This interface is designed to be used for per-device function pointers in combination with a linked vulkan library.
|
||||||
DispatchLoaderDynamic(VULKAN_HPP_NAMESPACE::Instance const& instance, VULKAN_HPP_NAMESPACE::Device const& device) VULKAN_HPP_NOEXCEPT
|
template <typename DynamicLoader>
|
||||||
|
void init(VULKAN_HPP_NAMESPACE::Instance const& instance, VULKAN_HPP_NAMESPACE::Device const& device, DynamicLoader const& dl) VULKAN_HPP_NOEXCEPT
|
||||||
{
|
{
|
||||||
init(instance, device);
|
PFN_vkGetInstanceProcAddr getInstanceProcAddr = dl.template getProcAddress<PFN_vkGetInstanceProcAddr>("vkGetInstanceProcAddr");
|
||||||
|
PFN_vkGetDeviceProcAddr getDeviceProcAddr = dl.template getProcAddress<PFN_vkGetDeviceProcAddr>("vkGetDeviceProcAddr");
|
||||||
|
init(static_cast<VkInstance>(instance), getInstanceProcAddr, static_cast<VkDevice>(device), device ? getDeviceProcAddr : nullptr);
|
||||||
}
|
}
|
||||||
|
|
||||||
// This interface is designed to be used for per-device function pointers in combination with a linked vulkan library.
|
// This interface is designed to be used for per-device function pointers in combination with a linked vulkan library.
|
||||||
|
template <typename DynamicLoader
|
||||||
|
#if VULKAN_HPP_ENABLE_DYNAMIC_LOADER_TOOL
|
||||||
|
= vk::DynamicLoader
|
||||||
|
#endif
|
||||||
|
>
|
||||||
void init(VULKAN_HPP_NAMESPACE::Instance const& instance, VULKAN_HPP_NAMESPACE::Device const& device) VULKAN_HPP_NOEXCEPT
|
void init(VULKAN_HPP_NAMESPACE::Instance const& instance, VULKAN_HPP_NAMESPACE::Device const& device) VULKAN_HPP_NOEXCEPT
|
||||||
{
|
{
|
||||||
static vk::DynamicLoader dl;
|
static DynamicLoader dl;
|
||||||
PFN_vkGetInstanceProcAddr getInstanceProcAddr = dl.getProcAddress<PFN_vkGetInstanceProcAddr>("vkGetInstanceProcAddr");
|
init(instance, device, dl);
|
||||||
PFN_vkGetDeviceProcAddr getDeviceProcAddr = dl.getProcAddress<PFN_vkGetDeviceProcAddr>("vkGetDeviceProcAddr");
|
|
||||||
init(static_cast<VkInstance>(instance), getInstanceProcAddr, static_cast<VkDevice>(device), device ? getDeviceProcAddr : nullptr);
|
|
||||||
}
|
}
|
||||||
#endif // !defined(VK_NO_PROTOTYPES)
|
#endif // !defined(VK_NO_PROTOTYPES)
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user