Introduce function release() to all vk::raii::HandleTypes.

This commit is contained in:
asuessenbach 2022-10-25 12:11:29 +02:00
parent ec9ee4ff04
commit d5ad2e1883
4 changed files with 392 additions and 8 deletions

View File

@ -174,11 +174,13 @@ int main( int /*argc*/, char ** /*argv*/ )
vk::DeviceCreateInfo deviceCreateInfo( {}, deviceQueueCreateInfo ); vk::DeviceCreateInfo deviceCreateInfo( {}, deviceQueueCreateInfo );
vk::raii::Device device( physicalDevice, deviceCreateInfo ); vk::raii::Device device( physicalDevice, deviceCreateInfo );
// Create a vk::CommandPool (not a vk::raii::CommandPool, for testing purposes!)
vk::CommandPoolCreateInfo commandPoolCreateInfo( {}, graphicsQueueFamilyIndex ); vk::CommandPoolCreateInfo commandPoolCreateInfo( {}, graphicsQueueFamilyIndex );
vk::CommandPool commandPool = ( *device ).createCommandPool( commandPoolCreateInfo, nullptr, *device.getDispatcher() ); vk::raii::CommandPool commandPool( device, commandPoolCreateInfo );
// The commandPool is not destroyed automatically (as it's not a UniqueCommandPool. // release the CommandPool without destroying it (for testing purposes only!)
vk::CommandPool cp = commandPool.release();
// The commandPool is not destroyed automatically (as it's released from its handle)
// That is, the device is destroyed before the commmand pool and will trigger a validation error. // That is, the device is destroyed before the commmand pool and will trigger a validation error.
std::cout << "*** INTENTIONALLY destroying the Device before destroying a CommandPool ***\n"; std::cout << "*** INTENTIONALLY destroying the Device before destroying a CommandPool ***\n";
std::cout << "*** The following error message is EXPECTED ***\n"; std::cout << "*** The following error message is EXPECTED ***\n";

View File

@ -6220,7 +6220,7 @@ std::string VulkanHppGenerator::generateRAIIHandle( std::pair<std::string, Handl
auto [singularConstructors, arrayConstructors] = generateRAIIHandleConstructors( handle ); auto [singularConstructors, arrayConstructors] = generateRAIIHandleConstructors( handle );
auto [clearMembers, getConstructorSuccessCode, memberVariables, moveConstructorInitializerList, moveAssignmentInstructions, swapMembers] = auto [clearMembers, getConstructorSuccessCode, memberVariables, moveConstructorInitializerList, moveAssignmentInstructions, swapMembers, releaseMembers] =
generateRAIIHandleDetails( handle ); generateRAIIHandleDetails( handle );
std::string declarations = generateRAIIHandleCommandDeclarations( handle, specialFunctions ); std::string declarations = generateRAIIHandleCommandDeclarations( handle, specialFunctions );
@ -6325,6 +6325,11 @@ ${moveAssignmentInstructions}
${clearMembers} ${clearMembers}
} }
VULKAN_HPP_NAMESPACE::${handleType} release()
{
${releaseMembers}
}
${getConstructorSuccessCode} ${getConstructorSuccessCode}
${getParent} ${getParent}
${dispatcherType} const * getDispatcher() const ${dispatcherType} const * getDispatcher() const
@ -6363,6 +6368,7 @@ ${leave})";
{ "moveAssignmentInstructions", moveAssignmentInstructions }, { "moveAssignmentInstructions", moveAssignmentInstructions },
{ "moveConstructorInitializerList", moveConstructorInitializerList }, { "moveConstructorInitializerList", moveConstructorInitializerList },
{ "objTypeEnum", objTypeEnum }, { "objTypeEnum", objTypeEnum },
{ "releaseMembers", releaseMembers },
{ "singularConstructors", singularConstructors }, { "singularConstructors", singularConstructors },
{ "swapMembers", swapMembers } } ); { "swapMembers", swapMembers } } );
@ -8152,7 +8158,7 @@ std::string VulkanHppGenerator::generateRAIIHandleDestructorCallArguments( std::
return arguments; return arguments;
} }
std::tuple<std::string, std::string, std::string, std::string, std::string, std::string> std::tuple<std::string, std::string, std::string, std::string, std::string, std::string, std::string>
VulkanHppGenerator::generateRAIIHandleDetails( std::pair<std::string, HandleData> const & handle ) const VulkanHppGenerator::generateRAIIHandleDetails( std::pair<std::string, HandleData> const & handle ) const
{ {
std::string getConstructorSuccessCode; std::string getConstructorSuccessCode;
@ -8171,7 +8177,7 @@ std::tuple<std::string, std::string, std::string, std::string, std::string, std:
std::string handleName = generateRAIIHandleConstructorParamName( handle.first, handle.second.destructorIt ); std::string handleName = generateRAIIHandleConstructorParamName( handle.first, handle.second.destructorIt );
std::string clearMembers, moveConstructorInitializerList, moveAssignmentInstructions, memberVariables, swapMembers; std::string clearMembers, moveConstructorInitializerList, moveAssignmentInstructions, memberVariables, swapMembers, releaseMembers;
if ( handle.second.destructorIt != m_commands.end() ) if ( handle.second.destructorIt != m_commands.end() )
{ {
@ -8216,6 +8222,10 @@ std::tuple<std::string, std::string, std::string, std::string, std::string, std:
"\n m_" + memberName + " = VULKAN_HPP_NAMESPACE::VULKAN_HPP_RAII_NAMESPACE::exchange( rhs.m_" + memberName + ", {} );"; "\n m_" + memberName + " = VULKAN_HPP_NAMESPACE::VULKAN_HPP_RAII_NAMESPACE::exchange( rhs.m_" + memberName + ", {} );";
memberVariables += "\n " + memberType + " m_" + memberName + " = {};"; memberVariables += "\n " + memberType + " m_" + memberName + " = {};";
swapMembers += "\n std::swap( m_" + memberName + ", rhs.m_" + memberName + " );"; swapMembers += "\n std::swap( m_" + memberName + ", rhs.m_" + memberName + " );";
if ( destructorParam.type.type != handle.first )
{
releaseMembers += "\n m_" + memberName + " = nullptr;";
}
} }
} }
} }
@ -8240,6 +8250,7 @@ std::tuple<std::string, std::string, std::string, std::string, std::string, std:
"\n m_" + frontName + " = VULKAN_HPP_NAMESPACE::VULKAN_HPP_RAII_NAMESPACE::exchange( rhs.m_" + frontName + ", {} );"; "\n m_" + frontName + " = VULKAN_HPP_NAMESPACE::VULKAN_HPP_RAII_NAMESPACE::exchange( rhs.m_" + frontName + ", {} );";
memberVariables = "\n VULKAN_HPP_NAMESPACE::" + stripPrefix( frontType, "Vk" ) + " m_" + frontName + " = {};"; memberVariables = "\n VULKAN_HPP_NAMESPACE::" + stripPrefix( frontType, "Vk" ) + " m_" + frontName + " = {};";
swapMembers = "\n std::swap( m_" + frontName + ", rhs.m_" + frontName + " );"; swapMembers = "\n std::swap( m_" + frontName + ", rhs.m_" + frontName + " );";
releaseMembers += "\n m_" + frontName + " = nullptr;";
} }
clearMembers += "\n m_" + handleName + " = nullptr;"; clearMembers += "\n m_" + handleName + " = nullptr;";
moveConstructorInitializerList += "m_" + handleName + "( VULKAN_HPP_NAMESPACE::VULKAN_HPP_RAII_NAMESPACE::exchange( rhs.m_" + handleName + ", {} ) ), "; moveConstructorInitializerList += "m_" + handleName + "( VULKAN_HPP_NAMESPACE::VULKAN_HPP_RAII_NAMESPACE::exchange( rhs.m_" + handleName + ", {} ) ), ";
@ -8258,6 +8269,7 @@ std::tuple<std::string, std::string, std::string, std::string, std::string, std:
"m_constructorSuccessCode( VULKAN_HPP_NAMESPACE::VULKAN_HPP_RAII_NAMESPACE::exchange( rhs.m_constructorSuccessCode, {} ) ), "; "m_constructorSuccessCode( VULKAN_HPP_NAMESPACE::VULKAN_HPP_RAII_NAMESPACE::exchange( rhs.m_constructorSuccessCode, {} ) ), ";
moveAssignmentInstructions += moveAssignmentInstructions +=
"\n m_constructorSuccessCode = VULKAN_HPP_NAMESPACE::VULKAN_HPP_RAII_NAMESPACE::exchange( rhs.m_constructorSuccessCode, {} );"; "\n m_constructorSuccessCode = VULKAN_HPP_NAMESPACE::VULKAN_HPP_RAII_NAMESPACE::exchange( rhs.m_constructorSuccessCode, {} );";
releaseMembers += "\n m_constructorSuccessCode = VULKAN_HPP_NAMESPACE::Result::eErrorUnknown;";
} }
if ( handle.first == "VkInstance" ) if ( handle.first == "VkInstance" )
@ -8278,6 +8290,8 @@ std::tuple<std::string, std::string, std::string, std::string, std::string, std:
} }
clearMembers += "\n m_dispatcher = nullptr;"; clearMembers += "\n m_dispatcher = nullptr;";
swapMembers += "\n std::swap( m_dispatcher, rhs.m_dispatcher );"; swapMembers += "\n std::swap( m_dispatcher, rhs.m_dispatcher );";
releaseMembers += "\n m_dispatcher = nullptr;";
releaseMembers += "\n return VULKAN_HPP_NAMESPACE::VULKAN_HPP_RAII_NAMESPACE::exchange( m_" + handleName + ", nullptr );";
if ( ( handle.first == "VkInstance" ) || ( handle.first == "VkDevice" ) ) if ( ( handle.first == "VkInstance" ) || ( handle.first == "VkDevice" ) )
{ {
@ -8290,7 +8304,7 @@ std::tuple<std::string, std::string, std::string, std::string, std::string, std:
moveAssignmentInstructions += "\n m_dispatcher = VULKAN_HPP_NAMESPACE::VULKAN_HPP_RAII_NAMESPACE::exchange( rhs.m_dispatcher, nullptr );"; moveAssignmentInstructions += "\n m_dispatcher = VULKAN_HPP_NAMESPACE::VULKAN_HPP_RAII_NAMESPACE::exchange( rhs.m_dispatcher, nullptr );";
} }
return std::make_tuple( clearMembers, getConstructorSuccessCode, memberVariables, moveConstructorInitializerList, moveAssignmentInstructions, swapMembers ); return std::make_tuple( clearMembers, getConstructorSuccessCode, memberVariables, moveConstructorInitializerList, moveAssignmentInstructions, swapMembers, releaseMembers );
} }
std::string VulkanHppGenerator::generateRAIIHandleForwardDeclarations( std::vector<RequireData> const & requireData, std::string const & title ) const std::string VulkanHppGenerator::generateRAIIHandleForwardDeclarations( std::vector<RequireData> const & requireData, std::string const & title ) const

View File

@ -844,7 +844,7 @@ private:
std::string generateRAIIHandleContext( std::pair<std::string, HandleData> const & handle, std::set<std::string> const & specialFunctions ) const; std::string generateRAIIHandleContext( std::pair<std::string, HandleData> const & handle, std::set<std::string> const & specialFunctions ) const;
std::string generateRAIIHandleDestructorCallArguments( std::string const & handleType, std::string generateRAIIHandleDestructorCallArguments( std::string const & handleType,
std::map<std::string, CommandData>::const_iterator destructorIt ) const; std::map<std::string, CommandData>::const_iterator destructorIt ) const;
std::tuple<std::string, std::string, std::string, std::string, std::string, std::string> std::tuple<std::string, std::string, std::string, std::string, std::string, std::string, std::string>
generateRAIIHandleDetails( std::pair<std::string, HandleData> const & handle ) const; generateRAIIHandleDetails( std::pair<std::string, HandleData> const & handle ) const;
std::string generateRAIIHandleForwardDeclarations( std::vector<RequireData> const & requireData, std::string const & title ) const; std::string generateRAIIHandleForwardDeclarations( std::vector<RequireData> const & requireData, std::string const & title ) const;
std::string generateRAIIHandles() const; std::string generateRAIIHandles() const;

View File

@ -2591,6 +2591,13 @@ namespace VULKAN_HPP_NAMESPACE
m_dispatcher = nullptr; m_dispatcher = nullptr;
} }
VULKAN_HPP_NAMESPACE::Instance release()
{
m_allocator = nullptr;
m_dispatcher = nullptr;
return VULKAN_HPP_NAMESPACE::VULKAN_HPP_RAII_NAMESPACE::exchange( m_instance, nullptr );
}
VULKAN_HPP_NAMESPACE::VULKAN_HPP_RAII_NAMESPACE::InstanceDispatcher const * getDispatcher() const VULKAN_HPP_NAMESPACE::VULKAN_HPP_RAII_NAMESPACE::InstanceDispatcher const * getDispatcher() const
{ {
VULKAN_HPP_ASSERT( m_dispatcher->getVkHeaderVersion() == VK_HEADER_VERSION ); VULKAN_HPP_ASSERT( m_dispatcher->getVkHeaderVersion() == VK_HEADER_VERSION );
@ -2820,6 +2827,12 @@ namespace VULKAN_HPP_NAMESPACE
m_dispatcher = nullptr; m_dispatcher = nullptr;
} }
VULKAN_HPP_NAMESPACE::PhysicalDevice release()
{
m_dispatcher = nullptr;
return VULKAN_HPP_NAMESPACE::VULKAN_HPP_RAII_NAMESPACE::exchange( m_physicalDevice, nullptr );
}
VULKAN_HPP_NAMESPACE::VULKAN_HPP_RAII_NAMESPACE::InstanceDispatcher const * getDispatcher() const VULKAN_HPP_NAMESPACE::VULKAN_HPP_RAII_NAMESPACE::InstanceDispatcher const * getDispatcher() const
{ {
VULKAN_HPP_ASSERT( m_dispatcher->getVkHeaderVersion() == VK_HEADER_VERSION ); VULKAN_HPP_ASSERT( m_dispatcher->getVkHeaderVersion() == VK_HEADER_VERSION );
@ -3281,6 +3294,13 @@ namespace VULKAN_HPP_NAMESPACE
m_dispatcher = nullptr; m_dispatcher = nullptr;
} }
VULKAN_HPP_NAMESPACE::Device release()
{
m_allocator = nullptr;
m_dispatcher = nullptr;
return VULKAN_HPP_NAMESPACE::VULKAN_HPP_RAII_NAMESPACE::exchange( m_device, nullptr );
}
VULKAN_HPP_NAMESPACE::VULKAN_HPP_RAII_NAMESPACE::DeviceDispatcher const * getDispatcher() const VULKAN_HPP_NAMESPACE::VULKAN_HPP_RAII_NAMESPACE::DeviceDispatcher const * getDispatcher() const
{ {
VULKAN_HPP_ASSERT( m_dispatcher->getVkHeaderVersion() == VK_HEADER_VERSION ); VULKAN_HPP_ASSERT( m_dispatcher->getVkHeaderVersion() == VK_HEADER_VERSION );
@ -4130,6 +4150,14 @@ namespace VULKAN_HPP_NAMESPACE
m_dispatcher = nullptr; m_dispatcher = nullptr;
} }
VULKAN_HPP_NAMESPACE::AccelerationStructureKHR release()
{
m_device = nullptr;
m_allocator = nullptr;
m_dispatcher = nullptr;
return VULKAN_HPP_NAMESPACE::VULKAN_HPP_RAII_NAMESPACE::exchange( m_accelerationStructure, nullptr );
}
VULKAN_HPP_NAMESPACE::Device getDevice() const VULKAN_HPP_NAMESPACE::Device getDevice() const
{ {
return m_device; return m_device;
@ -4243,6 +4271,14 @@ namespace VULKAN_HPP_NAMESPACE
m_dispatcher = nullptr; m_dispatcher = nullptr;
} }
VULKAN_HPP_NAMESPACE::AccelerationStructureNV release()
{
m_device = nullptr;
m_allocator = nullptr;
m_dispatcher = nullptr;
return VULKAN_HPP_NAMESPACE::VULKAN_HPP_RAII_NAMESPACE::exchange( m_accelerationStructure, nullptr );
}
VULKAN_HPP_NAMESPACE::Device getDevice() const VULKAN_HPP_NAMESPACE::Device getDevice() const
{ {
return m_device; return m_device;
@ -4363,6 +4399,14 @@ namespace VULKAN_HPP_NAMESPACE
m_dispatcher = nullptr; m_dispatcher = nullptr;
} }
VULKAN_HPP_NAMESPACE::Buffer release()
{
m_device = nullptr;
m_allocator = nullptr;
m_dispatcher = nullptr;
return VULKAN_HPP_NAMESPACE::VULKAN_HPP_RAII_NAMESPACE::exchange( m_buffer, nullptr );
}
VULKAN_HPP_NAMESPACE::Device getDevice() const VULKAN_HPP_NAMESPACE::Device getDevice() const
{ {
return m_device; return m_device;
@ -4483,6 +4527,14 @@ namespace VULKAN_HPP_NAMESPACE
m_dispatcher = nullptr; m_dispatcher = nullptr;
} }
VULKAN_HPP_NAMESPACE::BufferCollectionFUCHSIA release()
{
m_device = nullptr;
m_allocator = nullptr;
m_dispatcher = nullptr;
return VULKAN_HPP_NAMESPACE::VULKAN_HPP_RAII_NAMESPACE::exchange( m_collection, nullptr );
}
VULKAN_HPP_NAMESPACE::Device getDevice() const VULKAN_HPP_NAMESPACE::Device getDevice() const
{ {
return m_device; return m_device;
@ -4604,6 +4656,14 @@ namespace VULKAN_HPP_NAMESPACE
m_dispatcher = nullptr; m_dispatcher = nullptr;
} }
VULKAN_HPP_NAMESPACE::BufferView release()
{
m_device = nullptr;
m_allocator = nullptr;
m_dispatcher = nullptr;
return VULKAN_HPP_NAMESPACE::VULKAN_HPP_RAII_NAMESPACE::exchange( m_bufferView, nullptr );
}
VULKAN_HPP_NAMESPACE::Device getDevice() const VULKAN_HPP_NAMESPACE::Device getDevice() const
{ {
return m_device; return m_device;
@ -4716,6 +4776,14 @@ namespace VULKAN_HPP_NAMESPACE
m_dispatcher = nullptr; m_dispatcher = nullptr;
} }
VULKAN_HPP_NAMESPACE::CommandPool release()
{
m_device = nullptr;
m_allocator = nullptr;
m_dispatcher = nullptr;
return VULKAN_HPP_NAMESPACE::VULKAN_HPP_RAII_NAMESPACE::exchange( m_commandPool, nullptr );
}
VULKAN_HPP_NAMESPACE::Device getDevice() const VULKAN_HPP_NAMESPACE::Device getDevice() const
{ {
return m_device; return m_device;
@ -4817,6 +4885,14 @@ namespace VULKAN_HPP_NAMESPACE
m_dispatcher = nullptr; m_dispatcher = nullptr;
} }
VULKAN_HPP_NAMESPACE::CommandBuffer release()
{
m_device = nullptr;
m_commandPool = nullptr;
m_dispatcher = nullptr;
return VULKAN_HPP_NAMESPACE::VULKAN_HPP_RAII_NAMESPACE::exchange( m_commandBuffer, nullptr );
}
VULKAN_HPP_NAMESPACE::Device getDevice() const VULKAN_HPP_NAMESPACE::Device getDevice() const
{ {
return m_device; return m_device;
@ -5784,6 +5860,14 @@ namespace VULKAN_HPP_NAMESPACE
m_dispatcher = nullptr; m_dispatcher = nullptr;
} }
VULKAN_HPP_NAMESPACE::CuFunctionNVX release()
{
m_device = nullptr;
m_allocator = nullptr;
m_dispatcher = nullptr;
return VULKAN_HPP_NAMESPACE::VULKAN_HPP_RAII_NAMESPACE::exchange( m_function, nullptr );
}
VULKAN_HPP_NAMESPACE::Device getDevice() const VULKAN_HPP_NAMESPACE::Device getDevice() const
{ {
return m_device; return m_device;
@ -5896,6 +5980,14 @@ namespace VULKAN_HPP_NAMESPACE
m_dispatcher = nullptr; m_dispatcher = nullptr;
} }
VULKAN_HPP_NAMESPACE::CuModuleNVX release()
{
m_device = nullptr;
m_allocator = nullptr;
m_dispatcher = nullptr;
return VULKAN_HPP_NAMESPACE::VULKAN_HPP_RAII_NAMESPACE::exchange( m_module, nullptr );
}
VULKAN_HPP_NAMESPACE::Device getDevice() const VULKAN_HPP_NAMESPACE::Device getDevice() const
{ {
return m_device; return m_device;
@ -6009,6 +6101,14 @@ namespace VULKAN_HPP_NAMESPACE
m_dispatcher = nullptr; m_dispatcher = nullptr;
} }
VULKAN_HPP_NAMESPACE::DebugReportCallbackEXT release()
{
m_instance = nullptr;
m_allocator = nullptr;
m_dispatcher = nullptr;
return VULKAN_HPP_NAMESPACE::VULKAN_HPP_RAII_NAMESPACE::exchange( m_callback, nullptr );
}
VULKAN_HPP_NAMESPACE::Instance getInstance() const VULKAN_HPP_NAMESPACE::Instance getInstance() const
{ {
return m_instance; return m_instance;
@ -6122,6 +6222,14 @@ namespace VULKAN_HPP_NAMESPACE
m_dispatcher = nullptr; m_dispatcher = nullptr;
} }
VULKAN_HPP_NAMESPACE::DebugUtilsMessengerEXT release()
{
m_instance = nullptr;
m_allocator = nullptr;
m_dispatcher = nullptr;
return VULKAN_HPP_NAMESPACE::VULKAN_HPP_RAII_NAMESPACE::exchange( m_messenger, nullptr );
}
VULKAN_HPP_NAMESPACE::Instance getInstance() const VULKAN_HPP_NAMESPACE::Instance getInstance() const
{ {
return m_instance; return m_instance;
@ -6233,6 +6341,14 @@ namespace VULKAN_HPP_NAMESPACE
m_dispatcher = nullptr; m_dispatcher = nullptr;
} }
VULKAN_HPP_NAMESPACE::DeferredOperationKHR release()
{
m_device = nullptr;
m_allocator = nullptr;
m_dispatcher = nullptr;
return VULKAN_HPP_NAMESPACE::VULKAN_HPP_RAII_NAMESPACE::exchange( m_operation, nullptr );
}
VULKAN_HPP_NAMESPACE::Device getDevice() const VULKAN_HPP_NAMESPACE::Device getDevice() const
{ {
return m_device; return m_device;
@ -6354,6 +6470,14 @@ namespace VULKAN_HPP_NAMESPACE
m_dispatcher = nullptr; m_dispatcher = nullptr;
} }
VULKAN_HPP_NAMESPACE::DescriptorPool release()
{
m_device = nullptr;
m_allocator = nullptr;
m_dispatcher = nullptr;
return VULKAN_HPP_NAMESPACE::VULKAN_HPP_RAII_NAMESPACE::exchange( m_descriptorPool, nullptr );
}
VULKAN_HPP_NAMESPACE::Device getDevice() const VULKAN_HPP_NAMESPACE::Device getDevice() const
{ {
return m_device; return m_device;
@ -6449,6 +6573,14 @@ namespace VULKAN_HPP_NAMESPACE
m_dispatcher = nullptr; m_dispatcher = nullptr;
} }
VULKAN_HPP_NAMESPACE::DescriptorSet release()
{
m_device = nullptr;
m_descriptorPool = nullptr;
m_dispatcher = nullptr;
return VULKAN_HPP_NAMESPACE::VULKAN_HPP_RAII_NAMESPACE::exchange( m_descriptorSet, nullptr );
}
VULKAN_HPP_NAMESPACE::Device getDevice() const VULKAN_HPP_NAMESPACE::Device getDevice() const
{ {
return m_device; return m_device;
@ -6609,6 +6741,14 @@ namespace VULKAN_HPP_NAMESPACE
m_dispatcher = nullptr; m_dispatcher = nullptr;
} }
VULKAN_HPP_NAMESPACE::DescriptorSetLayout release()
{
m_device = nullptr;
m_allocator = nullptr;
m_dispatcher = nullptr;
return VULKAN_HPP_NAMESPACE::VULKAN_HPP_RAII_NAMESPACE::exchange( m_descriptorSetLayout, nullptr );
}
VULKAN_HPP_NAMESPACE::Device getDevice() const VULKAN_HPP_NAMESPACE::Device getDevice() const
{ {
return m_device; return m_device;
@ -6722,6 +6862,14 @@ namespace VULKAN_HPP_NAMESPACE
m_dispatcher = nullptr; m_dispatcher = nullptr;
} }
VULKAN_HPP_NAMESPACE::DescriptorUpdateTemplate release()
{
m_device = nullptr;
m_allocator = nullptr;
m_dispatcher = nullptr;
return VULKAN_HPP_NAMESPACE::VULKAN_HPP_RAII_NAMESPACE::exchange( m_descriptorUpdateTemplate, nullptr );
}
VULKAN_HPP_NAMESPACE::Device getDevice() const VULKAN_HPP_NAMESPACE::Device getDevice() const
{ {
return m_device; return m_device;
@ -6834,6 +6982,14 @@ namespace VULKAN_HPP_NAMESPACE
m_dispatcher = nullptr; m_dispatcher = nullptr;
} }
VULKAN_HPP_NAMESPACE::DeviceMemory release()
{
m_device = nullptr;
m_allocator = nullptr;
m_dispatcher = nullptr;
return VULKAN_HPP_NAMESPACE::VULKAN_HPP_RAII_NAMESPACE::exchange( m_memory, nullptr );
}
VULKAN_HPP_NAMESPACE::Device getDevice() const VULKAN_HPP_NAMESPACE::Device getDevice() const
{ {
return m_device; return m_device;
@ -6976,6 +7132,13 @@ namespace VULKAN_HPP_NAMESPACE
m_dispatcher = nullptr; m_dispatcher = nullptr;
} }
VULKAN_HPP_NAMESPACE::DisplayKHR release()
{
m_physicalDevice = nullptr;
m_dispatcher = nullptr;
return VULKAN_HPP_NAMESPACE::VULKAN_HPP_RAII_NAMESPACE::exchange( m_display, nullptr );
}
VULKAN_HPP_NAMESPACE::PhysicalDevice getPhysicalDevice() const VULKAN_HPP_NAMESPACE::PhysicalDevice getPhysicalDevice() const
{ {
return m_physicalDevice; return m_physicalDevice;
@ -7138,6 +7301,13 @@ namespace VULKAN_HPP_NAMESPACE
m_dispatcher = nullptr; m_dispatcher = nullptr;
} }
VULKAN_HPP_NAMESPACE::DisplayModeKHR release()
{
m_physicalDevice = nullptr;
m_dispatcher = nullptr;
return VULKAN_HPP_NAMESPACE::VULKAN_HPP_RAII_NAMESPACE::exchange( m_displayModeKHR, nullptr );
}
VULKAN_HPP_NAMESPACE::VULKAN_HPP_RAII_NAMESPACE::InstanceDispatcher const * getDispatcher() const VULKAN_HPP_NAMESPACE::VULKAN_HPP_RAII_NAMESPACE::InstanceDispatcher const * getDispatcher() const
{ {
VULKAN_HPP_ASSERT( m_dispatcher->getVkHeaderVersion() == VK_HEADER_VERSION ); VULKAN_HPP_ASSERT( m_dispatcher->getVkHeaderVersion() == VK_HEADER_VERSION );
@ -7247,6 +7417,14 @@ namespace VULKAN_HPP_NAMESPACE
m_dispatcher = nullptr; m_dispatcher = nullptr;
} }
VULKAN_HPP_NAMESPACE::Event release()
{
m_device = nullptr;
m_allocator = nullptr;
m_dispatcher = nullptr;
return VULKAN_HPP_NAMESPACE::VULKAN_HPP_RAII_NAMESPACE::exchange( m_event, nullptr );
}
VULKAN_HPP_NAMESPACE::Device getDevice() const VULKAN_HPP_NAMESPACE::Device getDevice() const
{ {
return m_device; return m_device;
@ -7405,6 +7583,14 @@ namespace VULKAN_HPP_NAMESPACE
m_dispatcher = nullptr; m_dispatcher = nullptr;
} }
VULKAN_HPP_NAMESPACE::Fence release()
{
m_device = nullptr;
m_allocator = nullptr;
m_dispatcher = nullptr;
return VULKAN_HPP_NAMESPACE::VULKAN_HPP_RAII_NAMESPACE::exchange( m_fence, nullptr );
}
VULKAN_HPP_NAMESPACE::Device getDevice() const VULKAN_HPP_NAMESPACE::Device getDevice() const
{ {
return m_device; return m_device;
@ -7521,6 +7707,14 @@ namespace VULKAN_HPP_NAMESPACE
m_dispatcher = nullptr; m_dispatcher = nullptr;
} }
VULKAN_HPP_NAMESPACE::Framebuffer release()
{
m_device = nullptr;
m_allocator = nullptr;
m_dispatcher = nullptr;
return VULKAN_HPP_NAMESPACE::VULKAN_HPP_RAII_NAMESPACE::exchange( m_framebuffer, nullptr );
}
VULKAN_HPP_NAMESPACE::Device getDevice() const VULKAN_HPP_NAMESPACE::Device getDevice() const
{ {
return m_device; return m_device;
@ -7637,6 +7831,14 @@ namespace VULKAN_HPP_NAMESPACE
m_dispatcher = nullptr; m_dispatcher = nullptr;
} }
VULKAN_HPP_NAMESPACE::Image release()
{
m_device = nullptr;
m_allocator = nullptr;
m_dispatcher = nullptr;
return VULKAN_HPP_NAMESPACE::VULKAN_HPP_RAII_NAMESPACE::exchange( m_image, nullptr );
}
VULKAN_HPP_NAMESPACE::Device getDevice() const VULKAN_HPP_NAMESPACE::Device getDevice() const
{ {
return m_device; return m_device;
@ -7773,6 +7975,14 @@ namespace VULKAN_HPP_NAMESPACE
m_dispatcher = nullptr; m_dispatcher = nullptr;
} }
VULKAN_HPP_NAMESPACE::ImageView release()
{
m_device = nullptr;
m_allocator = nullptr;
m_dispatcher = nullptr;
return VULKAN_HPP_NAMESPACE::VULKAN_HPP_RAII_NAMESPACE::exchange( m_imageView, nullptr );
}
VULKAN_HPP_NAMESPACE::Device getDevice() const VULKAN_HPP_NAMESPACE::Device getDevice() const
{ {
return m_device; return m_device;
@ -7890,6 +8100,14 @@ namespace VULKAN_HPP_NAMESPACE
m_dispatcher = nullptr; m_dispatcher = nullptr;
} }
VULKAN_HPP_NAMESPACE::IndirectCommandsLayoutNV release()
{
m_device = nullptr;
m_allocator = nullptr;
m_dispatcher = nullptr;
return VULKAN_HPP_NAMESPACE::VULKAN_HPP_RAII_NAMESPACE::exchange( m_indirectCommandsLayout, nullptr );
}
VULKAN_HPP_NAMESPACE::Device getDevice() const VULKAN_HPP_NAMESPACE::Device getDevice() const
{ {
return m_device; return m_device;
@ -8002,6 +8220,14 @@ namespace VULKAN_HPP_NAMESPACE
m_dispatcher = nullptr; m_dispatcher = nullptr;
} }
VULKAN_HPP_NAMESPACE::MicromapEXT release()
{
m_device = nullptr;
m_allocator = nullptr;
m_dispatcher = nullptr;
return VULKAN_HPP_NAMESPACE::VULKAN_HPP_RAII_NAMESPACE::exchange( m_micromap, nullptr );
}
VULKAN_HPP_NAMESPACE::Device getDevice() const VULKAN_HPP_NAMESPACE::Device getDevice() const
{ {
return m_device; return m_device;
@ -8115,6 +8341,14 @@ namespace VULKAN_HPP_NAMESPACE
m_dispatcher = nullptr; m_dispatcher = nullptr;
} }
VULKAN_HPP_NAMESPACE::OpticalFlowSessionNV release()
{
m_device = nullptr;
m_allocator = nullptr;
m_dispatcher = nullptr;
return VULKAN_HPP_NAMESPACE::VULKAN_HPP_RAII_NAMESPACE::exchange( m_session, nullptr );
}
VULKAN_HPP_NAMESPACE::Device getDevice() const VULKAN_HPP_NAMESPACE::Device getDevice() const
{ {
return m_device; return m_device;
@ -8221,6 +8455,13 @@ namespace VULKAN_HPP_NAMESPACE
m_dispatcher = nullptr; m_dispatcher = nullptr;
} }
VULKAN_HPP_NAMESPACE::PerformanceConfigurationINTEL release()
{
m_device = nullptr;
m_dispatcher = nullptr;
return VULKAN_HPP_NAMESPACE::VULKAN_HPP_RAII_NAMESPACE::exchange( m_configuration, nullptr );
}
VULKAN_HPP_NAMESPACE::Device getDevice() const VULKAN_HPP_NAMESPACE::Device getDevice() const
{ {
return m_device; return m_device;
@ -8332,6 +8573,14 @@ namespace VULKAN_HPP_NAMESPACE
m_dispatcher = nullptr; m_dispatcher = nullptr;
} }
VULKAN_HPP_NAMESPACE::PipelineCache release()
{
m_device = nullptr;
m_allocator = nullptr;
m_dispatcher = nullptr;
return VULKAN_HPP_NAMESPACE::VULKAN_HPP_RAII_NAMESPACE::exchange( m_pipelineCache, nullptr );
}
VULKAN_HPP_NAMESPACE::Device getDevice() const VULKAN_HPP_NAMESPACE::Device getDevice() const
{ {
return m_device; return m_device;
@ -8529,6 +8778,15 @@ namespace VULKAN_HPP_NAMESPACE
m_dispatcher = nullptr; m_dispatcher = nullptr;
} }
VULKAN_HPP_NAMESPACE::Pipeline release()
{
m_device = nullptr;
m_allocator = nullptr;
m_constructorSuccessCode = VULKAN_HPP_NAMESPACE::Result::eErrorUnknown;
m_dispatcher = nullptr;
return VULKAN_HPP_NAMESPACE::VULKAN_HPP_RAII_NAMESPACE::exchange( m_pipeline, nullptr );
}
VULKAN_HPP_NAMESPACE::Result getConstructorSuccessCode() const VULKAN_HPP_NAMESPACE::Result getConstructorSuccessCode() const
{ {
return m_constructorSuccessCode; return m_constructorSuccessCode;
@ -8809,6 +9067,14 @@ namespace VULKAN_HPP_NAMESPACE
m_dispatcher = nullptr; m_dispatcher = nullptr;
} }
VULKAN_HPP_NAMESPACE::PipelineLayout release()
{
m_device = nullptr;
m_allocator = nullptr;
m_dispatcher = nullptr;
return VULKAN_HPP_NAMESPACE::VULKAN_HPP_RAII_NAMESPACE::exchange( m_pipelineLayout, nullptr );
}
VULKAN_HPP_NAMESPACE::Device getDevice() const VULKAN_HPP_NAMESPACE::Device getDevice() const
{ {
return m_device; return m_device;
@ -8922,6 +9188,14 @@ namespace VULKAN_HPP_NAMESPACE
m_dispatcher = nullptr; m_dispatcher = nullptr;
} }
VULKAN_HPP_NAMESPACE::PrivateDataSlot release()
{
m_device = nullptr;
m_allocator = nullptr;
m_dispatcher = nullptr;
return VULKAN_HPP_NAMESPACE::VULKAN_HPP_RAII_NAMESPACE::exchange( m_privateDataSlot, nullptr );
}
VULKAN_HPP_NAMESPACE::Device getDevice() const VULKAN_HPP_NAMESPACE::Device getDevice() const
{ {
return m_device; return m_device;
@ -9034,6 +9308,14 @@ namespace VULKAN_HPP_NAMESPACE
m_dispatcher = nullptr; m_dispatcher = nullptr;
} }
VULKAN_HPP_NAMESPACE::QueryPool release()
{
m_device = nullptr;
m_allocator = nullptr;
m_dispatcher = nullptr;
return VULKAN_HPP_NAMESPACE::VULKAN_HPP_RAII_NAMESPACE::exchange( m_queryPool, nullptr );
}
VULKAN_HPP_NAMESPACE::Device getDevice() const VULKAN_HPP_NAMESPACE::Device getDevice() const
{ {
return m_device; return m_device;
@ -9153,6 +9435,12 @@ namespace VULKAN_HPP_NAMESPACE
m_dispatcher = nullptr; m_dispatcher = nullptr;
} }
VULKAN_HPP_NAMESPACE::Queue release()
{
m_dispatcher = nullptr;
return VULKAN_HPP_NAMESPACE::VULKAN_HPP_RAII_NAMESPACE::exchange( m_queue, nullptr );
}
VULKAN_HPP_NAMESPACE::VULKAN_HPP_RAII_NAMESPACE::DeviceDispatcher const * getDispatcher() const VULKAN_HPP_NAMESPACE::VULKAN_HPP_RAII_NAMESPACE::DeviceDispatcher const * getDispatcher() const
{ {
VULKAN_HPP_ASSERT( m_dispatcher->getVkHeaderVersion() == VK_HEADER_VERSION ); VULKAN_HPP_ASSERT( m_dispatcher->getVkHeaderVersion() == VK_HEADER_VERSION );
@ -9316,6 +9604,14 @@ namespace VULKAN_HPP_NAMESPACE
m_dispatcher = nullptr; m_dispatcher = nullptr;
} }
VULKAN_HPP_NAMESPACE::RenderPass release()
{
m_device = nullptr;
m_allocator = nullptr;
m_dispatcher = nullptr;
return VULKAN_HPP_NAMESPACE::VULKAN_HPP_RAII_NAMESPACE::exchange( m_renderPass, nullptr );
}
VULKAN_HPP_NAMESPACE::Device getDevice() const VULKAN_HPP_NAMESPACE::Device getDevice() const
{ {
return m_device; return m_device;
@ -9436,6 +9732,14 @@ namespace VULKAN_HPP_NAMESPACE
m_dispatcher = nullptr; m_dispatcher = nullptr;
} }
VULKAN_HPP_NAMESPACE::Sampler release()
{
m_device = nullptr;
m_allocator = nullptr;
m_dispatcher = nullptr;
return VULKAN_HPP_NAMESPACE::VULKAN_HPP_RAII_NAMESPACE::exchange( m_sampler, nullptr );
}
VULKAN_HPP_NAMESPACE::Device getDevice() const VULKAN_HPP_NAMESPACE::Device getDevice() const
{ {
return m_device; return m_device;
@ -9549,6 +9853,14 @@ namespace VULKAN_HPP_NAMESPACE
m_dispatcher = nullptr; m_dispatcher = nullptr;
} }
VULKAN_HPP_NAMESPACE::SamplerYcbcrConversion release()
{
m_device = nullptr;
m_allocator = nullptr;
m_dispatcher = nullptr;
return VULKAN_HPP_NAMESPACE::VULKAN_HPP_RAII_NAMESPACE::exchange( m_ycbcrConversion, nullptr );
}
VULKAN_HPP_NAMESPACE::Device getDevice() const VULKAN_HPP_NAMESPACE::Device getDevice() const
{ {
return m_device; return m_device;
@ -9661,6 +9973,14 @@ namespace VULKAN_HPP_NAMESPACE
m_dispatcher = nullptr; m_dispatcher = nullptr;
} }
VULKAN_HPP_NAMESPACE::Semaphore release()
{
m_device = nullptr;
m_allocator = nullptr;
m_dispatcher = nullptr;
return VULKAN_HPP_NAMESPACE::VULKAN_HPP_RAII_NAMESPACE::exchange( m_semaphore, nullptr );
}
VULKAN_HPP_NAMESPACE::Device getDevice() const VULKAN_HPP_NAMESPACE::Device getDevice() const
{ {
return m_device; return m_device;
@ -9781,6 +10101,14 @@ namespace VULKAN_HPP_NAMESPACE
m_dispatcher = nullptr; m_dispatcher = nullptr;
} }
VULKAN_HPP_NAMESPACE::ShaderModule release()
{
m_device = nullptr;
m_allocator = nullptr;
m_dispatcher = nullptr;
return VULKAN_HPP_NAMESPACE::VULKAN_HPP_RAII_NAMESPACE::exchange( m_shaderModule, nullptr );
}
VULKAN_HPP_NAMESPACE::Device getDevice() const VULKAN_HPP_NAMESPACE::Device getDevice() const
{ {
return m_device; return m_device;
@ -10175,6 +10503,14 @@ namespace VULKAN_HPP_NAMESPACE
m_dispatcher = nullptr; m_dispatcher = nullptr;
} }
VULKAN_HPP_NAMESPACE::SurfaceKHR release()
{
m_instance = nullptr;
m_allocator = nullptr;
m_dispatcher = nullptr;
return VULKAN_HPP_NAMESPACE::VULKAN_HPP_RAII_NAMESPACE::exchange( m_surface, nullptr );
}
VULKAN_HPP_NAMESPACE::Instance getInstance() const VULKAN_HPP_NAMESPACE::Instance getInstance() const
{ {
return m_instance; return m_instance;
@ -10287,6 +10623,14 @@ namespace VULKAN_HPP_NAMESPACE
m_dispatcher = nullptr; m_dispatcher = nullptr;
} }
VULKAN_HPP_NAMESPACE::SwapchainKHR release()
{
m_device = nullptr;
m_allocator = nullptr;
m_dispatcher = nullptr;
return VULKAN_HPP_NAMESPACE::VULKAN_HPP_RAII_NAMESPACE::exchange( m_swapchain, nullptr );
}
VULKAN_HPP_NAMESPACE::Device getDevice() const VULKAN_HPP_NAMESPACE::Device getDevice() const
{ {
return m_device; return m_device;
@ -10477,6 +10821,14 @@ namespace VULKAN_HPP_NAMESPACE
m_dispatcher = nullptr; m_dispatcher = nullptr;
} }
VULKAN_HPP_NAMESPACE::ValidationCacheEXT release()
{
m_device = nullptr;
m_allocator = nullptr;
m_dispatcher = nullptr;
return VULKAN_HPP_NAMESPACE::VULKAN_HPP_RAII_NAMESPACE::exchange( m_validationCache, nullptr );
}
VULKAN_HPP_NAMESPACE::Device getDevice() const VULKAN_HPP_NAMESPACE::Device getDevice() const
{ {
return m_device; return m_device;
@ -10597,6 +10949,14 @@ namespace VULKAN_HPP_NAMESPACE
m_dispatcher = nullptr; m_dispatcher = nullptr;
} }
VULKAN_HPP_NAMESPACE::VideoSessionKHR release()
{
m_device = nullptr;
m_allocator = nullptr;
m_dispatcher = nullptr;
return VULKAN_HPP_NAMESPACE::VULKAN_HPP_RAII_NAMESPACE::exchange( m_videoSession, nullptr );
}
VULKAN_HPP_NAMESPACE::Device getDevice() const VULKAN_HPP_NAMESPACE::Device getDevice() const
{ {
return m_device; return m_device;
@ -10718,6 +11078,14 @@ namespace VULKAN_HPP_NAMESPACE
m_dispatcher = nullptr; m_dispatcher = nullptr;
} }
VULKAN_HPP_NAMESPACE::VideoSessionParametersKHR release()
{
m_device = nullptr;
m_allocator = nullptr;
m_dispatcher = nullptr;
return VULKAN_HPP_NAMESPACE::VULKAN_HPP_RAII_NAMESPACE::exchange( m_videoSessionParameters, nullptr );
}
VULKAN_HPP_NAMESPACE::Device getDevice() const VULKAN_HPP_NAMESPACE::Device getDevice() const
{ {
return m_device; return m_device;