Correct version of two-step function returning two vectors of data

+ mark wrong version as deprecated (C++14)
This commit is contained in:
asuessenbach
2020-09-15 10:23:19 +02:00
parent f4b4e0eba9
commit d6dfdb547e
3 changed files with 589 additions and 22 deletions

View File

@@ -59231,6 +59231,30 @@ namespace VULKAN_HPP_NAMESPACE
ArrayProxy<VULKAN_HPP_NAMESPACE::PerformanceCounterKHR> const & counters,
Allocator const & vectorAllocator,
Dispatch const & d ) const;
template <typename PerformanceCounterKHRAllocator = std::allocator<PerformanceCounterKHR>,
typename PerformanceCounterDescriptionKHRAllocator = std::allocator<PerformanceCounterDescriptionKHR>,
typename Dispatch = VULKAN_HPP_DEFAULT_DISPATCHER_TYPE>
VULKAN_HPP_NODISCARD typename ResultValueType<
std::pair<std::vector<PerformanceCounterKHR, PerformanceCounterKHRAllocator>,
std::vector<PerformanceCounterDescriptionKHR, PerformanceCounterDescriptionKHRAllocator>>>::type
enumerateQueueFamilyPerformanceQueryCountersKHR(
uint32_t queueFamilyIndex, Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const;
template <typename PerformanceCounterKHRAllocator = std::allocator<PerformanceCounterKHR>,
typename PerformanceCounterDescriptionKHRAllocator = std::allocator<PerformanceCounterDescriptionKHR>,
typename Dispatch = VULKAN_HPP_DEFAULT_DISPATCHER_TYPE,
typename B1 = PerformanceCounterKHRAllocator,
typename B2 = PerformanceCounterDescriptionKHRAllocator,
typename std::enable_if<std::is_same<typename B1::value_type, PerformanceCounterKHR>::value &&
std::is_same<typename B2::value_type, PerformanceCounterDescriptionKHR>::value,
int>::type = 0>
VULKAN_HPP_NODISCARD typename ResultValueType<
std::pair<std::vector<PerformanceCounterKHR, PerformanceCounterKHRAllocator>,
std::vector<PerformanceCounterDescriptionKHR, PerformanceCounterDescriptionKHRAllocator>>>::type
enumerateQueueFamilyPerformanceQueryCountersKHR(
uint32_t queueFamilyIndex,
PerformanceCounterKHRAllocator & countersAllocator,
PerformanceCounterDescriptionKHRAllocator & counterDescriptionsAllocator,
Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const;
#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/
template <typename Dispatch = VULKAN_HPP_DEFAULT_DISPATCHER_TYPE>
@@ -100775,8 +100799,10 @@ namespace VULKAN_HPP_NAMESPACE
reinterpret_cast<VkPerformanceCounterKHR *>( pCounters ),
reinterpret_cast<VkPerformanceCounterDescriptionKHR *>( pCounterDescriptions ) ) );
}
#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE
template <typename Allocator, typename Dispatch>
VULKAN_HPP_DEPRECATED( "This function is deprecated. Use one of the other flavours of it." )
VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE
typename ResultValueType<std::vector<PerformanceCounterDescriptionKHR, Allocator>>::type
PhysicalDevice::enumerateQueueFamilyPerformanceQueryCountersKHR(
@@ -100816,11 +100842,13 @@ namespace VULKAN_HPP_NAMESPACE
VULKAN_HPP_NAMESPACE_STRING
"::PhysicalDevice::enumerateQueueFamilyPerformanceQueryCountersKHR" );
}
template <
typename Allocator,
typename Dispatch,
typename B,
typename std::enable_if<std::is_same<typename B::value_type, PerformanceCounterDescriptionKHR>::value, int>::type>
VULKAN_HPP_DEPRECATED( "This function is deprecated. Use one of the other flavours of it." )
VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE
typename ResultValueType<std::vector<PerformanceCounterDescriptionKHR, Allocator>>::type
PhysicalDevice::enumerateQueueFamilyPerformanceQueryCountersKHR(
@@ -100861,6 +100889,100 @@ namespace VULKAN_HPP_NAMESPACE
VULKAN_HPP_NAMESPACE_STRING
"::PhysicalDevice::enumerateQueueFamilyPerformanceQueryCountersKHR" );
}
template <typename PerformanceCounterKHRAllocator,
typename PerformanceCounterDescriptionKHRAllocator,
typename Dispatch>
VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE typename ResultValueType<
std::pair<std::vector<PerformanceCounterKHR, PerformanceCounterKHRAllocator>,
std::vector<PerformanceCounterDescriptionKHR, PerformanceCounterDescriptionKHRAllocator>>>::type
PhysicalDevice::enumerateQueueFamilyPerformanceQueryCountersKHR( uint32_t queueFamilyIndex,
Dispatch const & d ) const
{
std::pair<std::vector<PerformanceCounterKHR, PerformanceCounterKHRAllocator>,
std::vector<PerformanceCounterDescriptionKHR, PerformanceCounterDescriptionKHRAllocator>>
enumeratedData;
uint32_t counterCount;
Result result;
do
{
result = static_cast<Result>( d.vkEnumeratePhysicalDeviceQueueFamilyPerformanceQueryCountersKHR(
m_physicalDevice, queueFamilyIndex, &counterCount, nullptr, nullptr ) );
if ( ( result == Result::eSuccess ) && counterCount )
{
enumeratedData.first.resize( counterCount );
enumeratedData.second.resize( counterCount );
result = static_cast<Result>( d.vkEnumeratePhysicalDeviceQueueFamilyPerformanceQueryCountersKHR(
m_physicalDevice,
queueFamilyIndex,
&counterCount,
reinterpret_cast<VkPerformanceCounterKHR *>( enumeratedData.first.data() ),
reinterpret_cast<VkPerformanceCounterDescriptionKHR *>( enumeratedData.second.data() ) ) );
VULKAN_HPP_ASSERT( counterCount <= enumeratedData.first.size() );
}
} while ( result == Result::eIncomplete );
if ( ( result == Result::eSuccess ) && ( counterCount < enumeratedData.first.size() ) )
{
enumeratedData.first.resize( counterCount );
enumeratedData.second.resize( counterCount );
}
return createResultValue( result,
enumeratedData,
VULKAN_HPP_NAMESPACE_STRING
"::PhysicalDevice::enumerateQueueFamilyPerformanceQueryCountersKHR" );
}
template <typename PerformanceCounterKHRAllocator,
typename PerformanceCounterDescriptionKHRAllocator,
typename Dispatch,
typename B1,
typename B2,
typename std::enable_if<std::is_same<typename B1::value_type, PerformanceCounterKHR>::value &&
std::is_same<typename B2::value_type, PerformanceCounterDescriptionKHR>::value,
int>::type>
VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE typename ResultValueType<
std::pair<std::vector<PerformanceCounterKHR, PerformanceCounterKHRAllocator>,
std::vector<PerformanceCounterDescriptionKHR, PerformanceCounterDescriptionKHRAllocator>>>::type
PhysicalDevice::enumerateQueueFamilyPerformanceQueryCountersKHR(
uint32_t queueFamilyIndex,
PerformanceCounterKHRAllocator & countersAllocator,
PerformanceCounterDescriptionKHRAllocator & counterDescriptionsAllocator,
Dispatch const & d ) const
{
std::pair<std::vector<PerformanceCounterKHR, PerformanceCounterKHRAllocator>,
std::vector<PerformanceCounterDescriptionKHR, PerformanceCounterDescriptionKHRAllocator>>
enumeratedData( std::piecewise_construct,
std::forward_as_tuple( countersAllocator ),
std::forward_as_tuple( counterDescriptionsAllocator ) );
uint32_t counterCount;
Result result;
do
{
result = static_cast<Result>( d.vkEnumeratePhysicalDeviceQueueFamilyPerformanceQueryCountersKHR(
m_physicalDevice, queueFamilyIndex, &counterCount, nullptr, nullptr ) );
if ( ( result == Result::eSuccess ) && counterCount )
{
enumeratedData.first.resize( counterCount );
enumeratedData.second.resize( counterCount );
result = static_cast<Result>( d.vkEnumeratePhysicalDeviceQueueFamilyPerformanceQueryCountersKHR(
m_physicalDevice,
queueFamilyIndex,
&counterCount,
reinterpret_cast<VkPerformanceCounterKHR *>( enumeratedData.first.data() ),
reinterpret_cast<VkPerformanceCounterDescriptionKHR *>( enumeratedData.second.data() ) ) );
VULKAN_HPP_ASSERT( counterCount <= enumeratedData.first.size() );
}
} while ( result == Result::eIncomplete );
if ( ( result == Result::eSuccess ) && ( counterCount < enumeratedData.first.size() ) )
{
enumeratedData.first.resize( counterCount );
enumeratedData.second.resize( counterCount );
}
return createResultValue( result,
enumeratedData,
VULKAN_HPP_NAMESPACE_STRING
"::PhysicalDevice::enumerateQueueFamilyPerformanceQueryCountersKHR" );
}
#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/
template <typename Dispatch>