Refactor command that returns a vector of values and a single value.

This commit is contained in:
asuessenbach
2020-10-19 09:40:40 +02:00
parent cb6b61fd66
commit 2b47c6f9e5
3 changed files with 521 additions and 219 deletions

View File

@@ -54409,6 +54409,23 @@ namespace VULKAN_HPP_NAMESPACE
ArrayProxy<const VULKAN_HPP_NAMESPACE::CalibratedTimestampInfoEXT> const & timestampInfos,
ArrayProxy<uint64_t> const & timestamps,
Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const;
template <typename Uint64_tAllocator = std::allocator<uint64_t>,
typename Dispatch = VULKAN_HPP_DEFAULT_DISPATCHER_TYPE>
VULKAN_HPP_NODISCARD_WHEN_NO_EXCEPTIONS
typename ResultValueType<std::pair<std::vector<uint64_t, Uint64_tAllocator>, uint64_t>>::type
getCalibratedTimestampsEXT(
ArrayProxy<const VULKAN_HPP_NAMESPACE::CalibratedTimestampInfoEXT> const & timestampInfos,
Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const;
template <typename Uint64_tAllocator = std::allocator<uint64_t>,
typename Dispatch = VULKAN_HPP_DEFAULT_DISPATCHER_TYPE,
typename B = Uint64_tAllocator,
typename std::enable_if<std::is_same<typename B::value_type, uint64_t>::value, int>::type = 0>
VULKAN_HPP_NODISCARD_WHEN_NO_EXCEPTIONS
typename ResultValueType<std::pair<std::vector<uint64_t, Uint64_tAllocator>, uint64_t>>::type
getCalibratedTimestampsEXT(
ArrayProxy<const VULKAN_HPP_NAMESPACE::CalibratedTimestampInfoEXT> const & timestampInfos,
Uint64_tAllocator & uint64_tAllocator,
Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const;
#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/
#ifdef VK_ENABLE_BETA_EXTENSIONS
@@ -97657,10 +97674,12 @@ namespace VULKAN_HPP_NAMESPACE
pTimestamps,
pMaxDeviation ) );
}
#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE
template <typename Dispatch>
VULKAN_HPP_NODISCARD_WHEN_NO_EXCEPTIONS VULKAN_HPP_INLINE typename ResultValueType<uint64_t>::type
Device::getCalibratedTimestampsEXT(
VULKAN_HPP_DEPRECATED( "This function is deprecated. Use one of the other flavours of it." )
VULKAN_HPP_NODISCARD_WHEN_NO_EXCEPTIONS VULKAN_HPP_INLINE
typename ResultValueType<uint64_t>::type Device::getCalibratedTimestampsEXT(
ArrayProxy<const VULKAN_HPP_NAMESPACE::CalibratedTimestampInfoEXT> const & timestampInfos,
ArrayProxy<uint64_t> const & timestamps,
Dispatch const & d ) const
@@ -97684,6 +97703,52 @@ namespace VULKAN_HPP_NAMESPACE
return createResultValue(
result, maxDeviation, VULKAN_HPP_NAMESPACE_STRING "::Device::getCalibratedTimestampsEXT" );
}
template <typename Uint64_tAllocator, typename Dispatch>
VULKAN_HPP_NODISCARD_WHEN_NO_EXCEPTIONS VULKAN_HPP_INLINE
typename ResultValueType<std::pair<std::vector<uint64_t, Uint64_tAllocator>, uint64_t>>::type
Device::getCalibratedTimestampsEXT(
ArrayProxy<const VULKAN_HPP_NAMESPACE::CalibratedTimestampInfoEXT> const & timestampInfos,
Dispatch const & d ) const
{
std::pair<std::vector<uint64_t, Uint64_tAllocator>, uint64_t> data(
std::piecewise_construct, std::forward_as_tuple( timestampInfos.size() ), std::forward_as_tuple( 0 ) );
std::vector<uint64_t, Uint64_tAllocator> & timestamps = data.first;
uint64_t & maxDeviation = data.second;
Result result = static_cast<Result>(
d.vkGetCalibratedTimestampsEXT( m_device,
timestampInfos.size(),
reinterpret_cast<const VkCalibratedTimestampInfoEXT *>( timestampInfos.data() ),
timestamps.data(),
&maxDeviation ) );
return createResultValue( result, data, VULKAN_HPP_NAMESPACE_STRING "::Device::getCalibratedTimestampsEXT" );
}
template <typename Uint64_tAllocator,
typename Dispatch,
typename B,
typename std::enable_if<std::is_same<typename B::value_type, uint64_t>::value, int>::type>
VULKAN_HPP_NODISCARD_WHEN_NO_EXCEPTIONS VULKAN_HPP_INLINE
typename ResultValueType<std::pair<std::vector<uint64_t, Uint64_tAllocator>, uint64_t>>::type
Device::getCalibratedTimestampsEXT(
ArrayProxy<const VULKAN_HPP_NAMESPACE::CalibratedTimestampInfoEXT> const & timestampInfos,
Uint64_tAllocator & uint64_tAllocator,
Dispatch const & d ) const
{
std::pair<std::vector<uint64_t, Uint64_tAllocator>, uint64_t> data(
std::piecewise_construct,
std::forward_as_tuple( timestampInfos.size(), uint64_tAllocator ),
std::forward_as_tuple( 0 ) );
std::vector<uint64_t, Uint64_tAllocator> & timestamps = data.first;
uint64_t & maxDeviation = data.second;
Result result = static_cast<Result>(
d.vkGetCalibratedTimestampsEXT( m_device,
timestampInfos.size(),
reinterpret_cast<const VkCalibratedTimestampInfoEXT *>( timestampInfos.data() ),
timestamps.data(),
&maxDeviation ) );
return createResultValue( result, data, VULKAN_HPP_NAMESPACE_STRING "::Device::getCalibratedTimestampsEXT" );
}
#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/
#ifdef VK_ENABLE_BETA_EXTENSIONS
@@ -102675,7 +102740,10 @@ namespace VULKAN_HPP_NAMESPACE
{
std::pair<std::vector<PerformanceCounterKHR, PerformanceCounterKHRAllocator>,
std::vector<PerformanceCounterDescriptionKHR, PerformanceCounterDescriptionKHRAllocator>>
enumeratedData;
data;
std::vector<PerformanceCounterKHR, PerformanceCounterKHRAllocator> & counters = data.first;
std::vector<PerformanceCounterDescriptionKHR, PerformanceCounterDescriptionKHRAllocator> & counterDescriptions =
data.second;
uint32_t counterCount;
Result result;
do
@@ -102684,26 +102752,24 @@ namespace VULKAN_HPP_NAMESPACE
m_physicalDevice, queueFamilyIndex, &counterCount, nullptr, nullptr ) );
if ( ( result == Result::eSuccess ) && counterCount )
{
enumeratedData.first.resize( counterCount );
enumeratedData.second.resize( counterCount );
counters.resize( counterCount );
counterDescriptions.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() );
reinterpret_cast<VkPerformanceCounterKHR *>( counters.data() ),
reinterpret_cast<VkPerformanceCounterDescriptionKHR *>( counterDescriptions.data() ) ) );
VULKAN_HPP_ASSERT( counterCount <= counters.size() );
}
} while ( result == Result::eIncomplete );
if ( ( result == Result::eSuccess ) && ( counterCount < enumeratedData.first.size() ) )
if ( ( result == Result::eSuccess ) && ( counterCount < counters.size() ) )
{
enumeratedData.first.resize( counterCount );
enumeratedData.second.resize( counterCount );
counters.resize( counterCount );
counterDescriptions.resize( counterCount );
}
return createResultValue( result,
enumeratedData,
VULKAN_HPP_NAMESPACE_STRING
"::PhysicalDevice::enumerateQueueFamilyPerformanceQueryCountersKHR" );
return createResultValue(
result, data, VULKAN_HPP_NAMESPACE_STRING "::PhysicalDevice::enumerateQueueFamilyPerformanceQueryCountersKHR" );
}
template <typename PerformanceCounterKHRAllocator,
@@ -102725,9 +102791,12 @@ namespace VULKAN_HPP_NAMESPACE
{
std::pair<std::vector<PerformanceCounterKHR, PerformanceCounterKHRAllocator>,
std::vector<PerformanceCounterDescriptionKHR, PerformanceCounterDescriptionKHRAllocator>>
enumeratedData( std::piecewise_construct,
std::forward_as_tuple( performanceCounterKHRAllocator ),
std::forward_as_tuple( performanceCounterDescriptionKHRAllocator ) );
data( std::piecewise_construct,
std::forward_as_tuple( performanceCounterKHRAllocator ),
std::forward_as_tuple( performanceCounterDescriptionKHRAllocator ) );
std::vector<PerformanceCounterKHR, PerformanceCounterKHRAllocator> & counters = data.first;
std::vector<PerformanceCounterDescriptionKHR, PerformanceCounterDescriptionKHRAllocator> & counterDescriptions =
data.second;
uint32_t counterCount;
Result result;
do
@@ -102736,26 +102805,24 @@ namespace VULKAN_HPP_NAMESPACE
m_physicalDevice, queueFamilyIndex, &counterCount, nullptr, nullptr ) );
if ( ( result == Result::eSuccess ) && counterCount )
{
enumeratedData.first.resize( counterCount );
enumeratedData.second.resize( counterCount );
counters.resize( counterCount );
counterDescriptions.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() );
reinterpret_cast<VkPerformanceCounterKHR *>( counters.data() ),
reinterpret_cast<VkPerformanceCounterDescriptionKHR *>( counterDescriptions.data() ) ) );
VULKAN_HPP_ASSERT( counterCount <= counters.size() );
}
} while ( result == Result::eIncomplete );
if ( ( result == Result::eSuccess ) && ( counterCount < enumeratedData.first.size() ) )
if ( ( result == Result::eSuccess ) && ( counterCount < counters.size() ) )
{
enumeratedData.first.resize( counterCount );
enumeratedData.second.resize( counterCount );
counters.resize( counterCount );
counterDescriptions.resize( counterCount );
}
return createResultValue( result,
enumeratedData,
VULKAN_HPP_NAMESPACE_STRING
"::PhysicalDevice::enumerateQueueFamilyPerformanceQueryCountersKHR" );
return createResultValue(
result, data, VULKAN_HPP_NAMESPACE_STRING "::PhysicalDevice::enumerateQueueFamilyPerformanceQueryCountersKHR" );
}
#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/