2019-01-09 10:55:11 +00:00
|
|
|
// Copyright(c) 2015-2019, NVIDIA CORPORATION. All rights reserved.
|
2017-12-21 11:40:48 +00:00
|
|
|
//
|
|
|
|
// 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.
|
|
|
|
|
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include <iostream>
|
2020-04-12 19:49:12 +00:00
|
|
|
#include <map>
|
2017-12-21 11:40:48 +00:00
|
|
|
#include <set>
|
|
|
|
#include <tinyxml2.h>
|
2020-04-12 19:49:12 +00:00
|
|
|
#include <vector>
|
2017-12-21 11:40:48 +00:00
|
|
|
|
|
|
|
class VulkanHppGenerator
|
|
|
|
{
|
2020-04-12 19:49:12 +00:00
|
|
|
public:
|
|
|
|
VulkanHppGenerator( tinyxml2::XMLDocument const & document );
|
|
|
|
|
|
|
|
void appendBaseTypes( std::string & str ) const;
|
|
|
|
void appendBitmasks( std::string & str ) const;
|
|
|
|
void appendDispatchLoaderDynamic( std::string & str ); // use vkGet*ProcAddress to get function pointers
|
|
|
|
void appendDispatchLoaderStatic( std::string & str ); // use exported symbols from loader
|
|
|
|
void appendDispatchLoaderDefault(
|
|
|
|
std::string & str ); // typedef to DispatchLoaderStatic or undefined type, based on VK_NO_PROTOTYPES
|
2021-05-15 21:26:51 +00:00
|
|
|
void appendEnums( std::string & str ) const;
|
|
|
|
void appendHandles( std::string & str );
|
|
|
|
void appendHandlesCommandDefinitions( std::string & str ) const;
|
|
|
|
void appendHashStructures( std::string & str ) const;
|
|
|
|
void appendRAIICommands( std::string & str, std::set<std::string> const & specialFunctions ) const;
|
|
|
|
void appendRAIIDispatchers( std::string & str ) const;
|
|
|
|
void appendRAIIHandles( std::string & str, std::set<std::string> const & specialFunctions ) const;
|
|
|
|
void appendResultExceptions( std::string & str ) const;
|
|
|
|
void appendStructs( std::string & str );
|
|
|
|
void appendStructureChainValidation( std::string & str );
|
|
|
|
void appendThrowExceptions( std::string & str ) const;
|
|
|
|
void appendIndexTypeTraits( std::string & str ) const;
|
|
|
|
std::set<std::string> determineSpecialFunctions();
|
|
|
|
std::string const & getTypesafeCheck() const;
|
|
|
|
std::string const & getVersion() const;
|
|
|
|
std::string const & getVulkanLicenseHeader() const;
|
2020-04-12 19:49:12 +00:00
|
|
|
|
|
|
|
private:
|
|
|
|
struct BaseTypeData
|
|
|
|
{
|
|
|
|
BaseTypeData( std::string const & type_, int line ) : type( type_ ), xmlLine( line ) {}
|
|
|
|
|
|
|
|
std::string type;
|
|
|
|
int xmlLine;
|
|
|
|
};
|
|
|
|
|
|
|
|
struct BitmaskData
|
|
|
|
{
|
|
|
|
BitmaskData( std::string const & r, std::string const & t, int line )
|
|
|
|
: requirements( r ), type( t ), xmlLine( line )
|
|
|
|
{}
|
|
|
|
|
|
|
|
std::string requirements;
|
|
|
|
std::string type;
|
|
|
|
std::string alias;
|
|
|
|
int xmlLine;
|
|
|
|
};
|
|
|
|
|
|
|
|
struct NameData
|
|
|
|
{
|
|
|
|
std::string name;
|
|
|
|
std::vector<std::string> arraySizes;
|
|
|
|
};
|
|
|
|
|
2020-05-18 10:02:10 +00:00
|
|
|
struct TypeInfo
|
2020-04-12 19:49:12 +00:00
|
|
|
{
|
2020-10-13 12:39:12 +00:00
|
|
|
std::string compose( bool inNamespace = true ) const;
|
2020-04-12 19:49:12 +00:00
|
|
|
|
2020-05-18 10:02:10 +00:00
|
|
|
bool operator==( TypeInfo const & rhs ) const
|
2017-12-21 11:40:48 +00:00
|
|
|
{
|
2020-04-12 19:49:12 +00:00
|
|
|
return ( prefix == rhs.prefix ) && ( type == rhs.type ) && ( postfix == rhs.postfix );
|
|
|
|
}
|
|
|
|
|
2020-09-15 08:23:19 +00:00
|
|
|
bool isConstPointer() const
|
|
|
|
{
|
|
|
|
return ( prefix.find( "const" ) != std::string::npos ) && ( postfix.find( '*' ) != std::string::npos );
|
|
|
|
}
|
|
|
|
|
2020-09-02 13:00:06 +00:00
|
|
|
bool isNonConstPointer() const
|
|
|
|
{
|
|
|
|
return ( prefix.find( "const" ) == std::string::npos ) && ( postfix.find( '*' ) != std::string::npos );
|
|
|
|
}
|
|
|
|
|
|
|
|
bool isValue() const
|
|
|
|
{
|
2020-09-25 21:45:55 +00:00
|
|
|
return ( ( prefix.find( '*' ) == std::string::npos ) && ( postfix.find( '*' ) == std::string::npos ) );
|
2020-09-02 13:00:06 +00:00
|
|
|
}
|
|
|
|
|
2020-04-12 19:49:12 +00:00
|
|
|
std::string prefix;
|
|
|
|
std::string type;
|
|
|
|
std::string postfix;
|
|
|
|
};
|
|
|
|
|
|
|
|
struct ParamData
|
|
|
|
{
|
|
|
|
ParamData( int line ) : optional( false ), xmlLine( line ) {}
|
|
|
|
|
2020-05-18 10:02:10 +00:00
|
|
|
TypeInfo type;
|
2020-04-12 19:49:12 +00:00
|
|
|
std::string name;
|
|
|
|
std::vector<std::string> arraySizes;
|
|
|
|
std::string len;
|
|
|
|
bool optional;
|
|
|
|
int xmlLine;
|
|
|
|
};
|
|
|
|
|
|
|
|
struct CommandData
|
|
|
|
{
|
|
|
|
CommandData( int line ) : xmlLine( line ) {}
|
|
|
|
|
2021-04-28 11:35:14 +00:00
|
|
|
std::string alias;
|
|
|
|
std::vector<std::string> errorCodes;
|
|
|
|
std::string handle;
|
|
|
|
std::vector<ParamData> params;
|
|
|
|
std::string referencedIn;
|
|
|
|
std::string returnType;
|
|
|
|
std::vector<std::string> successCodes;
|
|
|
|
int xmlLine;
|
2020-04-12 19:49:12 +00:00
|
|
|
};
|
|
|
|
|
2021-05-04 15:08:24 +00:00
|
|
|
struct EnumAliasData
|
|
|
|
{
|
|
|
|
EnumAliasData( std::string const & vulkanValue_, std::string const & vkValue_, int line )
|
|
|
|
: vulkanValue( vulkanValue_ ), vkValue( vkValue_ ), xmlLine( line )
|
|
|
|
{}
|
|
|
|
|
|
|
|
std::string vulkanValue;
|
|
|
|
std::string vkValue;
|
|
|
|
int xmlLine;
|
|
|
|
};
|
|
|
|
|
2020-04-12 19:49:12 +00:00
|
|
|
struct EnumValueData
|
|
|
|
{
|
2021-01-25 15:34:32 +00:00
|
|
|
EnumValueData(
|
|
|
|
int line, std::string const & vulkan, std::string const & vk, std::string const & extension_, bool singleBit_ )
|
|
|
|
: vulkanValue( vulkan ), vkValue( vk ), extension( extension_ ), singleBit( singleBit_ ), xmlLine( line )
|
2020-04-12 19:49:12 +00:00
|
|
|
{}
|
|
|
|
|
|
|
|
std::string vulkanValue;
|
|
|
|
std::string vkValue;
|
2021-01-25 15:34:32 +00:00
|
|
|
std::string extension;
|
2020-04-12 19:49:12 +00:00
|
|
|
bool singleBit;
|
2020-07-13 09:45:47 +00:00
|
|
|
int xmlLine;
|
2020-04-12 19:49:12 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
struct EnumData
|
|
|
|
{
|
2021-04-27 07:06:55 +00:00
|
|
|
EnumData( int line ) : xmlLine( line ) {}
|
2020-04-30 09:30:17 +00:00
|
|
|
void addEnumAlias( int line, std::string const & name, std::string const & alias, std::string const & vkName );
|
2020-04-12 19:49:12 +00:00
|
|
|
void addEnumValue( int line,
|
|
|
|
std::string const & valueName,
|
|
|
|
bool bitmask,
|
|
|
|
bool bitpos,
|
|
|
|
std::string const & prefix,
|
|
|
|
std::string const & postfix,
|
2021-01-25 15:34:32 +00:00
|
|
|
std::string const & extension,
|
2020-04-12 19:49:12 +00:00
|
|
|
std::string const & tag );
|
|
|
|
|
2021-05-04 15:08:24 +00:00
|
|
|
std::string alias; // alias for this enum
|
|
|
|
std::map<std::string, EnumAliasData> aliases;
|
|
|
|
bool isBitmask = false;
|
|
|
|
std::vector<EnumValueData> values;
|
|
|
|
int xmlLine;
|
2020-04-12 19:49:12 +00:00
|
|
|
};
|
|
|
|
|
2021-04-27 15:19:32 +00:00
|
|
|
struct FeatureData
|
|
|
|
{
|
|
|
|
FeatureData( std::string const & number_ ) : number( number_ ) {}
|
|
|
|
|
2021-05-06 08:41:57 +00:00
|
|
|
std::vector<std::string> commands;
|
|
|
|
std::string number;
|
|
|
|
std::vector<std::pair<std::string, int>> types;
|
2021-04-27 15:19:32 +00:00
|
|
|
};
|
|
|
|
|
2020-04-12 19:49:12 +00:00
|
|
|
struct ExtensionData
|
|
|
|
{
|
2020-05-18 10:02:10 +00:00
|
|
|
ExtensionData( int line,
|
|
|
|
std::string const & deprecatedBy_,
|
2021-04-27 15:19:32 +00:00
|
|
|
std::string const & number_,
|
2020-05-18 10:02:10 +00:00
|
|
|
std::string const & obsoletedBy_,
|
|
|
|
std::string const & platform_,
|
|
|
|
std::string const & promotedTo_ )
|
2020-06-15 06:03:17 +00:00
|
|
|
: deprecatedBy( deprecatedBy_ )
|
2021-04-27 15:19:32 +00:00
|
|
|
, number( number_ )
|
2020-05-18 10:02:10 +00:00
|
|
|
, obsoletedBy( obsoletedBy_ )
|
|
|
|
, platform( platform_ )
|
|
|
|
, promotedTo( promotedTo_ )
|
2020-06-15 06:03:17 +00:00
|
|
|
, xmlLine( line )
|
2020-05-18 10:02:10 +00:00
|
|
|
{}
|
2020-04-12 19:49:12 +00:00
|
|
|
|
2021-04-27 15:19:32 +00:00
|
|
|
std::vector<std::string> commands;
|
2020-04-12 19:49:12 +00:00
|
|
|
std::string deprecatedBy;
|
2021-04-27 15:19:32 +00:00
|
|
|
std::string number;
|
2020-04-12 19:49:12 +00:00
|
|
|
std::string obsoletedBy;
|
2020-05-18 10:02:10 +00:00
|
|
|
std::string platform;
|
2020-04-12 19:49:12 +00:00
|
|
|
std::string promotedTo;
|
|
|
|
std::map<std::string, int> requirements;
|
2021-04-29 08:23:41 +00:00
|
|
|
std::vector<std::string> types;
|
2020-04-12 19:49:12 +00:00
|
|
|
int xmlLine;
|
|
|
|
};
|
|
|
|
|
|
|
|
struct FuncPointerData
|
|
|
|
{
|
|
|
|
FuncPointerData( std::string const & r, int line ) : requirements( r ), xmlLine( line ) {}
|
|
|
|
|
|
|
|
std::string requirements;
|
|
|
|
int xmlLine;
|
|
|
|
};
|
|
|
|
|
|
|
|
struct HandleData
|
|
|
|
{
|
2021-03-29 08:11:19 +00:00
|
|
|
HandleData( std::string const & p, std::string const & objType, int line )
|
|
|
|
: objTypeEnum( objType ), parent( p ), xmlLine( line )
|
2020-12-01 09:09:03 +00:00
|
|
|
{}
|
2020-04-12 19:49:12 +00:00
|
|
|
|
2021-04-12 10:38:04 +00:00
|
|
|
std::string alias;
|
|
|
|
std::set<std::string> childrenHandles;
|
|
|
|
std::set<std::string> commands;
|
|
|
|
std::string deleteCommand;
|
|
|
|
std::string deletePool;
|
|
|
|
std::string objTypeEnum;
|
|
|
|
std::string parent;
|
|
|
|
std::set<std::string> secondLevelCommands;
|
|
|
|
int xmlLine;
|
2021-02-17 09:49:59 +00:00
|
|
|
|
|
|
|
// RAII data
|
|
|
|
std::map<std::string, CommandData>::const_iterator destructorIt;
|
|
|
|
std::vector<std::map<std::string, CommandData>::const_iterator> constructorIts;
|
2020-04-12 19:49:12 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
struct MemberData
|
|
|
|
{
|
|
|
|
MemberData( int line ) : xmlLine( line ) {}
|
|
|
|
|
2020-05-18 10:02:10 +00:00
|
|
|
TypeInfo type;
|
2020-04-12 19:49:12 +00:00
|
|
|
std::string name;
|
|
|
|
std::vector<std::string> arraySizes;
|
|
|
|
std::string bitCount;
|
2020-07-01 12:43:37 +00:00
|
|
|
std::vector<std::string> len;
|
2020-07-08 08:58:37 +00:00
|
|
|
bool noAutoValidity = false;
|
2020-12-10 10:11:13 +00:00
|
|
|
std::vector<bool> optional;
|
2020-06-15 06:03:17 +00:00
|
|
|
std::string selection;
|
|
|
|
std::string selector;
|
2020-07-13 09:45:47 +00:00
|
|
|
std::vector<std::string> values;
|
2020-04-12 19:49:12 +00:00
|
|
|
std::string usedConstant;
|
|
|
|
int xmlLine;
|
|
|
|
};
|
|
|
|
|
2020-05-18 10:02:10 +00:00
|
|
|
struct PlatformData
|
|
|
|
{
|
|
|
|
PlatformData( std::string const & protect_ ) : protect( protect_ ) {}
|
|
|
|
|
|
|
|
std::string protect;
|
|
|
|
};
|
|
|
|
|
2020-04-12 19:49:12 +00:00
|
|
|
struct StructureData
|
|
|
|
{
|
2020-06-15 06:03:17 +00:00
|
|
|
StructureData( std::vector<std::string> const & extends, int line ) : structExtends( extends ), xmlLine( line ) {}
|
2020-04-12 19:49:12 +00:00
|
|
|
|
2020-12-10 16:23:44 +00:00
|
|
|
bool allowDuplicate = false;
|
|
|
|
bool isUnion = false;
|
|
|
|
bool returnedOnly = false;
|
|
|
|
bool mutualExclusiveLens = false;
|
2020-04-12 19:49:12 +00:00
|
|
|
std::vector<MemberData> members;
|
|
|
|
std::vector<std::string> structExtends;
|
|
|
|
std::set<std::string> aliases;
|
|
|
|
std::string subStruct;
|
|
|
|
int xmlLine;
|
|
|
|
};
|
|
|
|
|
|
|
|
enum class TypeCategory
|
|
|
|
{
|
|
|
|
Bitmask,
|
|
|
|
BaseType,
|
|
|
|
Define,
|
|
|
|
Enum,
|
|
|
|
FuncPointer,
|
|
|
|
Handle,
|
|
|
|
Requires,
|
|
|
|
Struct,
|
|
|
|
Union,
|
|
|
|
Unknown
|
|
|
|
};
|
|
|
|
|
2020-05-18 10:02:10 +00:00
|
|
|
struct TypeData
|
|
|
|
{
|
|
|
|
TypeData( TypeCategory category_ ) : category( category_ ) {}
|
|
|
|
|
2021-04-27 07:06:55 +00:00
|
|
|
TypeCategory category;
|
|
|
|
std::string referencedIn;
|
2020-05-18 10:02:10 +00:00
|
|
|
};
|
|
|
|
|
2020-04-12 19:49:12 +00:00
|
|
|
private:
|
2021-04-28 11:35:14 +00:00
|
|
|
void addCommand( std::string const & name, CommandData & commandData );
|
2020-10-19 07:40:40 +00:00
|
|
|
void appendArgumentPlainType( std::string & str, ParamData const & paramData ) const;
|
|
|
|
void appendArguments( std::string & str,
|
|
|
|
CommandData const & commandData,
|
|
|
|
size_t returnParamIndex,
|
|
|
|
size_t templateParamIndex,
|
|
|
|
std::map<size_t, size_t> const & vectorParamIndices,
|
|
|
|
bool twoStep,
|
|
|
|
bool firstCall,
|
|
|
|
size_t from,
|
|
|
|
size_t to ) const;
|
|
|
|
void appendArgumentVector( std::string & str,
|
|
|
|
size_t paramIndex,
|
|
|
|
ParamData const & paramData,
|
|
|
|
size_t returnParamIndex,
|
|
|
|
size_t templateParamIndex,
|
|
|
|
bool twoStep,
|
|
|
|
bool firstCall ) const;
|
2021-04-30 09:50:20 +00:00
|
|
|
void appendBitmask( std::string & str, std::map<std::string, BitmaskData>::const_iterator bitmaskIt ) const;
|
2020-10-19 07:40:40 +00:00
|
|
|
void appendBitmask( std::string & os,
|
|
|
|
std::string const & bitmaskName,
|
|
|
|
std::string const & bitmaskType,
|
|
|
|
std::string const & bitmaskAlias,
|
|
|
|
std::string const & enumName,
|
|
|
|
std::vector<EnumValueData> const & enumValues ) const;
|
|
|
|
void appendBitmaskToStringFunction( std::string & str,
|
|
|
|
std::string const & flagsName,
|
|
|
|
std::string const & enumName,
|
|
|
|
std::vector<EnumValueData> const & enumValues ) const;
|
|
|
|
void appendCall( std::string & str,
|
|
|
|
std::string const & name,
|
|
|
|
CommandData const & commandData,
|
|
|
|
size_t returnParamIndex,
|
|
|
|
size_t templateParamIndex,
|
|
|
|
std::map<size_t, size_t> const & vectorParamIndices,
|
|
|
|
bool twoStep,
|
|
|
|
bool firstCall ) const;
|
2021-05-15 21:26:51 +00:00
|
|
|
void appendCommand( std::string & str, std::string const & command, std::string const & handle ) const;
|
2020-10-19 07:40:40 +00:00
|
|
|
void appendCommand( std::string & str,
|
|
|
|
std::string const & name,
|
|
|
|
CommandData const & commandData,
|
2021-02-17 09:49:59 +00:00
|
|
|
size_t initialSkipCount,
|
2020-10-19 07:40:40 +00:00
|
|
|
bool definition ) const;
|
2020-10-28 09:18:05 +00:00
|
|
|
void appendCommandChained( std::string & str,
|
|
|
|
std::string const & name,
|
|
|
|
CommandData const & commandData,
|
2021-02-17 09:49:59 +00:00
|
|
|
size_t initialSkipCount,
|
2020-10-28 09:18:05 +00:00
|
|
|
bool definition,
|
|
|
|
std::map<size_t, size_t> const & vectorParamIndices,
|
|
|
|
size_t nonConstPointerIndex ) const;
|
2021-04-15 09:42:42 +00:00
|
|
|
bool appendCommandResult( std::string & str,
|
|
|
|
std::string const & name,
|
|
|
|
CommandData const & commandData,
|
|
|
|
size_t initialSkipCount,
|
|
|
|
bool definition ) const;
|
|
|
|
bool appendCommandResult0Return( std::string & str,
|
|
|
|
std::string const & name,
|
|
|
|
CommandData const & commandData,
|
|
|
|
size_t initialSkipCount,
|
|
|
|
bool definition ) const;
|
|
|
|
bool appendCommandResult1Return( std::string & str,
|
|
|
|
std::string const & name,
|
|
|
|
CommandData const & commandData,
|
|
|
|
size_t initialSkipCount,
|
|
|
|
bool definition,
|
|
|
|
size_t returnParamIndex ) const;
|
|
|
|
bool appendCommandResult2Return( std::string & str,
|
|
|
|
std::string const & name,
|
|
|
|
CommandData const & commandData,
|
|
|
|
size_t initialSkipCount,
|
|
|
|
bool definition,
|
|
|
|
std::vector<size_t> const & returnParamIndices ) const;
|
|
|
|
bool appendCommandResult3Return( std::string & str,
|
|
|
|
std::string const & name,
|
|
|
|
CommandData const & commandData,
|
|
|
|
size_t initialSkipCount,
|
|
|
|
bool definition,
|
|
|
|
std::vector<size_t> const & returnParamIndices ) const;
|
2020-10-19 07:40:40 +00:00
|
|
|
void appendCommandSingular( std::string & str,
|
|
|
|
std::string const & name,
|
|
|
|
CommandData const & commandData,
|
2021-02-17 09:49:59 +00:00
|
|
|
size_t initialSkipCount,
|
2020-10-21 14:25:12 +00:00
|
|
|
bool definition,
|
2020-10-19 07:40:40 +00:00
|
|
|
std::map<size_t, size_t> const & vectorParamIndices,
|
2020-10-21 14:25:12 +00:00
|
|
|
size_t returnParamIndex ) const;
|
2020-10-19 07:40:40 +00:00
|
|
|
void appendCommandStandard( std::string & str,
|
|
|
|
std::string const & name,
|
|
|
|
CommandData const & commandData,
|
2021-02-17 09:49:59 +00:00
|
|
|
size_t initialSkipCount,
|
2020-10-19 07:40:40 +00:00
|
|
|
bool definition ) const;
|
|
|
|
void appendCommandStandardAndEnhanced( std::string & str,
|
|
|
|
std::string const & name,
|
|
|
|
CommandData const & commandData,
|
2021-02-17 09:49:59 +00:00
|
|
|
size_t initialSkipCount,
|
2020-10-19 07:40:40 +00:00
|
|
|
bool definition,
|
|
|
|
std::map<size_t, size_t> const & vectorParamIndices,
|
|
|
|
std::vector<size_t> const & nonConstPointerParamIndices ) const;
|
|
|
|
void
|
2021-03-11 09:35:30 +00:00
|
|
|
appendCommandStandardEnhancedDeprecatedAllocator( std::string & str,
|
|
|
|
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 & nonConstPointerParamIndices ) const;
|
|
|
|
void appendCommandStandardOrEnhanced( std::string & str,
|
|
|
|
std::string const & name,
|
|
|
|
CommandData const & commandData,
|
|
|
|
size_t initialSkipCount,
|
|
|
|
bool definition ) const;
|
|
|
|
void appendCommandUnique( std::string & str,
|
|
|
|
std::string const & name,
|
|
|
|
CommandData const & commandData,
|
|
|
|
size_t initialSkipCount,
|
|
|
|
size_t nonConstPointerIndex,
|
|
|
|
bool definition ) const;
|
|
|
|
bool appendCommandValue( std::string & str,
|
|
|
|
std::string const & name,
|
|
|
|
CommandData const & commandData,
|
|
|
|
size_t initialSkipCount,
|
|
|
|
bool definition ) const;
|
|
|
|
bool appendCommandValue0Return( std::string & str,
|
2021-04-15 09:42:42 +00:00
|
|
|
std::string const & name,
|
|
|
|
CommandData const & commandData,
|
|
|
|
size_t initialSkipCount,
|
|
|
|
bool definition ) const;
|
2021-03-11 09:35:30 +00:00
|
|
|
void appendCommandVector( std::string & str,
|
|
|
|
std::string const & name,
|
|
|
|
CommandData const & commandData,
|
|
|
|
size_t initialSkipCount,
|
|
|
|
bool definition,
|
|
|
|
std::pair<size_t, size_t> const & vectorParamIndex,
|
|
|
|
std::vector<size_t> const & returnParamIndices ) const;
|
|
|
|
void appendCommandVectorChained( std::string & str,
|
|
|
|
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 & returnParamIndices ) const;
|
|
|
|
void appendCommandVectorDeprecated( std::string & str,
|
|
|
|
std::string const & name,
|
|
|
|
CommandData const & commandData,
|
|
|
|
size_t initialSkipCount,
|
|
|
|
std::map<size_t, size_t> const & vectorParamIndices,
|
|
|
|
std::vector<size_t> const & returnParamIndices,
|
|
|
|
bool definition ) const;
|
|
|
|
void appendCommandVectorSingular( std::string & str,
|
|
|
|
std::string const & name,
|
|
|
|
CommandData const & commandData,
|
|
|
|
size_t initialSkipCount,
|
|
|
|
std::map<size_t, size_t> const & vectorParamIndices,
|
|
|
|
size_t returnParamIndex,
|
|
|
|
bool definition ) const;
|
|
|
|
void appendCommandVectorSingularUnique( std::string & str,
|
2020-10-22 08:19:40 +00:00
|
|
|
std::string const & name,
|
|
|
|
CommandData const & commandData,
|
2021-02-17 09:49:59 +00:00
|
|
|
size_t initialSkipCount,
|
2020-10-26 15:16:48 +00:00
|
|
|
std::map<size_t, size_t> const & vectorParamIndices,
|
2021-03-11 09:35:30 +00:00
|
|
|
size_t returnParamIndex,
|
|
|
|
bool definition ) const;
|
|
|
|
void appendCommandVectorUnique( std::string & str,
|
|
|
|
std::string const & name,
|
|
|
|
CommandData const & commandData,
|
|
|
|
size_t initialSkipCount,
|
|
|
|
std::map<size_t, size_t> const & vectorParamIndices,
|
|
|
|
size_t returnParamIndex,
|
|
|
|
bool definition ) const;
|
|
|
|
bool appendCommandVoid( std::string & str,
|
|
|
|
std::string const & name,
|
|
|
|
CommandData const & commandData,
|
|
|
|
size_t initialSkipCount,
|
|
|
|
bool definition ) const;
|
|
|
|
bool appendCommandVoid0Return( std::string & str,
|
2021-04-15 09:42:42 +00:00
|
|
|
std::string const & name,
|
|
|
|
CommandData const & commandData,
|
|
|
|
size_t initialSkipCount,
|
|
|
|
bool definition ) const;
|
2021-03-11 09:35:30 +00:00
|
|
|
bool appendCommandVoid1Return( std::string & str,
|
|
|
|
std::string const & name,
|
|
|
|
CommandData const & commandData,
|
|
|
|
size_t initialSkipCount,
|
|
|
|
bool definition,
|
|
|
|
size_t returnParamIndex ) const;
|
|
|
|
bool appendCommandVoid2Return( std::string & str,
|
|
|
|
std::string const & name,
|
|
|
|
CommandData const & commandData,
|
|
|
|
size_t initialSkipCount,
|
|
|
|
bool definition,
|
|
|
|
std::vector<size_t> const & returnParamIndices ) const;
|
|
|
|
void appendDestroyCommand( std::string & str,
|
|
|
|
std::string const & name,
|
|
|
|
CommandData const & commandData
|
|
|
|
#if !defined( NDEBUG )
|
|
|
|
,
|
|
|
|
std::string const & handleName
|
|
|
|
#endif
|
|
|
|
) const;
|
2020-08-18 07:46:34 +00:00
|
|
|
void appendDispatchLoaderDynamicCommand( std::string & str,
|
|
|
|
std::string & emptyFunctions,
|
|
|
|
std::string & deviceFunctions,
|
|
|
|
std::string & deviceFunctionsInstance,
|
|
|
|
std::string & instanceFunctions,
|
|
|
|
std::string const & commandName,
|
|
|
|
CommandData const & commandData );
|
2020-09-02 13:00:06 +00:00
|
|
|
void appendEnum( std::string & str, std::pair<std::string, EnumData> const & enumData ) const;
|
2020-04-12 19:49:12 +00:00
|
|
|
void appendEnumInitializer( std::string & str,
|
2020-05-18 10:02:10 +00:00
|
|
|
TypeInfo const & type,
|
2020-04-12 19:49:12 +00:00
|
|
|
std::vector<std::string> const & arraySizes,
|
2020-04-29 09:45:10 +00:00
|
|
|
std::vector<EnumValueData> const & values ) const;
|
2020-04-12 19:49:12 +00:00
|
|
|
void appendEnumToString( std::string & str, std::pair<std::string, EnumData> const & enumData ) const;
|
2020-10-15 11:09:43 +00:00
|
|
|
std::string appendFunctionBodyEnhancedLocalReturnVariable( std::string & str,
|
|
|
|
std::string const & indentation,
|
|
|
|
CommandData const & commandData,
|
|
|
|
size_t returnParamIndex,
|
|
|
|
std::string const & enhancedReturnType,
|
|
|
|
bool withAllocator ) const;
|
2020-04-12 19:49:12 +00:00
|
|
|
void appendFunctionBodyEnhancedMultiVectorSizeCheck( std::string & str,
|
|
|
|
std::string const & indentation,
|
|
|
|
std::string const & name,
|
|
|
|
CommandData const & commandData,
|
2021-02-17 09:49:59 +00:00
|
|
|
size_t initialSkipCount,
|
2020-04-12 19:49:12 +00:00
|
|
|
size_t returnParamIndex,
|
|
|
|
std::map<size_t, size_t> const & vectorParamIndices ) const;
|
|
|
|
void appendFunctionBodyEnhancedReturnResultValue( std::string & str,
|
|
|
|
std::string const & indentation,
|
|
|
|
std::string const & returnName,
|
|
|
|
std::string const & name,
|
|
|
|
CommandData const & commandData,
|
2021-02-17 09:49:59 +00:00
|
|
|
size_t initialSkipCount,
|
2020-04-12 19:49:12 +00:00
|
|
|
size_t returnParamIndex,
|
2020-10-09 09:01:30 +00:00
|
|
|
bool twoStep ) const;
|
2020-04-12 19:49:12 +00:00
|
|
|
void appendFunctionBodyEnhancedTwoStep( std::string & str,
|
|
|
|
std::string const & indentation,
|
|
|
|
std::string const & name,
|
|
|
|
CommandData const & commandData,
|
|
|
|
size_t returnParamIndex,
|
|
|
|
size_t templateParamIndex,
|
|
|
|
std::map<size_t, size_t> const & vectorParamIndices,
|
|
|
|
std::string const & returnName ) const;
|
|
|
|
bool appendFunctionHeaderArgumentEnhanced( std::string & str,
|
|
|
|
ParamData const & param,
|
|
|
|
size_t paramIndex,
|
|
|
|
std::map<size_t, size_t> const & vectorParamIndices,
|
|
|
|
bool skip,
|
|
|
|
bool argEncountered,
|
2020-10-20 10:27:08 +00:00
|
|
|
bool isTemplateParam ) const;
|
2020-10-07 06:42:59 +00:00
|
|
|
void appendFunctionHeaderArgumentEnhancedVector( std::string & str,
|
|
|
|
ParamData const & param,
|
|
|
|
std::string const & strippedParameterName,
|
|
|
|
bool hasSizeParam,
|
2020-10-20 10:27:08 +00:00
|
|
|
bool isTemplateParam ) const;
|
2020-10-26 15:16:48 +00:00
|
|
|
void appendHandle( std::string & str, std::pair<std::string, HandleData> const & handle );
|
2021-02-17 09:49:59 +00:00
|
|
|
void appendRAIIHandle( std::string & str,
|
|
|
|
std::pair<std::string, HandleData> const & handle,
|
|
|
|
std::set<std::string> & listedHandles,
|
|
|
|
std::set<std::string> const & specialFunctions ) const;
|
|
|
|
void appendRAIIHandleContext( std::string & str,
|
|
|
|
std::pair<std::string, HandleData> const & handle,
|
|
|
|
std::set<std::string> const & specialFunctions ) const;
|
2021-04-27 15:19:32 +00:00
|
|
|
std::pair<std::string, std::string> appendStaticCommand( std::string & str,
|
|
|
|
std::pair<std::string, CommandData> const & command );
|
|
|
|
void appendStruct( std::string & str, std::pair<std::string, StructureData> const & structure );
|
|
|
|
void appendStructAssignmentOperators( std::string & str,
|
|
|
|
std::pair<std::string, StructureData> const & structure,
|
|
|
|
std::string const & prefix ) const;
|
2020-04-12 19:49:12 +00:00
|
|
|
void appendStructCompareOperators( std::string & str, std::pair<std::string, StructureData> const & structure ) const;
|
2020-06-24 09:28:43 +00:00
|
|
|
void appendStructConstructors( std::string & str,
|
|
|
|
std::pair<std::string, StructureData> const & structData,
|
|
|
|
std::string const & prefix ) const;
|
2020-07-08 08:58:37 +00:00
|
|
|
void appendStructConstructorsEnhanced( std::string & str,
|
|
|
|
std::pair<std::string, StructureData> const & structData,
|
|
|
|
std::string const & prefix ) const;
|
|
|
|
bool appendStructConstructorArgument( std::string & str,
|
|
|
|
bool listedArgument,
|
|
|
|
MemberData const & memberData,
|
|
|
|
bool withDefault ) const;
|
2020-04-21 12:26:32 +00:00
|
|
|
std::string appendStructMembers( std::string & str,
|
2020-04-12 19:49:12 +00:00
|
|
|
std::pair<std::string, StructureData> const & structData,
|
|
|
|
std::string const & prefix ) const;
|
2020-07-01 12:43:37 +00:00
|
|
|
void appendStructSetter( std::string & str,
|
|
|
|
std::string const & structureName,
|
|
|
|
std::vector<MemberData> const & memberData,
|
|
|
|
size_t index ) const;
|
2020-04-21 12:26:32 +00:00
|
|
|
void appendStructSubConstructor( std::string & str,
|
|
|
|
std::pair<std::string, StructureData> const & structData,
|
|
|
|
std::string const & prefix ) const;
|
|
|
|
void appendStructure( std::string & str, std::pair<std::string, StructureData> const & structure ) const;
|
2020-07-22 08:20:05 +00:00
|
|
|
void appendType( std::string & str, std::string const & typeName );
|
2020-04-21 12:26:32 +00:00
|
|
|
void appendUnion( std::string & str, std::pair<std::string, StructureData> const & structure ) const;
|
|
|
|
void appendUniqueTypes( std::string & str,
|
|
|
|
std::string const & parentType,
|
|
|
|
std::set<std::string> const & childrenTypes ) const;
|
2021-02-17 09:49:59 +00:00
|
|
|
bool checkEquivalentSingularConstructor(
|
|
|
|
std::vector<std::map<std::string, CommandData>::const_iterator> const & constructorIts,
|
|
|
|
std::map<std::string, CommandData>::const_iterator constructorIt,
|
|
|
|
std::vector<ParamData>::const_iterator lenIt ) const;
|
2020-09-17 10:09:43 +00:00
|
|
|
std::string constructArgumentListEnhanced( std::vector<ParamData> const & params,
|
|
|
|
std::set<size_t> const & skippedParams,
|
2021-04-12 10:38:04 +00:00
|
|
|
std::set<size_t> const & singularParams,
|
2020-09-21 21:18:24 +00:00
|
|
|
bool definition,
|
2020-10-22 08:19:40 +00:00
|
|
|
bool withAllocators,
|
2021-02-17 09:49:59 +00:00
|
|
|
bool structureChain,
|
|
|
|
bool withDispatcher ) const;
|
2020-09-17 10:09:43 +00:00
|
|
|
std::string constructArgumentListStandard( std::vector<ParamData> const & params,
|
2020-11-02 10:51:07 +00:00
|
|
|
std::set<size_t> const & skippedParams ) const;
|
2021-04-12 10:38:04 +00:00
|
|
|
std::string constructCallArgumentEnhanced( std::vector<ParamData> const & params,
|
|
|
|
size_t paramIndex,
|
2021-02-17 09:49:59 +00:00
|
|
|
bool nonConstPointerAsNullptr,
|
2021-04-12 10:38:04 +00:00
|
|
|
std::set<size_t> const & singularParams,
|
|
|
|
std::vector<size_t> const & returnParamIndices,
|
2021-02-17 09:49:59 +00:00
|
|
|
bool raiiHandleMemberFunction ) const;
|
|
|
|
std::string constructCallArgumentsEnhanced( std::vector<ParamData> const & params,
|
|
|
|
size_t initialSkipCount,
|
2020-11-02 14:47:20 +00:00
|
|
|
bool nonConstPointerAsNullptr,
|
2021-04-12 10:38:04 +00:00
|
|
|
std::set<size_t> const & singularParams,
|
|
|
|
std::vector<size_t> const & returnParamIndices,
|
2021-02-17 09:49:59 +00:00
|
|
|
bool raiiHandleMemberFunction ) const;
|
2020-10-01 11:32:23 +00:00
|
|
|
std::string constructCallArgumentsStandard( std::string const & handle, std::vector<ParamData> const & params ) const;
|
2021-02-24 14:47:30 +00:00
|
|
|
std::string constructCommandBoolGetValue( std::string const & name,
|
|
|
|
CommandData const & commandData,
|
|
|
|
size_t initialSkipCount,
|
|
|
|
bool definition,
|
|
|
|
size_t nonConstPointerIndex ) const;
|
2020-10-14 07:25:28 +00:00
|
|
|
std::string constructCommandResult( std::string const & name,
|
|
|
|
CommandData const & commandData,
|
2021-02-17 09:49:59 +00:00
|
|
|
size_t initialSkipCount,
|
2020-10-14 07:25:28 +00:00
|
|
|
bool definition,
|
|
|
|
std::map<size_t, size_t> const & vectorParamIndices ) const;
|
2020-10-20 10:27:08 +00:00
|
|
|
std::string constructCommandResultEnumerate( std::string const & name,
|
|
|
|
CommandData const & commandData,
|
2021-02-17 09:49:59 +00:00
|
|
|
size_t initialSkipCount,
|
2020-10-20 10:27:08 +00:00
|
|
|
bool definition,
|
|
|
|
std::pair<size_t, size_t> const & vectorParamIndices,
|
|
|
|
bool withAllocators ) const;
|
2020-11-17 08:51:55 +00:00
|
|
|
std::string constructCommandResultEnumerateChained( std::string const & name,
|
|
|
|
CommandData const & commandData,
|
2021-02-17 09:49:59 +00:00
|
|
|
size_t initialSkipCount,
|
2020-11-17 08:51:55 +00:00
|
|
|
bool definition,
|
|
|
|
std::pair<size_t, size_t> const & vectorParamIndex,
|
|
|
|
std::vector<size_t> const & returnParamIndices,
|
|
|
|
bool withAllocator ) const;
|
2020-10-14 07:25:28 +00:00
|
|
|
std::string constructCommandResultEnumerateTwoVectors( std::string const & name,
|
|
|
|
CommandData const & commandData,
|
2021-02-17 09:49:59 +00:00
|
|
|
size_t initialSkipCount,
|
2020-10-14 07:25:28 +00:00
|
|
|
bool definition,
|
2020-10-19 07:40:40 +00:00
|
|
|
std::map<size_t, size_t> const & vectorParamIndices,
|
2020-10-26 15:16:48 +00:00
|
|
|
std::vector<size_t> const & returnParamIndices,
|
2020-10-14 07:25:28 +00:00
|
|
|
bool withAllocators ) const;
|
|
|
|
std::string constructCommandResultEnumerateTwoVectorsDeprecated( std::string const & name,
|
|
|
|
CommandData const & commandData,
|
2021-02-17 09:49:59 +00:00
|
|
|
size_t initialSkipCount,
|
2020-10-14 07:25:28 +00:00
|
|
|
bool definition,
|
2020-10-19 07:40:40 +00:00
|
|
|
std::map<size_t, size_t> const & vectorParamIndices,
|
2020-10-14 07:25:28 +00:00
|
|
|
bool withAllocators ) const;
|
2020-10-15 07:01:04 +00:00
|
|
|
std::string constructCommandResultGetChain( std::string const & name,
|
|
|
|
CommandData const & commandData,
|
2021-02-17 09:49:59 +00:00
|
|
|
size_t initialSkipCount,
|
2020-10-19 07:40:40 +00:00
|
|
|
bool definition,
|
|
|
|
size_t nonConstPointerIndex ) const;
|
2020-10-14 07:25:28 +00:00
|
|
|
std::string constructCommandResultGetHandleUnique( std::string const & name,
|
|
|
|
CommandData const & commandData,
|
2021-02-17 09:49:59 +00:00
|
|
|
size_t initialSkipCount,
|
2020-10-19 07:40:40 +00:00
|
|
|
bool definition,
|
|
|
|
size_t nonConstPointerIndex ) const;
|
2021-01-21 17:11:51 +00:00
|
|
|
std::string constructCommandResultGetTwoValues( std::string const & name,
|
|
|
|
CommandData const & commandData,
|
2021-02-17 09:49:59 +00:00
|
|
|
size_t initialSkipCount,
|
2021-01-21 17:11:51 +00:00
|
|
|
bool definition,
|
|
|
|
std::vector<size_t> const & nonConstPointerParamIndices ) const;
|
2020-10-14 07:25:28 +00:00
|
|
|
std::string constructCommandResultGetTwoVectors( std::string const & name,
|
2020-10-09 09:01:30 +00:00
|
|
|
CommandData const & commandData,
|
2021-02-17 09:49:59 +00:00
|
|
|
size_t initialSkipCount,
|
2020-10-19 07:40:40 +00:00
|
|
|
bool definition,
|
|
|
|
std::map<size_t, size_t> const & vectorParamIndices ) const;
|
2020-10-14 07:25:28 +00:00
|
|
|
std::string constructCommandResultGetValue( std::string const & name,
|
|
|
|
CommandData const & commandData,
|
2021-02-17 09:49:59 +00:00
|
|
|
size_t initialSkipCount,
|
2020-10-19 07:40:40 +00:00
|
|
|
bool definition,
|
|
|
|
size_t nonConstPointerIndex ) const;
|
|
|
|
std::string constructCommandResultGetValueDeprecated( std::string const & name,
|
|
|
|
CommandData const & commandData,
|
2021-02-17 09:49:59 +00:00
|
|
|
size_t initialSkipCount,
|
2020-10-19 07:40:40 +00:00
|
|
|
bool definition,
|
|
|
|
std::map<size_t, size_t> const & vectorParamIndices,
|
|
|
|
size_t returnParamIndex ) const;
|
2020-10-14 07:25:28 +00:00
|
|
|
std::string constructCommandResultGetVector( std::string const & name,
|
|
|
|
CommandData const & commandData,
|
2021-02-17 09:49:59 +00:00
|
|
|
size_t initialSkipCount,
|
2020-10-19 07:40:40 +00:00
|
|
|
bool definition,
|
2020-10-14 07:25:28 +00:00
|
|
|
std::map<size_t, size_t> const & vectorParamIndices,
|
2020-10-19 07:40:40 +00:00
|
|
|
size_t returnParamIndex ) const;
|
2021-04-12 10:38:04 +00:00
|
|
|
std::string constructCommandResultGetVector( std::string const & name,
|
|
|
|
CommandData const & commandData,
|
|
|
|
size_t initialSkipCount,
|
|
|
|
bool definition,
|
|
|
|
std::map<size_t, size_t> const & vectorParamIndices,
|
|
|
|
size_t returnParamIndex,
|
|
|
|
bool withAllocator ) const;
|
2020-10-19 07:40:40 +00:00
|
|
|
std::string constructCommandResultGetVectorAndValue( std::string const & name,
|
|
|
|
CommandData const & commandData,
|
2021-02-17 09:49:59 +00:00
|
|
|
size_t initialSkipCount,
|
2020-10-19 07:40:40 +00:00
|
|
|
bool definition,
|
|
|
|
std::map<size_t, size_t> const & vectorParamIndices,
|
|
|
|
std::vector<size_t> const & returnParamIndex,
|
|
|
|
bool withAllocator ) const;
|
2020-10-14 07:25:28 +00:00
|
|
|
std::string constructCommandResultGetVectorDeprecated( std::string const & name,
|
|
|
|
CommandData const & commandData,
|
2021-02-17 09:49:59 +00:00
|
|
|
size_t initialSkipCount,
|
2020-10-19 07:40:40 +00:00
|
|
|
bool definition,
|
2020-10-14 07:25:28 +00:00
|
|
|
std::map<size_t, size_t> const & vectorParamIndices,
|
2020-10-19 07:40:40 +00:00
|
|
|
size_t returnParamIndex ) const;
|
2020-10-14 07:25:28 +00:00
|
|
|
std::string constructCommandResultGetVectorOfHandles( std::string const & name,
|
2020-10-09 09:01:30 +00:00
|
|
|
CommandData const & commandData,
|
2021-02-17 09:49:59 +00:00
|
|
|
size_t initialSkipCount,
|
2020-10-19 07:40:40 +00:00
|
|
|
bool definition,
|
2020-10-09 09:01:30 +00:00
|
|
|
std::map<size_t, size_t> const & vectorParamIndices,
|
|
|
|
size_t returnParamIndex,
|
|
|
|
bool withAllocator ) const;
|
2020-10-14 07:25:28 +00:00
|
|
|
std::string constructCommandResultGetVectorOfHandlesSingular( std::string const & name,
|
2020-10-09 09:01:30 +00:00
|
|
|
CommandData const & commandData,
|
2021-02-17 09:49:59 +00:00
|
|
|
size_t initialSkipCount,
|
2020-10-19 07:40:40 +00:00
|
|
|
bool definition,
|
2020-10-09 09:01:30 +00:00
|
|
|
std::map<size_t, size_t> const & vectorParamIndices,
|
2020-10-19 07:40:40 +00:00
|
|
|
size_t returnParamIndex ) const;
|
2020-10-14 07:25:28 +00:00
|
|
|
std::string constructCommandResultGetVectorOfHandlesUnique( std::string const & name,
|
|
|
|
CommandData const & commandData,
|
2021-02-17 09:49:59 +00:00
|
|
|
size_t initialSkipCount,
|
2020-10-19 07:40:40 +00:00
|
|
|
bool definition,
|
2020-10-14 07:25:28 +00:00
|
|
|
std::map<size_t, size_t> const & vectorParamIndices,
|
|
|
|
size_t returnParamIndex,
|
|
|
|
bool withAllocator ) const;
|
2020-09-17 10:09:43 +00:00
|
|
|
std::string
|
2020-10-14 07:25:28 +00:00
|
|
|
constructCommandResultGetVectorOfHandlesUniqueSingular( std::string const & name,
|
|
|
|
CommandData const & commandData,
|
2021-02-17 09:49:59 +00:00
|
|
|
size_t initialSkipCount,
|
2020-10-19 07:40:40 +00:00
|
|
|
bool definition,
|
2020-10-14 07:25:28 +00:00
|
|
|
std::map<size_t, size_t> const & vectorParamIndices,
|
2020-10-19 07:40:40 +00:00
|
|
|
size_t returnParamIndex ) const;
|
2021-04-12 10:38:04 +00:00
|
|
|
std::string constructCommandResultGetVectorOfVoidSingular( std::string const & name,
|
|
|
|
CommandData const & commandData,
|
|
|
|
size_t initialSkipCount,
|
|
|
|
bool definition,
|
|
|
|
std::map<size_t, size_t> const & vectorParamIndices,
|
|
|
|
size_t returnParamIndex ) const;
|
2020-10-14 07:25:28 +00:00
|
|
|
std::string constructCommandResultGetVectorSingular( std::string const & name,
|
|
|
|
CommandData const & commandData,
|
2021-02-17 09:49:59 +00:00
|
|
|
size_t initialSkipCount,
|
2020-10-19 07:40:40 +00:00
|
|
|
bool definition,
|
2020-10-14 07:25:28 +00:00
|
|
|
std::map<size_t, size_t> const & vectorParamIndices,
|
2020-10-19 07:40:40 +00:00
|
|
|
size_t returnParamIndex ) const;
|
2021-02-17 09:49:59 +00:00
|
|
|
std::string constructCommandStandard( std::string const & name,
|
|
|
|
CommandData const & commandData,
|
|
|
|
size_t initialSkipCount,
|
|
|
|
bool definition ) const;
|
|
|
|
std::string constructCommandType( std::string const & name,
|
|
|
|
CommandData const & commandData,
|
|
|
|
size_t initialSkipCount,
|
|
|
|
bool definition ) const;
|
2020-10-26 15:16:48 +00:00
|
|
|
std::string constructCommandVoid( std::string const & name,
|
|
|
|
CommandData const & commandData,
|
2021-02-17 09:49:59 +00:00
|
|
|
size_t initialSkipCount,
|
2020-10-26 15:16:48 +00:00
|
|
|
bool definition,
|
|
|
|
std::map<size_t, size_t> const & vectorParamIndices ) const;
|
|
|
|
std::string constructCommandVoidEnumerate( std::string const & name,
|
|
|
|
CommandData const & commandData,
|
2021-02-17 09:49:59 +00:00
|
|
|
size_t initialSkipCount,
|
2020-10-26 15:16:48 +00:00
|
|
|
bool definition,
|
|
|
|
std::pair<size_t, size_t> const & vectorParamIndex,
|
|
|
|
std::vector<size_t> const & returnParamIndices,
|
|
|
|
bool withAllocators ) const;
|
|
|
|
std::string constructCommandVoidEnumerateChained( std::string const & name,
|
|
|
|
CommandData const & commandData,
|
2021-02-17 09:49:59 +00:00
|
|
|
size_t initialSkipCount,
|
2020-10-26 15:16:48 +00:00
|
|
|
bool definition,
|
|
|
|
std::pair<size_t, size_t> const & vectorParamIndex,
|
|
|
|
std::vector<size_t> const & returnParamIndices,
|
|
|
|
bool withAllocators ) const;
|
|
|
|
std::string constructCommandVoidGetChain( std::string const & name,
|
|
|
|
CommandData const & commandData,
|
2021-02-17 09:49:59 +00:00
|
|
|
size_t initialSkipCount,
|
2020-10-26 15:16:48 +00:00
|
|
|
bool definition,
|
|
|
|
size_t nonConstPointerIndex ) const;
|
2020-10-28 09:18:05 +00:00
|
|
|
std::string constructCommandVoidGetValue( std::string const & name,
|
|
|
|
CommandData const & commandData,
|
2021-02-17 09:49:59 +00:00
|
|
|
size_t initialSkipCount,
|
2020-10-28 09:18:05 +00:00
|
|
|
bool definition,
|
|
|
|
std::map<size_t, size_t> const & vectorParamIndices,
|
|
|
|
size_t returnParamIndex ) const;
|
2021-01-21 17:11:51 +00:00
|
|
|
std::string constructConstexprString( std::pair<std::string, StructureData> const & structData,
|
|
|
|
bool assignmentOperator ) const;
|
2021-02-17 09:49:59 +00:00
|
|
|
std::string constructFailureCheck( std::vector<std::string> const & successCodes ) const;
|
2020-10-26 15:16:48 +00:00
|
|
|
std::string constructFunctionBodyEnhanced( std::string const & indentation,
|
|
|
|
std::string const & name,
|
|
|
|
CommandData const & commandData,
|
2021-02-17 09:49:59 +00:00
|
|
|
size_t initialSkipCount,
|
2020-10-26 15:16:48 +00:00
|
|
|
size_t returnParamIndex,
|
|
|
|
size_t templateParamIndex,
|
|
|
|
std::map<size_t, size_t> const & vectorParamIndices,
|
|
|
|
bool twoStep,
|
|
|
|
std::string const & enhancedReturnType,
|
|
|
|
bool withAllocator ) const;
|
|
|
|
std::string constructFunctionBodyEnhancedSingleStep( std::string const & indentation,
|
|
|
|
std::string const & name,
|
|
|
|
CommandData const & commandData,
|
|
|
|
size_t returnParamIndex,
|
|
|
|
size_t templateParamIndex,
|
|
|
|
std::map<size_t, size_t> const & vectorParamIndices ) const;
|
|
|
|
std::string constructFunctionHeaderArgumentsEnhanced( CommandData const & commandData,
|
|
|
|
size_t returnParamIndex,
|
|
|
|
size_t templateParamIndex,
|
|
|
|
std::map<size_t, size_t> const & vectorParamIndices,
|
|
|
|
bool withDefaults,
|
|
|
|
bool withAllocator ) const;
|
2021-04-27 07:06:55 +00:00
|
|
|
std::string constructFunctionPointerCheck( std::string const & function, std::string const & referencedIn ) const;
|
2020-10-26 15:16:48 +00:00
|
|
|
std::string constructNoDiscardStandard( CommandData const & commandData ) const;
|
2021-02-17 09:49:59 +00:00
|
|
|
std::pair<std::string, std::string> constructRAIIHandleConstructor(
|
|
|
|
std::pair<std::string, HandleData> const & handle,
|
|
|
|
std::map<std::string, VulkanHppGenerator::CommandData>::const_iterator constructorIt,
|
|
|
|
std::string const & enter,
|
|
|
|
std::string const & leave ) const;
|
2021-05-15 21:26:51 +00:00
|
|
|
std::string constructRAIIHandleConstructorArguments( std::string const & handleType,
|
|
|
|
std::vector<ParamData> const & params,
|
|
|
|
bool singular,
|
|
|
|
bool encounteredArgument ) const;
|
|
|
|
std::string constructRAIIHandleMemberFunctionResultSingleGetVector(
|
2021-04-12 10:38:04 +00:00
|
|
|
std::map<std::string, CommandData>::const_iterator commandIt,
|
|
|
|
size_t initialSkipCount,
|
|
|
|
std::map<size_t, size_t> const & vectorParamIndices,
|
2021-05-15 21:26:51 +00:00
|
|
|
size_t returnParamIndex,
|
|
|
|
bool definition ) const;
|
2021-02-17 09:49:59 +00:00
|
|
|
std::string constructRAIIHandleConstructorCallArguments( std::string const & handleType,
|
|
|
|
std::vector<ParamData> const & params,
|
|
|
|
bool nonConstPointerAsNullptr,
|
2021-04-12 10:38:04 +00:00
|
|
|
std::set<size_t> const & singularParams,
|
|
|
|
std::vector<size_t> const & returnParamIndices,
|
2021-02-17 09:49:59 +00:00
|
|
|
bool allocatorIsMemberVariable ) const;
|
|
|
|
std::string constructRAIIHandleConstructorEnumerate(
|
|
|
|
std::pair<std::string, HandleData> const & handle,
|
|
|
|
std::map<std::string, VulkanHppGenerator::CommandData>::const_iterator constructorIt,
|
|
|
|
std::vector<ParamData>::const_iterator handleParamIt,
|
|
|
|
std::vector<ParamData>::const_iterator lenParamIt,
|
|
|
|
std::string const & enter,
|
|
|
|
std::string const & leave ) const;
|
|
|
|
std::string constructRAIIHandleConstructorInitializationList(
|
|
|
|
std::string const & handleType,
|
|
|
|
std::map<std::string, VulkanHppGenerator::CommandData>::const_iterator constructorIt,
|
|
|
|
std::map<std::string, VulkanHppGenerator::CommandData>::const_iterator destructorIt,
|
|
|
|
bool hasSecondLevelCommands ) const;
|
|
|
|
std::string constructRAIIHandleConstructorResult(
|
|
|
|
std::pair<std::string, HandleData> const & handle,
|
|
|
|
std::map<std::string, VulkanHppGenerator::CommandData>::const_iterator constructorIt,
|
|
|
|
std::string const & enter,
|
|
|
|
std::string const & leave ) const;
|
|
|
|
std::string constructRAIIHandleConstructorTakeOwnership( std::pair<std::string, HandleData> const & handle ) const;
|
|
|
|
std::pair<std::string, std::string>
|
|
|
|
constructRAIIHandleConstructors( std::pair<std::string, HandleData> const & handle ) const;
|
|
|
|
std::string constructRAIIHandleConstructorVector(
|
|
|
|
std::pair<std::string, HandleData> const & handle,
|
|
|
|
std::map<std::string, VulkanHppGenerator::CommandData>::const_iterator constructorIt,
|
|
|
|
std::vector<ParamData>::const_iterator handleParamIt,
|
|
|
|
std::string const & enter,
|
|
|
|
std::string const & leave ) const;
|
|
|
|
std::string constructRAIIHandleConstructorVectorSingular(
|
|
|
|
std::pair<std::string, HandleData> const & handle,
|
|
|
|
std::map<std::string, VulkanHppGenerator::CommandData>::const_iterator constructorIt,
|
|
|
|
std::vector<ParamData>::const_iterator handleParamIt,
|
|
|
|
std::string const & enter,
|
|
|
|
std::string const & leave ) const;
|
|
|
|
std::string constructRAIIHandleConstructorVoid(
|
|
|
|
std::pair<std::string, HandleData> const & handle,
|
|
|
|
std::map<std::string, VulkanHppGenerator::CommandData>::const_iterator constructorIt,
|
|
|
|
std::string const & enter,
|
|
|
|
std::string const & leave ) const;
|
|
|
|
std::pair<std::string, std::string>
|
|
|
|
constructRAIIHandleDestructor( std::string const & handleType,
|
|
|
|
std::map<std::string, CommandData>::const_iterator destructorIt,
|
|
|
|
std::string const & enter ) const;
|
|
|
|
std::string constructRAIIHandleDestructorCallArguments( std::string const & handleType,
|
|
|
|
std::vector<ParamData> const & params ) const;
|
|
|
|
std::tuple<std::string, std::string, std::string, std::string>
|
2021-05-15 21:26:51 +00:00
|
|
|
constructRAIIHandleDetails( std::pair<std::string, HandleData> const & handle,
|
|
|
|
std::string const & destructorCall ) const;
|
|
|
|
std::string constructRAIIHandleMemberFunction( std::string const & command,
|
|
|
|
size_t initialSkipCount,
|
|
|
|
std::set<std::string> const & specialFunctions,
|
|
|
|
bool definition ) const;
|
|
|
|
std::string
|
2021-02-17 09:49:59 +00:00
|
|
|
constructRAIIHandleMemberFunctionResultEnumerate( std::map<std::string, CommandData>::const_iterator commandIt,
|
|
|
|
size_t initialSkipCount,
|
|
|
|
std::map<size_t, size_t> const & vectorParamIndices,
|
2021-05-15 21:26:51 +00:00
|
|
|
std::vector<size_t> const & nonConstPointerParamIndices,
|
|
|
|
bool definition ) const;
|
|
|
|
std::string constructRAIIHandleMemberFunctionResultEnumerateTwoVectors(
|
2021-02-17 09:49:59 +00:00
|
|
|
std::map<std::string, CommandData>::const_iterator commandIt,
|
|
|
|
size_t initialSkipCount,
|
|
|
|
std::map<size_t, size_t> const & vectorParamIndices,
|
2021-05-15 21:26:51 +00:00
|
|
|
std::vector<size_t> const & nonConstPointerParamIndices,
|
|
|
|
bool definition ) const;
|
2021-03-10 16:03:47 +00:00
|
|
|
std::pair<std::string, std::string> constructRAIIHandleMemberFunctionResultGetTwoValues(
|
|
|
|
std::map<std::string, CommandData>::const_iterator commandIt,
|
|
|
|
size_t initialSkipCount,
|
|
|
|
std::map<size_t, size_t> const & vectorParamIndices,
|
|
|
|
std::vector<size_t> const & nonConstPointerParamIndices ) const;
|
2021-05-15 21:26:51 +00:00
|
|
|
std::string
|
2021-02-17 09:49:59 +00:00
|
|
|
constructRAIIHandleMemberFunctionResultMulti( std::map<std::string, CommandData>::const_iterator commandIt,
|
|
|
|
size_t initialSkipCount,
|
2021-05-15 21:26:51 +00:00
|
|
|
std::map<size_t, size_t> const & vectorParamIndices,
|
|
|
|
bool definition ) const;
|
|
|
|
std::string
|
|
|
|
constructRAIIHandleMemberFunctionResultMultiGetValue( std::map<std::string, CommandData>::const_iterator commandIt,
|
|
|
|
size_t initialSkipCount,
|
|
|
|
std::map<size_t, size_t> const & vectorParamIndices,
|
|
|
|
std::vector<size_t> const & nonConstPointerParamIndices,
|
|
|
|
bool definition ) const;
|
|
|
|
std::string constructRAIIHandleMemberFunctionResultMultiGetVectorOfVoid(
|
2021-02-17 09:49:59 +00:00
|
|
|
std::map<std::string, CommandData>::const_iterator commandIt,
|
|
|
|
size_t initialSkipCount,
|
|
|
|
std::map<size_t, size_t> const & vectorParamIndices,
|
2021-05-15 21:26:51 +00:00
|
|
|
std::vector<size_t> const & nonConstPointerParamIndices,
|
|
|
|
bool definition ) const;
|
|
|
|
std::string constructRAIIHandleMemberFunctionResultMultiGetVectorOfVoidSingular(
|
2021-02-17 09:49:59 +00:00
|
|
|
std::map<std::string, CommandData>::const_iterator commandIt,
|
|
|
|
size_t initialSkipCount,
|
|
|
|
std::map<size_t, size_t> const & vectorParamIndices,
|
2021-05-15 21:26:51 +00:00
|
|
|
std::vector<size_t> const & nonConstPointerParamIndices,
|
|
|
|
bool definition ) const;
|
|
|
|
std::string
|
2021-02-17 09:49:59 +00:00
|
|
|
constructRAIIHandleMemberFunctionResultMultiNoErrors( std::map<std::string, CommandData>::const_iterator commandIt,
|
|
|
|
size_t initialSkipCount,
|
2021-05-15 21:26:51 +00:00
|
|
|
std::map<size_t, size_t> const & vectorParamIndices,
|
|
|
|
bool definition ) const;
|
|
|
|
std::string
|
2021-02-17 09:49:59 +00:00
|
|
|
constructRAIIHandleMemberFunctionResultSingle( std::map<std::string, CommandData>::const_iterator commandIt,
|
|
|
|
size_t initialSkipCount,
|
2021-05-15 21:26:51 +00:00
|
|
|
std::map<size_t, size_t> const & vectorParamIndices,
|
|
|
|
bool definition ) const;
|
|
|
|
std::string
|
|
|
|
constructRAIIHandleMemberFunctionResultSingleGetChain( std::map<std::string, CommandData>::const_iterator commandIt,
|
|
|
|
size_t initialSkipCount,
|
|
|
|
std::map<size_t, size_t> const & vectorParamIndices,
|
|
|
|
std::vector<size_t> const & nonConstPointerParamIndices,
|
|
|
|
bool definition ) const;
|
|
|
|
std::string constructRAIIHandleMemberFunctionResultSingleGetVectorAndValue(
|
2021-02-17 09:49:59 +00:00
|
|
|
std::map<std::string, CommandData>::const_iterator commandIt,
|
|
|
|
size_t initialSkipCount,
|
|
|
|
std::map<size_t, size_t> const & vectorParamIndices,
|
2021-05-15 21:26:51 +00:00
|
|
|
std::vector<size_t> const & nonConstPointerParamIndices,
|
|
|
|
bool definition ) const;
|
|
|
|
std::string constructRAIIHandleMemberFunctionResultSingleGetVectorOfVoid(
|
2021-02-17 09:49:59 +00:00
|
|
|
std::map<std::string, CommandData>::const_iterator commandIt,
|
|
|
|
size_t initialSkipCount,
|
|
|
|
std::map<size_t, size_t> const & vectorParamIndices,
|
2021-05-15 21:26:51 +00:00
|
|
|
std::vector<size_t> const & nonConstPointerParamIndices,
|
|
|
|
bool definition ) const;
|
|
|
|
std::string constructRAIIHandleMemberFunctionResultSingleGetVectorSingular(
|
2021-02-17 09:49:59 +00:00
|
|
|
std::map<std::string, CommandData>::const_iterator commandIt,
|
|
|
|
size_t initialSkipCount,
|
|
|
|
std::map<size_t, size_t> const & vectorParamIndices,
|
2021-05-15 21:26:51 +00:00
|
|
|
size_t returnParamIndex,
|
|
|
|
bool definition ) const;
|
|
|
|
std::string constructRAIIHandleMemberFunctionResultSingleGetVectorOfVoidSingular(
|
2021-04-12 10:38:04 +00:00
|
|
|
std::map<std::string, CommandData>::const_iterator commandIt,
|
|
|
|
size_t initialSkipCount,
|
|
|
|
std::map<size_t, size_t> const & vectorParamIndices,
|
2021-05-15 21:26:51 +00:00
|
|
|
std::vector<size_t> const & nonConstPointerParamIndices,
|
|
|
|
bool definition ) const;
|
|
|
|
std::string
|
2021-02-17 09:49:59 +00:00
|
|
|
constructRAIIHandleMemberFunctionResultSingleNoErrors( std::map<std::string, CommandData>::const_iterator commandIt,
|
|
|
|
size_t initialSkipCount,
|
2021-05-15 21:26:51 +00:00
|
|
|
std::map<size_t, size_t> const & vectorParamIndices,
|
|
|
|
bool definition ) const;
|
|
|
|
std::string
|
|
|
|
constructRAIIHandleMemberFunctionResultSingleGetValue( std::map<std::string, CommandData>::const_iterator commandIt,
|
|
|
|
size_t initialSkipCount,
|
|
|
|
std::map<size_t, size_t> const & vectorParamIndices,
|
|
|
|
std::vector<size_t> const & nonConstPointerParamIndices,
|
|
|
|
bool definition ) const;
|
2021-02-24 14:47:30 +00:00
|
|
|
std::pair<std::string, std::string>
|
2021-05-15 21:26:51 +00:00
|
|
|
constructRAIIHandleMemberFunctionBoolGetValue( std::map<std::string, CommandData>::const_iterator commandIt,
|
|
|
|
size_t initialSkipCount,
|
|
|
|
std::map<size_t, size_t> const & vectorParamIndices,
|
|
|
|
std::vector<size_t> const & nonConstPointerParamIndices ) const;
|
|
|
|
std::string constructRAIIHandleMemberFunctionResult( std::map<std::string, CommandData>::const_iterator commandIt,
|
|
|
|
size_t initialSkipCount,
|
|
|
|
bool definition ) const;
|
|
|
|
std::string constructRAIIHandleMemberFunctionResult0Return(
|
|
|
|
std::map<std::string, CommandData>::const_iterator commandIt, size_t initialSkipCount, bool definition ) const;
|
|
|
|
std::string
|
2021-04-15 09:42:42 +00:00
|
|
|
constructRAIIHandleMemberFunctionResult1Return( std::map<std::string, CommandData>::const_iterator commandIt,
|
|
|
|
size_t initialSkipCount,
|
2021-05-15 21:26:51 +00:00
|
|
|
size_t returnParamIndex,
|
|
|
|
bool definition ) const;
|
|
|
|
std::string
|
2021-04-15 09:42:42 +00:00
|
|
|
constructRAIIHandleMemberFunctionResult2Return( std::map<std::string, CommandData>::const_iterator commandIt,
|
|
|
|
size_t initialSkipCount,
|
2021-05-15 21:26:51 +00:00
|
|
|
std::vector<size_t> const & returnParamIndices,
|
|
|
|
bool definition ) const;
|
|
|
|
std::string
|
2021-04-15 09:42:42 +00:00
|
|
|
constructRAIIHandleMemberFunctionResult3Return( std::map<std::string, CommandData>::const_iterator commandIt,
|
|
|
|
size_t initialSkipCount,
|
2021-05-15 21:26:51 +00:00
|
|
|
std::vector<size_t> const & returnParamIndices,
|
|
|
|
bool definition ) const;
|
|
|
|
std::string constructRAIIHandleMemberFunctionDeclarations( std::pair<std::string, HandleData> const & handle,
|
|
|
|
std::set<std::string> const & specialFunctions ) const;
|
|
|
|
std::string constructRAIIHandleMemberFunctionType( std::map<std::string, CommandData>::const_iterator commandIt,
|
|
|
|
size_t initialSkipCount,
|
|
|
|
std::map<size_t, size_t> const & vectorParamIndices,
|
|
|
|
bool definition ) const;
|
|
|
|
std::string constructRAIIHandleMemberFunctionVkType( std::map<std::string, CommandData>::const_iterator commandIt,
|
|
|
|
size_t initialSkipCount,
|
|
|
|
std::map<size_t, size_t> const & vectorParamIndices,
|
|
|
|
bool definition ) const;
|
|
|
|
std::string constructRAIIHandleMemberFunctionValue( std::map<std::string, CommandData>::const_iterator commandIt,
|
|
|
|
size_t initialSkipCount,
|
|
|
|
bool definition ) const;
|
|
|
|
std::string constructRAIIHandleMemberFunctionValue0Return(
|
|
|
|
std::map<std::string, CommandData>::const_iterator commandIt, size_t initialSkipCount, bool definition ) const;
|
|
|
|
std::string constructRAIIHandleMemberFunctionVoid( std::map<std::string, CommandData>::const_iterator commandIt,
|
|
|
|
size_t initialSkipCount,
|
|
|
|
bool definition ) const;
|
|
|
|
std::string constructRAIIHandleMemberFunctionVoid0Return(
|
|
|
|
std::map<std::string, CommandData>::const_iterator commandIt, size_t initialSkipCount, bool definition ) const;
|
|
|
|
std::string
|
2021-04-15 09:42:42 +00:00
|
|
|
constructRAIIHandleMemberFunctionVoid1Return( std::map<std::string, CommandData>::const_iterator commandIt,
|
|
|
|
size_t initialSkipCount,
|
2021-05-15 21:26:51 +00:00
|
|
|
size_t returnParamIndex,
|
|
|
|
bool definition ) const;
|
|
|
|
std::string
|
2021-04-15 09:42:42 +00:00
|
|
|
constructRAIIHandleMemberFunctionVoid2Return( std::map<std::string, CommandData>::const_iterator commandIt,
|
|
|
|
size_t initialSkipCount,
|
2021-05-15 21:26:51 +00:00
|
|
|
std::vector<size_t> const & returnParamIndices,
|
|
|
|
bool definition ) const;
|
|
|
|
std::string
|
2021-02-17 09:49:59 +00:00
|
|
|
constructRAIIHandleMemberFunctionVoidEnumerate( std::map<std::string, CommandData>::const_iterator commandIt,
|
|
|
|
size_t initialSkipCount,
|
|
|
|
std::map<size_t, size_t> const & vectorParamIndices,
|
2021-05-15 21:26:51 +00:00
|
|
|
std::vector<size_t> const & nonConstPointerParamIndices,
|
|
|
|
bool definition ) const;
|
|
|
|
std::string
|
|
|
|
constructRAIIHandleMemberFunctionVoidEnumerateChain( std::map<std::string, CommandData>::const_iterator commandIt,
|
|
|
|
size_t initialSkipCount,
|
|
|
|
std::map<size_t, size_t> const & vectorParamIndices,
|
|
|
|
std::vector<size_t> const & nonConstPointerParamIndices,
|
|
|
|
bool definition ) const;
|
|
|
|
std::string
|
2021-02-17 09:49:59 +00:00
|
|
|
constructRAIIHandleMemberFunctionVoidGetChain( std::map<std::string, CommandData>::const_iterator commandIt,
|
|
|
|
size_t initialSkipCount,
|
|
|
|
std::map<size_t, size_t> const & vectorParamIndices,
|
2021-05-15 21:26:51 +00:00
|
|
|
std::vector<size_t> const & nonConstPointerParamIndices,
|
|
|
|
bool definition ) const;
|
|
|
|
std::string
|
2021-02-17 09:49:59 +00:00
|
|
|
constructRAIIHandleMemberFunctionVoidGetValue( std::map<std::string, CommandData>::const_iterator commandIt,
|
|
|
|
size_t initialSkipCount,
|
|
|
|
std::map<size_t, size_t> const & vectorParamIndices,
|
2021-05-15 21:26:51 +00:00
|
|
|
std::vector<size_t> const & nonConstPointerParamIndices,
|
|
|
|
bool definition ) const;
|
2021-02-17 09:49:59 +00:00
|
|
|
std::string constructRAIIHandleSingularConstructorArguments(
|
|
|
|
std::pair<std::string, HandleData> const & handle,
|
|
|
|
std::map<std::string, CommandData>::const_iterator constructorIt ) const;
|
|
|
|
std::string constructRAIIHandleVectorSizeCheck( std::string const & name,
|
|
|
|
CommandData const & commandData,
|
|
|
|
size_t initialSkipCount,
|
|
|
|
std::map<size_t, std::vector<size_t>> const & countToVectorMap,
|
|
|
|
std::set<size_t> const & skippedParams ) const;
|
|
|
|
std::string constructRAIIHandleUpgradeConstructor( std::pair<std::string, HandleData> const & handle ) const;
|
2020-10-26 15:16:48 +00:00
|
|
|
std::string constructReturnType( CommandData const & commandData, std::string const & baseType ) const;
|
|
|
|
std::string constructSuccessCheck( std::vector<std::string> const & successCodes ) const;
|
|
|
|
std::string constructSuccessCodeList( std::vector<std::string> const & successCodes ) const;
|
|
|
|
std::string constructVectorSizeCheck( std::string const & name,
|
|
|
|
CommandData const & commandData,
|
2021-02-17 09:49:59 +00:00
|
|
|
size_t initialSkipCount,
|
2020-10-26 15:16:48 +00:00
|
|
|
std::map<size_t, std::vector<size_t>> const & countToVectorMap,
|
|
|
|
std::set<size_t> const & skippedParams ) const;
|
|
|
|
void checkCorrectness();
|
|
|
|
bool containsArray( std::string const & type ) const;
|
|
|
|
bool containsUnion( std::string const & type ) const;
|
|
|
|
size_t determineDefaultStartIndex( std::vector<ParamData> const & params,
|
|
|
|
std::set<size_t> const & skippedParams ) const;
|
|
|
|
std::string determineEnhancedReturnType( CommandData const & commandData,
|
|
|
|
size_t returnParamIndex,
|
|
|
|
bool isStructureChain ) const;
|
2021-05-15 21:26:51 +00:00
|
|
|
size_t determineInitialSkipCount( std::string const & command ) const;
|
2021-02-17 09:49:59 +00:00
|
|
|
std::vector<std::map<std::string, CommandData>::const_iterator>
|
|
|
|
determineRAIIHandleConstructors( std::string const & handleType,
|
2021-04-28 11:35:14 +00:00
|
|
|
std::map<std::string, CommandData>::const_iterator destructorIt,
|
|
|
|
std::set<std::string> & specialFunctions ) const;
|
2021-02-17 09:49:59 +00:00
|
|
|
std::map<std::string, CommandData>::const_iterator
|
|
|
|
determineRAIIHandleDestructor( std::string const & handleType ) const;
|
|
|
|
size_t determineReturnParamIndex( CommandData const & commandData,
|
|
|
|
std::map<size_t, size_t> const & vectorParamIndices,
|
|
|
|
bool twoStep ) const;
|
|
|
|
std::set<size_t> determineSkippedParams( std::vector<ParamData> const & params,
|
|
|
|
size_t initialSkipCount,
|
2020-10-26 15:16:48 +00:00
|
|
|
std::map<size_t, size_t> const & vectorParamIndices,
|
|
|
|
std::vector<size_t> const & returnParamIndex,
|
|
|
|
bool singular ) const;
|
|
|
|
std::string determineSubStruct( std::pair<std::string, StructureData> const & structure ) const;
|
2020-09-17 10:09:43 +00:00
|
|
|
std::vector<size_t> determineConstPointerParamIndices( std::vector<ParamData> const & params ) const;
|
|
|
|
std::vector<size_t> determineNonConstPointerParamIndices( std::vector<ParamData> const & params ) const;
|
2020-09-28 14:34:50 +00:00
|
|
|
std::map<size_t, size_t> determineVectorParamIndicesNew( std::vector<ParamData> const & params ) const;
|
2021-02-17 09:49:59 +00:00
|
|
|
void distributeSecondLevelCommands( std::set<std::string> const & specialFunctions );
|
2020-12-10 16:23:44 +00:00
|
|
|
std::string
|
|
|
|
generateLenInitializer( std::vector<MemberData>::const_iterator mit,
|
|
|
|
std::map<std::vector<MemberData>::const_iterator,
|
|
|
|
std::vector<std::vector<MemberData>::const_iterator>>::const_iterator litit,
|
|
|
|
bool mutualExclusiveLens ) const;
|
2021-04-27 07:06:55 +00:00
|
|
|
std::pair<std::string, std::string> generateProtection( std::string const & referencedIn ) const;
|
2020-05-18 10:02:10 +00:00
|
|
|
std::pair<std::string, std::string> generateProtection( std::string const & type, bool isAliased ) const;
|
2021-04-27 07:06:55 +00:00
|
|
|
std::string generateSizeCheck( std::vector<std::vector<MemberData>::const_iterator> const & arrayIts,
|
|
|
|
std::string const & structName,
|
|
|
|
std::string const & prefix,
|
|
|
|
bool mutualExclusiveLens ) const;
|
|
|
|
std::string getEnumPrefix( int line, std::string const & name, bool bitmask ) const;
|
|
|
|
std::string getPlatform( std::string const & extension ) const;
|
2020-10-07 20:44:44 +00:00
|
|
|
std::pair<std::string, std::string> getPoolTypeAndName( std::string const & type ) const;
|
2020-10-09 09:01:30 +00:00
|
|
|
std::string getVectorSize( std::vector<ParamData> const & params,
|
|
|
|
std::map<size_t, size_t> const & vectorParamIndices,
|
|
|
|
size_t returnParamIndex ) const;
|
2021-03-25 14:28:05 +00:00
|
|
|
bool hasParentHandle( std::string const & handle, std::string const & parent ) const;
|
2020-10-07 20:44:44 +00:00
|
|
|
bool isHandleType( std::string const & type ) const;
|
2020-10-28 09:18:05 +00:00
|
|
|
bool isLenByStructMember( std::string const & name, std::vector<ParamData> const & params ) const;
|
|
|
|
bool isLenByStructMember( std::string const & name, ParamData const & param ) const;
|
2021-02-17 09:49:59 +00:00
|
|
|
bool isMultiSuccessCodeConstructor(
|
|
|
|
std::vector<std::map<std::string, CommandData>::const_iterator> const & constructorIts ) const;
|
2020-10-28 09:18:05 +00:00
|
|
|
bool isParam( std::string const & name, std::vector<ParamData> const & params ) const;
|
2020-10-14 07:25:28 +00:00
|
|
|
bool isStructureChainAnchor( std::string const & type ) const;
|
2020-09-30 08:13:51 +00:00
|
|
|
std::pair<bool, std::map<size_t, std::vector<size_t>>>
|
|
|
|
needsVectorSizeCheck( std::map<size_t, size_t> const & vectorParamIndices ) const;
|
2020-04-12 19:49:12 +00:00
|
|
|
void readBaseType( tinyxml2::XMLElement const * element, std::map<std::string, std::string> const & attributes );
|
|
|
|
void readBitmask( tinyxml2::XMLElement const * element, std::map<std::string, std::string> const & attributes );
|
|
|
|
void readBitmaskAlias( tinyxml2::XMLElement const * element, std::map<std::string, std::string> const & attributes );
|
|
|
|
void readCommand( tinyxml2::XMLElement const * element );
|
|
|
|
void readCommand( tinyxml2::XMLElement const * element, std::map<std::string, std::string> const & attributess );
|
|
|
|
void readCommandAlias( tinyxml2::XMLElement const * element, std::map<std::string, std::string> const & attributes );
|
|
|
|
ParamData readCommandParam( tinyxml2::XMLElement const * element, std::vector<ParamData> const & params );
|
|
|
|
std::pair<std::string, std::string> readCommandProto( tinyxml2::XMLElement const * element );
|
|
|
|
void readCommands( tinyxml2::XMLElement const * element );
|
|
|
|
std::string readComment( tinyxml2::XMLElement const * element );
|
|
|
|
void readDefine( tinyxml2::XMLElement const * element, std::map<std::string, std::string> const & attributes );
|
|
|
|
void readEnum( tinyxml2::XMLElement const * element,
|
|
|
|
EnumData & enumData,
|
|
|
|
bool bitmask,
|
|
|
|
std::string const & prefix,
|
|
|
|
std::string const & postfix );
|
|
|
|
void readEnum( tinyxml2::XMLElement const * element,
|
|
|
|
std::map<std::string, std::string> const & attributes,
|
|
|
|
EnumData & enumData,
|
|
|
|
bool bitmask,
|
|
|
|
std::string const & prefix,
|
|
|
|
std::string const & postfix );
|
|
|
|
void readEnumAlias( tinyxml2::XMLElement const * element,
|
|
|
|
std::map<std::string, std::string> const & attributes,
|
|
|
|
EnumData & enumData,
|
|
|
|
bool bitmask,
|
|
|
|
std::string const & prefix,
|
|
|
|
std::string const & postfix );
|
|
|
|
void readEnumConstant( tinyxml2::XMLElement const * element );
|
|
|
|
void readEnums( tinyxml2::XMLElement const * element );
|
|
|
|
void readExtension( tinyxml2::XMLElement const * element );
|
|
|
|
void readExtensionDisabledCommand( tinyxml2::XMLElement const * element );
|
2021-01-21 21:33:36 +00:00
|
|
|
void readExtensionDisabledRequire( tinyxml2::XMLElement const * element );
|
2020-04-12 19:49:12 +00:00
|
|
|
void readExtensionDisabledType( tinyxml2::XMLElement const * element );
|
2021-04-27 15:19:32 +00:00
|
|
|
void readExtensionRequire( tinyxml2::XMLElement const * element,
|
|
|
|
std::map<std::string, ExtensionData>::iterator extensionIt,
|
|
|
|
std::string const & tag );
|
|
|
|
void readExtensionRequireCommand( tinyxml2::XMLElement const * element,
|
|
|
|
std::map<std::string, ExtensionData>::iterator extensionIt );
|
2021-04-29 08:23:41 +00:00
|
|
|
void readExtensionRequireType( tinyxml2::XMLElement const * element,
|
|
|
|
std::map<std::string, ExtensionData>::iterator extensionIt );
|
2020-04-12 19:49:12 +00:00
|
|
|
void readExtensions( tinyxml2::XMLElement const * element );
|
|
|
|
void readFeature( tinyxml2::XMLElement const * element );
|
2021-04-27 15:19:32 +00:00
|
|
|
void readFeatureRequire( tinyxml2::XMLElement const * element,
|
|
|
|
std::map<std::string, FeatureData>::iterator featureIt );
|
|
|
|
void readFeatureRequireCommand( tinyxml2::XMLElement const * element,
|
|
|
|
std::map<std::string, FeatureData>::iterator featureIt );
|
2021-04-29 08:23:41 +00:00
|
|
|
void readFeatureRequireType( tinyxml2::XMLElement const * element,
|
|
|
|
std::map<std::string, FeatureData>::iterator featureIt );
|
2020-04-12 19:49:12 +00:00
|
|
|
void readFuncpointer( tinyxml2::XMLElement const * element, std::map<std::string, std::string> const & attributes );
|
|
|
|
void readHandle( tinyxml2::XMLElement const * element, std::map<std::string, std::string> const & attributes );
|
2020-05-18 10:02:10 +00:00
|
|
|
std::pair<NameData, TypeInfo> readNameAndType( tinyxml2::XMLElement const * elements );
|
2020-04-12 19:49:12 +00:00
|
|
|
void readPlatform( tinyxml2::XMLElement const * element );
|
|
|
|
void readPlatforms( tinyxml2::XMLElement const * element );
|
|
|
|
void readRegistry( tinyxml2::XMLElement const * element );
|
2021-01-25 15:34:32 +00:00
|
|
|
void readRequireEnum( tinyxml2::XMLElement const * element, std::string const & extension, std::string const & tag );
|
|
|
|
void readRequireEnum( tinyxml2::XMLElement const * element,
|
|
|
|
std::map<std::string, std::string> const & attributes,
|
|
|
|
std::string const & extension,
|
|
|
|
std::string const & tag );
|
|
|
|
void readRequireEnumAlias( tinyxml2::XMLElement const * element,
|
|
|
|
std::map<std::string, std::string> const & attributes,
|
|
|
|
std::string const & tag );
|
2020-04-12 19:49:12 +00:00
|
|
|
void readRequires( tinyxml2::XMLElement const * element, std::map<std::string, std::string> const & attributes );
|
2020-11-02 14:15:35 +00:00
|
|
|
void readSPIRVCapability( tinyxml2::XMLElement const * element );
|
|
|
|
void readSPIRVCapabilityEnable( tinyxml2::XMLElement const * element );
|
|
|
|
void readSPIRVCapabilityEnableExtension( int xmlLine, std::map<std::string, std::string> const & attributes );
|
|
|
|
void readSPIRVCapabilityEnableProperty( int xmlLine, std::map<std::string, std::string> const & attributes );
|
|
|
|
void readSPIRVCapabilityEnableStruct( int xmlLine, std::map<std::string, std::string> const & attributes );
|
|
|
|
void readSPIRVCapabilityEnableVersion( int xmlLine, std::map<std::string, std::string> const & attributes );
|
|
|
|
void readSPIRVCapabilities( tinyxml2::XMLElement const * element );
|
|
|
|
void readSPIRVExtension( tinyxml2::XMLElement const * element );
|
|
|
|
void readSPIRVExtensionEnable( tinyxml2::XMLElement const * element );
|
|
|
|
void readSPIRVExtensions( tinyxml2::XMLElement const * element );
|
2020-04-12 19:49:12 +00:00
|
|
|
void readStruct( tinyxml2::XMLElement const * element,
|
|
|
|
bool isUnion,
|
|
|
|
std::map<std::string, std::string> const & attributes );
|
|
|
|
void readStructAlias( tinyxml2::XMLElement const * element, std::map<std::string, std::string> const & attributes );
|
2020-06-15 06:03:17 +00:00
|
|
|
void readStructMember( tinyxml2::XMLElement const * element, std::vector<MemberData> & members, bool isUnion );
|
2020-04-12 19:49:12 +00:00
|
|
|
void readStructMemberEnum( tinyxml2::XMLElement const * element, MemberData & memberData );
|
|
|
|
void readStructMemberName( tinyxml2::XMLElement const * element,
|
|
|
|
MemberData & memberData,
|
|
|
|
std::vector<MemberData> const & members );
|
|
|
|
void readStructMemberType( tinyxml2::XMLElement const * element, MemberData & memberData );
|
|
|
|
void readTag( tinyxml2::XMLElement const * element );
|
|
|
|
void readTags( tinyxml2::XMLElement const * element );
|
|
|
|
void readType( tinyxml2::XMLElement const * element );
|
|
|
|
void readTypeEnum( tinyxml2::XMLElement const * element, std::map<std::string, std::string> const & attributes );
|
|
|
|
void readTypeInclude( tinyxml2::XMLElement const * element, std::map<std::string, std::string> const & attributes );
|
|
|
|
void readTypes( tinyxml2::XMLElement const * element );
|
|
|
|
void registerDeleter( std::string const & name, std::pair<std::string, CommandData> const & commandData );
|
2021-02-17 09:49:59 +00:00
|
|
|
void renameFunctionParameters();
|
|
|
|
void rescheduleRAIIHandle( std::string & str,
|
|
|
|
std::pair<std::string, HandleData> const & handle,
|
|
|
|
std::set<std::string> & listedHandles,
|
|
|
|
std::set<std::string> const & specialFunctions ) const;
|
2020-04-12 19:49:12 +00:00
|
|
|
void setVulkanLicenseHeader( int line, std::string const & comment );
|
|
|
|
std::string toString( TypeCategory category );
|
2017-12-21 11:40:48 +00:00
|
|
|
|
2020-04-21 12:26:32 +00:00
|
|
|
private:
|
2021-04-29 08:23:41 +00:00
|
|
|
std::map<std::string, BaseTypeData> m_baseTypes;
|
|
|
|
std::map<std::string, BitmaskData> m_bitmasks;
|
|
|
|
std::map<std::string, CommandData> m_commands;
|
|
|
|
std::map<std::string, std::string> m_constants;
|
|
|
|
std::set<std::string> m_defines;
|
|
|
|
std::map<std::string, EnumData> m_enums;
|
|
|
|
std::set<std::string> m_extendedStructs; // structs which are referenced by the structextends tag
|
|
|
|
std::map<std::string, ExtensionData> m_extensions;
|
|
|
|
std::map<int, std::map<std::string, ExtensionData>::const_iterator> m_extensionsByNumber;
|
|
|
|
std::map<std::string, FeatureData> m_features;
|
|
|
|
std::map<std::string, FuncPointerData> m_funcPointers;
|
|
|
|
std::map<std::string, HandleData> m_handles;
|
|
|
|
std::set<std::string> m_includes;
|
|
|
|
std::set<std::string> m_listedTypes;
|
|
|
|
std::set<std::string> m_listingTypes;
|
|
|
|
std::map<std::string, PlatformData> m_platforms;
|
|
|
|
std::map<std::string, std::string> m_structureAliases;
|
|
|
|
std::map<std::string, StructureData> m_structures;
|
|
|
|
std::set<std::string> m_tags;
|
|
|
|
std::map<std::string, TypeData> m_types;
|
|
|
|
std::string m_typesafeCheck;
|
|
|
|
std::string m_version;
|
|
|
|
std::string m_vulkanLicenseHeader;
|
2019-01-09 10:55:11 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
const size_t INVALID_INDEX = (size_t)~0;
|