Merge pull request #1150 from asuessenbach/fix

Filter out to get vkGetInstanceProcAddr in vk::raii::InstanceDispatcher
This commit is contained in:
Andreas Süßenbach 2021-11-24 12:25:42 +01:00 committed by GitHub
commit 736b33c650
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 12 additions and 8 deletions

View File

@ -1033,13 +1033,18 @@ void VulkanHppGenerator::appendRAIIDispatcherCommands( std::vector<RequireData>
assert( ( commandIt->second.handle == "VkInstance" ) ||
hasParentHandle( commandIt->second.handle, "VkInstance" ) );
ia += " " + commandIt->first + " = PFN_" + commandIt->first + "( vkGetInstanceProcAddr( instance, \"" +
commandIt->first + "\" ) );\n";
// if this is an alias'ed function, use it as a fallback for the original one
if ( !commandIt->second.alias.empty() )
// filter out vkGetInstanceProcAddr, as starting with Vulkan 1.2 it can resolve itself only (!) with an
// instance nullptr !
if ( command != "vkGetInstanceProcAddr" )
{
ia += " if ( !" + commandIt->second.alias + " ) " + commandIt->second.alias + " = " +
commandIt->first + ";\n";
ia += " " + commandIt->first + " = PFN_" + commandIt->first +
"( vkGetInstanceProcAddr( instance, \"" + commandIt->first + "\" ) );\n";
// if this is an alias'ed function, use it as a fallback for the original one
if ( !commandIt->second.alias.empty() )
{
ia += " if ( !" + commandIt->second.alias + " ) " + commandIt->second.alias + " = " +
commandIt->first + ";\n";
}
}
im += +" PFN_" + commandIt->first + " " + commandIt->first + " = 0;\n";

View File

@ -82,8 +82,7 @@ namespace VULKAN_HPP_NAMESPACE
vkGetInstanceProcAddr( instance, "vkGetPhysicalDeviceQueueFamilyProperties" ) );
vkGetPhysicalDeviceMemoryProperties = PFN_vkGetPhysicalDeviceMemoryProperties(
vkGetInstanceProcAddr( instance, "vkGetPhysicalDeviceMemoryProperties" ) );
vkGetInstanceProcAddr = PFN_vkGetInstanceProcAddr( vkGetInstanceProcAddr( instance, "vkGetInstanceProcAddr" ) );
vkCreateDevice = PFN_vkCreateDevice( vkGetInstanceProcAddr( instance, "vkCreateDevice" ) );
vkCreateDevice = PFN_vkCreateDevice( vkGetInstanceProcAddr( instance, "vkCreateDevice" ) );
vkEnumerateDeviceExtensionProperties = PFN_vkEnumerateDeviceExtensionProperties(
vkGetInstanceProcAddr( instance, "vkEnumerateDeviceExtensionProperties" ) );
vkEnumerateDeviceLayerProperties =