Refactor commands that enumerate some oqaque data behind a void pointer.

This commit is contained in:
asuessenbach 2020-10-20 23:29:00 +02:00
parent 55a27c7dfa
commit 1da76e4b4a
2 changed files with 113 additions and 98 deletions

View File

@ -57,7 +57,7 @@ std::string createEnumValueName( std::string const & name,
std::string createSuccessCode( std::string const & code, std::set<std::string> const & tags );
std::string determineCommandName( std::string const & vulkanCommandName, std::string const & firstArgumentType );
std::set<size_t> determineSkippedParams( size_t returnParamIndex, std::map<size_t, size_t> const & vectorParamIndices );
std::string extractTag( int line, std::string const & name, std::set<std::string> const & tags );
std::string extractTag( int line, std::string const & name, std::set<std::string> const & tags );
std::string findTag( std::set<std::string> const & tags, std::string const & name, std::string const & postfix = "" );
std::pair<bool, std::string> generateFunctionBodyStandardReturn( std::string const & returnType );
std::map<std::string, std::string> getAttributes( tinyxml2::XMLElement const * element );
@ -1247,8 +1247,7 @@ void VulkanHppGenerator::appendCommand( std::string & str,
// two returns but just one vector
auto vectorParamIndexIt = vectorParamIndices.begin();
if ( ( vectorParamIndexIt->second == nonConstPointerParamIndices[0] ) &&
( vectorParamIndexIt->first == nonConstPointerParamIndices[1] ) &&
( commandData.params[vectorParamIndexIt->first].type.type != "void" ) )
( vectorParamIndexIt->first == nonConstPointerParamIndices[1] ) )
{
// the size is a return value as well -> enumerate the values
// and the vector data is not of type void
@ -2863,8 +2862,8 @@ void VulkanHppGenerator::appendFunctionHeaderArgumentEnhancedVector( std::string
// use our ArrayProxy
bool isConst = ( param.type.prefix.find( "const" ) != std::string::npos );
str += optionalBegin + "ArrayProxy<" +
( isTemplateParam ? ( isConst ? "const T" : "T" ) : stripPostfix( param.type.compose(), "*" ) ) +
"> const &" + optionalEnd + strippedParameterName;
( isTemplateParam ? ( isConst ? "const T" : "T" ) : stripPostfix( param.type.compose(), "*" ) ) + "> const &" +
optionalEnd + strippedParameterName;
}
void VulkanHppGenerator::appendFunctionHeaderArguments( std::string & str,
@ -3565,9 +3564,8 @@ std::string VulkanHppGenerator::constructArgumentListEnhanced( std::vector<Param
else if ( params[i].optional )
{
argumentList +=
"Optional<const " + stripPrefix( params[i].type.type, "Vk" ) + "> " +
name +
( ( definition || withAllocators ) ? "" : " VULKAN_HPP_DEFAULT_ARGUMENT_NULLPTR_ASSIGNMENT" );
"Optional<const " + stripPrefix( params[i].type.type, "Vk" ) + "> " + name +
( ( definition || withAllocators ) ? "" : " VULKAN_HPP_DEFAULT_ARGUMENT_NULLPTR_ASSIGNMENT" );
hasDefaultAssignment = true;
}
else
@ -3636,7 +3634,8 @@ std::string VulkanHppGenerator::constructArgumentListEnhanced( std::vector<Param
{
if ( !params[sp].len.empty() )
{
std::string type = startUpperCase( stripPrefix( params[sp].type.type, "Vk" ) );
std::string type =
( params[sp].type.type == "void" ) ? "Uint8_t" : startUpperCase( stripPrefix( params[sp].type.type, "Vk" ) );
argumentList += type + "Allocator & " + startLowerCase( type ) + "Allocator, ";
}
}
@ -4045,14 +4044,20 @@ std::string VulkanHppGenerator::constructCommandResultEnumerate( std::string con
std::string commandName = determineCommandName( name, commandData.params[0].type.type );
std::string nodiscard = constructNoDiscardEnhanced( commandData );
std::string vectorElementType = stripPrefix( commandData.params[vectorParamIndices.first].type.type, "Vk" );
if ( commandData.params[vectorParamIndices.first].type.type == "void" )
{
// for returning vectors of type void, we use uint8_t !
vectorElementType = "uint8_t";
}
std::string allocatorType = startUpperCase( vectorElementType ) + "Allocator";
if ( definition )
{
const std::string functionTemplate =
R"( template <typename ${vectorElementType}Allocator, typename Dispatch${withAllocatorTypenameCheck}>
${nodiscard}VULKAN_HPP_INLINE typename ResultValueType<std::vector<${vectorElementType}, ${vectorElementType}Allocator>>::type ${className}${commandName}( ${argumentList} )${const}
R"( template <typename ${allocatorType}, typename Dispatch${withAllocatorTypenameCheck}>
${nodiscard}VULKAN_HPP_INLINE typename ResultValueType<std::vector<${vectorElementType}, ${allocatorType}>>::type ${className}${commandName}( ${argumentList} )${const}
{
std::vector<${vectorElementType}, ${vectorElementType}Allocator> ${vectorName}${vectorAllocator};
std::vector<${vectorElementType}, ${allocatorType}> ${vectorName}${vectorAllocator};
${counterType} ${counterName};
Result result;
do
@ -4079,7 +4084,8 @@ std::string VulkanHppGenerator::constructCommandResultEnumerate( std::string con
str = replaceWithMap(
functionTemplate,
std::map<std::string, std::string>(
{ { "argumentList", argumentList },
{ { "allocatorType", allocatorType },
{ "argumentList", argumentList },
{ "className", commandData.handle.empty() ? "" : ( stripPrefix( commandData.handle, "Vk" ) + "::" ) },
{ "commandName", commandName },
{ "const", commandData.handle.empty() ? "" : " const" },
@ -4092,7 +4098,7 @@ std::string VulkanHppGenerator::constructCommandResultEnumerate( std::string con
{ "secondCallArguments",
constructCallArgumentsEnumerateVectors(
commandData.handle, commandData.params, { vectorParamIndices }, false ) },
{ "vectorAllocator", withAllocator ? ( "( " + startLowerCase( vectorElementType ) + "Allocator )" ) : "" },
{ "vectorAllocator", withAllocator ? ( "( " + startLowerCase( allocatorType ) + " )" ) : "" },
{ "vectorElementType", vectorElementType },
{ "vectorName", startLowerCase( stripPrefix( commandData.params[vectorParamIndices.first].name, "p" ) ) },
{ "vkCommand", name },
@ -4101,17 +4107,17 @@ std::string VulkanHppGenerator::constructCommandResultEnumerate( std::string con
else
{
const std::string functionTemplate =
R"( template <typename ${vectorElementType}Allocator = std::allocator<${vectorElementType}>, typename Dispatch = VULKAN_HPP_DEFAULT_DISPATCHER_TYPE${withAllocatorTypenameCheck}>
${nodiscard}typename ResultValueType<std::vector<${vectorElementType}, ${vectorElementType}Allocator>>::type ${commandName}( ${argumentList} )${const};)";
R"( template <typename ${allocatorType} = std::allocator<${vectorElementType}>, typename Dispatch = VULKAN_HPP_DEFAULT_DISPATCHER_TYPE${withAllocatorTypenameCheck}>
${nodiscard}typename ResultValueType<std::vector<${vectorElementType}, ${allocatorType}>>::type ${commandName}( ${argumentList} )${const};)";
std::string withAllocatorsTypenameCheck =
", typename B = " + vectorElementType +
"Allocator, typename std::enable_if<std::is_same<typename B::value_type, " + vectorElementType +
">::value, int>::type = 0";
std::string withAllocatorsTypenameCheck = ", typename B = " + allocatorType +
", typename std::enable_if<std::is_same<typename B::value_type, " +
vectorElementType + ">::value, int>::type = 0";
str = replaceWithMap( functionTemplate,
std::map<std::string, std::string>(
{ { "argumentList", argumentList },
{ { "allocatorType", allocatorType },
{ "argumentList", argumentList },
{ "const", commandData.handle.empty() ? "" : " const" },
{ "commandName", commandName },
{ "nodiscard", nodiscard },
@ -7215,9 +7221,9 @@ size_t VulkanHppGenerator::determineDefaultStartIndex( std::vector<ParamData> co
return defaultStartIndex;
}
std::string VulkanHppGenerator::determineEnhancedReturnType( CommandData const & commandData,
size_t returnParamIndex,
bool isStructureChain ) const
std::string VulkanHppGenerator::determineEnhancedReturnType( CommandData const & commandData,
size_t returnParamIndex,
bool isStructureChain ) const
{
assert( ( returnParamIndex == INVALID_INDEX ) || ( returnParamIndex < commandData.params.size() ) );
@ -7229,12 +7235,12 @@ std::string VulkanHppGenerator::determineEnhancedReturnType( CommandData const &
assert( ( commandData.returnType == "void" ) || ( commandData.returnType == "VkResult" ) );
assert( commandData.successCodes.empty() || ( commandData.successCodes[0] == "VK_SUCCESS" ) );
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
? "std::vector<uint8_t,Allocator>" // the return parameter is a vector-type parameter
: 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
: "std::vector<" + stripPrefix( commandData.params[returnParamIndex].type.type, "Vk" ) +
",Allocator>"; // for the other parameters, we use a vector of the pure type
}
else if ( ( commandData.returnType == "VkResult" ) && ( commandData.successCodes.size() == 1 ) )
{

View File

@ -55095,20 +55095,21 @@ namespace VULKAN_HPP_NAMESPACE
VULKAN_HPP_NODISCARD Result
getPipelineCacheData( VULKAN_HPP_NAMESPACE::PipelineCache pipelineCache,
size_t * pDataSize,
void * pData,
void * pData VULKAN_HPP_DEFAULT_ARGUMENT_ASSIGNMENT,
Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const VULKAN_HPP_NOEXCEPT;
#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE
template <typename Allocator = std::allocator<uint8_t>, typename Dispatch = VULKAN_HPP_DEFAULT_DISPATCHER_TYPE>
VULKAN_HPP_NODISCARD typename ResultValueType<std::vector<uint8_t, Allocator>>::type
template <typename Uint8_tAllocator = std::allocator<uint8_t>,
typename Dispatch = VULKAN_HPP_DEFAULT_DISPATCHER_TYPE>
VULKAN_HPP_NODISCARD typename ResultValueType<std::vector<uint8_t, Uint8_tAllocator>>::type
getPipelineCacheData( VULKAN_HPP_NAMESPACE::PipelineCache pipelineCache,
Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const;
template <typename Allocator = std::allocator<uint8_t>,
typename Dispatch = VULKAN_HPP_DEFAULT_DISPATCHER_TYPE,
typename B = Allocator,
template <typename Uint8_tAllocator = std::allocator<uint8_t>,
typename Dispatch = VULKAN_HPP_DEFAULT_DISPATCHER_TYPE,
typename B = Uint8_tAllocator,
typename std::enable_if<std::is_same<typename B::value_type, uint8_t>::value, int>::type = 0>
VULKAN_HPP_NODISCARD typename ResultValueType<std::vector<uint8_t, Allocator>>::type
VULKAN_HPP_NODISCARD typename ResultValueType<std::vector<uint8_t, Uint8_tAllocator>>::type
getPipelineCacheData( VULKAN_HPP_NAMESPACE::PipelineCache pipelineCache,
Allocator const & vectorAllocator,
Uint8_tAllocator & uint8_tAllocator,
Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const;
#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/
@ -55440,24 +55441,25 @@ namespace VULKAN_HPP_NAMESPACE
VULKAN_HPP_NAMESPACE::ShaderStageFlagBits shaderStage,
VULKAN_HPP_NAMESPACE::ShaderInfoTypeAMD infoType,
size_t * pInfoSize,
void * pInfo,
void * pInfo VULKAN_HPP_DEFAULT_ARGUMENT_ASSIGNMENT,
Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const VULKAN_HPP_NOEXCEPT;
#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE
template <typename Allocator = std::allocator<uint8_t>, typename Dispatch = VULKAN_HPP_DEFAULT_DISPATCHER_TYPE>
VULKAN_HPP_NODISCARD typename ResultValueType<std::vector<uint8_t, Allocator>>::type
template <typename Uint8_tAllocator = std::allocator<uint8_t>,
typename Dispatch = VULKAN_HPP_DEFAULT_DISPATCHER_TYPE>
VULKAN_HPP_NODISCARD typename ResultValueType<std::vector<uint8_t, Uint8_tAllocator>>::type
getShaderInfoAMD( VULKAN_HPP_NAMESPACE::Pipeline pipeline,
VULKAN_HPP_NAMESPACE::ShaderStageFlagBits shaderStage,
VULKAN_HPP_NAMESPACE::ShaderInfoTypeAMD infoType,
Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const;
template <typename Allocator = std::allocator<uint8_t>,
typename Dispatch = VULKAN_HPP_DEFAULT_DISPATCHER_TYPE,
typename B = Allocator,
template <typename Uint8_tAllocator = std::allocator<uint8_t>,
typename Dispatch = VULKAN_HPP_DEFAULT_DISPATCHER_TYPE,
typename B = Uint8_tAllocator,
typename std::enable_if<std::is_same<typename B::value_type, uint8_t>::value, int>::type = 0>
VULKAN_HPP_NODISCARD typename ResultValueType<std::vector<uint8_t, Allocator>>::type
VULKAN_HPP_NODISCARD typename ResultValueType<std::vector<uint8_t, Uint8_tAllocator>>::type
getShaderInfoAMD( VULKAN_HPP_NAMESPACE::Pipeline pipeline,
VULKAN_HPP_NAMESPACE::ShaderStageFlagBits shaderStage,
VULKAN_HPP_NAMESPACE::ShaderInfoTypeAMD infoType,
Allocator const & vectorAllocator,
Uint8_tAllocator & uint8_tAllocator,
Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const;
#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/
@ -55511,20 +55513,21 @@ namespace VULKAN_HPP_NAMESPACE
VULKAN_HPP_NODISCARD Result getValidationCacheDataEXT(
VULKAN_HPP_NAMESPACE::ValidationCacheEXT validationCache,
size_t * pDataSize,
void * pData,
void * pData VULKAN_HPP_DEFAULT_ARGUMENT_ASSIGNMENT,
Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const VULKAN_HPP_NOEXCEPT;
#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE
template <typename Allocator = std::allocator<uint8_t>, typename Dispatch = VULKAN_HPP_DEFAULT_DISPATCHER_TYPE>
VULKAN_HPP_NODISCARD typename ResultValueType<std::vector<uint8_t, Allocator>>::type
template <typename Uint8_tAllocator = std::allocator<uint8_t>,
typename Dispatch = VULKAN_HPP_DEFAULT_DISPATCHER_TYPE>
VULKAN_HPP_NODISCARD typename ResultValueType<std::vector<uint8_t, Uint8_tAllocator>>::type
getValidationCacheDataEXT( VULKAN_HPP_NAMESPACE::ValidationCacheEXT validationCache,
Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const;
template <typename Allocator = std::allocator<uint8_t>,
typename Dispatch = VULKAN_HPP_DEFAULT_DISPATCHER_TYPE,
typename B = Allocator,
template <typename Uint8_tAllocator = std::allocator<uint8_t>,
typename Dispatch = VULKAN_HPP_DEFAULT_DISPATCHER_TYPE,
typename B = Uint8_tAllocator,
typename std::enable_if<std::is_same<typename B::value_type, uint8_t>::value, int>::type = 0>
VULKAN_HPP_NODISCARD typename ResultValueType<std::vector<uint8_t, Allocator>>::type
VULKAN_HPP_NODISCARD typename ResultValueType<std::vector<uint8_t, Uint8_tAllocator>>::type
getValidationCacheDataEXT( VULKAN_HPP_NAMESPACE::ValidationCacheEXT validationCache,
Allocator const & vectorAllocator,
Uint8_tAllocator & uint8_tAllocator,
Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const;
#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/
@ -99806,14 +99809,15 @@ namespace VULKAN_HPP_NAMESPACE
return static_cast<Result>(
d.vkGetPipelineCacheData( m_device, static_cast<VkPipelineCache>( pipelineCache ), pDataSize, pData ) );
}
#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE
template <typename Allocator, typename Dispatch>
VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE typename ResultValueType<std::vector<uint8_t, Allocator>>::type
template <typename Uint8_tAllocator, typename Dispatch>
VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE typename ResultValueType<std::vector<uint8_t, Uint8_tAllocator>>::type
Device::getPipelineCacheData( VULKAN_HPP_NAMESPACE::PipelineCache pipelineCache, Dispatch const & d ) const
{
std::vector<uint8_t, Allocator> data;
size_t dataSize;
Result result;
std::vector<uint8_t, Uint8_tAllocator> data;
size_t dataSize;
Result result;
do
{
result = static_cast<Result>(
@ -99825,27 +99829,28 @@ namespace VULKAN_HPP_NAMESPACE
static_cast<VkPipelineCache>( pipelineCache ),
&dataSize,
reinterpret_cast<void *>( data.data() ) ) );
VULKAN_HPP_ASSERT( dataSize <= data.size() );
}
} while ( result == Result::eIncomplete );
if ( result == Result::eSuccess )
if ( ( result == Result::eSuccess ) && ( dataSize < data.size() ) )
{
VULKAN_HPP_ASSERT( dataSize <= data.size() );
data.resize( dataSize );
}
return createResultValue( result, data, VULKAN_HPP_NAMESPACE_STRING "::Device::getPipelineCacheData" );
}
template <typename Allocator,
template <typename Uint8_tAllocator,
typename Dispatch,
typename B,
typename std::enable_if<std::is_same<typename B::value_type, uint8_t>::value, int>::type>
VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE typename ResultValueType<std::vector<uint8_t, Allocator>>::type
VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE typename ResultValueType<std::vector<uint8_t, Uint8_tAllocator>>::type
Device::getPipelineCacheData( VULKAN_HPP_NAMESPACE::PipelineCache pipelineCache,
Allocator const & vectorAllocator,
Uint8_tAllocator & uint8_tAllocator,
Dispatch const & d ) const
{
std::vector<uint8_t, Allocator> data( vectorAllocator );
size_t dataSize;
Result result;
std::vector<uint8_t, Uint8_tAllocator> data( uint8_tAllocator );
size_t dataSize;
Result result;
do
{
result = static_cast<Result>(
@ -99857,11 +99862,11 @@ namespace VULKAN_HPP_NAMESPACE
static_cast<VkPipelineCache>( pipelineCache ),
&dataSize,
reinterpret_cast<void *>( data.data() ) ) );
VULKAN_HPP_ASSERT( dataSize <= data.size() );
}
} while ( result == Result::eIncomplete );
if ( result == Result::eSuccess )
if ( ( result == Result::eSuccess ) && ( dataSize < data.size() ) )
{
VULKAN_HPP_ASSERT( dataSize <= data.size() );
data.resize( dataSize );
}
return createResultValue( result, data, VULKAN_HPP_NAMESPACE_STRING "::Device::getPipelineCacheData" );
@ -100652,17 +100657,18 @@ namespace VULKAN_HPP_NAMESPACE
pInfoSize,
pInfo ) );
}
#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE
template <typename Allocator, typename Dispatch>
VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE typename ResultValueType<std::vector<uint8_t, Allocator>>::type
template <typename Uint8_tAllocator, typename Dispatch>
VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE typename ResultValueType<std::vector<uint8_t, Uint8_tAllocator>>::type
Device::getShaderInfoAMD( VULKAN_HPP_NAMESPACE::Pipeline pipeline,
VULKAN_HPP_NAMESPACE::ShaderStageFlagBits shaderStage,
VULKAN_HPP_NAMESPACE::ShaderInfoTypeAMD infoType,
Dispatch const & d ) const
{
std::vector<uint8_t, Allocator> info;
size_t infoSize;
Result result;
std::vector<uint8_t, Uint8_tAllocator> info;
size_t infoSize;
Result result;
do
{
result = static_cast<Result>( d.vkGetShaderInfoAMD( m_device,
@ -100680,29 +100686,30 @@ namespace VULKAN_HPP_NAMESPACE
static_cast<VkShaderInfoTypeAMD>( infoType ),
&infoSize,
reinterpret_cast<void *>( info.data() ) ) );
VULKAN_HPP_ASSERT( infoSize <= info.size() );
}
} while ( result == Result::eIncomplete );
if ( result == Result::eSuccess )
if ( ( result == Result::eSuccess ) && ( infoSize < info.size() ) )
{
VULKAN_HPP_ASSERT( infoSize <= info.size() );
info.resize( infoSize );
}
return createResultValue( result, info, VULKAN_HPP_NAMESPACE_STRING "::Device::getShaderInfoAMD" );
}
template <typename Allocator,
template <typename Uint8_tAllocator,
typename Dispatch,
typename B,
typename std::enable_if<std::is_same<typename B::value_type, uint8_t>::value, int>::type>
VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE typename ResultValueType<std::vector<uint8_t, Allocator>>::type
VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE typename ResultValueType<std::vector<uint8_t, Uint8_tAllocator>>::type
Device::getShaderInfoAMD( VULKAN_HPP_NAMESPACE::Pipeline pipeline,
VULKAN_HPP_NAMESPACE::ShaderStageFlagBits shaderStage,
VULKAN_HPP_NAMESPACE::ShaderInfoTypeAMD infoType,
Allocator const & vectorAllocator,
Uint8_tAllocator & uint8_tAllocator,
Dispatch const & d ) const
{
std::vector<uint8_t, Allocator> info( vectorAllocator );
size_t infoSize;
Result result;
std::vector<uint8_t, Uint8_tAllocator> info( uint8_tAllocator );
size_t infoSize;
Result result;
do
{
result = static_cast<Result>( d.vkGetShaderInfoAMD( m_device,
@ -100720,11 +100727,11 @@ namespace VULKAN_HPP_NAMESPACE
static_cast<VkShaderInfoTypeAMD>( infoType ),
&infoSize,
reinterpret_cast<void *>( info.data() ) ) );
VULKAN_HPP_ASSERT( infoSize <= info.size() );
}
} while ( result == Result::eIncomplete );
if ( result == Result::eSuccess )
if ( ( result == Result::eSuccess ) && ( infoSize < info.size() ) )
{
VULKAN_HPP_ASSERT( infoSize <= info.size() );
info.resize( infoSize );
}
return createResultValue( result, info, VULKAN_HPP_NAMESPACE_STRING "::Device::getShaderInfoAMD" );
@ -100868,15 +100875,16 @@ namespace VULKAN_HPP_NAMESPACE
return static_cast<Result>( d.vkGetValidationCacheDataEXT(
m_device, static_cast<VkValidationCacheEXT>( validationCache ), pDataSize, pData ) );
}
#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE
template <typename Allocator, typename Dispatch>
VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE typename ResultValueType<std::vector<uint8_t, Allocator>>::type
template <typename Uint8_tAllocator, typename Dispatch>
VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE typename ResultValueType<std::vector<uint8_t, Uint8_tAllocator>>::type
Device::getValidationCacheDataEXT( VULKAN_HPP_NAMESPACE::ValidationCacheEXT validationCache,
Dispatch const & d ) const
{
std::vector<uint8_t, Allocator> data;
size_t dataSize;
Result result;
std::vector<uint8_t, Uint8_tAllocator> data;
size_t dataSize;
Result result;
do
{
result = static_cast<Result>( d.vkGetValidationCacheDataEXT(
@ -100889,27 +100897,28 @@ namespace VULKAN_HPP_NAMESPACE
static_cast<VkValidationCacheEXT>( validationCache ),
&dataSize,
reinterpret_cast<void *>( data.data() ) ) );
VULKAN_HPP_ASSERT( dataSize <= data.size() );
}
} while ( result == Result::eIncomplete );
if ( result == Result::eSuccess )
if ( ( result == Result::eSuccess ) && ( dataSize < data.size() ) )
{
VULKAN_HPP_ASSERT( dataSize <= data.size() );
data.resize( dataSize );
}
return createResultValue( result, data, VULKAN_HPP_NAMESPACE_STRING "::Device::getValidationCacheDataEXT" );
}
template <typename Allocator,
template <typename Uint8_tAllocator,
typename Dispatch,
typename B,
typename std::enable_if<std::is_same<typename B::value_type, uint8_t>::value, int>::type>
VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE typename ResultValueType<std::vector<uint8_t, Allocator>>::type
VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE typename ResultValueType<std::vector<uint8_t, Uint8_tAllocator>>::type
Device::getValidationCacheDataEXT( VULKAN_HPP_NAMESPACE::ValidationCacheEXT validationCache,
Allocator const & vectorAllocator,
Uint8_tAllocator & uint8_tAllocator,
Dispatch const & d ) const
{
std::vector<uint8_t, Allocator> data( vectorAllocator );
size_t dataSize;
Result result;
std::vector<uint8_t, Uint8_tAllocator> data( uint8_tAllocator );
size_t dataSize;
Result result;
do
{
result = static_cast<Result>( d.vkGetValidationCacheDataEXT(
@ -100922,11 +100931,11 @@ namespace VULKAN_HPP_NAMESPACE
static_cast<VkValidationCacheEXT>( validationCache ),
&dataSize,
reinterpret_cast<void *>( data.data() ) ) );
VULKAN_HPP_ASSERT( dataSize <= data.size() );
}
} while ( result == Result::eIncomplete );
if ( result == Result::eSuccess )
if ( ( result == Result::eSuccess ) && ( dataSize < data.size() ) )
{
VULKAN_HPP_ASSERT( dataSize <= data.size() );
data.resize( dataSize );
}
return createResultValue( result, data, VULKAN_HPP_NAMESPACE_STRING "::Device::getValidationCacheDataEXT" );