Merge pull request #729 from asuessenbach/appendCommand

Special handling for commands that get a size and a void-pointer to write data to
This commit is contained in:
Andreas Süßenbach 2020-09-02 15:29:26 +02:00 committed by GitHub
commit 6c39ce3f65
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 758 additions and 434 deletions

View File

@ -31,10 +31,8 @@ void appendArgumentCount( std::string & str,
bool twoStep,
bool singular );
std::string appendFunctionBodyEnhancedLocalReturnVariableSingular( std::string & str,
std::string const & indentation,
std::string const & returnName,
std::string const & typeName,
bool isStructureChain );
std::string const & typeName );
void appendReinterpretCast( std::string & str,
bool leadingConst,
std::string const & type,
@ -137,24 +135,12 @@ void appendArgumentCount( std::string & str,
}
std::string appendFunctionBodyEnhancedLocalReturnVariableSingular( std::string & str,
std::string const & indentation,
std::string const & returnName,
std::string const & typeName,
bool isStructureChain )
std::string const & typeName )
{
std::string strippedReturnName = stripPluralS( returnName );
if ( isStructureChain )
{
// For StructureChains use the template parameters
str += "StructureChain<X, Y, Z...> structureChain;\n" + indentation + " " + typeName + "& " + strippedReturnName +
" = structureChain.template get<" + typeName + ">()";
strippedReturnName = "structureChain";
}
else
{
// in singular case, just use the return parameters pure type for the return variable
str += typeName + " " + strippedReturnName;
}
return strippedReturnName;
}
@ -663,8 +649,10 @@ std::string stripPluralS( std::string const & name )
{
std::string strippedName( name );
size_t pos = strippedName.rfind( 's' );
assert( pos != std::string::npos );
if ( pos != std::string::npos )
{
strippedName.erase( pos, 1 );
}
return strippedName;
}
@ -832,19 +820,11 @@ void VulkanHppGenerator::appendArgumentPlainType( std::string & str, ParamData c
std::string parameterName = startLowerCase( stripPrefix( paramData.name, "p" ) );
if ( paramData.type.prefix.find( "const" ) != std::string::npos )
{
// it's a const pointer
if ( paramData.type.type == "char" )
{
// it's a const pointer to char -> it's a string -> get the data via c_str()
str += parameterName + ( paramData.optional ? ( " ? " + parameterName + "->c_str() : nullptr" ) : ".c_str()" );
}
else
{
// it's const pointer to something else -> just use the name
assert( paramData.type.type != "char" );
// it's const pointer -> just use the name
assert( !paramData.optional );
str += paramData.name;
}
}
else
{
// it's a non-const pointer, and char is the only type that occurs -> use the address of the parameter
@ -1224,6 +1204,19 @@ void VulkanHppGenerator::appendCommand( std::string & str,
CommandData const & commandData,
bool definition ) const
{
if ( commandData.params.back().type.isNonConstPointer() && ( commandData.params.back().type.type == "void" ) &&
!commandData.params.back().len.empty() )
{
std::string const & len = commandData.params.back().len;
auto lenIt = std::find_if(
commandData.params.begin(), commandData.params.end(), [&len]( ParamData const & pd ) { return pd.name == len; } );
if ( ( lenIt != commandData.params.end() ) && lenIt->type.isValue() )
{
appendCommandFixedSizeVector( str, name, commandData, definition );
return;
}
}
bool twoStep = isTwoStepAlgorithm( commandData.params );
std::map<size_t, size_t> vectorParamIndices = determineVectorParamIndices( commandData.params );
@ -1434,6 +1427,7 @@ void VulkanHppGenerator::appendCommand( std::string & str,
// and append one or both of them
if ( standard == enhanced )
{
assert( false ); // never passed this path !
// standard and enhanced string are equal -> just use one of them and we're done
str += standard;
}
@ -1471,6 +1465,149 @@ void VulkanHppGenerator::appendCommand( std::string & str,
}
}
void VulkanHppGenerator::appendCommandFixedSizeVector( std::string & str,
std::string const & name,
CommandData const & commandData,
bool definition ) const
{
assert( commandData.returnType == "VkResult" );
assert( commandData.successCodes.size() == 1 );
std::map<size_t, size_t> vectorParamIndices = determineVectorParamIndices( commandData.params );
std::string enter, leave;
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() ) );
if ( definition )
{
std::string const functionTemplate = R"(
${enter} template <typename Dispatch>
VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE Result ${className}::${commandName}( ${argumentListStandard} ) const VULKAN_HPP_NOEXCEPT
{
${functionBodyStandard}
}
#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE
template <typename T, typename Dispatch>
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
{
${functionBodyEnhancedDeprecated}
}
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
{
VULKAN_HPP_ASSERT( ${dataSize} % sizeof( T ) == 0 );
std::vector<T,Allocator> ${dataName}( ${dataSize} / sizeof( T ) );
${functionCall}
return createResultValue( result, ${dataName}, VULKAN_HPP_NAMESPACE_STRING "::${className}::${commandName}" );
}
template <typename T, typename Dispatch>
VULKAN_HPP_NODISCARD_WHEN_NO_EXCEPTIONS typename ResultValueType<T>::type ${className}::${commandName}( ${argumentListEnhancedSingular} ) const
{
T ${dataName};
${functionCallSingular}
return createResultValue( result, ${dataName}, VULKAN_HPP_NAMESPACE_STRING "::${className}::${commandName}" );
}
#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/
${leave}
)";
std::string functionCall = constructFunctionBodyEnhancedSingleStep(
" ", name, commandData, templateParamIndex, templateParamIndex, vectorParamIndices, false );
std::string functionCallSingular = constructFunctionBodyEnhancedSingleStep(
" ", name, commandData, templateParamIndex, templateParamIndex, vectorParamIndices, true );
str += replaceWithMap(
functionTemplate,
std::map<std::string, std::string>(
{ { "argumentListEnhanced",
constructFunctionHeaderArgumentsEnhanced(
commandData, templateParamIndex, templateParamIndex, {}, false, false, false ) },
{ "argumentListEnhancedDeprecated",
constructFunctionHeaderArgumentsEnhanced(
commandData, INVALID_INDEX, templateParamIndex, vectorParamIndices, false, false, false ) },
{ "argumentListEnhancedSingular",
constructFunctionHeaderArgumentsEnhanced(
commandData, templateParamIndex, templateParamIndex, vectorParamIndices, true, false, false ) },
{ "argumentListStandard", constructFunctionHeaderArgumentsStandard( commandData, false ) },
{ "className", stripPrefix( commandData.handle, "Vk" ) },
{ "commandName", startLowerCase( stripPrefix( name, "vk" ) ) },
{ "dataName", startLowerCase( stripPrefix( commandData.params[templateParamIndex].name, "p" ) ) },
{ "dataSize", commandData.params[templateParamIndex].len },
{ "enter", enter },
{ "functionBodyEnhancedDeprecated",
constructFunctionBodyEnhanced( " ",
name,
commandData,
INVALID_INDEX,
templateParamIndex,
vectorParamIndices,
false,
"void",
false,
false,
false,
false ) },
{ "functionBodyStandard", constructFunctionBodyStandard( " ", name, commandData ) },
{ "functionCall", functionCall },
{ "functionCallSingular", functionCallSingular },
{ "leave", leave },
{ "vkCommandName", name } } ) );
}
else
{
std::string const functionTemplate = R"(
${enter} template <typename Dispatch = VULKAN_HPP_DEFAULT_DISPATCHER_TYPE>
VULKAN_HPP_NODISCARD Result ${commandName}( ${argumentListStandard} ) const VULKAN_HPP_NOEXCEPT;
#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE
template <typename T, typename Dispatch = VULKAN_HPP_DEFAULT_DISPATCHER_TYPE>
VULKAN_HPP_NODISCARD_WHEN_NO_EXCEPTIONS typename ResultValueType<void>::type ${commandName}( ${argumentListEnhancedDeprecated} ) const;
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;
template <typename T, typename Dispatch = VULKAN_HPP_DEFAULT_DISPATCHER_TYPE>
VULKAN_HPP_NODISCARD_WHEN_NO_EXCEPTIONS typename ResultValueType<T>::type ${commandName}( ${argumentListEnhancedSingular} ) const;
#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/
${leave}
)";
str += replaceWithMap(
functionTemplate,
std::map<std::string, std::string>(
{ { "argumentListEnhanced",
constructFunctionHeaderArgumentsEnhanced(
commandData, templateParamIndex, templateParamIndex, {}, false, true, false ) },
{ "argumentListEnhancedDeprecated",
constructFunctionHeaderArgumentsEnhanced(
commandData, INVALID_INDEX, templateParamIndex, vectorParamIndices, false, true, false ) },
{ "argumentListEnhancedSingular",
constructFunctionHeaderArgumentsEnhanced(
commandData, templateParamIndex, templateParamIndex, vectorParamIndices, true, true, false ) },
{ "argumentListStandard", constructFunctionHeaderArgumentsStandard( commandData, true ) },
{ "commandName", startLowerCase( stripPrefix( name, "vk" ) ) },
{ "enter", enter },
{ "leave", leave } } ) );
}
if ( !commandData.aliasData.empty() )
{
CommandData aliasCommandData = commandData;
aliasCommandData.aliasData.clear();
for ( auto const & ad : commandData.aliasData )
{
aliasCommandData.extensions = ad.second.extensions;
aliasCommandData.feature = ad.second.feature;
aliasCommandData.xmlLine = ad.second.xmlLine;
appendCommandFixedSizeVector( str, ad.first, aliasCommandData, definition );
}
}
}
void VulkanHppGenerator::appendDispatchLoaderDynamic( std::string & str )
{
str += R"(
@ -2133,8 +2270,7 @@ void VulkanHppGenerator::appendFunction( std::string & str,
str += indentation + "{\n";
if ( enhanced )
{
appendFunctionBodyEnhanced( str,
indentation,
str += constructFunctionBodyEnhanced( indentation,
name,
commandData,
returnParamIndex,
@ -2149,100 +2285,12 @@ void VulkanHppGenerator::appendFunction( std::string & str,
}
else
{
appendFunctionBodyStandard( str, indentation, name, commandData );
str += constructFunctionBodyStandard( indentation, name, commandData );
}
str += indentation + "}\n";
}
}
void VulkanHppGenerator::appendFunctionBodyEnhanced( std::string & str,
std::string const & indentation,
std::string const & name,
CommandData const & commandData,
size_t returnParamIndex,
size_t templateParamIndex,
std::map<size_t, size_t> const & vectorParamIndices,
bool twoStep,
std::string const & enhancedReturnType,
bool singular,
bool unique,
bool isStructureChain,
bool withAllocator ) const
{
if ( unique && !singular &&
( vectorParamIndices.find( returnParamIndex ) != vectorParamIndices.end() ) ) // returns a vector of UniqueStuff
{
appendFunctionBodyEnhancedVectorOfUniqueHandles( str,
indentation,
name,
commandData,
returnParamIndex,
templateParamIndex,
vectorParamIndices,
twoStep,
singular,
withAllocator );
}
else if ( isStructureChain && ( vectorParamIndices.find( returnParamIndex ) != vectorParamIndices.end() ) )
{
appendFunctionBodyEnhancedVectorOfStructureChain(
str, indentation, name, commandData, returnParamIndex, vectorParamIndices, withAllocator );
}
else
{
if ( 1 < vectorParamIndices.size() )
{
appendFunctionBodyEnhancedMultiVectorSizeCheck(
str, indentation, name, commandData, returnParamIndex, vectorParamIndices );
}
std::string returnName;
if ( returnParamIndex != INVALID_INDEX )
{
returnName = appendFunctionBodyEnhancedLocalReturnVariable( str,
indentation,
commandData,
returnParamIndex,
vectorParamIndices,
twoStep,
enhancedReturnType,
singular,
isStructureChain,
withAllocator );
}
if ( twoStep )
{
appendFunctionBodyEnhancedTwoStep( str,
indentation,
name,
commandData,
returnParamIndex,
templateParamIndex,
vectorParamIndices,
singular,
returnName );
}
else
{
appendFunctionBodyEnhancedSingleStep(
str, indentation, name, commandData, returnParamIndex, templateParamIndex, vectorParamIndices, singular );
}
if ( ( commandData.returnType == "VkResult" ) || !commandData.successCodes.empty() )
{
appendFunctionBodyEnhancedReturnResultValue(
str, indentation, returnName, name, commandData, returnParamIndex, twoStep, singular, unique );
}
else if ( ( returnParamIndex != INVALID_INDEX ) &&
( stripPrefix( commandData.returnType, "Vk" ) != enhancedReturnType ) )
{
// for the other returning cases, when the return type is somhow enhanced, just return the local returnVariable
str += indentation + " return " + returnName + ";\n";
}
}
}
std::string VulkanHppGenerator::appendFunctionBodyEnhancedLocalReturnVariable(
std::string & str,
std::string const & indentation,
@ -2259,14 +2307,13 @@ std::string VulkanHppGenerator::appendFunctionBodyEnhancedLocalReturnVariable(
std::string returnName = startLowerCase( stripPrefix( commandData.params[returnParamIndex].name, "p" ) );
// there is a returned parameter -> we need a local variable to hold that value
if ( stripPrefix( commandData.returnType, "Vk" ) != enhancedReturnType )
{
assert( stripPrefix( commandData.returnType, "Vk" ) != enhancedReturnType );
// the returned parameter is somehow enhanced by us
str += indentation + " ";
if ( singular )
{
returnName = appendFunctionBodyEnhancedLocalReturnVariableSingular(
str, indentation, returnName, pureReturnType, isStructureChain );
assert( !isStructureChain );
returnName = appendFunctionBodyEnhancedLocalReturnVariableSingular( str, returnName, pureReturnType );
}
else
{
@ -2295,14 +2342,6 @@ std::string VulkanHppGenerator::appendFunctionBodyEnhancedLocalReturnVariable(
}
}
str += ";\n";
}
else
{
// the return parameter is not enhanced -> the type is supposed to be a Result and there are more than one success
// codes!
assert( ( commandData.returnType == "VkResult" ) && ( 1 < commandData.successCodes.size() ) );
str += indentation + " " + pureReturnType + " " + returnName + ";\n";
}
return returnName;
}
@ -2325,11 +2364,6 @@ void VulkanHppGenerator::appendFunctionBodyEnhancedLocalReturnVariableVectorSize
// -> replace the '->' by '.' and filter out the leading 'p' to access that value
size = startLowerCase( stripPrefix( params[returnParamIndex].len, "p" ) );
size_t pos = size.find( "->" );
// older versions of the vk.xml used the notation parameter::member !
if ( pos == std::string::npos )
{
pos = size.find( "::" );
}
assert( pos != std::string::npos );
size.replace( pos, 2, "." );
}
@ -2346,11 +2380,6 @@ void VulkanHppGenerator::appendFunctionBodyEnhancedLocalReturnVariableVectorSize
break;
}
}
if ( size.empty() )
{
// otherwise, just use that parameter
size = params[vectorParamIndex.second].name;
}
}
assert( !size.empty() );
str += "( " + size + ( withAllocator ? ", vectorAllocator" : "" ) + " )";
@ -2416,12 +2445,7 @@ void VulkanHppGenerator::appendFunctionBodyEnhancedReturnResultValue( std::strin
: "";
std::string commandName = determineCommandName( name, commandData.params[0].type.type );
if ( commandData.returnType == "void" )
{
std::cerr << "warning: skipping appendFunctionBodyEnhancedReturnResultValue for function " << commandName
<< " because the returnType is void";
return;
}
assert( commandData.returnType != "void" );
if ( unique )
{
@ -2470,32 +2494,6 @@ void VulkanHppGenerator::appendFunctionBodyEnhancedReturnResultValue( std::strin
str += " );\n";
}
void VulkanHppGenerator::appendFunctionBodyEnhancedSingleStep( std::string & str,
std::string const & indentation,
std::string const & name,
CommandData const & commandData,
size_t returnParamIndex,
size_t templateParamIndex,
std::map<size_t, size_t> const & vectorParamIndices,
bool singular ) const
{
str += indentation + " ";
if ( commandData.returnType == "VkResult" )
{
str += "Result result = static_cast<Result>( ";
}
else if ( commandData.returnType != "void" )
{
str += "return ";
}
appendCall( str, name, commandData, returnParamIndex, templateParamIndex, vectorParamIndices, false, true, singular );
if ( commandData.returnType == "VkResult" )
{
str += " )";
}
str += ";\n";
}
void VulkanHppGenerator::appendFunctionBodyEnhancedTwoStep( std::string & str,
std::string const & indentation,
std::string const & name,
@ -2705,29 +2703,6 @@ ${i} return createResultValue( result, std::move( ${uniqueTypeVariable}s ), VUL
{ "vectorSize", isCreateFunction ? "createInfos.size()" : "allocateInfo." + typeVariable + "Count" } } );
}
void VulkanHppGenerator::appendFunctionBodyStandard( std::string & str,
std::string const & indentation,
std::string const & commandName,
CommandData const & commandData ) const
{
std::pair<bool, std::string> returnData = generateFunctionBodyStandardReturn( commandData.returnType );
assert( commandData.handle.empty() || ( commandData.handle == commandData.params[0].type.type ) );
str += indentation + " " + returnData.second + "d." + commandName + "( " +
( commandData.handle.empty() ? "" : ( "m_" + startLowerCase( stripPrefix( commandData.handle, "Vk" ) ) ) );
for ( size_t i = commandData.handle.empty() ? 0 : 1; i < commandData.params.size(); i++ )
{
if ( 0 < i )
{
str += ", ";
}
appendFunctionBodyStandardArgument(
str, commandData.params[i].type, commandData.params[i].name, commandData.params[i].arraySizes );
}
str += std::string( " )" ) + ( returnData.first ? " )" : "" ) + ";\n";
}
void VulkanHppGenerator::appendFunctionBodyStandardArgument( std::string & str,
TypeInfo const & typeInfo,
std::string const & name,
@ -2835,18 +2810,14 @@ void VulkanHppGenerator::appendFunctionHeaderArgumentEnhancedPointer( std::strin
// for void-pointer, just use type and name
str += param.type.compose() + " " + param.name;
}
else if ( param.type.type != "char" )
else
{
assert( param.type.type != "char" );
// for non-char-pointer, change to reference
assert( param.type.postfix == "*" );
str += param.type.prefix + ( param.type.prefix.empty() ? "" : " " ) + stripPrefix( param.type.type, "Vk" ) + " & " +
strippedParameterName;
}
else
{
// for char-pointer, change to const reference to std::string
str += "const std::string & " + strippedParameterName;
}
}
void VulkanHppGenerator::appendFunctionHeaderArgumentEnhancedSimple(
@ -2930,18 +2901,12 @@ void VulkanHppGenerator::appendFunctionHeaderArguments( std::string &
str += "(";
if ( enhanced )
{
appendFunctionHeaderArgumentsEnhanced( str,
commandData,
returnParamIndex,
templateParamIndex,
vectorParamIndices,
singular,
withDefaults,
withAllocator );
str += constructFunctionHeaderArgumentsEnhanced(
commandData, returnParamIndex, templateParamIndex, vectorParamIndices, singular, withDefaults, withAllocator );
}
else
{
appendFunctionHeaderArgumentsStandard( str, commandData, withDefaults );
str += constructFunctionHeaderArgumentsStandard( commandData, withDefaults );
}
str += ")";
@ -2951,90 +2916,6 @@ void VulkanHppGenerator::appendFunctionHeaderArguments( std::string &
}
}
void VulkanHppGenerator::appendFunctionHeaderArgumentsEnhanced( std::string & str,
CommandData const & commandData,
size_t returnParamIndex,
size_t templateParamIndex,
std::map<size_t, size_t> const & vectorParamIndices,
bool singular,
bool withDefaults,
bool withAllocator ) const
{
// check if there's at least one argument left to put in here
std::set<size_t> skippedParams = determineSkippedParams( returnParamIndex, vectorParamIndices );
if ( skippedParams.size() + ( commandData.handle.empty() ? 0 : 1 ) < commandData.params.size() )
{
// determine the last argument, where we might provide some default for
size_t lastArgument = INVALID_INDEX;
for ( size_t i = commandData.params.size() - 1; i < commandData.params.size(); i-- )
{
if ( skippedParams.find( i ) == skippedParams.end() )
{
lastArgument = i;
break;
}
}
str += " ";
bool argEncountered = false;
for ( size_t i = commandData.handle.empty() ? 0 : 1; i < commandData.params.size(); i++ )
{
argEncountered = appendFunctionHeaderArgumentEnhanced( str,
commandData.params[i],
i,
vectorParamIndices,
skippedParams.find( i ) != skippedParams.end(),
argEncountered,
( templateParamIndex == i ),
( lastArgument == i ),
singular,
withDefaults,
withAllocator );
}
if ( argEncountered )
{
str += ", ";
}
}
if ( withAllocator )
{
str += "Allocator const& vectorAllocator, ";
}
str += "Dispatch const &d";
if ( withDefaults && !withAllocator )
{
str += " VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT";
}
str += " ";
}
void VulkanHppGenerator::appendFunctionHeaderArgumentsStandard( std::string & str,
CommandData const & commandData,
bool withDefaults ) const
{
// for the standard case, just list all the arguments as we've got them
// determine the last argument, where we might provide some default for
size_t lastArgument = commandData.params.size() - 1;
bool argEncountered = false;
for ( size_t i = commandData.handle.empty() ? 0 : 1; i < commandData.params.size(); i++ )
{
argEncountered = appendFunctionHeaderArgumentStandard(
str, commandData.params[i], argEncountered, lastArgument == i, withDefaults );
}
if ( argEncountered )
{
str += ", ";
}
str += "Dispatch const &d";
if ( withDefaults )
{
str += " VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT";
}
}
bool VulkanHppGenerator::appendFunctionHeaderArgumentStandard(
std::string & str, ParamData const & param, bool argEncountered, bool isLastArgument, bool withDefaults ) const
{
@ -3112,18 +2993,9 @@ void VulkanHppGenerator::appendFunctionHeaderReturnType( std::string &
str += ( useTypename ? "typename ResultValueType<" : "ResultValue<" ) + returnType + ">" +
( useTypename ? "::type " : " " );
}
else if ( ( returnParamIndex != INVALID_INDEX ) && ( 1 < commandData.successCodes.size() ) )
{
// if there is a return parameter at all, and there are multiple success codes, we return a ResultValue<...>
// with the pure return type
assert( commandData.returnType == "VkResult" );
str += "ResultValue<" +
( isStructureChain ? "StructureChain<X, Y, Z...>"
: stripPrefix( commandData.params[returnParamIndex].type.type, "Vk" ) ) +
"> ";
}
else
{
assert( ( returnParamIndex == INVALID_INDEX ) || ( commandData.successCodes.size() <= 1 ) );
// and in every other case, we just return the enhanced return type.
str += ( isStructureChain && !isVector ? "StructureChain<X, Y, Z...>" : enhancedReturnType ) + " ";
}
@ -3703,6 +3575,235 @@ std::string
: "";
}
std::string VulkanHppGenerator::constructFunctionBodyEnhanced( std::string const & indentation,
std::string const & name,
CommandData const & commandData,
size_t returnParamIndex,
size_t templateParamIndex,
std::map<size_t, size_t> const & vectorParamIndices,
bool twoStep,
std::string const & enhancedReturnType,
bool singular,
bool unique,
bool isStructureChain,
bool withAllocator ) const
{
std::string str;
if ( unique && !singular &&
( vectorParamIndices.find( returnParamIndex ) != vectorParamIndices.end() ) ) // returns a vector of UniqueStuff
{
appendFunctionBodyEnhancedVectorOfUniqueHandles( str,
indentation,
name,
commandData,
returnParamIndex,
templateParamIndex,
vectorParamIndices,
twoStep,
singular,
withAllocator );
}
else if ( isStructureChain && ( vectorParamIndices.find( returnParamIndex ) != vectorParamIndices.end() ) )
{
appendFunctionBodyEnhancedVectorOfStructureChain(
str, indentation, name, commandData, returnParamIndex, vectorParamIndices, withAllocator );
}
else
{
if ( 1 < vectorParamIndices.size() )
{
appendFunctionBodyEnhancedMultiVectorSizeCheck(
str, indentation, name, commandData, returnParamIndex, vectorParamIndices );
}
std::string returnName;
if ( returnParamIndex != INVALID_INDEX )
{
returnName = appendFunctionBodyEnhancedLocalReturnVariable( str,
indentation,
commandData,
returnParamIndex,
vectorParamIndices,
twoStep,
enhancedReturnType,
singular,
isStructureChain,
withAllocator );
}
if ( twoStep )
{
appendFunctionBodyEnhancedTwoStep( str,
indentation,
name,
commandData,
returnParamIndex,
templateParamIndex,
vectorParamIndices,
singular,
returnName );
}
else
{
str += constructFunctionBodyEnhancedSingleStep(
indentation, name, commandData, returnParamIndex, templateParamIndex, vectorParamIndices, singular );
}
if ( ( commandData.returnType == "VkResult" ) || !commandData.successCodes.empty() )
{
appendFunctionBodyEnhancedReturnResultValue(
str, indentation, returnName, name, commandData, returnParamIndex, twoStep, singular, unique );
}
else if ( ( returnParamIndex != INVALID_INDEX ) &&
( stripPrefix( commandData.returnType, "Vk" ) != enhancedReturnType ) )
{
// for the other returning cases, when the return type is somhow enhanced, just return the local returnVariable
str += indentation + " return " + returnName + ";\n";
}
}
return str;
}
std::string
VulkanHppGenerator::constructFunctionBodyEnhancedSingleStep( std::string const & indentation,
std::string const & name,
CommandData const & commandData,
size_t returnParamIndex,
size_t templateParamIndex,
std::map<size_t, size_t> const & vectorParamIndices,
bool singular ) const
{
std::string str;
str += indentation + " ";
if ( commandData.returnType == "VkResult" )
{
str += "Result result = static_cast<Result>( ";
}
else if ( commandData.returnType != "void" )
{
str += "return ";
}
appendCall( str, name, commandData, returnParamIndex, templateParamIndex, vectorParamIndices, false, true, singular );
if ( commandData.returnType == "VkResult" )
{
str += " )";
}
str += ";\n";
return str;
}
std::string VulkanHppGenerator::constructFunctionBodyStandard( std::string const & indentation,
std::string const & commandName,
CommandData const & commandData ) const
{
std::string str;
std::pair<bool, std::string> returnData = generateFunctionBodyStandardReturn( commandData.returnType );
assert( commandData.handle.empty() || ( commandData.handle == commandData.params[0].type.type ) );
str += indentation + " " + returnData.second + "d." + commandName + "( " +
( commandData.handle.empty() ? "" : ( "m_" + startLowerCase( stripPrefix( commandData.handle, "Vk" ) ) ) );
for ( size_t i = commandData.handle.empty() ? 0 : 1; i < commandData.params.size(); i++ )
{
if ( 0 < i )
{
str += ", ";
}
appendFunctionBodyStandardArgument(
str, commandData.params[i].type, commandData.params[i].name, commandData.params[i].arraySizes );
}
str += std::string( " )" ) + ( returnData.first ? " )" : "" ) + ";\n";
return str;
}
std::string
VulkanHppGenerator::constructFunctionHeaderArgumentsEnhanced( CommandData const & commandData,
size_t returnParamIndex,
size_t templateParamIndex,
std::map<size_t, size_t> const & vectorParamIndices,
bool singular,
bool withDefaults,
bool withAllocator ) const
{
std::string str;
// check if there's at least one argument left to put in here
std::set<size_t> skippedParams = determineSkippedParams( returnParamIndex, vectorParamIndices );
if ( skippedParams.size() + ( commandData.handle.empty() ? 0 : 1 ) < commandData.params.size() )
{
// determine the last argument, where we might provide some default for
size_t lastArgument = INVALID_INDEX;
for ( size_t i = commandData.params.size() - 1; i < commandData.params.size(); i-- )
{
if ( skippedParams.find( i ) == skippedParams.end() )
{
lastArgument = i;
break;
}
}
str += " ";
bool argEncountered = false;
for ( size_t i = commandData.handle.empty() ? 0 : 1; i < commandData.params.size(); i++ )
{
argEncountered = appendFunctionHeaderArgumentEnhanced( str,
commandData.params[i],
i,
vectorParamIndices,
skippedParams.find( i ) != skippedParams.end(),
argEncountered,
( templateParamIndex == i ),
( lastArgument == i ),
singular,
withDefaults,
withAllocator );
}
if ( argEncountered )
{
str += ", ";
}
}
if ( withAllocator )
{
str += "Allocator const& vectorAllocator, ";
}
str += "Dispatch const &d";
if ( withDefaults && !withAllocator )
{
str += " VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT";
}
str += " ";
return str;
}
std::string VulkanHppGenerator::constructFunctionHeaderArgumentsStandard( CommandData const & commandData,
bool withDefaults ) const
{
std::string str;
// for the standard case, just list all the arguments as we've got them
// determine the last argument, where we might provide some default for
size_t lastArgument = commandData.params.size() - 1;
bool argEncountered = false;
for ( size_t i = commandData.handle.empty() ? 0 : 1; i < commandData.params.size(); i++ )
{
argEncountered = appendFunctionHeaderArgumentStandard(
str, commandData.params[i], argEncountered, lastArgument == i, withDefaults );
}
if ( argEncountered )
{
str += ", ";
}
str += "Dispatch const &d";
if ( withDefaults )
{
str += " VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT";
}
return str;
}
template <class InputIt, class UnaryPredicate>
std::vector<InputIt> findAll( InputIt first, InputIt last, UnaryPredicate p )
{
@ -4906,10 +5007,10 @@ std::string VulkanHppGenerator::determineEnhancedReturnType( CommandData const &
assert( commandData.successCodes.empty() || ( commandData.successCodes[0] == "VK_SUCCESS" ) );
if ( vectorParamIndices.find( returnParamIndex ) != vectorParamIndices.end() )
{
enhancedReturnType =
( commandData.params[returnParamIndex].type.type == "void" )
enhancedReturnType = ( commandData.params[returnParamIndex].type.type == "void" )
? "std::vector<uint8_t,Allocator>" // the return parameter is a vector-type parameter
: isStructureChain ? "std::vector<StructureChain,Allocator>" // for structureChain returns, it's just
: isStructureChain
? "std::vector<StructureChain,Allocator>" // for structureChain returns, it's just
// a vector of StrutureChains
: "std::vector<" + stripPrefix( commandData.params[returnParamIndex].type.type, "Vk" ) +
",Allocator>"; // for the other parameters, we use a vector of the pure type

View File

@ -81,6 +81,16 @@ private:
return ( prefix == rhs.prefix ) && ( type == rhs.type ) && ( postfix == rhs.postfix );
}
bool isNonConstPointer() const
{
return ( prefix.find( "const" ) == std::string::npos ) && ( postfix.find( '*' ) != std::string::npos );
}
bool isValue() const
{
return prefix.empty() && postfix.empty();
}
std::string prefix;
std::string type;
std::string postfix;
@ -111,7 +121,7 @@ private:
{
CommandData( int line ) : xmlLine( line ) {}
std::map<std::string,CommandAliasData> aliasData;
std::map<std::string, CommandAliasData> aliasData;
std::vector<std::string> errorCodes;
std::set<std::string> extensions;
std::string feature;
@ -301,6 +311,10 @@ private:
std::string const & name,
CommandData const & commandData,
bool definition ) const;
void appendCommandFixedSizeVector( std::string & str,
std::string const & name,
CommandData const & commandData,
bool definition ) const;
void appendDispatchLoaderDynamicCommand( std::string & str,
std::string & emptyFunctions,
std::string & deviceFunctions,
@ -308,8 +322,7 @@ private:
std::string & instanceFunctions,
std::string const & commandName,
CommandData const & commandData );
void appendEnum( std::string & str,
std::pair<std::string, EnumData> const & enumData ) const;
void appendEnum( std::string & str, std::pair<std::string, EnumData> const & enumData ) const;
void appendEnumInitializer( std::string & str,
TypeInfo const & type,
std::vector<std::string> const & arraySizes,
@ -330,19 +343,6 @@ private:
bool unique,
bool isStructureChain,
bool withAllocatorArgument ) const;
void appendFunctionBodyEnhanced( std::string & str,
std::string const & indentation,
std::string const & name,
CommandData const & commandData,
size_t returnParamIndex,
size_t templateParamIndex,
std::map<size_t, size_t> const & vectorParamIndices,
bool twoStep,
std::string const & enhancedReturnType,
bool singular,
bool unique,
bool isStructureChain,
bool withAllocator ) const;
std::string appendFunctionBodyEnhancedLocalReturnVariable( std::string & str,
std::string const & indentation,
CommandData const & commandData,
@ -374,14 +374,6 @@ private:
bool twoStep,
bool singular,
bool unique ) const;
void appendFunctionBodyEnhancedSingleStep( std::string & str,
std::string const & indentation,
std::string const & name,
CommandData const & commandData,
size_t returnParamIndex,
size_t templateParamIndex,
std::map<size_t, size_t> const & vectorParamIndices,
bool singular ) const;
void appendFunctionBodyEnhancedTwoStep( std::string & str,
std::string const & indentation,
std::string const & name,
@ -408,10 +400,6 @@ private:
bool twoStep,
bool singular,
bool withAllocator ) const;
void appendFunctionBodyStandard( std::string & str,
std::string const & indentation,
std::string const & commandName,
CommandData const & commandData ) const;
void appendFunctionBodyStandardArgument( std::string & str,
TypeInfo const & typeData,
std::string const & name,
@ -451,17 +439,6 @@ private:
bool singular,
bool withDefaults,
bool withAllocator ) const;
void appendFunctionHeaderArgumentsEnhanced( std::string & str,
CommandData const & commandData,
size_t returnParamIndex,
size_t templateParamIndex,
std::map<size_t, size_t> const & vectorParamIndices,
bool singular,
bool withDefaults,
bool withAllocator ) const;
void appendFunctionHeaderArgumentsStandard( std::string & str,
CommandData const & commandData,
bool withDefaults ) const;
bool appendFunctionHeaderArgumentStandard(
std::string & str, ParamData const & param, bool argEncountered, bool isLastArgument, bool withDefaults ) const;
void appendFunctionHeaderReturnType( std::string & str,
@ -518,6 +495,36 @@ private:
std::string const & parentType,
std::set<std::string> const & childrenTypes ) const;
std::string constructConstexprString( std::pair<std::string, StructureData> const & structData ) const;
std::string constructFunctionBodyEnhanced( std::string const & indentation,
std::string const & name,
CommandData const & commandData,
size_t returnParamIndex,
size_t templateParamIndex,
std::map<size_t, size_t> const & vectorParamIndices,
bool twoStep,
std::string const & enhancedReturnType,
bool singular,
bool unique,
bool isStructureChain,
bool withAllocator ) const;
std::string constructFunctionBodyEnhancedSingleStep( std::string const & indentation,
std::string const & name,
CommandData const & commandData,
size_t returnParamIndex,
size_t templateParamIndex,
std::map<size_t, size_t> const & vectorParamIndices,
bool singular ) const;
std::string constructFunctionBodyStandard( std::string const & indentation,
std::string const & commandName,
CommandData const & commandData ) const;
std::string constructFunctionHeaderArgumentsEnhanced( CommandData const & commandData,
size_t returnParamIndex,
size_t templateParamIndex,
std::map<size_t, size_t> const & vectorParamIndices,
bool singular,
bool withDefaults,
bool withAllocator ) const;
std::string constructFunctionHeaderArgumentsStandard( CommandData const & commandData, bool withDefaults ) const;
void checkCorrectness();
bool containsArray( std::string const & type ) const;
bool containsUnion( std::string const & type ) const;

View File

@ -134,8 +134,7 @@ AccelerationStructureData
std::vector<GeometryInstanceData> geometryInstanceData;
for ( size_t i = 0; i < instances.size(); i++ )
{
uint64_t accelerationStructureHandle = 0;
device->getAccelerationStructureHandleNV<uint64_t>( instances[i].first, accelerationStructureHandle );
uint64_t accelerationStructureHandle = device->getAccelerationStructureHandleNV<uint64_t>( instances[i].first );
// For each instance we set its instance index to its index i in the instance vector, and set
// its hit group index to 2*i. The hit group index defines which entry of the shader binding
@ -1134,12 +1133,12 @@ int main( int /*argc*/, char ** /*argv*/ )
vk::DeviceSize shaderBindingTableSize = hitShaderBindingOffset + hitShaderTableSize;
std::vector<uint8_t> shaderHandleStorage( shaderBindingTableSize );
device->getRayTracingShaderGroupHandlesNV<uint8_t>(
*rayTracingPipeline, 0, 1, { raygenShaderTableSize, &shaderHandleStorage[raygenShaderBindingOffset] } );
device->getRayTracingShaderGroupHandlesNV<uint8_t>(
*rayTracingPipeline, 1, 2, { missShaderTableSize, &shaderHandleStorage[missShaderBindingOffset] } );
device->getRayTracingShaderGroupHandlesNV<uint8_t>(
*rayTracingPipeline, 3, 2, { hitShaderTableSize, &shaderHandleStorage[hitShaderBindingOffset] } );
device->getRayTracingShaderGroupHandlesNV(
*rayTracingPipeline, 0, 1, raygenShaderTableSize, &shaderHandleStorage[raygenShaderBindingOffset] );
device->getRayTracingShaderGroupHandlesNV(
*rayTracingPipeline, 1, 2, missShaderTableSize, &shaderHandleStorage[missShaderBindingOffset] );
device->getRayTracingShaderGroupHandlesNV(
*rayTracingPipeline, 3, 2, hitShaderTableSize, &shaderHandleStorage[hitShaderBindingOffset] );
vk::su::BufferData shaderBindingTableBufferData( physicalDevice,
device,

View File

@ -52,8 +52,7 @@ int main( int /*argc*/, char ** /*argv*/ )
vk::UniqueDevice device =
physicalDevice.createDeviceUnique( vk::DeviceCreateInfo( vk::DeviceCreateFlags(), deviceQueueCreateInfo ) );
std::vector<uint8_t> data;
device->getAccelerationStructureHandleNV<uint8_t>( {}, data, vk::DispatchLoaderDynamic() );
uint64_t handle = device->getAccelerationStructureHandleNV<uint8_t>( {}, vk::DispatchLoaderDynamic() );
std::vector<vk::UniqueCommandBuffer>::allocator_type vectorAllocator;
vk::UniqueCommandBuffer commandBuffer =

View File

@ -52845,6 +52845,17 @@ namespace VULKAN_HPP_NAMESPACE
getAccelerationStructureHandleNV( VULKAN_HPP_NAMESPACE::AccelerationStructureKHR accelerationStructure,
ArrayProxy<T> const & data,
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_WHEN_NO_EXCEPTIONS typename ResultValueType<std::vector<T, Allocator>>::type
getAccelerationStructureHandleNV( VULKAN_HPP_NAMESPACE::AccelerationStructureKHR accelerationStructure,
size_t dataSize,
Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const;
template <typename T, typename Dispatch = VULKAN_HPP_DEFAULT_DISPATCHER_TYPE>
VULKAN_HPP_NODISCARD_WHEN_NO_EXCEPTIONS typename ResultValueType<T>::type
getAccelerationStructureHandleNV( VULKAN_HPP_NAMESPACE::AccelerationStructureKHR accelerationStructure,
Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const;
#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/
#ifdef VK_ENABLE_BETA_EXTENSIONS
@ -53730,6 +53741,23 @@ namespace VULKAN_HPP_NAMESPACE
ArrayProxy<T> const & data,
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_WHEN_NO_EXCEPTIONS typename ResultValueType<std::vector<T, Allocator>>::type
getRayTracingCaptureReplayShaderGroupHandlesKHR( VULKAN_HPP_NAMESPACE::Pipeline pipeline,
uint32_t firstGroup,
uint32_t groupCount,
size_t dataSize,
Dispatch const & d
VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const;
template <typename T, typename Dispatch = VULKAN_HPP_DEFAULT_DISPATCHER_TYPE>
VULKAN_HPP_NODISCARD_WHEN_NO_EXCEPTIONS typename ResultValueType<T>::type
getRayTracingCaptureReplayShaderGroupHandlesKHR( VULKAN_HPP_NAMESPACE::Pipeline pipeline,
uint32_t firstGroup,
uint32_t groupCount,
Dispatch const & d
VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const;
# endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/
#endif /*VK_ENABLE_BETA_EXTENSIONS*/
@ -53750,6 +53778,21 @@ namespace VULKAN_HPP_NAMESPACE
uint32_t groupCount,
ArrayProxy<T> const & data,
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_WHEN_NO_EXCEPTIONS typename ResultValueType<std::vector<T, Allocator>>::type
getRayTracingShaderGroupHandlesKHR( VULKAN_HPP_NAMESPACE::Pipeline pipeline,
uint32_t firstGroup,
uint32_t groupCount,
size_t dataSize,
Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const;
template <typename T, typename Dispatch = VULKAN_HPP_DEFAULT_DISPATCHER_TYPE>
VULKAN_HPP_NODISCARD_WHEN_NO_EXCEPTIONS typename ResultValueType<T>::type
getRayTracingShaderGroupHandlesKHR( VULKAN_HPP_NAMESPACE::Pipeline pipeline,
uint32_t firstGroup,
uint32_t groupCount,
Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const;
# endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/
#endif /*VK_ENABLE_BETA_EXTENSIONS*/
@ -53769,6 +53812,21 @@ namespace VULKAN_HPP_NAMESPACE
uint32_t groupCount,
ArrayProxy<T> const & data,
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_WHEN_NO_EXCEPTIONS typename ResultValueType<std::vector<T, Allocator>>::type
getRayTracingShaderGroupHandlesNV( VULKAN_HPP_NAMESPACE::Pipeline pipeline,
uint32_t firstGroup,
uint32_t groupCount,
size_t dataSize,
Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const;
template <typename T, typename Dispatch = VULKAN_HPP_DEFAULT_DISPATCHER_TYPE>
VULKAN_HPP_NODISCARD_WHEN_NO_EXCEPTIONS typename ResultValueType<T>::type
getRayTracingShaderGroupHandlesNV( VULKAN_HPP_NAMESPACE::Pipeline pipeline,
uint32_t firstGroup,
uint32_t groupCount,
Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const;
#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/
template <typename Dispatch = VULKAN_HPP_DEFAULT_DISPATCHER_TYPE>
@ -95512,10 +95570,13 @@ namespace VULKAN_HPP_NAMESPACE
return static_cast<Result>( d.vkGetAccelerationStructureHandleNV(
m_device, static_cast<VkAccelerationStructureKHR>( accelerationStructure ), dataSize, pData ) );
}
#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE
template <typename T, typename Dispatch>
VULKAN_HPP_NODISCARD_WHEN_NO_EXCEPTIONS VULKAN_HPP_INLINE typename ResultValueType<void>::type
Device::getAccelerationStructureHandleNV( VULKAN_HPP_NAMESPACE::AccelerationStructureKHR accelerationStructure,
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 Device::getAccelerationStructureHandleNV(
VULKAN_HPP_NAMESPACE::AccelerationStructureKHR accelerationStructure,
ArrayProxy<T> const & data,
Dispatch const & d ) const
{
@ -95526,6 +95587,38 @@ namespace VULKAN_HPP_NAMESPACE
reinterpret_cast<void *>( data.data() ) ) );
return createResultValue( result, VULKAN_HPP_NAMESPACE_STRING "::Device::getAccelerationStructureHandleNV" );
}
template <typename T, typename Allocator, typename Dispatch>
VULKAN_HPP_NODISCARD_WHEN_NO_EXCEPTIONS VULKAN_HPP_INLINE typename ResultValueType<std::vector<T, Allocator>>::type
Device::getAccelerationStructureHandleNV( VULKAN_HPP_NAMESPACE::AccelerationStructureKHR accelerationStructure,
size_t dataSize,
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.vkGetAccelerationStructureHandleNV( m_device,
static_cast<VkAccelerationStructureKHR>( accelerationStructure ),
data.size() * sizeof( T ),
reinterpret_cast<void *>( data.data() ) ) );
return createResultValue( result, data, VULKAN_HPP_NAMESPACE_STRING "::Device::getAccelerationStructureHandleNV" );
}
template <typename T, typename Dispatch>
VULKAN_HPP_NODISCARD_WHEN_NO_EXCEPTIONS typename ResultValueType<T>::type
Device::getAccelerationStructureHandleNV( VULKAN_HPP_NAMESPACE::AccelerationStructureKHR accelerationStructure,
Dispatch const & d ) const
{
T data;
Result result = static_cast<Result>(
d.vkGetAccelerationStructureHandleNV( m_device,
static_cast<VkAccelerationStructureKHR>( accelerationStructure ),
1 * sizeof( T ),
reinterpret_cast<void *>( &data ) ) );
return createResultValue( result, data, VULKAN_HPP_NAMESPACE_STRING "::Device::getAccelerationStructureHandleNV" );
}
#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/
#ifdef VK_ENABLE_BETA_EXTENSIONS
@ -97463,10 +97556,13 @@ namespace VULKAN_HPP_NAMESPACE
return static_cast<Result>( d.vkGetRayTracingCaptureReplayShaderGroupHandlesKHR(
m_device, static_cast<VkPipeline>( pipeline ), firstGroup, groupCount, dataSize, pData ) );
}
# ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE
template <typename T, typename Dispatch>
VULKAN_HPP_NODISCARD_WHEN_NO_EXCEPTIONS VULKAN_HPP_INLINE typename ResultValueType<void>::type
Device::getRayTracingCaptureReplayShaderGroupHandlesKHR( VULKAN_HPP_NAMESPACE::Pipeline pipeline,
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 Device::getRayTracingCaptureReplayShaderGroupHandlesKHR(
VULKAN_HPP_NAMESPACE::Pipeline pipeline,
uint32_t firstGroup,
uint32_t groupCount,
ArrayProxy<T> const & data,
@ -97482,6 +97578,48 @@ namespace VULKAN_HPP_NAMESPACE
return createResultValue( result,
VULKAN_HPP_NAMESPACE_STRING "::Device::getRayTracingCaptureReplayShaderGroupHandlesKHR" );
}
template <typename T, typename Allocator, typename Dispatch>
VULKAN_HPP_NODISCARD_WHEN_NO_EXCEPTIONS VULKAN_HPP_INLINE typename ResultValueType<std::vector<T, Allocator>>::type
Device::getRayTracingCaptureReplayShaderGroupHandlesKHR( VULKAN_HPP_NAMESPACE::Pipeline pipeline,
uint32_t firstGroup,
uint32_t groupCount,
size_t dataSize,
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.vkGetRayTracingCaptureReplayShaderGroupHandlesKHR( m_device,
static_cast<VkPipeline>( pipeline ),
firstGroup,
groupCount,
data.size() * sizeof( T ),
reinterpret_cast<void *>( data.data() ) ) );
return createResultValue(
result, data, VULKAN_HPP_NAMESPACE_STRING "::Device::getRayTracingCaptureReplayShaderGroupHandlesKHR" );
}
template <typename T, typename Dispatch>
VULKAN_HPP_NODISCARD_WHEN_NO_EXCEPTIONS typename ResultValueType<T>::type
Device::getRayTracingCaptureReplayShaderGroupHandlesKHR( VULKAN_HPP_NAMESPACE::Pipeline pipeline,
uint32_t firstGroup,
uint32_t groupCount,
Dispatch const & d ) const
{
T data;
Result result =
static_cast<Result>( d.vkGetRayTracingCaptureReplayShaderGroupHandlesKHR( m_device,
static_cast<VkPipeline>( pipeline ),
firstGroup,
groupCount,
1 * sizeof( T ),
reinterpret_cast<void *>( &data ) ) );
return createResultValue(
result, data, VULKAN_HPP_NAMESPACE_STRING "::Device::getRayTracingCaptureReplayShaderGroupHandlesKHR" );
}
# endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/
#endif /*VK_ENABLE_BETA_EXTENSIONS*/
@ -97498,10 +97636,13 @@ namespace VULKAN_HPP_NAMESPACE
return static_cast<Result>( d.vkGetRayTracingShaderGroupHandlesKHR(
m_device, static_cast<VkPipeline>( pipeline ), firstGroup, groupCount, dataSize, pData ) );
}
# ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE
template <typename T, typename Dispatch>
VULKAN_HPP_NODISCARD_WHEN_NO_EXCEPTIONS VULKAN_HPP_INLINE typename ResultValueType<void>::type
Device::getRayTracingShaderGroupHandlesKHR( VULKAN_HPP_NAMESPACE::Pipeline pipeline,
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 Device::getRayTracingShaderGroupHandlesKHR(
VULKAN_HPP_NAMESPACE::Pipeline pipeline,
uint32_t firstGroup,
uint32_t groupCount,
ArrayProxy<T> const & data,
@ -97516,6 +97657,44 @@ namespace VULKAN_HPP_NAMESPACE
reinterpret_cast<void *>( data.data() ) ) );
return createResultValue( result, VULKAN_HPP_NAMESPACE_STRING "::Device::getRayTracingShaderGroupHandlesKHR" );
}
template <typename T, typename Allocator, typename Dispatch>
VULKAN_HPP_NODISCARD_WHEN_NO_EXCEPTIONS VULKAN_HPP_INLINE typename ResultValueType<std::vector<T, Allocator>>::type
Device::getRayTracingShaderGroupHandlesKHR( VULKAN_HPP_NAMESPACE::Pipeline pipeline,
uint32_t firstGroup,
uint32_t groupCount,
size_t dataSize,
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.vkGetRayTracingShaderGroupHandlesKHR( m_device,
static_cast<VkPipeline>( pipeline ),
firstGroup,
groupCount,
data.size() * sizeof( T ),
reinterpret_cast<void *>( data.data() ) ) );
return createResultValue(
result, data, VULKAN_HPP_NAMESPACE_STRING "::Device::getRayTracingShaderGroupHandlesKHR" );
}
template <typename T, typename Dispatch>
VULKAN_HPP_NODISCARD_WHEN_NO_EXCEPTIONS typename ResultValueType<T>::type Device::getRayTracingShaderGroupHandlesKHR(
VULKAN_HPP_NAMESPACE::Pipeline pipeline, uint32_t firstGroup, uint32_t groupCount, Dispatch const & d ) const
{
T data;
Result result = static_cast<Result>( d.vkGetRayTracingShaderGroupHandlesKHR( m_device,
static_cast<VkPipeline>( pipeline ),
firstGroup,
groupCount,
1 * sizeof( T ),
reinterpret_cast<void *>( &data ) ) );
return createResultValue(
result, data, VULKAN_HPP_NAMESPACE_STRING "::Device::getRayTracingShaderGroupHandlesKHR" );
}
# endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/
#endif /*VK_ENABLE_BETA_EXTENSIONS*/
@ -97531,10 +97710,13 @@ namespace VULKAN_HPP_NAMESPACE
return static_cast<Result>( d.vkGetRayTracingShaderGroupHandlesNV(
m_device, static_cast<VkPipeline>( pipeline ), firstGroup, groupCount, dataSize, pData ) );
}
#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE
template <typename T, typename Dispatch>
VULKAN_HPP_NODISCARD_WHEN_NO_EXCEPTIONS VULKAN_HPP_INLINE typename ResultValueType<void>::type
Device::getRayTracingShaderGroupHandlesNV( VULKAN_HPP_NAMESPACE::Pipeline pipeline,
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 Device::getRayTracingShaderGroupHandlesNV(
VULKAN_HPP_NAMESPACE::Pipeline pipeline,
uint32_t firstGroup,
uint32_t groupCount,
ArrayProxy<T> const & data,
@ -97549,6 +97731,42 @@ namespace VULKAN_HPP_NAMESPACE
reinterpret_cast<void *>( data.data() ) ) );
return createResultValue( result, VULKAN_HPP_NAMESPACE_STRING "::Device::getRayTracingShaderGroupHandlesNV" );
}
template <typename T, typename Allocator, typename Dispatch>
VULKAN_HPP_NODISCARD_WHEN_NO_EXCEPTIONS VULKAN_HPP_INLINE typename ResultValueType<std::vector<T, Allocator>>::type
Device::getRayTracingShaderGroupHandlesNV( VULKAN_HPP_NAMESPACE::Pipeline pipeline,
uint32_t firstGroup,
uint32_t groupCount,
size_t dataSize,
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.vkGetRayTracingShaderGroupHandlesNV( m_device,
static_cast<VkPipeline>( pipeline ),
firstGroup,
groupCount,
data.size() * sizeof( T ),
reinterpret_cast<void *>( data.data() ) ) );
return createResultValue( result, data, VULKAN_HPP_NAMESPACE_STRING "::Device::getRayTracingShaderGroupHandlesNV" );
}
template <typename T, typename Dispatch>
VULKAN_HPP_NODISCARD_WHEN_NO_EXCEPTIONS typename ResultValueType<T>::type Device::getRayTracingShaderGroupHandlesNV(
VULKAN_HPP_NAMESPACE::Pipeline pipeline, uint32_t firstGroup, uint32_t groupCount, Dispatch const & d ) const
{
T data;
Result result = static_cast<Result>( d.vkGetRayTracingShaderGroupHandlesNV( m_device,
static_cast<VkPipeline>( pipeline ),
firstGroup,
groupCount,
1 * sizeof( T ),
reinterpret_cast<void *>( &data ) ) );
return createResultValue( result, data, VULKAN_HPP_NAMESPACE_STRING "::Device::getRayTracingShaderGroupHandlesNV" );
}
#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/
template <typename Dispatch>