Combine two types of commands into one generation function.

This commit is contained in:
asuessenbach 2022-04-06 10:33:08 +02:00
parent 1739c1d0e1
commit d50485c5c7
8 changed files with 197 additions and 220 deletions

View File

@ -2263,24 +2263,24 @@ std::vector<VulkanHppGenerator::MemberData>::const_iterator VulkanHppGenerator::
return std::find_if( memberData.begin(), memberData.end(), [&type]( MemberData const & md ) { return md.type.type == type; } );
}
std::string VulkanHppGenerator::generateAllocatorTemplates( CommandData const & commandData,
std::vector<size_t> const & returnParams,
std::string VulkanHppGenerator::generateAllocatorTemplates( std::vector<size_t> const & returnParams,
std::vector<std::string> const & returnDataTypes,
std::map<size_t, size_t> const & vectorParams,
bool definition,
bool singular ) const
{
assert( returnParams.size() == returnDataTypes.size() );
std::string allocatorTemplates;
if ( !singular )
{
for ( auto returnParam : returnParams )
for ( size_t i = 0; i < returnParams.size(); i++ )
{
if ( vectorParams.find( returnParam ) != vectorParams.end() )
if ( vectorParams.find( returnParams[i] ) != vectorParams.end() )
{
std::string elementType = stripPrefix( commandData.params[returnParam].type.type, "Vk" );
allocatorTemplates += "typename " + startUpperCase( elementType ) + "Allocator";
allocatorTemplates += "typename " + stripPrefix( returnDataTypes[i], "VULKAN_HPP_NAMESPACE::" ) + "Allocator";
if ( !definition )
{
allocatorTemplates += " = std::allocator<" + elementType + ">";
allocatorTemplates += " = std::allocator<" + returnDataTypes[i] + ">";
}
allocatorTemplates += ", ";
}
@ -3627,66 +3627,6 @@ std::string VulkanHppGenerator::generateCommandResultGetSingularAndValue( std::s
}
}
std::string VulkanHppGenerator::generateCommandResultGetVector( std::string const & name,
CommandData const & commandData,
size_t initialSkipCount,
bool definition,
std::map<size_t, size_t> const & vectorParams,
size_t returnParam ) const
{
assert( commandData.returnType == "VkResult" );
std::set<size_t> skippedParams = determineSkippedParams( commandData.params, initialSkipCount, vectorParams, { returnParam }, false );
std::set<size_t> templatedParams = determineVoidPointerParams( commandData.params );
assert( templatedParams.size() == 1 );
std::string argumentList = generateArgumentListEnhanced( commandData.params, skippedParams, {}, templatedParams, definition, false, false, true );
std::string commandName = generateCommandName( name, commandData.params, initialSkipCount, m_tags );
std::string nodiscard = generateNoDiscard( true, 1 < commandData.successCodes.size(), 1 < commandData.errorCodes.size() );
std::string dataType = stripPrefix( commandData.params[*templatedParams.begin()].name, "p" ) + "Type";
std::string returnType = generateReturnType( commandData, { returnParam }, vectorParams, false, false, false, dataType );
if ( definition )
{
std::string const functionTemplate =
R"( template <typename ${dataType}, typename ${dataType}Allocator, typename Dispatch>
${nodiscard}VULKAN_HPP_INLINE ${returnType} ${className}${classSeparator}${commandName}( ${argumentList} ) const
{
VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION );
VULKAN_HPP_ASSERT( ${dataSize} % sizeof( ${dataType} ) == 0 );
std::vector<${dataType},${dataType}Allocator> ${dataName}( ${dataSize} / sizeof( ${dataType} ) );
Result result = static_cast<Result>( d.${vkCommand}( ${callArguments} ) );
return createResultValue( result, ${dataName}, VULKAN_HPP_NAMESPACE_STRING "::${className}${classSeparator}${commandName}"${successCodeList} );
})";
return replaceWithMap( functionTemplate,
{ { "argumentList", argumentList },
{ "callArguments", generateCallArgumentsEnhanced( commandData, initialSkipCount, false, {}, {}, false ) },
{ "className", initialSkipCount ? stripPrefix( commandData.params[initialSkipCount - 1].type.type, "Vk" ) : "" },
{ "classSeparator", commandData.handle.empty() ? "" : "::" },
{ "commandName", commandName },
{ "dataName", startLowerCase( stripPrefix( commandData.params[returnParam].name, "p" ) ) },
{ "dataSize", commandData.params[returnParam].len },
{ "dataType", dataType },
{ "nodiscard", nodiscard },
{ "returnType", returnType },
{ "successCodeList", generateSuccessCodeList( commandData.successCodes ) },
{ "vkCommand", name } } );
}
else
{
std::string const functionTemplate =
R"( template <typename ${dataType}, typename ${dataType}Allocator = std::allocator<${dataType}>, typename Dispatch = VULKAN_HPP_DEFAULT_DISPATCHER_TYPE>
${nodiscard}${returnType} ${commandName}( ${argumentList} ) const;)";
return replaceWithMap( functionTemplate,
{ { "argumentList", argumentList },
{ "commandName", commandName },
{ "dataType", dataType },
{ "nodiscard", nodiscard },
{ "returnType", returnType } } );
}
}
std::string VulkanHppGenerator::generateCommandResultGetVectorAndValue( std::string const & name,
CommandData const & commandData,
size_t initialSkipCount,
@ -3832,6 +3772,8 @@ std::string VulkanHppGenerator::generateCommandResultGetVectorOfHandlesUnique( s
? ( ", typename B, typename std::enable_if<std::is_same<typename B::value_type, UniqueHandle<" + handleType + ", Dispatch>>::value, int>::type " )
: "";
std::string vectorName = startLowerCase( stripPrefix( commandData.params[returnParam].name, "p" ) );
std::string vectorSize = getVectorSize(
commandData.params, vectorParams, returnParam, commandData.params[returnParam].type.type, determineVoidPointerParams( commandData.params ) );
return replaceWithMap( functionTemplate,
{ { "argumentList", argumentList },
@ -3849,7 +3791,7 @@ std::string VulkanHppGenerator::generateCommandResultGetVectorOfHandlesUnique( s
{ "uniqueVectorName", "unique" + stripPrefix( commandData.params[returnParam].name, "p" ) },
{ "vectorAllocator", withAllocator ? ( "( " + startLowerCase( handleType ) + "Allocator )" ) : "" },
{ "vectorName", vectorName },
{ "vectorSize", getVectorSize( commandData.params, vectorParams, returnParam ) },
{ "vectorSize", vectorSize },
{ "vkCommand", name } } );
}
else
@ -4027,7 +3969,7 @@ std::string VulkanHppGenerator::generateCommandResultMultiSuccessWithErrors1Retu
return generateCommandSetStandardEnhancedSingular(
definition,
generateCommandStandard( name, commandData, initialSkipCount, definition ),
generateCommandResultGetVector( name, commandData, initialSkipCount, definition, vectorParams, returnParam ),
generateCommandSingle( name, commandData, initialSkipCount, definition, vectorParams, { returnParam }, false, false, false ),
generateCommandSingle( name, commandData, initialSkipCount, definition, vectorParams, { returnParam }, true, false, false ) );
}
}
@ -4411,7 +4353,7 @@ std::string VulkanHppGenerator::generateCommandResultSingleSuccessWithErrors1Ret
return generateCommandSetStandardEnhancedSingular(
definition,
generateCommandStandard( name, commandData, initialSkipCount, definition ),
generateCommandResultGetVector( name, commandData, initialSkipCount, definition, vectorParams, returnParam ),
generateCommandSingle( name, commandData, initialSkipCount, definition, vectorParams, { returnParam }, false, false, false ),
generateCommandSingle( name, commandData, initialSkipCount, definition, vectorParams, { returnParam }, true, false, false ) );
}
}
@ -4430,7 +4372,7 @@ std::string VulkanHppGenerator::generateCommandResultSingleSuccessWithErrors1Ret
return generateCommandSetStandardEnhancedSingular(
definition,
generateCommandStandard( name, commandData, initialSkipCount, definition ),
generateCommandResultGetVector( name, commandData, initialSkipCount, definition, vectorParams, returnParam ),
generateCommandSingle( name, commandData, initialSkipCount, definition, vectorParams, { returnParam }, false, false, false ),
generateCommandSingle( name, commandData, initialSkipCount, definition, vectorParams, { returnParam }, true, false, false ) );
}
}
@ -4776,7 +4718,7 @@ std::string VulkanHppGenerator::generateCommandSingle( std::string const &
std::string argumentTemplates = generateArgumentTemplates( commandData.params, templatedParams, false );
std::string chainTemplates = chained ? "typename X, typename Y, typename... Z, " : "";
std::string allocatorTemplates = generateAllocatorTemplates( commandData, returnParams, vectorParams, definition, singular );
std::string allocatorTemplates = generateAllocatorTemplates( returnParams, dataTypes, vectorParams, definition, singular );
std::string typenameCheck = generateTypenameCheck( commandData, returnParams, vectorParams, definition, false, withAllocator );
std::string nodiscard = generateNoDiscard( !returnParams.empty(), 1 < commandData.successCodes.size(), 1 < commandData.errorCodes.size() );
std::string returnType = generateReturnType( commandData, returnParams, vectorParams, singular, false, chained, dataType );
@ -4802,8 +4744,9 @@ std::string VulkanHppGenerator::generateCommandSingle( std::string const &
std::string vectorSizeCheckString =
vectorSizeCheck.first ? generateVectorSizeCheck( name, commandData, initialSkipCount, vectorSizeCheck.second, skippedParams, false ) : "";
std::string returnVariable = generateReturnVariable( commandData, returnParams, chained, singular );
std::string dataDeclarations =
generateDataDeclarations( commandData, returnParams, vectorParams, singular, withAllocator, chained, dataTypes, returnType, returnVariable );
std::string dataDeclarations = generateDataDeclarations(
commandData, returnParams, vectorParams, templatedParams, singular, withAllocator, chained, dataTypes, returnType, returnVariable );
std::string dataSizeChecks = generateDataSizeChecks( commandData, returnParams, dataTypes, vectorParams, templatedParams, singular );
std::string resultAssignment = generateResultAssignment( commandData );
std::string callArguments = generateCallArgumentsEnhanced( commandData, initialSkipCount, false, singularParams, templatedParams, false );
std::string resultCheck = generateResultCheck( commandData, className, classSeparator, commandName );
@ -4815,6 +4758,7 @@ std::string VulkanHppGenerator::generateCommandSingle( std::string const &
{
VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION );
${vectorSizeCheck}
${dataSizeChecks}
${dataDeclarations}
${resultAssignment}d.${vkCommand}( ${callArguments} );
${resultCheck}
@ -4832,6 +4776,7 @@ ${vectorSizeCheck}
{ "commandName", commandName },
{ "const", constString },
{ "dataDeclarations", dataDeclarations },
{ "dataSizeChecks", dataSizeChecks },
{ "nodiscard", nodiscard },
{ "noexcept", noexceptString },
{ "resultAssignment", resultAssignment },
@ -5267,6 +5212,7 @@ std::string VulkanHppGenerator::generateConstexprString( std::string const & str
std::string VulkanHppGenerator::generateDataDeclarations( CommandData const & commandData,
std::vector<size_t> const & returnParams,
std::map<size_t, size_t> const & vectorParams,
std::set<size_t> const & templatedParams,
bool singular,
bool withAllocator,
bool chained,
@ -5302,13 +5248,15 @@ std::string VulkanHppGenerator::generateDataDeclarations( CommandData const &
else
{
std::string dataTypeAllocator = startUpperCase( stripPrefix( dataTypes[0], "VULKAN_HPP_NAMESPACE::" ) ) + "Allocator";
std::string vectorSize = getVectorSize( commandData.params, vectorParams, returnParams[0], dataTypes[0], templatedParams );
std::string const dataDeclarationsTemplate = R"(std::vector<${dataType}, ${dataTypeAllocator}> ${dataVariable}( ${vectorSize}${vectorAllocator} );)";
dataDeclarations = replaceWithMap( dataDeclarationsTemplate,
{ { "dataType", dataTypes[0] },
{ "dataTypeAllocator", dataTypeAllocator },
{ "dataVariable", returnVariable },
{ "vectorAllocator", withAllocator ? ( ", " + startLowerCase( dataTypeAllocator ) ) : "" },
{ "vectorSize", getVectorSize( commandData.params, vectorParams, returnParams[0] ) } } );
{ "vectorSize", vectorSize } } );
}
}
break;
@ -5331,6 +5279,31 @@ std::string VulkanHppGenerator::generateDataDeclarations( CommandData const &
return dataDeclarations;
}
std::string VulkanHppGenerator::generateDataSizeChecks( CommandData const & commandData,
std::vector<size_t> const & returnParams,
std::vector<std::string> const & returnParamTypes,
std::map<size_t, size_t> const & vectorParams,
std::set<size_t> const & templatedParams,
bool singular ) const
{
assert( returnParams.size() == returnParamTypes.size() );
std::string dataSizeChecks;
if ( !singular )
{
const std::string dataSizeCheckTemplate = R"( VULKAN_HPP_ASSERT( ${dataSize} % sizeof( ${dataType} ) == 0 );)";
for ( size_t i = 0; i < returnParams.size(); i++ )
{
auto vectorIt = vectorParams.find( returnParams[i] );
if ( ( vectorIt != vectorParams.end() ) && ( templatedParams.find( returnParams[i] ) != templatedParams.end() ) )
{
dataSizeChecks +=
replaceWithMap( dataSizeCheckTemplate, { { "dataSize", commandData.params[vectorIt->second].name }, { "dataType", returnParamTypes[i] } } );
}
}
}
return dataSizeChecks;
}
std::string VulkanHppGenerator::generateDestroyCommand( std::string const & name, CommandData const & commandData ) const
{
// special handling for destroy functions, filter out alias functions
@ -11750,8 +11723,13 @@ std::pair<std::string, std::string> VulkanHppGenerator::getPoolTypeAndName( std:
return std::make_pair( memberIt->type.type, memberIt->name );
}
std::string VulkanHppGenerator::getVectorSize( std::vector<ParamData> const & params, std::map<size_t, size_t> const & vectorParams, size_t returnParam ) const
std::string VulkanHppGenerator::getVectorSize( std::vector<ParamData> const & params,
std::map<size_t, size_t> const & vectorParams,
size_t returnParam,
std::string const & returnParamType,
std::set<size_t> const & templatedParams ) const
{
std::string vectorSize;
std::vector<std::string> lenParts = tokenize( params[returnParam].len, "->" );
switch ( lenParts.size() )
{
@ -11766,16 +11744,29 @@ std::string VulkanHppGenerator::getVectorSize( std::vector<ParamData> const & pa
std::find_if( vectorParams.begin(),
vectorParams.end(),
[&lenIdx, &returnParam]( std::pair<size_t, size_t> const & vpi ) { return ( vpi.first != returnParam ) && ( vpi.second == lenIdx ); } );
return ( lenVectorParamIt == vectorParams.end() ) ? lenParts[0]
: ( startLowerCase( stripPrefix( params[lenVectorParamIt->first].name, "p" ) ) + ".size()" );
if ( lenVectorParamIt == vectorParams.end() )
{
vectorSize = lenParts[0];
if ( templatedParams.find( returnParam ) != templatedParams.end() )
{
vectorSize += " / sizeof( " + returnParamType + " )";
}
}
else
{
assert( templatedParams.find( returnParam ) == templatedParams.end() );
vectorSize = startLowerCase( stripPrefix( params[lenVectorParamIt->first].name, "p" ) ) + ".size()";
}
}
break;
case 2:
assert( vectorParams.find( returnParam ) != vectorParams.end() );
return startLowerCase( stripPrefix( lenParts[0], "p" ) ) + "." + lenParts[1];
vectorSize = startLowerCase( stripPrefix( lenParts[0], "p" ) ) + "." + lenParts[1];
break;
default: assert( false ); return "";
default: assert( false ); break;
}
assert( !vectorSize.empty() );
return vectorSize;
}
bool VulkanHppGenerator::hasParentHandle( std::string const & handle, std::string const & parent ) const
@ -16838,22 +16829,6 @@ extern "C" __declspec( dllimport ) FARPROC __stdcall GetProcAddress( HINSTANCE h
#endif
}
template <typename T>
VULKAN_HPP_INLINE ResultValue<T> createResultValue( Result result, T & data, char const * message, std::initializer_list<Result> successCodes )
{
#ifdef VULKAN_HPP_NO_EXCEPTIONS
ignore(message);
ignore(successCodes); // just in case VULKAN_HPP_ASSERT_ON_RESULT is empty
VULKAN_HPP_ASSERT_ON_RESULT( std::find( successCodes.begin(), successCodes.end(), result ) != successCodes.end() );
#else
if ( std::find( successCodes.begin(), successCodes.end(), result ) == successCodes.end() )
{
throwResultException( result, message );
}
#endif
return ResultValue<T>( result, std::move( data ) );
}
#ifndef VULKAN_HPP_NO_SMART_HANDLE
template <typename T, typename D>
VULKAN_HPP_INLINE typename ResultValueType<UniqueHandle<T,D>>::type createResultValue( Result result, T & data, char const * message, typename UniqueHandleTraits<T,D>::deleter const & deleter )

View File

@ -414,8 +414,8 @@ private:
std::string findBaseName( std::string aliasName, std::map<std::string, EnumAliasData> const & aliases ) const;
std::vector<MemberData>::const_iterator findStructMemberIt( std::string const & name, std::vector<MemberData> const & memberData ) const;
std::vector<MemberData>::const_iterator findStructMemberItByType( std::string const & type, std::vector<MemberData> const & memberData ) const;
std::string generateAllocatorTemplates( CommandData const & commandData,
std::vector<size_t> const & returnParams,
std::string generateAllocatorTemplates( std::vector<size_t> const & returnParams,
std::vector<std::string> const & returnDataTypes,
std::map<size_t, size_t> const & vectorParams,
bool definition,
bool singular ) const;
@ -492,12 +492,6 @@ private:
bool definition,
std::vector<size_t> const & returnParamIndices,
std::map<size_t, size_t> const & vectorParamIndices ) const;
std::string generateCommandResultGetVector( std::string const & name,
CommandData const & commandData,
size_t initialSkipCount,
bool definition,
std::map<size_t, size_t> const & vectorParamIndices,
size_t returnParam ) const;
std::string generateCommandResultGetVectorAndValue( std::string const & name,
CommandData const & commandData,
size_t initialSkipCount,
@ -648,12 +642,19 @@ private:
std::string generateDataDeclarations( CommandData const & commandData,
std::vector<size_t> const & returnParams,
std::map<size_t, size_t> const & vectorParams,
std::set<size_t> const & templatedParams,
bool singular,
bool withAllocator,
bool chained,
std::vector<std::string> const & dataTypes,
std::string const & returnType,
std::string const & returnVariable ) const;
std::string generateDataSizeChecks( CommandData const & commandData,
std::vector<size_t> const & returnParams,
std::vector<std::string> const & returnParamTypes,
std::map<size_t, size_t> const & vectorParams,
std::set<size_t> const & templatedParams,
bool singular ) const;
std::string generateDestroyCommand( std::string const & name, CommandData const & commandData ) const;
std::string
generateDispatchLoaderDynamicCommandAssignment( std::string const & commandName, CommandData const & commandData, std::string const & firstArg ) const;
@ -1002,7 +1003,11 @@ private:
std::pair<std::string, std::string> getParentTypeAndName( std::pair<std::string, HandleData> const & handle ) const;
std::string getPlatform( std::string const & title ) const;
std::pair<std::string, std::string> getPoolTypeAndName( std::string const & type ) const;
std::string getVectorSize( std::vector<ParamData> const & params, std::map<size_t, size_t> const & vectorParamIndices, size_t returnParam ) const;
std::string getVectorSize( std::vector<ParamData> const & params,
std::map<size_t, size_t> const & vectorParamIndices,
size_t returnParam,
std::string const & returnParamType,
std::set<size_t> const & templatedParams ) const;
bool hasParentHandle( std::string const & handle, std::string const & parent ) const;
bool isDeviceCommand( CommandData const & commandData ) const;
bool isHandleType( std::string const & type ) const;

View File

@ -272,6 +272,8 @@ int main( int /*argc*/, char ** /*argv*/ )
vk::UniquePipeline graphicsPipeline3 =
std::move( device->createGraphicsPipelinesUnique<vk::DispatchLoaderDynamic>( *pipelineCache, graphicsPipelineCreateInfo ).value[0] );
std::vector<vk::UniqueDescriptorSet> descriptorSets = device->allocateDescriptorSetsUnique( {} );
// destroy the non-Unique surface used here
instance->destroySurfaceKHR( surfaceData.surface );
}

View File

@ -5983,22 +5983,6 @@ namespace VULKAN_HPP_NAMESPACE
#endif
}
template <typename T>
VULKAN_HPP_INLINE ResultValue<T> createResultValue( Result result, T & data, char const * message, std::initializer_list<Result> successCodes )
{
#ifdef VULKAN_HPP_NO_EXCEPTIONS
ignore( message );
ignore( successCodes ); // just in case VULKAN_HPP_ASSERT_ON_RESULT is empty
VULKAN_HPP_ASSERT_ON_RESULT( std::find( successCodes.begin(), successCodes.end(), result ) != successCodes.end() );
#else
if ( std::find( successCodes.begin(), successCodes.end(), result ) == successCodes.end() )
{
throwResultException( result, message );
}
#endif
return ResultValue<T>( result, std::move( data ) );
}
#ifndef VULKAN_HPP_NO_SMART_HANDLE
template <typename T, typename D>
VULKAN_HPP_INLINE typename ResultValueType<UniqueHandle<T, D>>::type

View File

@ -1847,20 +1847,21 @@ namespace VULKAN_HPP_NAMESPACE
Dispatch const & d ) const
{
VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION );
VULKAN_HPP_ASSERT( dataSize % sizeof( DataType ) == 0 );
std::vector<DataType, DataTypeAllocator> data( dataSize / sizeof( DataType ) );
Result result = static_cast<Result>( d.vkGetQueryPoolResults( m_device,
VkResult result = d.vkGetQueryPoolResults( m_device,
static_cast<VkQueryPool>( queryPool ),
firstQuery,
queryCount,
data.size() * sizeof( DataType ),
reinterpret_cast<void *>( data.data() ),
static_cast<VkDeviceSize>( stride ),
static_cast<VkQueryResultFlags>( flags ) ) );
return createResultValue( result,
data,
static_cast<VkQueryResultFlags>( flags ) );
resultCheck( static_cast<VULKAN_HPP_NAMESPACE::Result>( result ),
VULKAN_HPP_NAMESPACE_STRING "::Device::getQueryPoolResults",
{ VULKAN_HPP_NAMESPACE::Result::eSuccess, VULKAN_HPP_NAMESPACE::Result::eNotReady } );
return ResultValue<std::vector<DataType, DataTypeAllocator>>( static_cast<VULKAN_HPP_NAMESPACE::Result>( result ), data );
}
template <typename DataType, typename Dispatch>
@ -13621,17 +13622,18 @@ namespace VULKAN_HPP_NAMESPACE
Dispatch const & d ) const
{
VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION );
VULKAN_HPP_ASSERT( dataSize % sizeof( DataType ) == 0 );
std::vector<DataType, DataTypeAllocator> data( dataSize / sizeof( DataType ) );
Result result =
static_cast<Result>( d.vkWriteAccelerationStructuresPropertiesKHR( m_device,
VkResult result = d.vkWriteAccelerationStructuresPropertiesKHR( m_device,
accelerationStructures.size(),
reinterpret_cast<const VkAccelerationStructureKHR *>( accelerationStructures.data() ),
static_cast<VkQueryType>( queryType ),
data.size() * sizeof( DataType ),
reinterpret_cast<void *>( data.data() ),
stride ) );
return createResultValue( result, data, VULKAN_HPP_NAMESPACE_STRING "::Device::writeAccelerationStructuresPropertiesKHR" );
stride );
resultCheck( static_cast<VULKAN_HPP_NAMESPACE::Result>( result ), VULKAN_HPP_NAMESPACE_STRING "::Device::writeAccelerationStructuresPropertiesKHR" );
return createResultValueType( static_cast<VULKAN_HPP_NAMESPACE::Result>( result ), data );
}
template <typename DataType, typename Dispatch>
@ -13835,6 +13837,7 @@ namespace VULKAN_HPP_NAMESPACE
throw LogicError( VULKAN_HPP_NAMESPACE_STRING "::Device::getAccelerationStructureBuildSizesKHR: maxPrimitiveCounts.size() != buildInfo.geometryCount" );
}
# endif /*VULKAN_HPP_NO_EXCEPTIONS*/
VULKAN_HPP_NAMESPACE::AccelerationStructureBuildSizesInfoKHR sizeInfo;
d.vkGetAccelerationStructureBuildSizesKHR( m_device,
static_cast<VkAccelerationStructureBuildTypeKHR>( buildType ),
@ -14740,11 +14743,13 @@ namespace VULKAN_HPP_NAMESPACE
VULKAN_HPP_NAMESPACE::Pipeline pipeline, uint32_t firstGroup, uint32_t groupCount, size_t dataSize, Dispatch const & d ) const
{
VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION );
VULKAN_HPP_ASSERT( dataSize % sizeof( DataType ) == 0 );
std::vector<DataType, DataTypeAllocator> data( dataSize / sizeof( DataType ) );
Result result = static_cast<Result>( d.vkGetRayTracingShaderGroupHandlesNV(
m_device, static_cast<VkPipeline>( pipeline ), firstGroup, groupCount, data.size() * sizeof( DataType ), reinterpret_cast<void *>( data.data() ) ) );
return createResultValue( result, data, VULKAN_HPP_NAMESPACE_STRING "::Device::getRayTracingShaderGroupHandlesNV" );
VkResult result = d.vkGetRayTracingShaderGroupHandlesNV(
m_device, static_cast<VkPipeline>( pipeline ), firstGroup, groupCount, data.size() * sizeof( DataType ), reinterpret_cast<void *>( data.data() ) );
resultCheck( static_cast<VULKAN_HPP_NAMESPACE::Result>( result ), VULKAN_HPP_NAMESPACE_STRING "::Device::getRayTracingShaderGroupHandlesNV" );
return createResultValueType( static_cast<VULKAN_HPP_NAMESPACE::Result>( result ), data );
}
template <typename DataType, typename Dispatch>
@ -14778,11 +14783,13 @@ namespace VULKAN_HPP_NAMESPACE
Device::getAccelerationStructureHandleNV( VULKAN_HPP_NAMESPACE::AccelerationStructureNV accelerationStructure, size_t dataSize, Dispatch const & d ) const
{
VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION );
VULKAN_HPP_ASSERT( dataSize % sizeof( DataType ) == 0 );
std::vector<DataType, DataTypeAllocator> data( dataSize / sizeof( DataType ) );
Result result = static_cast<Result>( d.vkGetAccelerationStructureHandleNV(
m_device, static_cast<VkAccelerationStructureNV>( accelerationStructure ), data.size() * sizeof( DataType ), reinterpret_cast<void *>( data.data() ) ) );
return createResultValue( result, data, VULKAN_HPP_NAMESPACE_STRING "::Device::getAccelerationStructureHandleNV" );
VkResult result = d.vkGetAccelerationStructureHandleNV(
m_device, static_cast<VkAccelerationStructureNV>( accelerationStructure ), data.size() * sizeof( DataType ), reinterpret_cast<void *>( data.data() ) );
resultCheck( static_cast<VULKAN_HPP_NAMESPACE::Result>( result ), VULKAN_HPP_NAMESPACE_STRING "::Device::getAccelerationStructureHandleNV" );
return createResultValueType( static_cast<VULKAN_HPP_NAMESPACE::Result>( result ), data );
}
template <typename DataType, typename Dispatch>
@ -18093,11 +18100,13 @@ namespace VULKAN_HPP_NAMESPACE
VULKAN_HPP_NAMESPACE::Pipeline pipeline, uint32_t firstGroup, uint32_t groupCount, size_t dataSize, Dispatch const & d ) const
{
VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION );
VULKAN_HPP_ASSERT( dataSize % sizeof( DataType ) == 0 );
std::vector<DataType, DataTypeAllocator> data( dataSize / sizeof( DataType ) );
Result result = static_cast<Result>( d.vkGetRayTracingShaderGroupHandlesKHR(
m_device, static_cast<VkPipeline>( pipeline ), firstGroup, groupCount, data.size() * sizeof( DataType ), reinterpret_cast<void *>( data.data() ) ) );
return createResultValue( result, data, VULKAN_HPP_NAMESPACE_STRING "::Device::getRayTracingShaderGroupHandlesKHR" );
VkResult result = d.vkGetRayTracingShaderGroupHandlesKHR(
m_device, static_cast<VkPipeline>( pipeline ), firstGroup, groupCount, data.size() * sizeof( DataType ), reinterpret_cast<void *>( data.data() ) );
resultCheck( static_cast<VULKAN_HPP_NAMESPACE::Result>( result ), VULKAN_HPP_NAMESPACE_STRING "::Device::getRayTracingShaderGroupHandlesKHR" );
return createResultValueType( static_cast<VULKAN_HPP_NAMESPACE::Result>( result ), data );
}
template <typename DataType, typename Dispatch>
@ -18134,11 +18143,13 @@ namespace VULKAN_HPP_NAMESPACE
VULKAN_HPP_NAMESPACE::Pipeline pipeline, uint32_t firstGroup, uint32_t groupCount, size_t dataSize, Dispatch const & d ) const
{
VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION );
VULKAN_HPP_ASSERT( dataSize % sizeof( DataType ) == 0 );
std::vector<DataType, DataTypeAllocator> data( dataSize / sizeof( DataType ) );
Result result = static_cast<Result>( d.vkGetRayTracingCaptureReplayShaderGroupHandlesKHR(
m_device, static_cast<VkPipeline>( pipeline ), firstGroup, groupCount, data.size() * sizeof( DataType ), reinterpret_cast<void *>( data.data() ) ) );
return createResultValue( result, data, VULKAN_HPP_NAMESPACE_STRING "::Device::getRayTracingCaptureReplayShaderGroupHandlesKHR" );
VkResult result = d.vkGetRayTracingCaptureReplayShaderGroupHandlesKHR(
m_device, static_cast<VkPipeline>( pipeline ), firstGroup, groupCount, data.size() * sizeof( DataType ), reinterpret_cast<void *>( data.data() ) );
resultCheck( static_cast<VULKAN_HPP_NAMESPACE::Result>( result ), VULKAN_HPP_NAMESPACE_STRING "::Device::getRayTracingCaptureReplayShaderGroupHandlesKHR" );
return createResultValueType( static_cast<VULKAN_HPP_NAMESPACE::Result>( result ), data );
}
template <typename DataType, typename Dispatch>

View File

@ -7921,13 +7921,13 @@ namespace VULKAN_HPP_NAMESPACE
VULKAN_HPP_NAMESPACE::Pipeline * pPipelines,
Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const VULKAN_HPP_NOEXCEPT;
#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE
template <typename PipelineAllocator = std::allocator<Pipeline>, typename Dispatch = VULKAN_HPP_DEFAULT_DISPATCHER_TYPE>
template <typename PipelineAllocator = std::allocator<VULKAN_HPP_NAMESPACE::Pipeline>, typename Dispatch = VULKAN_HPP_DEFAULT_DISPATCHER_TYPE>
VULKAN_HPP_NODISCARD ResultValue<std::vector<VULKAN_HPP_NAMESPACE::Pipeline, PipelineAllocator>>
createGraphicsPipelines( VULKAN_HPP_NAMESPACE::PipelineCache pipelineCache,
ArrayProxy<const VULKAN_HPP_NAMESPACE::GraphicsPipelineCreateInfo> const & createInfos,
Optional<const VULKAN_HPP_NAMESPACE::AllocationCallbacks> allocator VULKAN_HPP_DEFAULT_ARGUMENT_NULLPTR_ASSIGNMENT,
Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const;
template <typename PipelineAllocator = std::allocator<Pipeline>,
template <typename PipelineAllocator = std::allocator<VULKAN_HPP_NAMESPACE::Pipeline>,
typename Dispatch = VULKAN_HPP_DEFAULT_DISPATCHER_TYPE,
typename B = PipelineAllocator,
typename std::enable_if<std::is_same<typename B::value_type, Pipeline>::value, int>::type = 0>
@ -7977,13 +7977,13 @@ namespace VULKAN_HPP_NAMESPACE
VULKAN_HPP_NAMESPACE::Pipeline * pPipelines,
Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const VULKAN_HPP_NOEXCEPT;
#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE
template <typename PipelineAllocator = std::allocator<Pipeline>, typename Dispatch = VULKAN_HPP_DEFAULT_DISPATCHER_TYPE>
template <typename PipelineAllocator = std::allocator<VULKAN_HPP_NAMESPACE::Pipeline>, typename Dispatch = VULKAN_HPP_DEFAULT_DISPATCHER_TYPE>
VULKAN_HPP_NODISCARD ResultValue<std::vector<VULKAN_HPP_NAMESPACE::Pipeline, PipelineAllocator>>
createComputePipelines( VULKAN_HPP_NAMESPACE::PipelineCache pipelineCache,
ArrayProxy<const VULKAN_HPP_NAMESPACE::ComputePipelineCreateInfo> const & createInfos,
Optional<const VULKAN_HPP_NAMESPACE::AllocationCallbacks> allocator VULKAN_HPP_DEFAULT_ARGUMENT_NULLPTR_ASSIGNMENT,
Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const;
template <typename PipelineAllocator = std::allocator<Pipeline>,
template <typename PipelineAllocator = std::allocator<VULKAN_HPP_NAMESPACE::Pipeline>,
typename Dispatch = VULKAN_HPP_DEFAULT_DISPATCHER_TYPE,
typename B = PipelineAllocator,
typename std::enable_if<std::is_same<typename B::value_type, Pipeline>::value, int>::type = 0>
@ -8232,11 +8232,11 @@ namespace VULKAN_HPP_NAMESPACE
VULKAN_HPP_NAMESPACE::DescriptorSet * pDescriptorSets,
Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const VULKAN_HPP_NOEXCEPT;
#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE
template <typename DescriptorSetAllocator = std::allocator<DescriptorSet>, typename Dispatch = VULKAN_HPP_DEFAULT_DISPATCHER_TYPE>
template <typename DescriptorSetAllocator = std::allocator<VULKAN_HPP_NAMESPACE::DescriptorSet>, typename Dispatch = VULKAN_HPP_DEFAULT_DISPATCHER_TYPE>
VULKAN_HPP_NODISCARD typename ResultValueType<std::vector<VULKAN_HPP_NAMESPACE::DescriptorSet, DescriptorSetAllocator>>::type
allocateDescriptorSets( const VULKAN_HPP_NAMESPACE::DescriptorSetAllocateInfo & allocateInfo,
Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const;
template <typename DescriptorSetAllocator = std::allocator<DescriptorSet>,
template <typename DescriptorSetAllocator = std::allocator<VULKAN_HPP_NAMESPACE::DescriptorSet>,
typename Dispatch = VULKAN_HPP_DEFAULT_DISPATCHER_TYPE,
typename B = DescriptorSetAllocator,
typename std::enable_if<std::is_same<typename B::value_type, DescriptorSet>::value, int>::type = 0>
@ -8451,11 +8451,11 @@ namespace VULKAN_HPP_NAMESPACE
VULKAN_HPP_NAMESPACE::CommandBuffer * pCommandBuffers,
Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const VULKAN_HPP_NOEXCEPT;
#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE
template <typename CommandBufferAllocator = std::allocator<CommandBuffer>, typename Dispatch = VULKAN_HPP_DEFAULT_DISPATCHER_TYPE>
template <typename CommandBufferAllocator = std::allocator<VULKAN_HPP_NAMESPACE::CommandBuffer>, typename Dispatch = VULKAN_HPP_DEFAULT_DISPATCHER_TYPE>
VULKAN_HPP_NODISCARD typename ResultValueType<std::vector<VULKAN_HPP_NAMESPACE::CommandBuffer, CommandBufferAllocator>>::type
allocateCommandBuffers( const VULKAN_HPP_NAMESPACE::CommandBufferAllocateInfo & allocateInfo,
Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const;
template <typename CommandBufferAllocator = std::allocator<CommandBuffer>,
template <typename CommandBufferAllocator = std::allocator<VULKAN_HPP_NAMESPACE::CommandBuffer>,
typename Dispatch = VULKAN_HPP_DEFAULT_DISPATCHER_TYPE,
typename B = CommandBufferAllocator,
typename std::enable_if<std::is_same<typename B::value_type, CommandBuffer>::value, int>::type = 0>
@ -9045,12 +9045,12 @@ namespace VULKAN_HPP_NAMESPACE
VULKAN_HPP_NAMESPACE::SwapchainKHR * pSwapchains,
Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const VULKAN_HPP_NOEXCEPT;
#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE
template <typename SwapchainKHRAllocator = std::allocator<SwapchainKHR>, typename Dispatch = VULKAN_HPP_DEFAULT_DISPATCHER_TYPE>
template <typename SwapchainKHRAllocator = std::allocator<VULKAN_HPP_NAMESPACE::SwapchainKHR>, typename Dispatch = VULKAN_HPP_DEFAULT_DISPATCHER_TYPE>
VULKAN_HPP_NODISCARD typename ResultValueType<std::vector<VULKAN_HPP_NAMESPACE::SwapchainKHR, SwapchainKHRAllocator>>::type
createSharedSwapchainsKHR( ArrayProxy<const VULKAN_HPP_NAMESPACE::SwapchainCreateInfoKHR> const & createInfos,
Optional<const VULKAN_HPP_NAMESPACE::AllocationCallbacks> allocator VULKAN_HPP_DEFAULT_ARGUMENT_NULLPTR_ASSIGNMENT,
Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const;
template <typename SwapchainKHRAllocator = std::allocator<SwapchainKHR>,
template <typename SwapchainKHRAllocator = std::allocator<VULKAN_HPP_NAMESPACE::SwapchainKHR>,
typename Dispatch = VULKAN_HPP_DEFAULT_DISPATCHER_TYPE,
typename B = SwapchainKHRAllocator,
typename std::enable_if<std::is_same<typename B::value_type, SwapchainKHR>::value, int>::type = 0>
@ -10253,13 +10253,13 @@ namespace VULKAN_HPP_NAMESPACE
VULKAN_HPP_NAMESPACE::Pipeline * pPipelines,
Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const VULKAN_HPP_NOEXCEPT;
#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE
template <typename PipelineAllocator = std::allocator<Pipeline>, typename Dispatch = VULKAN_HPP_DEFAULT_DISPATCHER_TYPE>
template <typename PipelineAllocator = std::allocator<VULKAN_HPP_NAMESPACE::Pipeline>, typename Dispatch = VULKAN_HPP_DEFAULT_DISPATCHER_TYPE>
VULKAN_HPP_NODISCARD ResultValue<std::vector<VULKAN_HPP_NAMESPACE::Pipeline, PipelineAllocator>>
createRayTracingPipelinesNV( VULKAN_HPP_NAMESPACE::PipelineCache pipelineCache,
ArrayProxy<const VULKAN_HPP_NAMESPACE::RayTracingPipelineCreateInfoNV> const & createInfos,
Optional<const VULKAN_HPP_NAMESPACE::AllocationCallbacks> allocator VULKAN_HPP_DEFAULT_ARGUMENT_NULLPTR_ASSIGNMENT,
Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const;
template <typename PipelineAllocator = std::allocator<Pipeline>,
template <typename PipelineAllocator = std::allocator<VULKAN_HPP_NAMESPACE::Pipeline>,
typename Dispatch = VULKAN_HPP_DEFAULT_DISPATCHER_TYPE,
typename B = PipelineAllocator,
typename std::enable_if<std::is_same<typename B::value_type, Pipeline>::value, int>::type = 0>
@ -10876,14 +10876,14 @@ namespace VULKAN_HPP_NAMESPACE
VULKAN_HPP_NAMESPACE::Pipeline * pPipelines,
Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const VULKAN_HPP_NOEXCEPT;
#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE
template <typename PipelineAllocator = std::allocator<Pipeline>, typename Dispatch = VULKAN_HPP_DEFAULT_DISPATCHER_TYPE>
template <typename PipelineAllocator = std::allocator<VULKAN_HPP_NAMESPACE::Pipeline>, typename Dispatch = VULKAN_HPP_DEFAULT_DISPATCHER_TYPE>
VULKAN_HPP_NODISCARD ResultValue<std::vector<VULKAN_HPP_NAMESPACE::Pipeline, PipelineAllocator>>
createRayTracingPipelinesKHR( VULKAN_HPP_NAMESPACE::DeferredOperationKHR deferredOperation,
VULKAN_HPP_NAMESPACE::PipelineCache pipelineCache,
ArrayProxy<const VULKAN_HPP_NAMESPACE::RayTracingPipelineCreateInfoKHR> const & createInfos,
Optional<const VULKAN_HPP_NAMESPACE::AllocationCallbacks> allocator VULKAN_HPP_DEFAULT_ARGUMENT_NULLPTR_ASSIGNMENT,
Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const;
template <typename PipelineAllocator = std::allocator<Pipeline>,
template <typename PipelineAllocator = std::allocator<VULKAN_HPP_NAMESPACE::Pipeline>,
typename Dispatch = VULKAN_HPP_DEFAULT_DISPATCHER_TYPE,
typename B = PipelineAllocator,
typename std::enable_if<std::is_same<typename B::value_type, Pipeline>::value, int>::type = 0>