Merge pull request #1406 from asuessenbach/stride

Introduce helper class vk::StridedArrayProxy; use it on functions with parameters having the 'stride' attribute.
This commit is contained in:
Andreas Süßenbach 2022-09-12 17:56:29 +02:00 committed by GitHub
commit b99cbcdf04
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
13 changed files with 2093 additions and 1693 deletions

File diff suppressed because it is too large Load Diff

View File

@ -20,6 +20,8 @@
#include <tinyxml2.h>
#include <vector>
const size_t INVALID_INDEX = (size_t)~0;
class VulkanHppGenerator
{
public:
@ -110,6 +112,7 @@ private:
std::vector<std::string> arraySizes;
std::string len;
bool optional;
std::string stride;
int xmlLine;
};
@ -350,11 +353,17 @@ private:
std::string referencedIn;
};
struct VectorParamData
{
size_t lenParam = INVALID_INDEX;
size_t strideParam = INVALID_INDEX;
};
private:
void addCommand( std::string const & name, CommandData & commandData );
void addMissingFlagBits( std::vector<RequireData> & requireData, std::string const & referencedIn );
std::string addTitleAndProtection( std::string const & title, std::string const & strIf, std::string const & strElse = {} ) const;
bool allVectorSizesSupported( std::vector<ParamData> const & params, std::map<size_t, size_t> const & vectorParams ) const;
bool allVectorSizesSupported( std::vector<ParamData> const & params, std::map<size_t, VectorParamData> const & vectorParams ) const;
void appendDispatchLoaderDynamicCommands( std::vector<RequireData> const & requireData,
std::set<std::string> & listedCommands,
std::string const & title,
@ -385,69 +394,70 @@ private:
void checkStructCorrectness() const;
void checkStructMemberCorrectness( std::string const & structureName, std::vector<MemberData> const & members, std::set<std::string> & sTypeValues ) const;
void checkValidStructs( int line, std::map<std::string, std::string> const & attributes ) const;
std::string combineDataTypes( std::map<size_t, size_t> const & vectorParams,
std::vector<size_t> const & returnParams,
bool singular,
bool enumerating,
std::vector<std::string> const & dataTypes,
bool unique,
bool raii ) const;
std::string combineDataTypes( std::map<size_t, VectorParamData> const & vectorParams,
std::vector<size_t> const & returnParams,
bool singular,
bool enumerating,
std::vector<std::string> const & dataTypes,
bool unique,
bool raii ) const;
bool containsArray( std::string const & type ) const;
bool containsFuncPointer( std::string const & type ) const;
bool containsFloatingPoints( std::vector<MemberData> const & members ) const;
bool containsUnion( std::string const & type ) const;
std::vector<size_t> determineConstPointerParams( std::vector<ParamData> const & params ) const;
std::vector<std::string> determineDataTypes( std::vector<VulkanHppGenerator::ParamData> const & params,
std::map<size_t, size_t> const & vectorParams,
std::map<size_t, VectorParamData> const & vectorParams,
std::vector<size_t> const & returnParams,
std::set<size_t> const & templatedParams,
bool raii ) const;
size_t determineDefaultStartIndex( std::vector<ParamData> const & params, std::set<size_t> const & skippedParams ) const;
bool determineEnumeration( std::map<size_t, size_t> const & vectorParams, std::vector<size_t> const & returnParams ) const;
bool determineEnumeration( std::map<size_t, VectorParamData> const & vectorParams, std::vector<size_t> const & returnParams ) const;
size_t determineInitialSkipCount( std::string const & command ) const;
std::vector<size_t> determineReturnParams( std::vector<ParamData> const & params ) const;
std::vector<std::map<std::string, CommandData>::const_iterator>
determineRAIIHandleConstructors( std::string const & handleType, std::map<std::string, CommandData>::const_iterator destructorIt ) const;
std::map<std::string, CommandData>::const_iterator determineRAIIHandleDestructor( std::string const & handleType ) const;
std::set<size_t> determineSkippedParams( std::vector<ParamData> const & params,
size_t initialSkipCount,
std::map<size_t, size_t> const & vectorParamIndices,
std::vector<size_t> const & returnParam,
bool singular ) const;
std::string determineSubStruct( std::pair<std::string, StructureData> const & structure ) const;
std::map<size_t, size_t> determineVectorParams( std::vector<ParamData> const & params ) const;
std::set<size_t> determineVoidPointerParams( std::vector<ParamData> const & params ) const;
void distributeSecondLevelCommands( std::set<std::string> const & specialFunctions );
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::pair<std::string, 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,
bool unique,
bool chained ) const;
std::string generateArgumentListEnhanced( std::vector<ParamData> const & params,
std::vector<size_t> const & returnParams,
std::map<size_t, size_t> const & vectorParams,
std::set<size_t> const & skippedParams,
std::set<size_t> const & singularParams,
std::set<size_t> const & templatedParams,
bool definition,
bool withAllocators,
bool structureChain,
bool withDispatcher ) const;
std::string generateArgumentListStandard( std::vector<ParamData> const & params, std::set<size_t> const & skippedParams ) const;
std::string generateArgumentTemplates( std::vector<ParamData> const & params,
std::vector<size_t> const & returnParams,
std::map<size_t, size_t> const & vectorParams,
std::set<size_t> const & templatedParams,
bool chained,
bool raii ) const;
std::string generateBaseTypes() const;
std::string generateBitmask( std::map<std::string, BitmaskData>::const_iterator bitmaskIt ) const;
std::string generateBitmasks() const;
std::set<size_t> determineSingularParams( size_t returnParam, std::map<size_t, VectorParamData> const & vectorParams ) const;
std::set<size_t> determineSkippedParams( std::vector<ParamData> const & params,
size_t initialSkipCount,
std::map<size_t, VectorParamData> const & vectorParams,
std::vector<size_t> const & returnParam,
bool singular ) const;
std::string determineSubStruct( std::pair<std::string, StructureData> const & structure ) const;
std::map<size_t, VectorParamData> determineVectorParams( std::vector<ParamData> const & params ) const;
std::set<size_t> determineVoidPointerParams( std::vector<ParamData> const & params ) const;
void distributeSecondLevelCommands( std::set<std::string> const & specialFunctions );
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::pair<std::string, std::string> generateAllocatorTemplates( std::vector<size_t> const & returnParams,
std::vector<std::string> const & returnDataTypes,
std::map<size_t, VectorParamData> const & vectorParams,
bool definition,
bool singular,
bool unique,
bool chained ) const;
std::string generateArgumentListEnhanced( std::vector<ParamData> const & params,
std::vector<size_t> const & returnParams,
std::map<size_t, VectorParamData> const & vectorParams,
std::set<size_t> const & skippedParams,
std::set<size_t> const & singularParams,
std::set<size_t> const & templatedParams,
bool definition,
bool withAllocators,
bool structureChain,
bool withDispatcher ) const;
std::string generateArgumentListStandard( std::vector<ParamData> const & params, std::set<size_t> const & skippedParams ) const;
std::string generateArgumentTemplates( std::vector<ParamData> const & params,
std::vector<size_t> const & returnParams,
std::map<size_t, VectorParamData> const & vectorParams,
std::set<size_t> const & templatedParams,
bool chained,
bool raii ) const;
std::string generateBaseTypes() const;
std::string generateBitmask( std::map<std::string, BitmaskData>::const_iterator bitmaskIt ) const;
std::string generateBitmasks() const;
std::string generateBitmasks( std::vector<RequireData> const & requireData, std::set<std::string> & listedBitmasks, std::string const & title ) const;
std::string generateBitmasksToString() const;
std::string generateBitmasksToString( std::vector<RequireData> const & requireData, std::set<std::string> & listedBitmasks, std::string const & title ) const;
@ -476,31 +486,31 @@ private:
std::string generateCallArgumentEnhancedNonConstPointer(
ParamData const & param, size_t paramIndex, bool nonConstPointerAsNullptr, std::set<size_t> const & singularParams, bool raiiHandleMemberFunction ) const;
std::string generateCallArgumentEnhancedValue( std::vector<ParamData> const & params, size_t paramIndex, std::set<size_t> const & singularParams ) const;
std::string generateCallSequence( std::string const & name,
CommandData const & commandData,
std::vector<size_t> const & returnParams,
std::map<size_t, size_t> const & vectorParams,
size_t initialSkipCount,
std::set<size_t> const & singularParams,
std::set<size_t> const & templatedParams,
bool chained,
bool raii ) const;
std::string generateCallSequence( std::string const & name,
CommandData const & commandData,
std::vector<size_t> const & returnParams,
std::map<size_t, VectorParamData> const & vectorParams,
size_t initialSkipCount,
std::set<size_t> const & singularParams,
std::set<size_t> const & templatedParams,
bool chained,
bool raii ) const;
std::string generateChainTemplates( std::vector<size_t> const & returnParams, bool chained ) const;
std::string generateCommand( std::string const & name, CommandData const & commandData, size_t initialSkipCount, bool definition ) const;
std::string generateCommandDefinitions() const;
std::string
generateCommandDefinitions( std::vector<RequireData> const & requireData, std::set<std::string> & listedCommands, std::string const & title ) const;
std::string generateCommandDefinitions( std::string const & command, std::string const & handle ) const;
std::string generateCommandEnhanced( std::string const & name,
CommandData const & commandData,
size_t initialSkipCount,
bool definition,
std::map<size_t, size_t> const & vectorParamIndices,
std::vector<size_t> const & returnParams,
bool singular,
bool withAllocator,
bool chained,
bool unique ) const;
std::string generateCommandEnhanced( std::string const & name,
CommandData const & commandData,
size_t initialSkipCount,
bool definition,
std::map<size_t, VectorParamData> const & vectorParams,
std::vector<size_t> const & returnParams,
bool singular,
bool withAllocator,
bool chained,
bool unique ) const;
std::string generateCommandName( std::string const & vulkanCommandName,
std::vector<ParamData> const & params,
size_t initialSkipCount,
@ -533,26 +543,26 @@ private:
std::string const & name, CommandData const & commandData, size_t initialSkipCount, bool definition, size_t returnParam ) const;
std::string generateCommandResultSingleSuccessWithErrors1ReturnHandle(
std::string const & name, CommandData const & commandData, size_t initialSkipCount, bool definition, size_t returnParam ) const;
std::string generateCommandResultSingleSuccessWithErrors1ReturnHandle1Vector( std::string const & name,
CommandData const & commandData,
size_t initialSkipCount,
bool definition,
size_t returnParam,
std::pair<size_t, size_t> const & vectorParamIndex ) const;
std::string generateCommandResultSingleSuccessWithErrors1ReturnHandle2Vector( std::string const & name,
CommandData const & commandData,
size_t initialSkipCount,
bool definition,
size_t returnParam,
std::map<size_t, size_t> const & vectorParamIndices ) const;
std::string generateCommandResultSingleSuccessWithErrors1ReturnHandle1Vector( std::string const & name,
CommandData const & commandData,
size_t initialSkipCount,
bool definition,
size_t returnParam,
std::pair<size_t, VectorParamData> const & vectorParamIndex ) const;
std::string generateCommandResultSingleSuccessWithErrors1ReturnHandle2Vector( std::string const & name,
CommandData const & commandData,
size_t initialSkipCount,
bool definition,
size_t returnParam,
std::map<size_t, VectorParamData> const & vectorParamIndices ) const;
std::string generateCommandResultSingleSuccessWithErrors1ReturnValue(
std::string const & name, CommandData const & commandData, size_t initialSkipCount, bool definition, size_t returnParam ) const;
std::string generateCommandResultSingleSuccessWithErrors1ReturnValue2Vectors( std::string const & name,
CommandData const & commandData,
size_t initialSkipCount,
bool definition,
size_t returnParam,
std::map<size_t, size_t> const & vectorParamIndices ) const;
std::string generateCommandResultSingleSuccessWithErrors1ReturnValue2Vectors( std::string const & name,
CommandData const & commandData,
size_t initialSkipCount,
bool definition,
size_t returnParam,
std::map<size_t, VectorParamData> const & vectorParamIndices ) const;
std::string generateCommandResultSingleSuccessWithErrors1ReturnVoid(
std::string const & name, CommandData const & commandData, size_t initialSkipCount, bool definition, size_t returnParam ) const;
std::string generateCommandResultSingleSuccessWithErrors2Return(
@ -611,62 +621,62 @@ private:
std::string generateCommandVoid2Return(
std::string const & name, CommandData const & commandData, size_t initialSkipCount, bool definition, std::vector<size_t> const & returnParamIndices ) const;
std::string generateConstexprString( std::string const & structName ) const;
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,
bool unique,
bool raii,
std::vector<std::string> const & dataTypes,
std::string const & dataType,
std::string const & returnType,
std::string const & returnVariable ) const;
std::string generateDataDeclarations1Return( 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,
bool unique,
std::vector<std::string> const & dataTypes,
std::string const & dataType,
std::string const & returnType,
std::string const & returnVariable ) const;
std::string generateDataDeclarations2Returns( CommandData const & commandData,
std::vector<size_t> const & returnParams,
std::map<size_t, size_t> const & vectorParams,
bool singular,
bool withAllocator,
bool chained,
bool raii,
std::vector<std::string> const & dataTypes,
std::string const & dataType,
std::string const & returnVariable ) const;
std::string generateDataDeclarations( CommandData const & commandData,
std::vector<size_t> const & returnParams,
std::map<size_t, VectorParamData> const & vectorParams,
std::set<size_t> const & templatedParams,
bool singular,
bool withAllocator,
bool chained,
bool unique,
bool raii,
std::vector<std::string> const & dataTypes,
std::string const & dataType,
std::string const & returnType,
std::string const & returnVariable ) const;
std::string generateDataDeclarations1Return( CommandData const & commandData,
std::vector<size_t> const & returnParams,
std::map<size_t, VectorParamData> const & vectorParams,
std::set<size_t> const & templatedParams,
bool singular,
bool withAllocator,
bool chained,
bool unique,
std::vector<std::string> const & dataTypes,
std::string const & dataType,
std::string const & returnType,
std::string const & returnVariable ) const;
std::string generateDataDeclarations2Returns( CommandData const & commandData,
std::vector<size_t> const & returnParams,
std::map<size_t, VectorParamData> const & vectorParams,
bool singular,
bool withAllocator,
bool chained,
bool raii,
std::vector<std::string> const & dataTypes,
std::string const & dataType,
std::string const & returnVariable ) const;
std::string generateDataDeclarations3Returns( CommandData const & commandData,
std::vector<size_t> const & returnParams,
bool withAllocator,
bool raii,
std::vector<std::string> const & dataTypes ) const;
std::string generateDataPreparation( CommandData const & commandData,
size_t initialSkipCount,
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 unique,
bool chained,
bool enumerating ) 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 generateDataPreparation( CommandData const & commandData,
size_t initialSkipCount,
std::vector<size_t> const & returnParams,
std::map<size_t, VectorParamData> const & vectorParams,
std::set<size_t> const & templatedParams,
bool singular,
bool withAllocator,
bool unique,
bool chained,
bool enumerating ) const;
std::string generateDataSizeChecks( CommandData const & commandData,
std::vector<size_t> const & returnParams,
std::vector<std::string> const & returnParamTypes,
std::map<size_t, VectorParamData> const & vectorParams,
std::set<size_t> const & templatedParams,
bool singular ) const;
std::string generateDispatchLoaderDynamic() const; // uses vkGet*ProcAddress to get function pointers
std::string generateDispatchLoaderStatic() const; // uses exported symbols from loader
std::string generateDestroyCommand( std::string const & name, CommandData const & commandData ) const;
@ -701,6 +711,12 @@ private:
std::map<std::vector<MemberData>::const_iterator, std::vector<std::vector<MemberData>::const_iterator>>::const_iterator litit,
bool mutualExclusiveLens ) const;
std::string generateName( TypeInfo const & typeInfo ) const;
std::string generateNoExcept( std::vector<std::string> const & errorCodes,
std::vector<size_t> const & returnParams,
std::map<size_t, VectorParamData> const & vectorParams,
bool singular,
bool vectorSizeCheck,
bool raii ) const;
std::string generateObjectDeleter( std::string const & commandName, CommandData const & commandData, size_t initialSkipCount, size_t returnParam ) const;
std::pair<std::string, std::string> generateProtection( std::string const & referencedIn, std::string const & protect ) const;
std::pair<std::string, std::string> generateProtection( std::string const & type, bool isAliased ) const;
@ -716,14 +732,14 @@ private:
std::string generateRAIIHandleCommandEnhanced( std::map<std::string, CommandData>::const_iterator commandIt,
size_t initialSkipCount,
std::vector<size_t> const & returnParams,
std::map<size_t, size_t> const & vectorParamIndices,
std::map<size_t, VectorParamData> const & vectorParamIndices,
bool definition,
bool chained,
bool singular ) const;
std::string generateRAIIHandleCommandFactory( std::map<std::string, CommandData>::const_iterator commandIt,
size_t initialSkipCount,
std::vector<size_t> const & returnParams,
std::map<size_t, size_t> const & vectorParams,
std::map<size_t, VectorParamData> const & vectorParams,
bool definition,
bool singular ) const;
std::string generateRAIIHandleCommandFactoryArgumentList( std::vector<ParamData> const & params,
@ -778,7 +794,7 @@ private:
std::string const & enter,
std::string const & leave,
size_t returnParam,
std::map<size_t, size_t> const & vectorParamIndices ) const;
std::map<size_t, VectorParamData> const & vectorParamIndices ) const;
std::pair<std::string, std::string> generateRAIIHandleConstructors( std::pair<std::string, HandleData> const & handle ) const;
std::string generateRAIIHandleConstructorArgument( ParamData const & param, bool definition, bool singular, bool takesOwnership ) const;
std::string generateRAIIHandleConstructorArguments( std::pair<std::string, HandleData> const & handle,
@ -856,18 +872,18 @@ private:
bool unique,
bool enumerating,
bool raii ) const;
std::string generateReturnType( CommandData const & commandData,
std::vector<size_t> const & returnParams,
std::map<size_t, size_t> const & vectorParams,
bool unique,
bool chained,
bool raii,
std::string const & dataType ) const;
std::string generateReturnVariable( CommandData const & commandData,
std::vector<size_t> const & returnParams,
std::map<size_t, size_t> const & vectorParams,
bool chained,
bool singular ) const;
std::string generateReturnType( CommandData const & commandData,
std::vector<size_t> const & returnParams,
std::map<size_t, VectorParamData> const & vectorParams,
bool unique,
bool chained,
bool raii,
std::string const & dataType ) const;
std::string generateReturnVariable( CommandData const & commandData,
std::vector<size_t> const & returnParams,
std::map<size_t, VectorParamData> const & vectorParams,
bool chained,
bool singular ) const;
std::string
generateSizeCheck( std::vector<std::vector<MemberData>::const_iterator> const & arrayIts, std::string const & structName, bool mutualExclusiveLens ) const;
std::string generateStaticAssertions( std::vector<RequireData> const & requireData, std::string const & title ) const;
@ -893,14 +909,14 @@ private:
std::string generateSuccessCheck( std::vector<std::string> const & successCodes ) const;
std::string generateSuccessCodeList( std::vector<std::string> const & successCodes, bool enumerating ) const;
std::string generateThrowResultException() const;
std::string generateTypenameCheck( std::vector<size_t> const & returnParams,
std::map<size_t, size_t> const & vectorParams,
bool definition,
std::vector<std::string> const & dataTypes,
bool singular,
bool withAllocator,
bool unique,
bool chained ) const;
std::string generateTypenameCheck( std::vector<size_t> const & returnParams,
std::map<size_t, VectorParamData> const & vectorParams,
bool definition,
std::vector<std::string> const & dataTypes,
bool singular,
bool withAllocator,
bool unique,
bool chained ) const;
std::string generateUnion( std::pair<std::string, StructureData> const & structure ) const;
std::string generateUniqueTypes( std::string const & parentType, std::set<std::string> const & childrenTypes ) const;
std::string generateVectorSizeCheck( std::string const & name,
@ -912,11 +928,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,
std::string const & returnParamType,
std::set<size_t> const & templatedParams ) const;
std::string getVectorSize( std::vector<ParamData> const & params,
std::map<size_t, VectorParamData> 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;
@ -926,10 +942,10 @@ private:
bool isParam( std::string const & name, std::vector<ParamData> const & params ) const;
bool isStructMember( std::string const & name, std::vector<MemberData> const & memberData ) const;
bool isStructureChainAnchor( std::string const & type ) const;
std::pair<bool, std::map<size_t, std::vector<size_t>>> needsVectorSizeCheck( std::vector<ParamData> const & params,
std::map<size_t, size_t> const & vectorParams,
std::vector<size_t> const & returnParams,
std::set<size_t> const & singularParams ) const;
std::pair<bool, std::map<size_t, std::vector<size_t>>> needsVectorSizeCheck( std::vector<ParamData> const & params,
std::map<size_t, VectorParamData> const & vectorParams,
std::vector<size_t> const & returnParams,
std::set<size_t> const & singularParams ) const;
void readCommands( tinyxml2::XMLElement const * element );
void readCommandsCommand( tinyxml2::XMLElement const * element );
ParamData readCommandsCommandParam( tinyxml2::XMLElement const * element, std::vector<ParamData> const & params );
@ -1026,5 +1042,3 @@ private:
std::string m_version;
std::string m_vulkanLicenseHeader;
};
const size_t INVALID_INDEX = (size_t)~0;

View File

@ -12,36 +12,18 @@
, m_ptr( nullptr )
{}
ArrayProxy( T & value ) VULKAN_HPP_NOEXCEPT
ArrayProxy( T const & value ) VULKAN_HPP_NOEXCEPT
: m_count( 1 )
, m_ptr( &value )
{}
template <typename B = T, typename std::enable_if<std::is_const<B>::value, int>::type = 0>
ArrayProxy( typename std::remove_const<T>::type & value ) VULKAN_HPP_NOEXCEPT
: m_count( 1 )
, m_ptr( &value )
{}
ArrayProxy( uint32_t count, T * ptr ) VULKAN_HPP_NOEXCEPT
: m_count( count )
, m_ptr( ptr )
{}
template <typename B = T, typename std::enable_if<std::is_const<B>::value, int>::type = 0>
ArrayProxy( uint32_t count, typename std::remove_const<T>::type * ptr ) VULKAN_HPP_NOEXCEPT
ArrayProxy( uint32_t count, T const * ptr ) VULKAN_HPP_NOEXCEPT
: m_count( count )
, m_ptr( ptr )
{}
template <std::size_t C>
ArrayProxy( T (& ptr)[C] ) VULKAN_HPP_NOEXCEPT
: m_count( C )
, m_ptr( ptr )
{}
template <std::size_t C, typename B = T, typename std::enable_if<std::is_const<B>::value, int>::type = 0>
ArrayProxy( typename std::remove_const<T>::type (& ptr)[C] ) VULKAN_HPP_NOEXCEPT
ArrayProxy( T const ( &ptr )[C] ) VULKAN_HPP_NOEXCEPT
: m_count( C )
, m_ptr( ptr )
{}
@ -60,20 +42,10 @@
ArrayProxy( std::initializer_list<typename std::remove_const<T>::type> const & list ) VULKAN_HPP_NOEXCEPT
: m_count( static_cast<uint32_t>( list.size() ) )
, m_ptr( list.begin() )
{}
{
}
ArrayProxy( std::initializer_list<T> & list ) VULKAN_HPP_NOEXCEPT
: m_count( static_cast<uint32_t>( list.size() ) )
, m_ptr( list.begin() )
{}
template <typename B = T, typename std::enable_if<std::is_const<B>::value, int>::type = 0>
ArrayProxy( std::initializer_list<typename std::remove_const<T>::type> & list ) VULKAN_HPP_NOEXCEPT
: m_count( static_cast<uint32_t>( list.size() ) )
, m_ptr( list.begin() )
{}
# if __GNUC__ >= 9
#if __GNUC__ >= 9
# pragma GCC diagnostic pop
# endif
@ -88,15 +60,6 @@
, m_ptr( v.data() )
{}
template <typename V,
typename std::enable_if<
std::is_convertible<decltype( std::declval<V>().data() ), T *>::value &&
std::is_convertible<decltype( std::declval<V>().size() ), std::size_t>::value>::type * = nullptr>
ArrayProxy( V & v ) VULKAN_HPP_NOEXCEPT
: m_count( static_cast<uint32_t>( v.size() ) )
, m_ptr( v.data() )
{}
const T * begin() const VULKAN_HPP_NOEXCEPT
{
return m_ptr;
@ -129,12 +92,12 @@
return m_count;
}
T * data() const VULKAN_HPP_NOEXCEPT
T const * data() const VULKAN_HPP_NOEXCEPT
{
return m_ptr;
}
private:
uint32_t m_count;
T * m_ptr;
uint32_t m_count;
T const * m_ptr;
};

View File

@ -0,0 +1,40 @@
template <typename T>
class StridedArrayProxy : protected ArrayProxy<T>
{
public:
using ArrayProxy<T>::ArrayProxy;
StridedArrayProxy( uint32_t count, T const * ptr, uint32_t stride ) VULKAN_HPP_NOEXCEPT
: ArrayProxy<T>( count, ptr )
, m_stride( stride )
{
VULKAN_HPP_ASSERT( sizeof( T ) <= stride );
}
using ArrayProxy<T>::begin;
const T * end() const VULKAN_HPP_NOEXCEPT
{
return reinterpret_cast<T const *>( static_cast<uint8_t const *>( begin() ) + size() * m_stride );
}
using ArrayProxy<T>::front;
const T & back() const VULKAN_HPP_NOEXCEPT
{
VULKAN_HPP_ASSERT( begin() && size() );
return *reinterpret_cast<T const *>( static_cast<uint8_t const *>( begin() ) + ( size() - 1 ) * m_stride );
}
using ArrayProxy<T>::empty;
using ArrayProxy<T>::size;
using ArrayProxy<T>::data;
uint32_t stride() const
{
return m_stride;
}
private:
uint32_t m_stride = sizeof( T );
};

View File

@ -58,6 +58,7 @@ add_subdirectory(DispatchLoaderStatic)
add_subdirectory(FormatTraits)
add_subdirectory(Hash)
add_subdirectory(NoExceptions)
add_subdirectory(StridedArrayProxy)
add_subdirectory(StructureChain)
add_subdirectory(UniqueHandle)
add_subdirectory(UniqueHandleDefaultArguments)

View File

@ -0,0 +1,37 @@
# Copyright(c) 2018, NVIDIA CORPORATION. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
cmake_minimum_required(VERSION 3.2)
if (NOT TESTS_BUILD_ONLY_DYNAMIC)
project(StridedArrayProxy)
set(HEADERS
)
set(SOURCES
StridedArrayProxy.cpp
)
source_group(headers FILES ${HEADERS})
source_group(sources FILES ${SOURCES})
add_executable(StridedArrayProxy
${HEADERS}
${SOURCES}
)
set_target_properties(StridedArrayProxy PROPERTIES FOLDER "Tests")
target_link_libraries(StridedArrayProxy PRIVATE utils)
endif()

View File

@ -0,0 +1,241 @@
// Copyright(c) 2018, NVIDIA CORPORATION. All rights reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
//
// VulkanHpp Samples : StridedArrayProxy
// Compile test on using vk::StridedArrayProxy
#include <iostream>
#include <vulkan/vulkan.hpp>
#if ( 20 <= VULKAN_HPP_CPP_VERSION )
# include <span>
#endif
void fct( vk::StridedArrayProxy<int> /*ap*/ ) {}
void fctc( vk::StridedArrayProxy<const int> /*ap*/ ) {}
int main( int /*argc*/, char ** /*argv*/ )
{
try
{
// to prevent a warning on unreferenced function vk::getDispatchLoaderStatic, use just one arbitrary vk-function
// (void)vk::enumerateInstanceVersion();
// nullptr_t
fct( nullptr );
fctc( nullptr );
vk::StridedArrayProxy<int> ap0 = nullptr;
assert( ap0.size() == 0 );
// Type
// fct(2); // not supported: cannot convert argument 1 from 'int' to 'vk::StridedArrayProxy<int>'
fctc( 1 );
int i0 = 1;
fct( i0 );
fctc( i0 );
const int i1 = 2;
// fct(i1); // not supported: cannot convert argument 1 from 'const int' to 'vk::StridedArrayProxy<int>'
fctc( i1 );
vk::StridedArrayProxy<const int> ap1 = 1;
assert( ap1.size() == 1 );
vk::StridedArrayProxy<const int> ap2 = i0;
assert( ap2.size() == 1 );
vk::StridedArrayProxy<const int> ap3 = i1;
assert( ap3.size() == 1 );
// count, T *
int * i0p = &i0;
fct( { 1, i0p } );
fctc( { 1, i0p } );
// count, T const*
int const * i1p = &i1;
// fct({ 1, i1p }); // not supported: cannot convert argument 1 from 'initializer list' to 'vk::StridedArrayProxy<int>'
fctc( { 1, i1p } );
vk::StridedArrayProxy<const int> ap4 = { 1, i0p };
assert( ap4.size() == 1 );
vk::StridedArrayProxy<const int> ap5 = { 1, i1p };
assert( ap5.size() == 1 );
// T[count]
int ia0[2] = { 0, 1 };
fct( ia0 );
fctc( ia0 );
// const T[count]
const int ia1[2] = { 0, 1 };
// fct( ia1 ); // not supported: cannot convert argument 1 from 'const int [2]' to 'vk::StridedArrayProxy<int>'
fctc( ia1 );
vk::StridedArrayProxy<const int> ap6 = ia0;
assert( ap6.size() == 2 );
vk::StridedArrayProxy<const int> ap7 = ia1;
assert( ap7.size() == 2 );
// std::array<T,N>
std::array<int, 2> sa0 = { 0, 1 };
fct( sa0 );
fctc( sa0 );
// std::array<T,N> const
std::array<const int, 2> sa1 = { 0, 1 };
// fct(sa1); // not supported: cannot convert argument 1 from 'std::array<const int,2>' to 'vk::StridedArrayProxy<int>'
fctc( sa1 );
std::array<int, 2> const sa2 = { 1, 2 };
// fct(sa2); // not supported: cannot convert from 'const _Ty *' to 'T *'
fctc( sa2 );
std::array<const int, 2> const sa3 = { 1, 2 };
// fct(sa3); // not supported: cannot convert argument 1 from 'const std::array<const int,2>' to 'vk::StridedArrayProxy<int>'
fctc( sa3 );
vk::StridedArrayProxy<int> ap8 = sa0;
assert( ap8.size() == 2 );
// vk::StridedArrayProxy<int> ap9 = sa1; // not supported: cannot convert from 'std::array<const int,2>' to 'vk::StridedArrayProxy<int>'
// vk::StridedArrayProxy<int> ap10 = sa2; // not supported: cannot convert from '_Ty *' to 'T *'
// vk::StridedArrayProxy<int> ap11 = sa3; // not supported: cannot convert from 'const std::array<const int,2>' to 'vk::StridedArrayProxy<int>'
vk::StridedArrayProxy<const int> ap12 = sa0;
assert( ap12.size() == 2 );
vk::StridedArrayProxy<const int> ap13 = sa1;
assert( ap13.size() == 2 );
vk::StridedArrayProxy<const int> ap14 = sa2;
assert( ap14.size() == 2 );
vk::StridedArrayProxy<const int> ap15 = sa3;
assert( ap15.size() == 2 );
// std::vector<T>
std::vector<int> sv0 = { 0, 1 };
fct( sv0 );
fctc( sv0 );
std::vector<int> const sv1 = { 0, 1 };
// fct(sv1); // not supported: cannot convert from 'const _Ty *' to 'T *'
fctc( sv1 );
vk::StridedArrayProxy<int> ap16 = sv0;
assert( ap16.size() == 2 );
// vk::StridedArrayProxy<int> ap17 = sv1; // not supported: cannot convert from '_Ty *' to 'T *'
vk::StridedArrayProxy<const int> ap18 = sv0;
assert( ap18.size() == 2 );
vk::StridedArrayProxy<const int> ap19 = sv1;
assert( ap19.size() == 2 );
// std::initializer_list
fct( {} );
fctc( {} );
// fct({ 0, 1 }); // not supported: cannot convert from 'const _Elem *' to 'T *'
fctc( { 0, 1 } );
int a = 0;
int b = 1;
// fct({ a, b }); // not supported: cannot convert from 'const _Elem *' to 'T *'
fctc( { a, b } );
auto il0 = { 0, 1 }; // -> std::initializer_list<int>
// fct(il0); // not supported: cannot convert from 'const _Elem *' to 'T *'
fctc( il0 );
std::initializer_list<int> il1 = { 0, 1 };
// fct(il1); // not supported: cannot convert from 'const _Elem *' to 'T *'
fctc( il1 );
std::initializer_list<const int> il2 = { 0, 1 };
// fct(il2); // not supported: cannot convert argument 1 from 'std::initializer_list<T>' to 'vk::StridedArrayProxy<int>'
fctc( il2 );
std::initializer_list<int> const il3 = { 0, 1 };
// fct(il3); // not supported: cannot convert from 'const _Elem *' to 'T *'
fctc( il3 );
std::initializer_list<const int> const il4 = { 0, 1 };
// fct(il4); // not supported: cannot convert argument 1 from 'const std::initializer_list<T>' to 'vk::StridedArrayProxy<int>'
fctc( il4 );
// vk::StridedArrayProxy<int> ap20 = il1; // not supported: cannot convert from 'const _Elem *' to 'T *'
// vk::StridedArrayProxy<int> ap21 = il2; // not supported: cannot convert from 'std::initializer_list<T>' to 'vk::StridedArrayProxy<int>'
// vk::StridedArrayProxy<int> ap22 = il3; // not supported: cannot convert from 'const _Elem *' to 'T *'
// vk::StridedArrayProxy<int> ap23 = il4; // not supported: cannot convert from 'const std::initializer_list<T>' to 'vk::StridedArrayProxy<int>'
vk::StridedArrayProxy<const int> ap24 = {};
assert( ap24.size() == 0 );
vk::StridedArrayProxy<const int> ap25 = { 0, 1 };
assert( ap25.size() == 2 );
vk::StridedArrayProxy<const int> ap26 = il1;
assert( ap26.size() == 2 );
vk::StridedArrayProxy<const int> ap27 = il2;
assert( ap27.size() == 2 );
vk::StridedArrayProxy<const int> ap28 = il3;
assert( ap28.size() == 2 );
vk::StridedArrayProxy<const int> ap29 = il4;
assert( ap29.size() == 2 );
#if defined( VULKAN_HPP_SUPPORT_SPAN )
// std::span<T, N>
std::span<int> ss0( sa0.begin(), sa0.size() );
fct( ss0 );
fctc( ss0 );
// std::span<T,N> const
std::span<const int> ss1( sa1.begin(), sa1.size() );
// fct(ss1); // not supported: cannot convert from 'std::span<const int>' to 'vk::StridedArrayProxy<int>'
fctc( ss1 );
std::span<int> const ss2;
fct( ss2 );
fctc( ss2 );
std::span<const int> const ss3( sa3.begin(), sa3.end() );
// fct(ss3); // not supported: cannot convert from 'const std::span<const int>' to 'vk::StridedArrayProxy<int>'
fctc( ss3 );
vk::StridedArrayProxy<const int> ap30 = ss0;
assert( ap30.size() == 2 );
vk::StridedArrayProxy<const int> ap31 = ss1;
assert( ap31.size() == 2 );
vk::StridedArrayProxy<const int> ap32 = ss2;
assert( ap32.size() == 2 );
vk::StridedArrayProxy<const int> ap33 = ss3;
assert( ap33.size() == 2 );
#endif
struct Data
{
double d;
int i;
};
Data data[3];
vk::StridedArrayProxy<double> sap0( 3, reinterpret_cast<double const *>( & data[0]), sizeof( Data ) );
}
catch ( vk::SystemError const & err )
{
std::cout << "vk::SystemError: " << err.what() << std::endl;
exit( -1 );
}
catch ( ... )
{
std::cout << "unknown error\n";
exit( -1 );
}
return 0;
}

View File

@ -574,41 +574,20 @@ namespace VULKAN_HPP_NAMESPACE
{
}
ArrayProxy( T & value ) VULKAN_HPP_NOEXCEPT
ArrayProxy( T const & value ) VULKAN_HPP_NOEXCEPT
: m_count( 1 )
, m_ptr( &value )
{
}
template <typename B = T, typename std::enable_if<std::is_const<B>::value, int>::type = 0>
ArrayProxy( typename std::remove_const<T>::type & value ) VULKAN_HPP_NOEXCEPT
: m_count( 1 )
, m_ptr( &value )
{
}
ArrayProxy( uint32_t count, T * ptr ) VULKAN_HPP_NOEXCEPT
: m_count( count )
, m_ptr( ptr )
{
}
template <typename B = T, typename std::enable_if<std::is_const<B>::value, int>::type = 0>
ArrayProxy( uint32_t count, typename std::remove_const<T>::type * ptr ) VULKAN_HPP_NOEXCEPT
ArrayProxy( uint32_t count, T const * ptr ) VULKAN_HPP_NOEXCEPT
: m_count( count )
, m_ptr( ptr )
{
}
template <std::size_t C>
ArrayProxy( T ( &ptr )[C] ) VULKAN_HPP_NOEXCEPT
: m_count( C )
, m_ptr( ptr )
{
}
template <std::size_t C, typename B = T, typename std::enable_if<std::is_const<B>::value, int>::type = 0>
ArrayProxy( typename std::remove_const<T>::type ( &ptr )[C] ) VULKAN_HPP_NOEXCEPT
ArrayProxy( T const ( &ptr )[C] ) VULKAN_HPP_NOEXCEPT
: m_count( C )
, m_ptr( ptr )
{
@ -632,19 +611,6 @@ namespace VULKAN_HPP_NAMESPACE
{
}
ArrayProxy( std::initializer_list<T> & list ) VULKAN_HPP_NOEXCEPT
: m_count( static_cast<uint32_t>( list.size() ) )
, m_ptr( list.begin() )
{
}
template <typename B = T, typename std::enable_if<std::is_const<B>::value, int>::type = 0>
ArrayProxy( std::initializer_list<typename std::remove_const<T>::type> & list ) VULKAN_HPP_NOEXCEPT
: m_count( static_cast<uint32_t>( list.size() ) )
, m_ptr( list.begin() )
{
}
# if __GNUC__ >= 9
# pragma GCC diagnostic pop
# endif
@ -660,15 +626,6 @@ namespace VULKAN_HPP_NAMESPACE
{
}
template <typename V,
typename std::enable_if<std::is_convertible<decltype( std::declval<V>().data() ), T *>::value &&
std::is_convertible<decltype( std::declval<V>().size() ), std::size_t>::value>::type * = nullptr>
ArrayProxy( V & v ) VULKAN_HPP_NOEXCEPT
: m_count( static_cast<uint32_t>( v.size() ) )
, m_ptr( v.data() )
{
}
const T * begin() const VULKAN_HPP_NOEXCEPT
{
return m_ptr;
@ -701,14 +658,14 @@ namespace VULKAN_HPP_NAMESPACE
return m_count;
}
T * data() const VULKAN_HPP_NOEXCEPT
T const * data() const VULKAN_HPP_NOEXCEPT
{
return m_ptr;
}
private:
uint32_t m_count;
T * m_ptr;
uint32_t m_count;
T const * m_ptr;
};
template <typename T>
@ -868,6 +825,47 @@ namespace VULKAN_HPP_NAMESPACE
T * m_ptr;
};
template <typename T>
class StridedArrayProxy : protected ArrayProxy<T>
{
public:
using ArrayProxy<T>::ArrayProxy;
StridedArrayProxy( uint32_t count, T const * ptr, uint32_t stride ) VULKAN_HPP_NOEXCEPT
: ArrayProxy<T>( count, ptr )
, m_stride( stride )
{
VULKAN_HPP_ASSERT( sizeof( T ) <= stride );
}
using ArrayProxy<T>::begin;
const T * end() const VULKAN_HPP_NOEXCEPT
{
return reinterpret_cast<T const *>( static_cast<uint8_t const *>( begin() ) + size() * m_stride );
}
using ArrayProxy<T>::front;
const T & back() const VULKAN_HPP_NOEXCEPT
{
VULKAN_HPP_ASSERT( begin() && size() );
return *reinterpret_cast<T const *>( static_cast<uint8_t const *>( begin() ) + ( size() - 1 ) * m_stride );
}
using ArrayProxy<T>::empty;
using ArrayProxy<T>::size;
using ArrayProxy<T>::data;
uint32_t stride() const
{
return m_stride;
}
private:
uint32_t m_stride = sizeof( T );
};
template <typename RefType>
class Optional
{

View File

@ -4359,15 +4359,15 @@ namespace VULKAN_HPP_NAMESPACE
VkFlags( ImageUsageFlagBits::eDepthStencilAttachment ) | VkFlags( ImageUsageFlagBits::eTransientAttachment ) |
VkFlags( ImageUsageFlagBits::eInputAttachment )
#if defined( VK_ENABLE_BETA_EXTENSIONS )
| VkFlags( ImageUsageFlagBits::eVideoDecodeDstKHR ) | VkFlags( ImageUsageFlagBits::eVideoDecodeSrcKHR ) |
| VkFlags( ImageUsageFlagBits::eVideoDecodeDstKHR ) | VkFlags( ImageUsageFlagBits::eVideoDecodeSrcKHR ) |
VkFlags( ImageUsageFlagBits::eVideoDecodeDpbKHR )
#endif /*VK_ENABLE_BETA_EXTENSIONS*/
| VkFlags( ImageUsageFlagBits::eFragmentDensityMapEXT ) | VkFlags( ImageUsageFlagBits::eFragmentShadingRateAttachmentKHR )
| VkFlags( ImageUsageFlagBits::eFragmentDensityMapEXT ) | VkFlags( ImageUsageFlagBits::eFragmentShadingRateAttachmentKHR )
#if defined( VK_ENABLE_BETA_EXTENSIONS )
| VkFlags( ImageUsageFlagBits::eVideoEncodeDstKHR ) | VkFlags( ImageUsageFlagBits::eVideoEncodeSrcKHR ) |
| VkFlags( ImageUsageFlagBits::eVideoEncodeDstKHR ) | VkFlags( ImageUsageFlagBits::eVideoEncodeSrcKHR ) |
VkFlags( ImageUsageFlagBits::eVideoEncodeDpbKHR )
#endif /*VK_ENABLE_BETA_EXTENSIONS*/
| VkFlags( ImageUsageFlagBits::eAttachmentFeedbackLoopEXT ) | VkFlags( ImageUsageFlagBits::eInvocationMaskHUAWEI ) |
| VkFlags( ImageUsageFlagBits::eAttachmentFeedbackLoopEXT ) | VkFlags( ImageUsageFlagBits::eInvocationMaskHUAWEI ) |
VkFlags( ImageUsageFlagBits::eSampleWeightQCOM ) | VkFlags( ImageUsageFlagBits::eSampleBlockMatchQCOM )
};
};
@ -4499,7 +4499,7 @@ namespace VULKAN_HPP_NAMESPACE
allFlags = VkFlags( QueueFlagBits::eGraphics ) | VkFlags( QueueFlagBits::eCompute ) | VkFlags( QueueFlagBits::eTransfer ) |
VkFlags( QueueFlagBits::eSparseBinding ) | VkFlags( QueueFlagBits::eProtected )
#if defined( VK_ENABLE_BETA_EXTENSIONS )
| VkFlags( QueueFlagBits::eVideoDecodeKHR ) | VkFlags( QueueFlagBits::eVideoEncodeKHR )
| VkFlags( QueueFlagBits::eVideoDecodeKHR ) | VkFlags( QueueFlagBits::eVideoEncodeKHR )
#endif /*VK_ENABLE_BETA_EXTENSIONS*/
};
};
@ -4850,7 +4850,7 @@ namespace VULKAN_HPP_NAMESPACE
allFlags = VkFlags( QueryResultFlagBits::e64 ) | VkFlags( QueryResultFlagBits::eWait ) | VkFlags( QueryResultFlagBits::eWithAvailability ) |
VkFlags( QueryResultFlagBits::ePartial )
#if defined( VK_ENABLE_BETA_EXTENSIONS )
| VkFlags( QueryResultFlagBits::eWithStatusKHR )
| VkFlags( QueryResultFlagBits::eWithStatusKHR )
#endif /*VK_ENABLE_BETA_EXTENSIONS*/
};
};
@ -4921,13 +4921,13 @@ namespace VULKAN_HPP_NAMESPACE
VkFlags( BufferUsageFlagBits::eIndexBuffer ) | VkFlags( BufferUsageFlagBits::eVertexBuffer ) |
VkFlags( BufferUsageFlagBits::eIndirectBuffer ) | VkFlags( BufferUsageFlagBits::eShaderDeviceAddress )
#if defined( VK_ENABLE_BETA_EXTENSIONS )
| VkFlags( BufferUsageFlagBits::eVideoDecodeSrcKHR ) | VkFlags( BufferUsageFlagBits::eVideoDecodeDstKHR )
| VkFlags( BufferUsageFlagBits::eVideoDecodeSrcKHR ) | VkFlags( BufferUsageFlagBits::eVideoDecodeDstKHR )
#endif /*VK_ENABLE_BETA_EXTENSIONS*/
| VkFlags( BufferUsageFlagBits::eTransformFeedbackBufferEXT ) | VkFlags( BufferUsageFlagBits::eTransformFeedbackCounterBufferEXT ) |
| VkFlags( BufferUsageFlagBits::eTransformFeedbackBufferEXT ) | VkFlags( BufferUsageFlagBits::eTransformFeedbackCounterBufferEXT ) |
VkFlags( BufferUsageFlagBits::eConditionalRenderingEXT ) | VkFlags( BufferUsageFlagBits::eAccelerationStructureBuildInputReadOnlyKHR ) |
VkFlags( BufferUsageFlagBits::eAccelerationStructureStorageKHR ) | VkFlags( BufferUsageFlagBits::eShaderBindingTableKHR )
#if defined( VK_ENABLE_BETA_EXTENSIONS )
| VkFlags( BufferUsageFlagBits::eVideoEncodeDstKHR ) | VkFlags( BufferUsageFlagBits::eVideoEncodeSrcKHR )
| VkFlags( BufferUsageFlagBits::eVideoEncodeDstKHR ) | VkFlags( BufferUsageFlagBits::eVideoEncodeSrcKHR )
#endif /*VK_ENABLE_BETA_EXTENSIONS*/
};
};
@ -5948,13 +5948,13 @@ namespace VULKAN_HPP_NAMESPACE
VkFlags( ExternalMemoryHandleTypeFlagBits::eD3D11TextureKmt ) | VkFlags( ExternalMemoryHandleTypeFlagBits::eD3D12Heap ) |
VkFlags( ExternalMemoryHandleTypeFlagBits::eD3D12Resource ) | VkFlags( ExternalMemoryHandleTypeFlagBits::eDmaBufEXT )
#if defined( VK_USE_PLATFORM_ANDROID_KHR )
| VkFlags( ExternalMemoryHandleTypeFlagBits::eAndroidHardwareBufferANDROID )
| VkFlags( ExternalMemoryHandleTypeFlagBits::eAndroidHardwareBufferANDROID )
#endif /*VK_USE_PLATFORM_ANDROID_KHR*/
| VkFlags( ExternalMemoryHandleTypeFlagBits::eHostAllocationEXT ) | VkFlags( ExternalMemoryHandleTypeFlagBits::eHostMappedForeignMemoryEXT )
| VkFlags( ExternalMemoryHandleTypeFlagBits::eHostAllocationEXT ) | VkFlags( ExternalMemoryHandleTypeFlagBits::eHostMappedForeignMemoryEXT )
#if defined( VK_USE_PLATFORM_FUCHSIA )
| VkFlags( ExternalMemoryHandleTypeFlagBits::eZirconVmoFUCHSIA )
| VkFlags( ExternalMemoryHandleTypeFlagBits::eZirconVmoFUCHSIA )
#endif /*VK_USE_PLATFORM_FUCHSIA*/
| VkFlags( ExternalMemoryHandleTypeFlagBits::eRdmaAddressNV )
| VkFlags( ExternalMemoryHandleTypeFlagBits::eRdmaAddressNV )
};
};
@ -6170,7 +6170,7 @@ namespace VULKAN_HPP_NAMESPACE
VkFlags( ExternalSemaphoreHandleTypeFlagBits::eOpaqueWin32Kmt ) | VkFlags( ExternalSemaphoreHandleTypeFlagBits::eD3D12Fence ) |
VkFlags( ExternalSemaphoreHandleTypeFlagBits::eSyncFd )
#if defined( VK_USE_PLATFORM_FUCHSIA )
| VkFlags( ExternalSemaphoreHandleTypeFlagBits::eZirconEventFUCHSIA )
| VkFlags( ExternalSemaphoreHandleTypeFlagBits::eZirconEventFUCHSIA )
#endif /*VK_USE_PLATFORM_FUCHSIA*/
};
};
@ -6437,9 +6437,9 @@ namespace VULKAN_HPP_NAMESPACE
VkFlags64( PipelineStageFlagBits2::eClear ) | VkFlags64( PipelineStageFlagBits2::eIndexInput ) |
VkFlags64( PipelineStageFlagBits2::eVertexAttributeInput ) | VkFlags64( PipelineStageFlagBits2::ePreRasterizationShaders )
#if defined( VK_ENABLE_BETA_EXTENSIONS )
| VkFlags64( PipelineStageFlagBits2::eVideoDecodeKHR ) | VkFlags64( PipelineStageFlagBits2::eVideoEncodeKHR )
| VkFlags64( PipelineStageFlagBits2::eVideoDecodeKHR ) | VkFlags64( PipelineStageFlagBits2::eVideoEncodeKHR )
#endif /*VK_ENABLE_BETA_EXTENSIONS*/
| VkFlags64( PipelineStageFlagBits2::eTransformFeedbackEXT ) | VkFlags64( PipelineStageFlagBits2::eConditionalRenderingEXT ) |
| VkFlags64( PipelineStageFlagBits2::eTransformFeedbackEXT ) | VkFlags64( PipelineStageFlagBits2::eConditionalRenderingEXT ) |
VkFlags64( PipelineStageFlagBits2::eCommandPreprocessNV ) | VkFlags64( PipelineStageFlagBits2::eFragmentShadingRateAttachmentKHR ) |
VkFlags64( PipelineStageFlagBits2::eAccelerationStructureBuildKHR ) | VkFlags64( PipelineStageFlagBits2::eRayTracingShaderKHR ) |
VkFlags64( PipelineStageFlagBits2::eFragmentDensityProcessEXT ) | VkFlags64( PipelineStageFlagBits2::eTaskShaderEXT ) |
@ -6487,10 +6487,10 @@ namespace VULKAN_HPP_NAMESPACE
VkFlags64( AccessFlagBits2::eShaderSampledRead ) | VkFlags64( AccessFlagBits2::eShaderStorageRead ) |
VkFlags64( AccessFlagBits2::eShaderStorageWrite )
#if defined( VK_ENABLE_BETA_EXTENSIONS )
| VkFlags64( AccessFlagBits2::eVideoDecodeReadKHR ) | VkFlags64( AccessFlagBits2::eVideoDecodeWriteKHR ) |
| VkFlags64( AccessFlagBits2::eVideoDecodeReadKHR ) | VkFlags64( AccessFlagBits2::eVideoDecodeWriteKHR ) |
VkFlags64( AccessFlagBits2::eVideoEncodeReadKHR ) | VkFlags64( AccessFlagBits2::eVideoEncodeWriteKHR )
#endif /*VK_ENABLE_BETA_EXTENSIONS*/
| VkFlags64( AccessFlagBits2::eTransformFeedbackWriteEXT ) | VkFlags64( AccessFlagBits2::eTransformFeedbackCounterReadEXT ) |
| VkFlags64( AccessFlagBits2::eTransformFeedbackWriteEXT ) | VkFlags64( AccessFlagBits2::eTransformFeedbackCounterReadEXT ) |
VkFlags64( AccessFlagBits2::eTransformFeedbackCounterWriteEXT ) | VkFlags64( AccessFlagBits2::eConditionalRenderingReadEXT ) |
VkFlags64( AccessFlagBits2::eCommandPreprocessReadNV ) | VkFlags64( AccessFlagBits2::eCommandPreprocessWriteNV ) |
VkFlags64( AccessFlagBits2::eFragmentShadingRateAttachmentReadKHR ) | VkFlags64( AccessFlagBits2::eAccelerationStructureReadKHR ) |
@ -6613,14 +6613,14 @@ namespace VULKAN_HPP_NAMESPACE
VkFlags64( FormatFeatureFlagBits2::eStorageReadWithoutFormat ) | VkFlags64( FormatFeatureFlagBits2::eStorageWriteWithoutFormat ) |
VkFlags64( FormatFeatureFlagBits2::eSampledImageDepthComparison )
#if defined( VK_ENABLE_BETA_EXTENSIONS )
| VkFlags64( FormatFeatureFlagBits2::eVideoDecodeOutputKHR ) | VkFlags64( FormatFeatureFlagBits2::eVideoDecodeDpbKHR )
| VkFlags64( FormatFeatureFlagBits2::eVideoDecodeOutputKHR ) | VkFlags64( FormatFeatureFlagBits2::eVideoDecodeDpbKHR )
#endif /*VK_ENABLE_BETA_EXTENSIONS*/
| VkFlags64( FormatFeatureFlagBits2::eAccelerationStructureVertexBufferKHR ) | VkFlags64( FormatFeatureFlagBits2::eFragmentDensityMapEXT ) |
| VkFlags64( FormatFeatureFlagBits2::eAccelerationStructureVertexBufferKHR ) | VkFlags64( FormatFeatureFlagBits2::eFragmentDensityMapEXT ) |
VkFlags64( FormatFeatureFlagBits2::eFragmentShadingRateAttachmentKHR )
#if defined( VK_ENABLE_BETA_EXTENSIONS )
| VkFlags64( FormatFeatureFlagBits2::eVideoEncodeInputKHR ) | VkFlags64( FormatFeatureFlagBits2::eVideoEncodeDpbKHR )
| VkFlags64( FormatFeatureFlagBits2::eVideoEncodeInputKHR ) | VkFlags64( FormatFeatureFlagBits2::eVideoEncodeDpbKHR )
#endif /*VK_ENABLE_BETA_EXTENSIONS*/
| VkFlags64( FormatFeatureFlagBits2::eLinearColorAttachmentNV ) | VkFlags64( FormatFeatureFlagBits2::eWeightImageQCOM ) |
| VkFlags64( FormatFeatureFlagBits2::eLinearColorAttachmentNV ) | VkFlags64( FormatFeatureFlagBits2::eWeightImageQCOM ) |
VkFlags64( FormatFeatureFlagBits2::eWeightSampledImageQCOM ) | VkFlags64( FormatFeatureFlagBits2::eBlockMatchingQCOM ) |
VkFlags64( FormatFeatureFlagBits2::eBoxFilterSampledQCOM )
};
@ -6914,7 +6914,7 @@ namespace VULKAN_HPP_NAMESPACE
{
allFlags = VkFlags( VideoCodecOperationFlagBitsKHR::eNone )
# if defined( VK_ENABLE_BETA_EXTENSIONS )
| VkFlags( VideoCodecOperationFlagBitsKHR::eEncodeH264EXT ) | VkFlags( VideoCodecOperationFlagBitsKHR::eEncodeH265EXT ) |
| VkFlags( VideoCodecOperationFlagBitsKHR::eEncodeH264EXT ) | VkFlags( VideoCodecOperationFlagBitsKHR::eEncodeH265EXT ) |
VkFlags( VideoCodecOperationFlagBitsKHR::eDecodeH264EXT ) | VkFlags( VideoCodecOperationFlagBitsKHR::eDecodeH265EXT )
# endif /*VK_ENABLE_BETA_EXTENSIONS*/
};
@ -7097,7 +7097,7 @@ namespace VULKAN_HPP_NAMESPACE
{
allFlags = VkFlags( VideoCodingControlFlagBitsKHR::eReset )
# if defined( VK_ENABLE_BETA_EXTENSIONS )
| VkFlags( VideoCodingControlFlagBitsKHR::eEncodeRateControl ) | VkFlags( VideoCodingControlFlagBitsKHR::eEncodeRateControlLayer )
| VkFlags( VideoCodingControlFlagBitsKHR::eEncodeRateControl ) | VkFlags( VideoCodingControlFlagBitsKHR::eEncodeRateControlLayer )
# endif /*VK_ENABLE_BETA_EXTENSIONS*/
};
};

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -2516,10 +2516,10 @@ namespace VULKAN_HPP_NAMESPACE
public:
VULKAN_HPP_NAMESPACE::TransformMatrixKHR transform = {};
uint32_t instanceCustomIndex : 24;
uint32_t mask : 8;
uint32_t instanceCustomIndex : 24;
uint32_t mask : 8;
uint32_t instanceShaderBindingTableRecordOffset : 24;
VkGeometryInstanceFlagsKHR flags : 8;
VkGeometryInstanceFlagsKHR flags : 8;
uint64_t accelerationStructureReference = {};
};
using AccelerationStructureInstanceNV = AccelerationStructureInstanceKHR;
@ -2662,10 +2662,10 @@ namespace VULKAN_HPP_NAMESPACE
public:
VULKAN_HPP_NAMESPACE::TransformMatrixKHR transformT0 = {};
VULKAN_HPP_NAMESPACE::TransformMatrixKHR transformT1 = {};
uint32_t instanceCustomIndex : 24;
uint32_t mask : 8;
uint32_t instanceCustomIndex : 24;
uint32_t mask : 8;
uint32_t instanceShaderBindingTableRecordOffset : 24;
VkGeometryInstanceFlagsKHR flags : 8;
VkGeometryInstanceFlagsKHR flags : 8;
uint64_t accelerationStructureReference = {};
};
@ -3256,10 +3256,10 @@ namespace VULKAN_HPP_NAMESPACE
public:
VULKAN_HPP_NAMESPACE::SRTDataNV transformT0 = {};
VULKAN_HPP_NAMESPACE::SRTDataNV transformT1 = {};
uint32_t instanceCustomIndex : 24;
uint32_t mask : 8;
uint32_t instanceCustomIndex : 24;
uint32_t mask : 8;
uint32_t instanceShaderBindingTableRecordOffset : 24;
VkGeometryInstanceFlagsKHR flags : 8;
VkGeometryInstanceFlagsKHR flags : 8;
uint64_t accelerationStructureReference = {};
};