correct enhanced version of vkGetQueryPoolResults

- mark wrong version as deprecated (C++14)
- introduce new version returning ResultValue<vector<T,Allocator>>
- introduce new singular version returning ResultValue<T>
This commit is contained in:
asuessenbach 2020-09-03 11:20:57 +02:00
parent 51dbd32515
commit 77b401d4a9
4 changed files with 191 additions and 75 deletions

View File

@ -1204,21 +1204,20 @@ void VulkanHppGenerator::appendCommand( std::string & str,
CommandData const & commandData, CommandData const & commandData,
bool definition ) const bool definition ) const
{ {
if ( commandData.params.back().type.isNonConstPointer() && ( commandData.params.back().type.type == "void" ) && std::map<size_t, size_t> vectorParamIndices = determineVectorParamIndices( commandData.params );
!commandData.params.back().len.empty() ) if ( vectorParamIndices.size() == 1 )
{ {
std::string const & len = commandData.params.back().len; auto vectorParamIndexIt = vectorParamIndices.begin();
auto lenIt = std::find_if( if ( commandData.params[vectorParamIndexIt->first].type.isNonConstPointer() &&
commandData.params.begin(), commandData.params.end(), [&len]( ParamData const & pd ) { return pd.name == len; } ); ( commandData.params[vectorParamIndexIt->first].type.type == "void" ) &&
if ( ( lenIt != commandData.params.end() ) && lenIt->type.isValue() ) commandData.params[vectorParamIndexIt->second].type.isValue() )
{ {
appendCommandFixedSizeVector( str, name, commandData, definition ); appendCommandFixedSizeVector( str, name, commandData, vectorParamIndices, definition );
return; return;
} }
} }
bool twoStep = isTwoStepAlgorithm( commandData.params ); bool twoStep = isTwoStepAlgorithm( commandData.params );
std::map<size_t, size_t> vectorParamIndices = determineVectorParamIndices( commandData.params );
size_t returnParamIndex = determineReturnParamIndex( commandData, vectorParamIndices, twoStep ); size_t returnParamIndex = determineReturnParamIndex( commandData, vectorParamIndices, twoStep );
bool isStructureChain = bool isStructureChain =
@ -1465,24 +1464,32 @@ void VulkanHppGenerator::appendCommand( std::string & str,
} }
} }
void VulkanHppGenerator::appendCommandFixedSizeVector( std::string & str, void VulkanHppGenerator::appendCommandFixedSizeVector( std::string & str,
std::string const & name, std::string const & name,
CommandData const & commandData, CommandData const & commandData,
bool definition ) const std::map<size_t, size_t> const & vectorParamIndices,
bool definition ) const
{ {
assert( commandData.returnType == "VkResult" ); assert( commandData.returnType == "VkResult" );
assert( commandData.successCodes.size() == 1 ); assert( vectorParamIndices.size() == 1 );
std::map<size_t, size_t>::const_iterator vectorParamIndexIt = vectorParamIndices.begin();
std::map<size_t, size_t> vectorParamIndices = determineVectorParamIndices( commandData.params ); std::string enter, leave;
std::string enter, leave; std::tie( enter, leave ) = generateProtection( commandData.feature, commandData.extensions );
std::tie( enter, leave ) = generateProtection( commandData.feature, commandData.extensions );
size_t templateParamIndex = commandData.params.size() - 1;
assert( ( vectorParamIndices.size() == 1 ) &&
( vectorParamIndices.find( templateParamIndex ) != vectorParamIndices.end() ) );
std::string commandName = startLowerCase( stripPrefix( name, "vk" ) ); std::string commandName = startLowerCase( stripPrefix( name, "vk" ) );
std::string commandNameSingular = stripPluralS( commandName ); std::string commandNameSingular = stripPluralS( commandName );
std::string nodiscard =
( 1 < commandData.successCodes.size() )
? "VULKAN_HPP_NODISCARD "
: ( ( 1 < commandData.errorCodes.size() ) ? "VULKAN_HPP_NODISCARD_WHEN_NO_EXCEPTIONS " : "" );
std::string returnType = ( 1 < commandData.successCodes.size() )
? "ResultValue<std::vector<T,Allocator>>"
: "typename ResultValueType<std::vector<T,Allocator>>::type";
std::string returnTypeDeprecated =
( 1 < commandData.successCodes.size() ) ? "Result" : "typename ResultValueType<void>::type";
std::string returnTypeSingular =
( 1 < commandData.successCodes.size() ) ? "ResultValue<T>" : "typename ResultValueType<T>::type";
if ( definition ) if ( definition )
{ {
@ -1496,61 +1503,76 @@ ${enter} template <typename Dispatch>
#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE #ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE
template <typename T, typename Dispatch> template <typename T, typename Dispatch>
VULKAN_HPP_DEPRECATED( "This function is deprecated. Use one of the other flavours of it.") 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<void>::type ${className}::${commandName}( ${argumentListEnhancedDeprecated} ) const ${nodiscard}VULKAN_HPP_INLINE ${returnTypeDeprecated} ${className}::${commandName}( ${argumentListEnhancedDeprecated} ) const
{ {
${functionBodyEnhancedDeprecated} ${functionBodyEnhancedDeprecated}
} }
template <typename T, typename Allocator, typename Dispatch> template <typename T, typename Allocator, typename Dispatch>
VULKAN_HPP_NODISCARD_WHEN_NO_EXCEPTIONS VULKAN_HPP_INLINE typename ResultValueType<std::vector<T,Allocator>>::type ${className}::${commandName}( ${argumentListEnhanced} ) const ${nodiscard}VULKAN_HPP_INLINE ${returnType} ${className}::${commandName}( ${argumentListEnhanced} ) const
{ {
VULKAN_HPP_ASSERT( ${dataSize} % sizeof( T ) == 0 ); VULKAN_HPP_ASSERT( ${dataSize} % sizeof( T ) == 0 );
std::vector<T,Allocator> ${dataName}( ${dataSize} / sizeof( T ) ); std::vector<T,Allocator> ${dataName}( ${dataSize} / sizeof( T ) );
${functionCall} ${functionCall}
return createResultValue( result, ${dataName}, VULKAN_HPP_NAMESPACE_STRING "::${className}::${commandName}" ); return createResultValue( result, ${dataName}, VULKAN_HPP_NAMESPACE_STRING "::${className}::${commandName}"${successCodeList} );
} }
template <typename T, typename Dispatch> template <typename T, typename Dispatch>
VULKAN_HPP_NODISCARD_WHEN_NO_EXCEPTIONS typename ResultValueType<T>::type ${className}::${commandNameSingular}( ${argumentListEnhancedSingular} ) const ${nodiscard}VULKAN_HPP_INLINE ${returnTypeSingular} ${className}::${commandNameSingular}( ${argumentListEnhancedSingular} ) const
{ {
T ${dataName}; T ${dataName};
${functionCallSingular} ${functionCallSingular}
return createResultValue( result, ${dataName}, VULKAN_HPP_NAMESPACE_STRING "::${className}::${commandName}" ); return createResultValue( result, ${dataName}, VULKAN_HPP_NAMESPACE_STRING "::${className}::${commandName}"${successCodeList} );
} }
#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ #endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/
${leave} ${leave}
)"; )";
std::string functionCall = constructFunctionBodyEnhancedSingleStep( std::string functionCall = constructFunctionBodyEnhancedSingleStep(
" ", name, commandData, templateParamIndex, templateParamIndex, vectorParamIndices, false ); " ", name, commandData, vectorParamIndexIt->first, vectorParamIndexIt->first, vectorParamIndices, false );
std::string functionCallSingular = constructFunctionBodyEnhancedSingleStep( std::string functionCallSingular = constructFunctionBodyEnhancedSingleStep(
" ", name, commandData, templateParamIndex, templateParamIndex, vectorParamIndices, true ); " ", name, commandData, vectorParamIndexIt->first, vectorParamIndexIt->first, vectorParamIndices, true );
std::string successCodeList;
if ( 1 < commandData.successCodes.size() )
{
successCodeList = ", { Result::" + createSuccessCode( commandData.successCodes[0], m_tags );
for ( size_t i = 1; i < commandData.successCodes.size(); ++i )
{
successCodeList += ", Result::" + createSuccessCode( commandData.successCodes[i], m_tags );
}
successCodeList += " }";
}
str += replaceWithMap( str += replaceWithMap(
functionTemplate, functionTemplate,
std::map<std::string, std::string>( std::map<std::string, std::string>(
{ { "argumentListEnhanced", { { "argumentListEnhanced",
constructFunctionHeaderArgumentsEnhanced( constructFunctionHeaderArgumentsEnhanced(
commandData, templateParamIndex, templateParamIndex, {}, false, false, false ) }, commandData, vectorParamIndexIt->first, vectorParamIndexIt->first, {}, false, false, false ) },
{ "argumentListEnhancedDeprecated", { "argumentListEnhancedDeprecated",
constructFunctionHeaderArgumentsEnhanced( constructFunctionHeaderArgumentsEnhanced(
commandData, INVALID_INDEX, templateParamIndex, vectorParamIndices, false, false, false ) }, commandData, INVALID_INDEX, vectorParamIndexIt->first, vectorParamIndices, false, false, false ) },
{ "argumentListEnhancedSingular", { "argumentListEnhancedSingular",
constructFunctionHeaderArgumentsEnhanced( constructFunctionHeaderArgumentsEnhanced( commandData,
commandData, templateParamIndex, templateParamIndex, vectorParamIndices, true, false, false ) }, vectorParamIndexIt->first,
vectorParamIndexIt->first,
vectorParamIndices,
true,
false,
false ) },
{ "argumentListStandard", constructFunctionHeaderArgumentsStandard( commandData, false ) }, { "argumentListStandard", constructFunctionHeaderArgumentsStandard( commandData, false ) },
{ "className", stripPrefix( commandData.handle, "Vk" ) }, { "className", stripPrefix( commandData.handle, "Vk" ) },
{ "commandName", commandName }, { "commandName", commandName },
{ "commandNameSingular", commandNameSingular }, { "commandNameSingular", commandNameSingular },
{ "dataName", startLowerCase( stripPrefix( commandData.params[templateParamIndex].name, "p" ) ) }, { "dataName", startLowerCase( stripPrefix( commandData.params[vectorParamIndexIt->first].name, "p" ) ) },
{ "dataSize", commandData.params[templateParamIndex].len }, { "dataSize", commandData.params[vectorParamIndexIt->first].len },
{ "enter", enter }, { "enter", enter },
{ "functionBodyEnhancedDeprecated", { "functionBodyEnhancedDeprecated",
constructFunctionBodyEnhanced( " ", constructFunctionBodyEnhanced( " ",
name, name,
commandData, commandData,
INVALID_INDEX, INVALID_INDEX,
templateParamIndex, vectorParamIndexIt->first,
vectorParamIndices, vectorParamIndices,
false, false,
"void", "void",
@ -1562,6 +1584,11 @@ ${leave}
{ "functionCall", functionCall }, { "functionCall", functionCall },
{ "functionCallSingular", functionCallSingular }, { "functionCallSingular", functionCallSingular },
{ "leave", leave }, { "leave", leave },
{ "nodiscard", nodiscard },
{ "successCodeList", successCodeList },
{ "returnType", returnType },
{ "returnTypeDeprecated", returnTypeDeprecated },
{ "returnTypeSingular", returnTypeSingular },
{ "vkCommandName", name } } ) ); { "vkCommandName", name } } ) );
} }
else else
@ -1571,11 +1598,11 @@ ${enter} template <typename Dispatch = VULKAN_HPP_DEFAULT_DISPATCHER_TYPE>
VULKAN_HPP_NODISCARD Result ${commandName}( ${argumentListStandard} ) const VULKAN_HPP_NOEXCEPT; VULKAN_HPP_NODISCARD Result ${commandName}( ${argumentListStandard} ) const VULKAN_HPP_NOEXCEPT;
#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE #ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE
template <typename T, typename Dispatch = VULKAN_HPP_DEFAULT_DISPATCHER_TYPE> template <typename T, typename Dispatch = VULKAN_HPP_DEFAULT_DISPATCHER_TYPE>
VULKAN_HPP_NODISCARD_WHEN_NO_EXCEPTIONS typename ResultValueType<void>::type ${commandName}( ${argumentListEnhancedDeprecated} ) const; ${nodiscard}${returnTypeDeprecated} ${commandName}( ${argumentListEnhancedDeprecated} ) const;
template <typename T, typename Allocator = std::allocator<T>, typename Dispatch = VULKAN_HPP_DEFAULT_DISPATCHER_TYPE> template <typename T, typename Allocator = std::allocator<T>, typename Dispatch = VULKAN_HPP_DEFAULT_DISPATCHER_TYPE>
VULKAN_HPP_NODISCARD_WHEN_NO_EXCEPTIONS typename ResultValueType<std::vector<T,Allocator>>::type ${commandName}( ${argumentListEnhanced} ) const; ${nodiscard}${returnType} ${commandName}( ${argumentListEnhanced} ) const;
template <typename T, typename Dispatch = VULKAN_HPP_DEFAULT_DISPATCHER_TYPE> template <typename T, typename Dispatch = VULKAN_HPP_DEFAULT_DISPATCHER_TYPE>
VULKAN_HPP_NODISCARD_WHEN_NO_EXCEPTIONS typename ResultValueType<T>::type ${commandNameSingular}( ${argumentListEnhancedSingular} ) const; ${nodiscard}${returnTypeSingular} ${commandNameSingular}( ${argumentListEnhancedSingular} ) const;
#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ #endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/
${leave} ${leave}
)"; )";
@ -1585,18 +1612,27 @@ ${leave}
std::map<std::string, std::string>( std::map<std::string, std::string>(
{ { "argumentListEnhanced", { { "argumentListEnhanced",
constructFunctionHeaderArgumentsEnhanced( constructFunctionHeaderArgumentsEnhanced(
commandData, templateParamIndex, templateParamIndex, {}, false, true, false ) }, commandData, vectorParamIndexIt->first, vectorParamIndexIt->first, {}, false, true, false ) },
{ "argumentListEnhancedDeprecated", { "argumentListEnhancedDeprecated",
constructFunctionHeaderArgumentsEnhanced( constructFunctionHeaderArgumentsEnhanced(
commandData, INVALID_INDEX, templateParamIndex, vectorParamIndices, false, true, false ) }, commandData, INVALID_INDEX, vectorParamIndexIt->first, vectorParamIndices, false, true, false ) },
{ "argumentListEnhancedSingular", { "argumentListEnhancedSingular",
constructFunctionHeaderArgumentsEnhanced( constructFunctionHeaderArgumentsEnhanced( commandData,
commandData, templateParamIndex, templateParamIndex, vectorParamIndices, true, true, false ) }, vectorParamIndexIt->first,
vectorParamIndexIt->first,
vectorParamIndices,
true,
true,
false ) },
{ "argumentListStandard", constructFunctionHeaderArgumentsStandard( commandData, true ) }, { "argumentListStandard", constructFunctionHeaderArgumentsStandard( commandData, true ) },
{ "commandName", commandName }, { "commandName", commandName },
{ "commandNameSingular", commandNameSingular }, { "commandNameSingular", commandNameSingular },
{ "enter", enter }, { "enter", enter },
{ "leave", leave } } ) ); { "leave", leave },
{ "nodiscard", nodiscard },
{ "returnType", returnType },
{ "returnTypeDeprecated", returnTypeDeprecated },
{ "returnTypeSingular", returnTypeSingular } } ) );
} }
if ( !commandData.aliasData.empty() ) if ( !commandData.aliasData.empty() )
@ -1608,7 +1644,7 @@ ${leave}
aliasCommandData.extensions = ad.second.extensions; aliasCommandData.extensions = ad.second.extensions;
aliasCommandData.feature = ad.second.feature; aliasCommandData.feature = ad.second.feature;
aliasCommandData.xmlLine = ad.second.xmlLine; aliasCommandData.xmlLine = ad.second.xmlLine;
appendCommandFixedSizeVector( str, ad.first, aliasCommandData, definition ); appendCommandFixedSizeVector( str, ad.first, aliasCommandData, vectorParamIndices, definition );
} }
} }
} }

View File

@ -311,10 +311,11 @@ private:
std::string const & name, std::string const & name,
CommandData const & commandData, CommandData const & commandData,
bool definition ) const; bool definition ) const;
void appendCommandFixedSizeVector( std::string & str, void appendCommandFixedSizeVector( std::string & str,
std::string const & name, std::string const & name,
CommandData const & commandData, CommandData const & commandData,
bool definition ) const; std::map<size_t, size_t> const & vectorParamIndices,
bool definition ) const;
void appendDispatchLoaderDynamicCommand( std::string & str, void appendDispatchLoaderDynamicCommand( std::string & str,
std::string & emptyFunctions, std::string & emptyFunctions,
std::string & deviceFunctions, std::string & deviceFunctions,

View File

@ -202,14 +202,14 @@ int main( int /*argc*/, char ** /*argv*/ )
graphicsQueue.waitIdle(); graphicsQueue.waitIdle();
uint64_t samplesPassed[2]; vk::ResultValue<std::vector<uint64_t>> rv =
vk::Result result = device->getQueryPoolResults( queryPool.get(), device->getQueryPoolResults<uint64_t>( *queryPool,
0, 0,
2, 2,
vk::ArrayProxy<uint64_t>( 4, samplesPassed ), 2 * sizeof( uint64_t ),
sizeof( uint64_t ), sizeof( uint64_t ),
vk::QueryResultFlagBits::e64 | vk::QueryResultFlagBits::eWait ); vk::QueryResultFlagBits::e64 | vk::QueryResultFlagBits::eWait );
switch ( result ) switch ( rv.result )
{ {
case vk::Result::eSuccess: break; case vk::Result::eSuccess: break;
case vk::Result::eNotReady: std::cout << "vk::Device::getQueryPoolResults returned vk::Result::eNotReady !\n"; case vk::Result::eNotReady: std::cout << "vk::Device::getQueryPoolResults returned vk::Result::eNotReady !\n";
@ -217,8 +217,8 @@ int main( int /*argc*/, char ** /*argv*/ )
} }
std::cout << "vkGetQueryPoolResults data\n"; std::cout << "vkGetQueryPoolResults data\n";
std::cout << "samples_passed[0] = " << samplesPassed[0] << "\n"; std::cout << "samples_passed[0] = " << rv.value[0] << "\n";
std::cout << "samples_passed[1] = " << samplesPassed[1] << "\n"; std::cout << "samples_passed[1] = " << rv.value[1] << "\n";
/* Read back query result from buffer */ /* Read back query result from buffer */
uint64_t * samplesPassedPtr = static_cast<uint64_t *>( uint64_t * samplesPassedPtr = static_cast<uint64_t *>(
@ -233,7 +233,7 @@ int main( int /*argc*/, char ** /*argv*/ )
while ( vk::Result::eTimeout == device->waitForFences( drawFence.get(), VK_TRUE, vk::su::FenceTimeout ) ) while ( vk::Result::eTimeout == device->waitForFences( drawFence.get(), VK_TRUE, vk::su::FenceTimeout ) )
; ;
result = presentQueue.presentKHR( vk::PresentInfoKHR( {}, *swapChainData.swapChain, currentBuffer.value ) ); vk::Result result = presentQueue.presentKHR( vk::PresentInfoKHR( {}, *swapChainData.swapChain, currentBuffer.value ) );
switch ( result ) switch ( result )
{ {
case vk::Result::eSuccess: break; case vk::Result::eSuccess: break;

View File

@ -53721,6 +53721,25 @@ namespace VULKAN_HPP_NAMESPACE
VULKAN_HPP_NAMESPACE::DeviceSize stride, VULKAN_HPP_NAMESPACE::DeviceSize stride,
VULKAN_HPP_NAMESPACE::QueryResultFlags flags, VULKAN_HPP_NAMESPACE::QueryResultFlags flags,
Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const; Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const;
template <typename T,
typename Allocator = std::allocator<T>,
typename Dispatch = VULKAN_HPP_DEFAULT_DISPATCHER_TYPE>
VULKAN_HPP_NODISCARD ResultValue<std::vector<T, Allocator>>
getQueryPoolResults( VULKAN_HPP_NAMESPACE::QueryPool queryPool,
uint32_t firstQuery,
uint32_t queryCount,
size_t dataSize,
VULKAN_HPP_NAMESPACE::DeviceSize stride,
VULKAN_HPP_NAMESPACE::QueryResultFlags flags,
Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const;
template <typename T, typename Dispatch = VULKAN_HPP_DEFAULT_DISPATCHER_TYPE>
VULKAN_HPP_NODISCARD ResultValue<T>
getQueryPoolResult( VULKAN_HPP_NAMESPACE::QueryPool queryPool,
uint32_t firstQuery,
uint32_t queryCount,
VULKAN_HPP_NAMESPACE::DeviceSize stride,
VULKAN_HPP_NAMESPACE::QueryResultFlags flags,
Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const;
#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ #endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/
#ifdef VK_ENABLE_BETA_EXTENSIONS #ifdef VK_ENABLE_BETA_EXTENSIONS
@ -95606,8 +95625,8 @@ namespace VULKAN_HPP_NAMESPACE
} }
template <typename T, typename Dispatch> template <typename T, typename Dispatch>
VULKAN_HPP_NODISCARD_WHEN_NO_EXCEPTIONS typename ResultValueType<T>::type VULKAN_HPP_NODISCARD_WHEN_NO_EXCEPTIONS VULKAN_HPP_INLINE typename ResultValueType<T>::type
Device::getAccelerationStructureHandleNV( VULKAN_HPP_NAMESPACE::AccelerationStructureKHR accelerationStructure, Device::getAccelerationStructureHandleNV( VULKAN_HPP_NAMESPACE::AccelerationStructureKHR accelerationStructure,
Dispatch const & d ) const Dispatch const & d ) const
{ {
T data; T data;
@ -97519,16 +97538,18 @@ namespace VULKAN_HPP_NAMESPACE
static_cast<VkDeviceSize>( stride ), static_cast<VkDeviceSize>( stride ),
static_cast<VkQueryResultFlags>( flags ) ) ); static_cast<VkQueryResultFlags>( flags ) ) );
} }
#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE #ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE
template <typename T, typename Dispatch> template <typename T, typename Dispatch>
VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE Result VULKAN_HPP_DEPRECATED( "This function is deprecated. Use one of the other flavours of it." )
Device::getQueryPoolResults( VULKAN_HPP_NAMESPACE::QueryPool queryPool, VULKAN_HPP_NODISCARD
uint32_t firstQuery, VULKAN_HPP_INLINE Result Device::getQueryPoolResults( VULKAN_HPP_NAMESPACE::QueryPool queryPool,
uint32_t queryCount, uint32_t firstQuery,
ArrayProxy<T> const & data, uint32_t queryCount,
VULKAN_HPP_NAMESPACE::DeviceSize stride, ArrayProxy<T> const & data,
VULKAN_HPP_NAMESPACE::QueryResultFlags flags, VULKAN_HPP_NAMESPACE::DeviceSize stride,
Dispatch const & d ) const VULKAN_HPP_NAMESPACE::QueryResultFlags flags,
Dispatch const & d ) const
{ {
Result result = static_cast<Result>( d.vkGetQueryPoolResults( m_device, Result result = static_cast<Result>( d.vkGetQueryPoolResults( m_device,
static_cast<VkQueryPool>( queryPool ), static_cast<VkQueryPool>( queryPool ),
@ -97541,6 +97562,58 @@ namespace VULKAN_HPP_NAMESPACE
return createResultValue( return createResultValue(
result, VULKAN_HPP_NAMESPACE_STRING "::Device::getQueryPoolResults", { Result::eSuccess, Result::eNotReady } ); result, VULKAN_HPP_NAMESPACE_STRING "::Device::getQueryPoolResults", { Result::eSuccess, Result::eNotReady } );
} }
template <typename T, typename Allocator, typename Dispatch>
VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE ResultValue<std::vector<T, Allocator>>
Device::getQueryPoolResults( VULKAN_HPP_NAMESPACE::QueryPool queryPool,
uint32_t firstQuery,
uint32_t queryCount,
size_t dataSize,
VULKAN_HPP_NAMESPACE::DeviceSize stride,
VULKAN_HPP_NAMESPACE::QueryResultFlags flags,
Dispatch const & d ) const
{
VULKAN_HPP_ASSERT( dataSize % sizeof( T ) == 0 );
std::vector<T, Allocator> data( dataSize / sizeof( T ) );
Result result = static_cast<Result>( d.vkGetQueryPoolResults( m_device,
static_cast<VkQueryPool>( queryPool ),
firstQuery,
queryCount,
data.size() * sizeof( T ),
reinterpret_cast<void *>( data.data() ),
static_cast<VkDeviceSize>( stride ),
static_cast<VkQueryResultFlags>( flags ) ) );
return createResultValue( result,
data,
VULKAN_HPP_NAMESPACE_STRING "::Device::getQueryPoolResults",
{ Result::eSuccess, Result::eNotReady } );
}
template <typename T, typename Dispatch>
VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE ResultValue<T>
Device::getQueryPoolResult( VULKAN_HPP_NAMESPACE::QueryPool queryPool,
uint32_t firstQuery,
uint32_t queryCount,
VULKAN_HPP_NAMESPACE::DeviceSize stride,
VULKAN_HPP_NAMESPACE::QueryResultFlags flags,
Dispatch const & d ) const
{
T data;
Result result = static_cast<Result>( d.vkGetQueryPoolResults( m_device,
static_cast<VkQueryPool>( queryPool ),
firstQuery,
queryCount,
1 * sizeof( T ),
reinterpret_cast<void *>( &data ),
static_cast<VkDeviceSize>( stride ),
static_cast<VkQueryResultFlags>( flags ) ) );
return createResultValue( result,
data,
VULKAN_HPP_NAMESPACE_STRING "::Device::getQueryPoolResults",
{ Result::eSuccess, Result::eNotReady } );
}
#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ #endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/
#ifdef VK_ENABLE_BETA_EXTENSIONS #ifdef VK_ENABLE_BETA_EXTENSIONS
@ -97602,8 +97675,8 @@ namespace VULKAN_HPP_NAMESPACE
} }
template <typename T, typename Dispatch> template <typename T, typename Dispatch>
VULKAN_HPP_NODISCARD_WHEN_NO_EXCEPTIONS typename ResultValueType<T>::type VULKAN_HPP_NODISCARD_WHEN_NO_EXCEPTIONS VULKAN_HPP_INLINE typename ResultValueType<T>::type
Device::getRayTracingCaptureReplayShaderGroupHandleKHR( VULKAN_HPP_NAMESPACE::Pipeline pipeline, Device::getRayTracingCaptureReplayShaderGroupHandleKHR( VULKAN_HPP_NAMESPACE::Pipeline pipeline,
uint32_t firstGroup, uint32_t firstGroup,
uint32_t groupCount, uint32_t groupCount,
Dispatch const & d ) const Dispatch const & d ) const
@ -97681,8 +97754,11 @@ namespace VULKAN_HPP_NAMESPACE
} }
template <typename T, typename Dispatch> template <typename T, typename Dispatch>
VULKAN_HPP_NODISCARD_WHEN_NO_EXCEPTIONS typename ResultValueType<T>::type Device::getRayTracingShaderGroupHandleKHR( VULKAN_HPP_NODISCARD_WHEN_NO_EXCEPTIONS VULKAN_HPP_INLINE typename ResultValueType<T>::type
VULKAN_HPP_NAMESPACE::Pipeline pipeline, uint32_t firstGroup, uint32_t groupCount, Dispatch const & d ) const Device::getRayTracingShaderGroupHandleKHR( VULKAN_HPP_NAMESPACE::Pipeline pipeline,
uint32_t firstGroup,
uint32_t groupCount,
Dispatch const & d ) const
{ {
T data; T data;
Result result = static_cast<Result>( d.vkGetRayTracingShaderGroupHandlesKHR( m_device, Result result = static_cast<Result>( d.vkGetRayTracingShaderGroupHandlesKHR( m_device,
@ -97754,8 +97830,11 @@ namespace VULKAN_HPP_NAMESPACE
} }
template <typename T, typename Dispatch> template <typename T, typename Dispatch>
VULKAN_HPP_NODISCARD_WHEN_NO_EXCEPTIONS typename ResultValueType<T>::type Device::getRayTracingShaderGroupHandleNV( VULKAN_HPP_NODISCARD_WHEN_NO_EXCEPTIONS VULKAN_HPP_INLINE typename ResultValueType<T>::type
VULKAN_HPP_NAMESPACE::Pipeline pipeline, uint32_t firstGroup, uint32_t groupCount, Dispatch const & d ) const Device::getRayTracingShaderGroupHandleNV( VULKAN_HPP_NAMESPACE::Pipeline pipeline,
uint32_t firstGroup,
uint32_t groupCount,
Dispatch const & d ) const
{ {
T data; T data;
Result result = static_cast<Result>( d.vkGetRayTracingShaderGroupHandlesNV( m_device, Result result = static_cast<Result>( d.vkGetRayTracingShaderGroupHandlesNV( m_device,