Merge pull request #794 from asuessenbach/refactor

Refactor commands that enumerate handles (no unique versions)
This commit is contained in:
Andreas Süßenbach 2020-10-21 13:35:13 +02:00 committed by GitHub
commit ede635596c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 158 additions and 139 deletions

View File

@ -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();

View File

@ -55479,22 +55479,22 @@ namespace VULKAN_HPP_NAMESPACE
template <typename Dispatch = VULKAN_HPP_DEFAULT_DISPATCHER_TYPE>
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 Allocator = std::allocator<Image>, typename Dispatch = VULKAN_HPP_DEFAULT_DISPATCHER_TYPE>
VULKAN_HPP_NODISCARD typename ResultValueType<std::vector<Image, Allocator>>::type
template <typename ImageAllocator = std::allocator<Image>, typename Dispatch = VULKAN_HPP_DEFAULT_DISPATCHER_TYPE>
VULKAN_HPP_NODISCARD typename ResultValueType<std::vector<Image, ImageAllocator>>::type
getSwapchainImagesKHR( VULKAN_HPP_NAMESPACE::SwapchainKHR swapchain,
Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const;
template <typename Allocator = std::allocator<Image>,
typename Dispatch = VULKAN_HPP_DEFAULT_DISPATCHER_TYPE,
typename B = Allocator,
template <typename ImageAllocator = std::allocator<Image>,
typename Dispatch = VULKAN_HPP_DEFAULT_DISPATCHER_TYPE,
typename B = ImageAllocator,
typename std::enable_if<std::is_same<typename B::value_type, Image>::value, int>::type = 0>
VULKAN_HPP_NODISCARD typename ResultValueType<std::vector<Image, Allocator>>::type
VULKAN_HPP_NODISCARD typename ResultValueType<std::vector<Image, ImageAllocator>>::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 <typename Dispatch = VULKAN_HPP_DEFAULT_DISPATCHER_TYPE>
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 Allocator = std::allocator<DisplayKHR>, typename Dispatch = VULKAN_HPP_DEFAULT_DISPATCHER_TYPE>
VULKAN_HPP_NODISCARD typename ResultValueType<std::vector<DisplayKHR, Allocator>>::type
template <typename DisplayKHRAllocator = std::allocator<DisplayKHR>,
typename Dispatch = VULKAN_HPP_DEFAULT_DISPATCHER_TYPE>
VULKAN_HPP_NODISCARD typename ResultValueType<std::vector<DisplayKHR, DisplayKHRAllocator>>::type
getDisplayPlaneSupportedDisplaysKHR( uint32_t planeIndex,
Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const;
template <typename Allocator = std::allocator<DisplayKHR>,
typename Dispatch = VULKAN_HPP_DEFAULT_DISPATCHER_TYPE,
typename B = Allocator,
template <typename DisplayKHRAllocator = std::allocator<DisplayKHR>,
typename Dispatch = VULKAN_HPP_DEFAULT_DISPATCHER_TYPE,
typename B = DisplayKHRAllocator,
typename std::enable_if<std::is_same<typename B::value_type, DisplayKHR>::value, int>::type = 0>
VULKAN_HPP_NODISCARD typename ResultValueType<std::vector<DisplayKHR, Allocator>>::type
getDisplayPlaneSupportedDisplaysKHR( uint32_t planeIndex,
Allocator const & vectorAllocator,
Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const;
VULKAN_HPP_NODISCARD typename ResultValueType<std::vector<DisplayKHR, DisplayKHRAllocator>>::type
getDisplayPlaneSupportedDisplaysKHR( uint32_t planeIndex,
DisplayKHRAllocator & displayKHRAllocator,
Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const;
#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/
template <typename Dispatch = VULKAN_HPP_DEFAULT_DISPATCHER_TYPE>
@ -90179,22 +90180,22 @@ namespace VULKAN_HPP_NAMESPACE
#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/
template <typename Dispatch = VULKAN_HPP_DEFAULT_DISPATCHER_TYPE>
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 Allocator = std::allocator<PhysicalDevice>,
typename Dispatch = VULKAN_HPP_DEFAULT_DISPATCHER_TYPE>
VULKAN_HPP_NODISCARD typename ResultValueType<std::vector<PhysicalDevice, Allocator>>::type
template <typename PhysicalDeviceAllocator = std::allocator<PhysicalDevice>,
typename Dispatch = VULKAN_HPP_DEFAULT_DISPATCHER_TYPE>
VULKAN_HPP_NODISCARD typename ResultValueType<std::vector<PhysicalDevice, PhysicalDeviceAllocator>>::type
enumeratePhysicalDevices( Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const;
template <typename Allocator = std::allocator<PhysicalDevice>,
typename Dispatch = VULKAN_HPP_DEFAULT_DISPATCHER_TYPE,
typename B = Allocator,
template <typename PhysicalDeviceAllocator = std::allocator<PhysicalDevice>,
typename Dispatch = VULKAN_HPP_DEFAULT_DISPATCHER_TYPE,
typename B = PhysicalDeviceAllocator,
typename std::enable_if<std::is_same<typename B::value_type, PhysicalDevice>::value, int>::type = 0>
VULKAN_HPP_NODISCARD typename ResultValueType<std::vector<PhysicalDevice, Allocator>>::type
enumeratePhysicalDevices( Allocator const & vectorAllocator,
Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const;
VULKAN_HPP_NODISCARD typename ResultValueType<std::vector<PhysicalDevice, PhysicalDeviceAllocator>>::type
enumeratePhysicalDevices( PhysicalDeviceAllocator & physicalDeviceAllocator,
Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const;
#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/
template <typename Dispatch = VULKAN_HPP_DEFAULT_DISPATCHER_TYPE>
@ -100780,14 +100781,15 @@ namespace VULKAN_HPP_NAMESPACE
pSwapchainImageCount,
reinterpret_cast<VkImage *>( pSwapchainImages ) ) );
}
#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE
template <typename Allocator, typename Dispatch>
VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE typename ResultValueType<std::vector<Image, Allocator>>::type
template <typename ImageAllocator, typename Dispatch>
VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE typename ResultValueType<std::vector<Image, ImageAllocator>>::type
Device::getSwapchainImagesKHR( VULKAN_HPP_NAMESPACE::SwapchainKHR swapchain, Dispatch const & d ) const
{
std::vector<Image, Allocator> swapchainImages;
uint32_t swapchainImageCount;
Result result;
std::vector<Image, ImageAllocator> swapchainImages;
uint32_t swapchainImageCount;
Result result;
do
{
result = static_cast<Result>( d.vkGetSwapchainImagesKHR(
@ -100800,27 +100802,28 @@ namespace VULKAN_HPP_NAMESPACE
static_cast<VkSwapchainKHR>( swapchain ),
&swapchainImageCount,
reinterpret_cast<VkImage *>( 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 <typename Allocator,
template <typename ImageAllocator,
typename Dispatch,
typename B,
typename std::enable_if<std::is_same<typename B::value_type, Image>::value, int>::type>
VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE typename ResultValueType<std::vector<Image, Allocator>>::type
VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE typename ResultValueType<std::vector<Image, ImageAllocator>>::type
Device::getSwapchainImagesKHR( VULKAN_HPP_NAMESPACE::SwapchainKHR swapchain,
Allocator const & vectorAllocator,
ImageAllocator & imageAllocator,
Dispatch const & d ) const
{
std::vector<Image, Allocator> swapchainImages( vectorAllocator );
uint32_t swapchainImageCount;
Result result;
std::vector<Image, ImageAllocator> swapchainImages( imageAllocator );
uint32_t swapchainImageCount;
Result result;
do
{
result = static_cast<Result>( d.vkGetSwapchainImagesKHR(
@ -100833,11 +100836,11 @@ namespace VULKAN_HPP_NAMESPACE
static_cast<VkSwapchainKHR>( swapchain ),
&swapchainImageCount,
reinterpret_cast<VkImage *>( 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<Result>( d.vkEnumeratePhysicalDevices(
m_instance, pPhysicalDeviceCount, reinterpret_cast<VkPhysicalDevice *>( pPhysicalDevices ) ) );
}
#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE
template <typename Allocator, typename Dispatch>
VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE typename ResultValueType<std::vector<PhysicalDevice, Allocator>>::type
Instance::enumeratePhysicalDevices( Dispatch const & d ) const
template <typename PhysicalDeviceAllocator, typename Dispatch>
VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE
typename ResultValueType<std::vector<PhysicalDevice, PhysicalDeviceAllocator>>::type
Instance::enumeratePhysicalDevices( Dispatch const & d ) const
{
std::vector<PhysicalDevice, Allocator> physicalDevices;
uint32_t physicalDeviceCount;
Result result;
std::vector<PhysicalDevice, PhysicalDeviceAllocator> physicalDevices;
uint32_t physicalDeviceCount;
Result result;
do
{
result = static_cast<Result>( d.vkEnumeratePhysicalDevices( m_instance, &physicalDeviceCount, nullptr ) );
@ -103098,26 +103103,28 @@ namespace VULKAN_HPP_NAMESPACE
physicalDevices.resize( physicalDeviceCount );
result = static_cast<Result>( d.vkEnumeratePhysicalDevices(
m_instance, &physicalDeviceCount, reinterpret_cast<VkPhysicalDevice *>( 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 <typename Allocator,
template <typename PhysicalDeviceAllocator,
typename Dispatch,
typename B,
typename std::enable_if<std::is_same<typename B::value_type, PhysicalDevice>::value, int>::type>
VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE typename ResultValueType<std::vector<PhysicalDevice, Allocator>>::type
Instance::enumeratePhysicalDevices( Allocator const & vectorAllocator, Dispatch const & d ) const
VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE
typename ResultValueType<std::vector<PhysicalDevice, PhysicalDeviceAllocator>>::type
Instance::enumeratePhysicalDevices( PhysicalDeviceAllocator & physicalDeviceAllocator, Dispatch const & d ) const
{
std::vector<PhysicalDevice, Allocator> physicalDevices( vectorAllocator );
uint32_t physicalDeviceCount;
Result result;
std::vector<PhysicalDevice, PhysicalDeviceAllocator> physicalDevices( physicalDeviceAllocator );
uint32_t physicalDeviceCount;
Result result;
do
{
result = static_cast<Result>( d.vkEnumeratePhysicalDevices( m_instance, &physicalDeviceCount, nullptr ) );
@ -103126,11 +103133,11 @@ namespace VULKAN_HPP_NAMESPACE
physicalDevices.resize( physicalDeviceCount );
result = static_cast<Result>( d.vkEnumeratePhysicalDevices(
m_instance, &physicalDeviceCount, reinterpret_cast<VkPhysicalDevice *>( 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<Result>( d.vkGetDisplayPlaneSupportedDisplaysKHR(
m_physicalDevice, planeIndex, pDisplayCount, reinterpret_cast<VkDisplayKHR *>( pDisplays ) ) );
}
#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE
template <typename Allocator, typename Dispatch>
VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE typename ResultValueType<std::vector<DisplayKHR, Allocator>>::type
template <typename DisplayKHRAllocator, typename Dispatch>
VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE typename ResultValueType<std::vector<DisplayKHR, DisplayKHRAllocator>>::type
PhysicalDevice::getDisplayPlaneSupportedDisplaysKHR( uint32_t planeIndex, Dispatch const & d ) const
{
std::vector<DisplayKHR, Allocator> displays;
uint32_t displayCount;
Result result;
std::vector<DisplayKHR, DisplayKHRAllocator> displays;
uint32_t displayCount;
Result result;
do
{
result = static_cast<Result>(
@ -103929,28 +103937,29 @@ namespace VULKAN_HPP_NAMESPACE
displays.resize( displayCount );
result = static_cast<Result>( d.vkGetDisplayPlaneSupportedDisplaysKHR(
m_physicalDevice, planeIndex, &displayCount, reinterpret_cast<VkDisplayKHR *>( 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 <typename Allocator,
template <typename DisplayKHRAllocator,
typename Dispatch,
typename B,
typename std::enable_if<std::is_same<typename B::value_type, DisplayKHR>::value, int>::type>
VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE typename ResultValueType<std::vector<DisplayKHR, Allocator>>::type
PhysicalDevice::getDisplayPlaneSupportedDisplaysKHR( uint32_t planeIndex,
Allocator const & vectorAllocator,
Dispatch const & d ) const
VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE typename ResultValueType<std::vector<DisplayKHR, DisplayKHRAllocator>>::type
PhysicalDevice::getDisplayPlaneSupportedDisplaysKHR( uint32_t planeIndex,
DisplayKHRAllocator & displayKHRAllocator,
Dispatch const & d ) const
{
std::vector<DisplayKHR, Allocator> displays( vectorAllocator );
uint32_t displayCount;
Result result;
std::vector<DisplayKHR, DisplayKHRAllocator> displays( displayKHRAllocator );
uint32_t displayCount;
Result result;
do
{
result = static_cast<Result>(
@ -103960,11 +103969,11 @@ namespace VULKAN_HPP_NAMESPACE
displays.resize( displayCount );
result = static_cast<Result>( d.vkGetDisplayPlaneSupportedDisplaysKHR(
m_physicalDevice, planeIndex, &displayCount, reinterpret_cast<VkDisplayKHR *>( 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(