From dc4777a206eb6730cfc9aee8c011d27c1d5b2e43 Mon Sep 17 00:00:00 2001 From: asuessenbach Date: Wed, 21 Oct 2020 10:06:25 +0200 Subject: [PATCH] Refactor commands that enumerate handles (no unique versions) --- VulkanHppGenerator.cpp | 120 +++++++++++++++------------- vulkan/vulkan.hpp | 177 ++++++++++++++++++++++------------------- 2 files changed, 158 insertions(+), 139 deletions(-) diff --git a/VulkanHppGenerator.cpp b/VulkanHppGenerator.cpp index 3d1c336..dd3c7cd 100644 --- a/VulkanHppGenerator.cpp +++ b/VulkanHppGenerator.cpp @@ -1161,36 +1161,22 @@ void VulkanHppGenerator::appendCommand( std::string & str, break; case 1: // one return parameter + if ( isHandleType( commandData.params[nonConstPointerParamIndices[0]].type.type ) ) { + // get handle(s) auto returnVectorParamIt = vectorParamIndices.find( nonConstPointerParamIndices[0] ); if ( returnVectorParamIt == vectorParamIndices.end() ) { - // the return parameter is not a vector - if ( isHandleType( commandData.params[nonConstPointerParamIndices[0]].type.type ) ) + // the return parameter is not a vector -> get just one handle + if ( commandData.returnType == "VkResult" ) { - if ( commandData.returnType == "VkResult" ) - { - // provide standard, enhanced, and unique call - appendCommandUnique( str, name, commandData, nonConstPointerParamIndices[0], definition ); - appendedFunction = true; - } - else if ( commandData.returnType == "void" ) - { - // it's a handle type, but without construction and destruction function; it's just get - assert( beginsWith( name, "vkGet" ) ); - appendCommandStandardAndEnhanced( - str, name, commandData, definition, vectorParamIndices, nonConstPointerParamIndices ); - appendedFunction = true; - } - } - else if ( isStructureChainAnchor( commandData.params[nonConstPointerParamIndices[0]].type.type ) ) - { - // provide standard, enhanced, and chained call - appendCommandChained( str, name, commandData, nonConstPointerParamIndices[0], definition ); + // provide standard, enhanced, and unique call + appendCommandUnique( str, name, commandData, nonConstPointerParamIndices[0], definition ); appendedFunction = true; } - else if ( ( commandData.returnType == "VkResult" ) || ( commandData.returnType == "void" ) ) + else if ( ( commandData.returnType == "void" ) && beginsWith( name, "vkGet" ) ) { + // it's a handle type, but without construction and destruction function; it's just get appendCommandStandardAndEnhanced( str, name, commandData, definition, vectorParamIndices, nonConstPointerParamIndices ); appendedFunction = true; @@ -1198,48 +1184,70 @@ void VulkanHppGenerator::appendCommand( std::string & str, } else { - // the return parameter is a vector - if ( isHandleType( commandData.params[returnVectorParamIt->first].type.type ) ) + // get a vector of handles + if ( ( commandData.params[returnVectorParamIt->second].type.isValue() ) ) { - if ( ( commandData.params[returnVectorParamIt->second].type.isValue() ) ) + if ( ( vectorParamIndices.size() == 2 ) && + ( vectorParamIndices.begin()->second == std::next( vectorParamIndices.begin() )->second ) ) { - assert( vectorParamIndices.size() == 2 ); - assert( vectorParamIndices.begin()->second == std::next( vectorParamIndices.begin() )->second ); // provide standard, enhanced, vector, singular, and unique (and the combinations!) calls appendCommandVectorSingularUnique( str, name, commandData, vectorParamIndices, nonConstPointerParamIndices[0], definition ); + appendedFunction = true; } - else - { - assert( ( isParamIndirect( commandData.params[returnVectorParamIt->first].len, - commandData.params[returnVectorParamIt->second] ) ) ); - assert( vectorParamIndices.size() == 1 ); - // provide standard, enhanced, vector, and unique (and the combinations!) calls - appendCommandVectorUnique( - str, name, commandData, vectorParamIndices, nonConstPointerParamIndices[0], definition ); - } - appendedFunction = true; } - else if ( vectorParamIndices.size() == 1 ) + else if ( ( ( isParamIndirect( commandData.params[returnVectorParamIt->first].len, + commandData.params[returnVectorParamIt->second] ) ) ) && + ( vectorParamIndices.size() == 1 ) ) { - assert( commandData.params[returnVectorParamIt->first].type.type == "void" ); - assert( commandData.params[returnVectorParamIt->second].type.isValue() ); - // provide standard, enhanced, and singular calls - appendCommandSingular( + // provide standard, enhanced, vector, and unique (and the combinations!) calls + appendCommandVectorUnique( str, name, commandData, vectorParamIndices, nonConstPointerParamIndices[0], definition ); appendedFunction = true; } } } + else if ( isStructureChainAnchor( commandData.params[nonConstPointerParamIndices[0]].type.type ) ) + { + auto returnVectorParamIt = vectorParamIndices.find( nonConstPointerParamIndices[0] ); + if ( returnVectorParamIt == vectorParamIndices.end() ) + { + // provide standard, enhanced, and chained call + appendCommandChained( str, name, commandData, nonConstPointerParamIndices[0], definition ); + appendedFunction = true; + } + } + else + { + auto returnVectorParamIt = vectorParamIndices.find( nonConstPointerParamIndices[0] ); + if ( returnVectorParamIt == vectorParamIndices.end() ) + { + if ( ( commandData.returnType == "VkResult" ) || ( commandData.returnType == "void" ) ) + { + appendCommandStandardAndEnhanced( + str, name, commandData, definition, vectorParamIndices, nonConstPointerParamIndices ); + appendedFunction = true; + } + } + else if ( ( vectorParamIndices.size() == 1 ) && + ( commandData.params[returnVectorParamIt->first].type.type == "void" ) && + ( commandData.params[returnVectorParamIt->second].type.isValue() ) ) + { + // provide standard, enhanced, and singular calls + appendCommandSingular( + str, name, commandData, vectorParamIndices, nonConstPointerParamIndices[0], definition ); + appendedFunction = true; + } + } break; case 2: // two return parameters if ( !isHandleType( commandData.params[nonConstPointerParamIndices[0]].type.type ) && - !isHandleType( commandData.params[nonConstPointerParamIndices[1]].type.type ) && !isStructureChainAnchor( commandData.params[nonConstPointerParamIndices[0]].type.type ) && !isStructureChainAnchor( commandData.params[nonConstPointerParamIndices[1]].type.type ) ) { - // non of the return parameters is a handle or a StructureChain + // non of the return parameters is a StructureChain + // Note: if the vector returned holds handles, the function does not create them, but just gets them switch ( vectorParamIndices.size() ) { case 1: @@ -1264,13 +1272,15 @@ void VulkanHppGenerator::appendCommand( std::string & str, { // two returns and two vectors! But one input vector, one output vector of the same size, and one output // value - assert( vectorParamIndices.find( nonConstPointerParamIndices[0] ) != vectorParamIndices.end() ); - assert( vectorParamIndices.find( nonConstPointerParamIndices[1] ) == vectorParamIndices.end() ); - assert( commandData.returnType == "VkResult" ); - // provide standard, enhanced deprecated, enhanced, and enhanced with allocator calls - appendCommandStandardEnhancedDeprecatedAllocator( - str, name, commandData, definition, vectorParamIndices, nonConstPointerParamIndices ); - appendedFunction = true; + if ( ( vectorParamIndices.find( nonConstPointerParamIndices[0] ) != vectorParamIndices.end() ) && + ( vectorParamIndices.find( nonConstPointerParamIndices[1] ) == vectorParamIndices.end() ) && + ( commandData.returnType == "VkResult" ) ) + { + // provide standard, enhanced deprecated, enhanced, and enhanced with allocator calls + appendCommandStandardEnhancedDeprecatedAllocator( + str, name, commandData, definition, vectorParamIndices, nonConstPointerParamIndices ); + appendedFunction = true; + } } break; default: break; @@ -1279,10 +1289,10 @@ void VulkanHppGenerator::appendCommand( std::string & str, break; case 3: // three return parameters - assert( ( vectorParamIndices.size() == 2 ) && - ( vectorParamIndices.begin()->second == nonConstPointerParamIndices[0] ) && - ( vectorParamIndices.begin()->first == nonConstPointerParamIndices[1] ) && - ( std::next( vectorParamIndices.begin() )->first == nonConstPointerParamIndices[2] ) ); + if ( ( vectorParamIndices.size() == 2 ) && + ( vectorParamIndices.begin()->second == nonConstPointerParamIndices[0] ) && + ( vectorParamIndices.begin()->first == nonConstPointerParamIndices[1] ) && + ( std::next( vectorParamIndices.begin() )->first == nonConstPointerParamIndices[2] ) ) { // two vector parameters auto firstVectorParam = vectorParamIndices.begin(); diff --git a/vulkan/vulkan.hpp b/vulkan/vulkan.hpp index 854b8d8..82047d7 100644 --- a/vulkan/vulkan.hpp +++ b/vulkan/vulkan.hpp @@ -55479,22 +55479,22 @@ namespace VULKAN_HPP_NAMESPACE template VULKAN_HPP_NODISCARD Result - getSwapchainImagesKHR( VULKAN_HPP_NAMESPACE::SwapchainKHR swapchain, - uint32_t * pSwapchainImageCount, - VULKAN_HPP_NAMESPACE::Image * pSwapchainImages, + getSwapchainImagesKHR( VULKAN_HPP_NAMESPACE::SwapchainKHR swapchain, + uint32_t * pSwapchainImageCount, + VULKAN_HPP_NAMESPACE::Image * pSwapchainImages VULKAN_HPP_DEFAULT_ARGUMENT_ASSIGNMENT, Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const VULKAN_HPP_NOEXCEPT; #ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template , typename Dispatch = VULKAN_HPP_DEFAULT_DISPATCHER_TYPE> - VULKAN_HPP_NODISCARD typename ResultValueType>::type + template , typename Dispatch = VULKAN_HPP_DEFAULT_DISPATCHER_TYPE> + VULKAN_HPP_NODISCARD typename ResultValueType>::type getSwapchainImagesKHR( VULKAN_HPP_NAMESPACE::SwapchainKHR swapchain, Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const; - template , - typename Dispatch = VULKAN_HPP_DEFAULT_DISPATCHER_TYPE, - typename B = Allocator, + template , + typename Dispatch = VULKAN_HPP_DEFAULT_DISPATCHER_TYPE, + typename B = ImageAllocator, typename std::enable_if::value, int>::type = 0> - VULKAN_HPP_NODISCARD typename ResultValueType>::type + VULKAN_HPP_NODISCARD typename ResultValueType>::type getSwapchainImagesKHR( VULKAN_HPP_NAMESPACE::SwapchainKHR swapchain, - Allocator const & vectorAllocator, + ImageAllocator & imageAllocator, Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const; #endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ @@ -60892,23 +60892,24 @@ namespace VULKAN_HPP_NAMESPACE template VULKAN_HPP_NODISCARD Result getDisplayPlaneSupportedDisplaysKHR( - uint32_t planeIndex, - uint32_t * pDisplayCount, - VULKAN_HPP_NAMESPACE::DisplayKHR * pDisplays, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const VULKAN_HPP_NOEXCEPT; + uint32_t planeIndex, + uint32_t * pDisplayCount, + VULKAN_HPP_NAMESPACE::DisplayKHR * pDisplays VULKAN_HPP_DEFAULT_ARGUMENT_ASSIGNMENT, + Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const VULKAN_HPP_NOEXCEPT; #ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template , typename Dispatch = VULKAN_HPP_DEFAULT_DISPATCHER_TYPE> - VULKAN_HPP_NODISCARD typename ResultValueType>::type + template , + typename Dispatch = VULKAN_HPP_DEFAULT_DISPATCHER_TYPE> + VULKAN_HPP_NODISCARD typename ResultValueType>::type getDisplayPlaneSupportedDisplaysKHR( uint32_t planeIndex, Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const; - template , - typename Dispatch = VULKAN_HPP_DEFAULT_DISPATCHER_TYPE, - typename B = Allocator, + template , + typename Dispatch = VULKAN_HPP_DEFAULT_DISPATCHER_TYPE, + typename B = DisplayKHRAllocator, typename std::enable_if::value, int>::type = 0> - VULKAN_HPP_NODISCARD typename ResultValueType>::type - getDisplayPlaneSupportedDisplaysKHR( uint32_t planeIndex, - Allocator const & vectorAllocator, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const; + VULKAN_HPP_NODISCARD typename ResultValueType>::type + getDisplayPlaneSupportedDisplaysKHR( uint32_t planeIndex, + DisplayKHRAllocator & displayKHRAllocator, + Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const; #endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ template @@ -90179,22 +90180,22 @@ namespace VULKAN_HPP_NAMESPACE #endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ template - VULKAN_HPP_NODISCARD Result - enumeratePhysicalDevices( uint32_t * pPhysicalDeviceCount, - VULKAN_HPP_NAMESPACE::PhysicalDevice * pPhysicalDevices, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const VULKAN_HPP_NOEXCEPT; + VULKAN_HPP_NODISCARD Result enumeratePhysicalDevices( + uint32_t * pPhysicalDeviceCount, + VULKAN_HPP_NAMESPACE::PhysicalDevice * pPhysicalDevices VULKAN_HPP_DEFAULT_ARGUMENT_ASSIGNMENT, + Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const VULKAN_HPP_NOEXCEPT; #ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template , - typename Dispatch = VULKAN_HPP_DEFAULT_DISPATCHER_TYPE> - VULKAN_HPP_NODISCARD typename ResultValueType>::type + template , + typename Dispatch = VULKAN_HPP_DEFAULT_DISPATCHER_TYPE> + VULKAN_HPP_NODISCARD typename ResultValueType>::type enumeratePhysicalDevices( Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const; - template , - typename Dispatch = VULKAN_HPP_DEFAULT_DISPATCHER_TYPE, - typename B = Allocator, + template , + typename Dispatch = VULKAN_HPP_DEFAULT_DISPATCHER_TYPE, + typename B = PhysicalDeviceAllocator, typename std::enable_if::value, int>::type = 0> - VULKAN_HPP_NODISCARD typename ResultValueType>::type - enumeratePhysicalDevices( Allocator const & vectorAllocator, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const; + VULKAN_HPP_NODISCARD typename ResultValueType>::type + enumeratePhysicalDevices( PhysicalDeviceAllocator & physicalDeviceAllocator, + Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const; #endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ template @@ -100780,14 +100781,15 @@ namespace VULKAN_HPP_NAMESPACE pSwapchainImageCount, reinterpret_cast( pSwapchainImages ) ) ); } + #ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template - VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE typename ResultValueType>::type + template + VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE typename ResultValueType>::type Device::getSwapchainImagesKHR( VULKAN_HPP_NAMESPACE::SwapchainKHR swapchain, Dispatch const & d ) const { - std::vector swapchainImages; - uint32_t swapchainImageCount; - Result result; + std::vector swapchainImages; + uint32_t swapchainImageCount; + Result result; do { result = static_cast( d.vkGetSwapchainImagesKHR( @@ -100800,27 +100802,28 @@ namespace VULKAN_HPP_NAMESPACE static_cast( swapchain ), &swapchainImageCount, reinterpret_cast( swapchainImages.data() ) ) ); + VULKAN_HPP_ASSERT( swapchainImageCount <= swapchainImages.size() ); } } while ( result == Result::eIncomplete ); - if ( result == Result::eSuccess ) + if ( ( result == Result::eSuccess ) && ( swapchainImageCount < swapchainImages.size() ) ) { - VULKAN_HPP_ASSERT( swapchainImageCount <= swapchainImages.size() ); swapchainImages.resize( swapchainImageCount ); } return createResultValue( result, swapchainImages, VULKAN_HPP_NAMESPACE_STRING "::Device::getSwapchainImagesKHR" ); } - template ::value, int>::type> - VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE typename ResultValueType>::type + VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE typename ResultValueType>::type Device::getSwapchainImagesKHR( VULKAN_HPP_NAMESPACE::SwapchainKHR swapchain, - Allocator const & vectorAllocator, + ImageAllocator & imageAllocator, Dispatch const & d ) const { - std::vector swapchainImages( vectorAllocator ); - uint32_t swapchainImageCount; - Result result; + std::vector swapchainImages( imageAllocator ); + uint32_t swapchainImageCount; + Result result; do { result = static_cast( d.vkGetSwapchainImagesKHR( @@ -100833,11 +100836,11 @@ namespace VULKAN_HPP_NAMESPACE static_cast( swapchain ), &swapchainImageCount, reinterpret_cast( swapchainImages.data() ) ) ); + VULKAN_HPP_ASSERT( swapchainImageCount <= swapchainImages.size() ); } } while ( result == Result::eIncomplete ); - if ( result == Result::eSuccess ) + if ( ( result == Result::eSuccess ) && ( swapchainImageCount < swapchainImages.size() ) ) { - VULKAN_HPP_ASSERT( swapchainImageCount <= swapchainImages.size() ); swapchainImages.resize( swapchainImageCount ); } return createResultValue( result, swapchainImages, VULKAN_HPP_NAMESPACE_STRING "::Device::getSwapchainImagesKHR" ); @@ -103082,14 +103085,16 @@ namespace VULKAN_HPP_NAMESPACE return static_cast( d.vkEnumeratePhysicalDevices( m_instance, pPhysicalDeviceCount, reinterpret_cast( pPhysicalDevices ) ) ); } + #ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template - VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE typename ResultValueType>::type - Instance::enumeratePhysicalDevices( Dispatch const & d ) const + template + VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE + typename ResultValueType>::type + Instance::enumeratePhysicalDevices( Dispatch const & d ) const { - std::vector physicalDevices; - uint32_t physicalDeviceCount; - Result result; + std::vector physicalDevices; + uint32_t physicalDeviceCount; + Result result; do { result = static_cast( d.vkEnumeratePhysicalDevices( m_instance, &physicalDeviceCount, nullptr ) ); @@ -103098,26 +103103,28 @@ namespace VULKAN_HPP_NAMESPACE physicalDevices.resize( physicalDeviceCount ); result = static_cast( d.vkEnumeratePhysicalDevices( m_instance, &physicalDeviceCount, reinterpret_cast( physicalDevices.data() ) ) ); + VULKAN_HPP_ASSERT( physicalDeviceCount <= physicalDevices.size() ); } } while ( result == Result::eIncomplete ); - if ( result == Result::eSuccess ) + if ( ( result == Result::eSuccess ) && ( physicalDeviceCount < physicalDevices.size() ) ) { - VULKAN_HPP_ASSERT( physicalDeviceCount <= physicalDevices.size() ); physicalDevices.resize( physicalDeviceCount ); } return createResultValue( result, physicalDevices, VULKAN_HPP_NAMESPACE_STRING "::Instance::enumeratePhysicalDevices" ); } - template ::value, int>::type> - VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE typename ResultValueType>::type - Instance::enumeratePhysicalDevices( Allocator const & vectorAllocator, Dispatch const & d ) const + VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE + typename ResultValueType>::type + Instance::enumeratePhysicalDevices( PhysicalDeviceAllocator & physicalDeviceAllocator, Dispatch const & d ) const { - std::vector physicalDevices( vectorAllocator ); - uint32_t physicalDeviceCount; - Result result; + std::vector physicalDevices( physicalDeviceAllocator ); + uint32_t physicalDeviceCount; + Result result; do { result = static_cast( d.vkEnumeratePhysicalDevices( m_instance, &physicalDeviceCount, nullptr ) ); @@ -103126,11 +103133,11 @@ namespace VULKAN_HPP_NAMESPACE physicalDevices.resize( physicalDeviceCount ); result = static_cast( d.vkEnumeratePhysicalDevices( m_instance, &physicalDeviceCount, reinterpret_cast( physicalDevices.data() ) ) ); + VULKAN_HPP_ASSERT( physicalDeviceCount <= physicalDevices.size() ); } } while ( result == Result::eIncomplete ); - if ( result == Result::eSuccess ) + if ( ( result == Result::eSuccess ) && ( physicalDeviceCount < physicalDevices.size() ) ) { - VULKAN_HPP_ASSERT( physicalDeviceCount <= physicalDevices.size() ); physicalDevices.resize( physicalDeviceCount ); } return createResultValue( @@ -103912,14 +103919,15 @@ namespace VULKAN_HPP_NAMESPACE return static_cast( d.vkGetDisplayPlaneSupportedDisplaysKHR( m_physicalDevice, planeIndex, pDisplayCount, reinterpret_cast( pDisplays ) ) ); } + #ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template - VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE typename ResultValueType>::type + template + VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE typename ResultValueType>::type PhysicalDevice::getDisplayPlaneSupportedDisplaysKHR( uint32_t planeIndex, Dispatch const & d ) const { - std::vector displays; - uint32_t displayCount; - Result result; + std::vector displays; + uint32_t displayCount; + Result result; do { result = static_cast( @@ -103929,28 +103937,29 @@ namespace VULKAN_HPP_NAMESPACE displays.resize( displayCount ); result = static_cast( d.vkGetDisplayPlaneSupportedDisplaysKHR( m_physicalDevice, planeIndex, &displayCount, reinterpret_cast( displays.data() ) ) ); + VULKAN_HPP_ASSERT( displayCount <= displays.size() ); } } while ( result == Result::eIncomplete ); - if ( result == Result::eSuccess ) + if ( ( result == Result::eSuccess ) && ( displayCount < displays.size() ) ) { - VULKAN_HPP_ASSERT( displayCount <= displays.size() ); displays.resize( displayCount ); } return createResultValue( result, displays, VULKAN_HPP_NAMESPACE_STRING "::PhysicalDevice::getDisplayPlaneSupportedDisplaysKHR" ); } - template ::value, int>::type> - VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE typename ResultValueType>::type - PhysicalDevice::getDisplayPlaneSupportedDisplaysKHR( uint32_t planeIndex, - Allocator const & vectorAllocator, - Dispatch const & d ) const + VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE typename ResultValueType>::type + PhysicalDevice::getDisplayPlaneSupportedDisplaysKHR( uint32_t planeIndex, + DisplayKHRAllocator & displayKHRAllocator, + Dispatch const & d ) const { - std::vector displays( vectorAllocator ); - uint32_t displayCount; - Result result; + std::vector displays( displayKHRAllocator ); + uint32_t displayCount; + Result result; do { result = static_cast( @@ -103960,11 +103969,11 @@ namespace VULKAN_HPP_NAMESPACE displays.resize( displayCount ); result = static_cast( d.vkGetDisplayPlaneSupportedDisplaysKHR( m_physicalDevice, planeIndex, &displayCount, reinterpret_cast( displays.data() ) ) ); + VULKAN_HPP_ASSERT( displayCount <= displays.size() ); } } while ( result == Result::eIncomplete ); - if ( result == Result::eSuccess ) + if ( ( result == Result::eSuccess ) && ( displayCount < displays.size() ) ) { - VULKAN_HPP_ASSERT( displayCount <= displays.size() ); displays.resize( displayCount ); } return createResultValue(