Gather commands and types per require-block in features and extensions

This commit is contained in:
asuessenbach 2021-07-21 17:09:21 +02:00
parent 710c052892
commit 4a3c6d024d
3 changed files with 600 additions and 519 deletions

File diff suppressed because it is too large Load Diff

View File

@ -171,13 +171,22 @@ private:
int xmlLine;
};
struct RequireData
{
RequireData( int line, std::string const & title_ ) : title( title_ ), xmlLine( line ) {}
std::string title;
std::vector<std::string> commands;
std::vector<std::string> types;
int xmlLine;
};
struct FeatureData
{
FeatureData( std::string const & number_ ) : number( number_ ) {}
std::vector<std::string> commands;
std::string number;
std::vector<std::string> types;
std::vector<RequireData> requireData;
};
struct ExtensionData
@ -196,15 +205,14 @@ private:
, xmlLine( line )
{}
std::vector<std::string> commands;
std::string deprecatedBy;
std::string number;
std::string obsoletedBy;
std::string platform;
std::string promotedTo;
std::map<std::string, int> requirements;
std::vector<std::string> types;
int xmlLine;
std::string deprecatedBy;
std::string number;
std::string obsoletedBy;
std::string platform;
std::string promotedTo;
std::set<std::string> requiresAttribute;
std::vector<RequireData> requireData;
int xmlLine;
};
struct FuncPointerData
@ -308,9 +316,9 @@ private:
private:
void addCommand( std::string const & name, CommandData & commandData );
void addMissingFlagBits( std::vector<std::string> & types, std::string const & referencedIn );
void addMissingFlagBits( std::vector<RequireData> & requireData, std::string const & referencedIn );
std::string addTitleAndProtection( std::string const & str, std::string const & title ) const;
void appendDispatchLoaderDynamicCommands( std::vector<std::string> const & commands,
void appendDispatchLoaderDynamicCommands( std::vector<RequireData> const & requireData,
std::set<std::string> & listedCommands,
std::string const & title,
std::string & commandMembers,
@ -844,7 +852,7 @@ private:
std::map<size_t, std::vector<size_t>> const & countToVectorMap,
std::set<size_t> const & skippedParams ) const;
void checkCorrectness();
void checkEnumCorrectness( std::vector<std::string> const & types ) const;
void checkEnumCorrectness( std::vector<RequireData> const & requireData ) const;
bool containsArray( std::string const & type ) const;
bool containsUnion( std::string const & type ) const;
size_t determineDefaultStartIndex( std::vector<ParamData> const & params,
@ -874,14 +882,14 @@ private:
void distributeSecondLevelCommands( std::set<std::string> const & specialFunctions );
std::string findBaseName( std::string aliasName, std::map<std::string, EnumAliasData> const & aliases ) const;
std::string generateBitmask( std::map<std::string, BitmaskData>::const_iterator bitmaskIt ) const;
std::string generateBitmasks( std::vector<std::string> const & types,
std::string generateBitmasks( std::vector<RequireData> const & requireData,
std::set<std::string> & listedBitmasks,
std::string const & title ) const;
std::string generateCommand( std::string const & name,
CommandData const & commandData,
size_t initialSkipCount,
bool definition ) const;
std::string generateCommandDefinitions( std::vector<std::string> const & commands,
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;
@ -1016,7 +1024,7 @@ private:
std::string generateDispatchLoaderDynamicCommandAssignment( std::string const & commandName,
CommandData const & commandData,
std::string const & firstArg ) const;
std::string generateDispatchLoaderStaticCommands( std::vector<std::string> const & commands,
std::string generateDispatchLoaderStaticCommands( std::vector<RequireData> const & requireData,
std::set<std::string> & listedCommands,
std::string const & title ) const;
std::string generateEnum( std::pair<std::string, EnumData> const & enumData ) const;
@ -1024,7 +1032,7 @@ private:
std::vector<std::string> const & arraySizes,
std::vector<EnumValueData> const & values,
bool bitmask ) const;
std::string generateEnums( std::vector<std::string> const & enums,
std::string generateEnums( std::vector<RequireData> const & requireData,
std::set<std::string> & listedEnums,
std::string const & title ) const;
std::string generateEnumToString( std::pair<std::string, EnumData> const & enumData ) const;
@ -1068,7 +1076,7 @@ private:
bool isTemplateParam ) const;
std::string generateHandle( std::pair<std::string, HandleData> const & handle,
std::set<std::string> & listedHandles ) const;
std::string generateHashStructures( std::vector<std::string> const & types, std::string const & title ) const;
std::string generateHashStructures( std::vector<RequireData> const & requireData, std::string const & title ) const;
std::string
generateLenInitializer( std::vector<MemberData>::const_iterator mit,
std::map<std::vector<MemberData>::const_iterator,
@ -1077,17 +1085,17 @@ private:
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;
std::string generateRAIICommandDefinitions( std::vector<std::string> const & commands,
std::string generateRAIICommandDefinitions( std::vector<RequireData> const & requireData,
std::set<std::string> & listedCommands,
std::string const & title ) const;
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 generateStructExtendsStructs( std::vector<std::string> const & types,
std::string generateStructExtendsStructs( std::vector<RequireData> const & requireData,
std::set<std::string> & listedStructs,
std::string const & title ) const;
std::string getPlatform( std::string const & extension ) 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,
@ -1129,31 +1137,34 @@ private:
void readExtensionDisabledType( tinyxml2::XMLElement const * element );
void readExtensionRequire( tinyxml2::XMLElement const * element,
std::map<std::string, ExtensionData>::iterator extensionIt );
void readExtensionRequireCommand( tinyxml2::XMLElement const * element,
std::map<std::string, ExtensionData>::iterator extensionIt );
void readExtensionRequireType( tinyxml2::XMLElement const * element,
std::map<std::string, ExtensionData>::iterator extensionIt );
void readExtensionRequireCommand( tinyxml2::XMLElement const * element,
std::string const & extensionName,
RequireData & requireData );
void readExtensionRequireType( tinyxml2::XMLElement const * element,
std::string const & extensionName,
RequireData & requireData );
void readExtensions( tinyxml2::XMLElement const * element );
void readFeature( tinyxml2::XMLElement const * element );
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 );
std::map<std::string, FeatureData>::iterator featureIt,
RequireData & requireData );
void readFeatureRequireType( tinyxml2::XMLElement const * element,
std::map<std::string, FeatureData>::iterator featureIt );
std::map<std::string, FeatureData>::iterator featureIt,
RequireData & requireData );
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 );
std::pair<NameData, TypeInfo> readNameAndType( tinyxml2::XMLElement const * elements );
void readPlatform( tinyxml2::XMLElement const * element );
void readPlatforms( tinyxml2::XMLElement const * element );
void readRegistry( tinyxml2::XMLElement const * element );
void readRequireEnum( tinyxml2::XMLElement const * element,
std::map<std::string, ExtensionData>::iterator extensionIt );
void readRequireEnum( tinyxml2::XMLElement const * element,
std::map<std::string, std::string> const & attributes,
std::map<std::string, ExtensionData>::iterator extensionIt );
void readRequireEnumAlias( tinyxml2::XMLElement const * element,
std::map<std::string, std::string> const & attributes );
void readRequireEnum( tinyxml2::XMLElement const * element, std::string const & extensionName );
void readRequireEnum( tinyxml2::XMLElement const * element,
std::map<std::string, std::string> const & attributes,
std::string const & extensionName );
void readRequireEnumAlias( tinyxml2::XMLElement const * element,
std::map<std::string, std::string> const & attributes );
void readRequires( tinyxml2::XMLElement const * element, std::map<std::string, std::string> const & attributes );
void readSPIRVCapability( tinyxml2::XMLElement const * element );
void readSPIRVCapabilityEnable( tinyxml2::XMLElement const * element );
@ -1188,7 +1199,10 @@ private:
std::pair<std::string, HandleData> const & handle,
std::set<std::string> & listedHandles,
std::set<std::string> const & specialFunctions ) const;
void setVulkanLicenseHeader( int line, std::string const & comment );
std::vector<std::string> selectCommandsByHandle( std::vector<RequireData> const & requireData,
std::set<std::string> const & handleCommands,
std::set<std::string> & listedCommands ) const;
void setVulkanLicenseHeader( int line, std::string const & comment );
std::string toString( TypeCategory category );
private:

View File

@ -2835,6 +2835,15 @@ namespace VULKAN_HPP_NAMESPACE
}
}
enum class InstanceCreateFlagBits
{
};
VULKAN_HPP_INLINE std::string to_string( InstanceCreateFlagBits )
{
return "(void)";
}
enum class DeviceQueueCreateFlagBits : VkDeviceQueueCreateFlags
{
eProtected = VK_DEVICE_QUEUE_CREATE_PROTECTED_BIT
@ -2849,6 +2858,15 @@ namespace VULKAN_HPP_NAMESPACE
}
}
enum class DeviceCreateFlagBits
{
};
VULKAN_HPP_INLINE std::string to_string( DeviceCreateFlagBits )
{
return "(void)";
}
enum class PipelineStageFlagBits : VkPipelineStageFlags
{
eTopOfPipe = VK_PIPELINE_STAGE_TOP_OF_PIPE_BIT,
@ -2918,6 +2936,15 @@ namespace VULKAN_HPP_NAMESPACE
}
}
enum class MemoryMapFlagBits : VkMemoryMapFlags
{
};
VULKAN_HPP_INLINE std::string to_string( MemoryMapFlagBits )
{
return "(void)";
}
enum class ImageAspectFlagBits : VkImageAspectFlags
{
eColor = VK_IMAGE_ASPECT_COLOR_BIT,
@ -3001,6 +3028,15 @@ namespace VULKAN_HPP_NAMESPACE
}
}
enum class SemaphoreCreateFlagBits : VkSemaphoreCreateFlags
{
};
VULKAN_HPP_INLINE std::string to_string( SemaphoreCreateFlagBits )
{
return "(void)";
}
enum class EventCreateFlagBits : VkEventCreateFlags
{
eDeviceOnlyKHR = VK_EVENT_CREATE_DEVICE_ONLY_BIT_KHR
@ -3119,6 +3155,15 @@ namespace VULKAN_HPP_NAMESPACE
}
}
enum class QueryPoolCreateFlagBits
{
};
VULKAN_HPP_INLINE std::string to_string( QueryPoolCreateFlagBits )
{
return "(void)";
}
enum class BufferCreateFlagBits : VkBufferCreateFlags
{
eSparseBinding = VK_BUFFER_CREATE_SPARSE_BINDING_BIT,
@ -3223,6 +3268,15 @@ namespace VULKAN_HPP_NAMESPACE
}
}
enum class BufferViewCreateFlagBits : VkBufferViewCreateFlags
{
};
VULKAN_HPP_INLINE std::string to_string( BufferViewCreateFlagBits )
{
return "(void)";
}
enum class ImageLayout
{
eUndefined = VK_IMAGE_LAYOUT_UNDEFINED,
@ -3996,6 +4050,96 @@ namespace VULKAN_HPP_NAMESPACE
}
}
enum class PipelineColorBlendStateCreateFlagBits : VkPipelineColorBlendStateCreateFlags
{
};
VULKAN_HPP_INLINE std::string to_string( PipelineColorBlendStateCreateFlagBits )
{
return "(void)";
}
enum class PipelineDepthStencilStateCreateFlagBits : VkPipelineDepthStencilStateCreateFlags
{
};
VULKAN_HPP_INLINE std::string to_string( PipelineDepthStencilStateCreateFlagBits )
{
return "(void)";
}
enum class PipelineDynamicStateCreateFlagBits : VkPipelineDynamicStateCreateFlags
{
};
VULKAN_HPP_INLINE std::string to_string( PipelineDynamicStateCreateFlagBits )
{
return "(void)";
}
enum class PipelineInputAssemblyStateCreateFlagBits : VkPipelineInputAssemblyStateCreateFlags
{
};
VULKAN_HPP_INLINE std::string to_string( PipelineInputAssemblyStateCreateFlagBits )
{
return "(void)";
}
enum class PipelineLayoutCreateFlagBits : VkPipelineLayoutCreateFlags
{
};
VULKAN_HPP_INLINE std::string to_string( PipelineLayoutCreateFlagBits )
{
return "(void)";
}
enum class PipelineMultisampleStateCreateFlagBits : VkPipelineMultisampleStateCreateFlags
{
};
VULKAN_HPP_INLINE std::string to_string( PipelineMultisampleStateCreateFlagBits )
{
return "(void)";
}
enum class PipelineRasterizationStateCreateFlagBits : VkPipelineRasterizationStateCreateFlags
{
};
VULKAN_HPP_INLINE std::string to_string( PipelineRasterizationStateCreateFlagBits )
{
return "(void)";
}
enum class PipelineTessellationStateCreateFlagBits : VkPipelineTessellationStateCreateFlags
{
};
VULKAN_HPP_INLINE std::string to_string( PipelineTessellationStateCreateFlagBits )
{
return "(void)";
}
enum class PipelineVertexInputStateCreateFlagBits : VkPipelineVertexInputStateCreateFlags
{
};
VULKAN_HPP_INLINE std::string to_string( PipelineVertexInputStateCreateFlagBits )
{
return "(void)";
}
enum class PipelineViewportStateCreateFlagBits : VkPipelineViewportStateCreateFlags
{
};
VULKAN_HPP_INLINE std::string to_string( PipelineViewportStateCreateFlagBits )
{
return "(void)";
}
enum class BorderColor
{
eFloatTransparentBlack = VK_BORDER_COLOR_FLOAT_TRANSPARENT_BLACK,
@ -4178,6 +4322,15 @@ namespace VULKAN_HPP_NAMESPACE
}
}
enum class DescriptorPoolResetFlagBits : VkDescriptorPoolResetFlags
{
};
VULKAN_HPP_INLINE std::string to_string( DescriptorPoolResetFlagBits )
{
return "(void)";
}
enum class AccessFlagBits : VkAccessFlags
{
eIndirectCommandRead = VK_ACCESS_INDIRECT_COMMAND_READ_BIT,
@ -4541,159 +4694,6 @@ namespace VULKAN_HPP_NAMESPACE
}
}
enum class InstanceCreateFlagBits
{
};
VULKAN_HPP_INLINE std::string to_string( InstanceCreateFlagBits )
{
return "(void)";
}
enum class DeviceCreateFlagBits
{
};
VULKAN_HPP_INLINE std::string to_string( DeviceCreateFlagBits )
{
return "(void)";
}
enum class MemoryMapFlagBits : VkMemoryMapFlags
{
};
VULKAN_HPP_INLINE std::string to_string( MemoryMapFlagBits )
{
return "(void)";
}
enum class SemaphoreCreateFlagBits : VkSemaphoreCreateFlags
{
};
VULKAN_HPP_INLINE std::string to_string( SemaphoreCreateFlagBits )
{
return "(void)";
}
enum class QueryPoolCreateFlagBits
{
};
VULKAN_HPP_INLINE std::string to_string( QueryPoolCreateFlagBits )
{
return "(void)";
}
enum class BufferViewCreateFlagBits : VkBufferViewCreateFlags
{
};
VULKAN_HPP_INLINE std::string to_string( BufferViewCreateFlagBits )
{
return "(void)";
}
enum class PipelineColorBlendStateCreateFlagBits : VkPipelineColorBlendStateCreateFlags
{
};
VULKAN_HPP_INLINE std::string to_string( PipelineColorBlendStateCreateFlagBits )
{
return "(void)";
}
enum class PipelineDepthStencilStateCreateFlagBits : VkPipelineDepthStencilStateCreateFlags
{
};
VULKAN_HPP_INLINE std::string to_string( PipelineDepthStencilStateCreateFlagBits )
{
return "(void)";
}
enum class PipelineDynamicStateCreateFlagBits : VkPipelineDynamicStateCreateFlags
{
};
VULKAN_HPP_INLINE std::string to_string( PipelineDynamicStateCreateFlagBits )
{
return "(void)";
}
enum class PipelineInputAssemblyStateCreateFlagBits : VkPipelineInputAssemblyStateCreateFlags
{
};
VULKAN_HPP_INLINE std::string to_string( PipelineInputAssemblyStateCreateFlagBits )
{
return "(void)";
}
enum class PipelineLayoutCreateFlagBits : VkPipelineLayoutCreateFlags
{
};
VULKAN_HPP_INLINE std::string to_string( PipelineLayoutCreateFlagBits )
{
return "(void)";
}
enum class PipelineMultisampleStateCreateFlagBits : VkPipelineMultisampleStateCreateFlags
{
};
VULKAN_HPP_INLINE std::string to_string( PipelineMultisampleStateCreateFlagBits )
{
return "(void)";
}
enum class PipelineRasterizationStateCreateFlagBits : VkPipelineRasterizationStateCreateFlags
{
};
VULKAN_HPP_INLINE std::string to_string( PipelineRasterizationStateCreateFlagBits )
{
return "(void)";
}
enum class PipelineTessellationStateCreateFlagBits : VkPipelineTessellationStateCreateFlags
{
};
VULKAN_HPP_INLINE std::string to_string( PipelineTessellationStateCreateFlagBits )
{
return "(void)";
}
enum class PipelineVertexInputStateCreateFlagBits : VkPipelineVertexInputStateCreateFlags
{
};
VULKAN_HPP_INLINE std::string to_string( PipelineVertexInputStateCreateFlagBits )
{
return "(void)";
}
enum class PipelineViewportStateCreateFlagBits : VkPipelineViewportStateCreateFlags
{
};
VULKAN_HPP_INLINE std::string to_string( PipelineViewportStateCreateFlagBits )
{
return "(void)";
}
enum class DescriptorPoolResetFlagBits : VkDescriptorPoolResetFlags
{
};
VULKAN_HPP_INLINE std::string to_string( DescriptorPoolResetFlagBits )
{
return "(void)";
}
//=== VK_VERSION_1_1 ===
enum class SubgroupFeatureFlagBits : VkSubgroupFeatureFlags
@ -4766,6 +4766,15 @@ namespace VULKAN_HPP_NAMESPACE
}
}
enum class CommandPoolTrimFlagBits : VkCommandPoolTrimFlags
{
};
VULKAN_HPP_INLINE std::string to_string( CommandPoolTrimFlagBits )
{
return "(void)";
}
enum class PointClippingBehavior
{
eAllClipPlanes = VK_POINT_CLIPPING_BEHAVIOR_ALL_CLIP_PLANES,
@ -4874,6 +4883,15 @@ namespace VULKAN_HPP_NAMESPACE
}
}
enum class DescriptorUpdateTemplateCreateFlagBits : VkDescriptorUpdateTemplateCreateFlags
{
};
VULKAN_HPP_INLINE std::string to_string( DescriptorUpdateTemplateCreateFlagBits )
{
return "(void)";
}
enum class ExternalMemoryHandleTypeFlagBits : VkExternalMemoryHandleTypeFlags
{
eOpaqueFd = VK_EXTERNAL_MEMORY_HANDLE_TYPE_OPAQUE_FD_BIT,
@ -5055,24 +5073,6 @@ namespace VULKAN_HPP_NAMESPACE
}
}
enum class CommandPoolTrimFlagBits : VkCommandPoolTrimFlags
{
};
VULKAN_HPP_INLINE std::string to_string( CommandPoolTrimFlagBits )
{
return "(void)";
}
enum class DescriptorUpdateTemplateCreateFlagBits : VkDescriptorUpdateTemplateCreateFlags
{
};
VULKAN_HPP_INLINE std::string to_string( DescriptorUpdateTemplateCreateFlagBits )
{
return "(void)";
}
//=== VK_VERSION_1_2 ===
enum class DriverId