Refactor parent member of the vk::raii classes.

This commit is contained in:
asuessenbach 2021-10-20 16:55:30 +02:00
parent 14bfefb209
commit e725ff31bd
4 changed files with 1296 additions and 1236 deletions

View File

@ -48,8 +48,8 @@ int main( int /*argc*/, char ** /*argv*/ )
<< "physicalDevices:\n";
for ( size_t j = 0; j < groupProperties[i].physicalDeviceCount; j++ )
{
vk::raii::PhysicalDevice physicalDevice( static_cast<VkPhysicalDevice>( groupProperties[i].physicalDevices[j] ),
instance.getDispatcher() );
vk::raii::PhysicalDevice physicalDevice(
instance, static_cast<VkPhysicalDevice>( groupProperties[i].physicalDevices[j] ) );
std::cout << "\t\t" << j << " : " << physicalDevice.getProperties().deviceName << "\n";
}
std::cout << "\t"
@ -58,8 +58,8 @@ int main( int /*argc*/, char ** /*argv*/ )
if ( 1 < groupProperties[i].physicalDeviceCount )
{
vk::raii::PhysicalDevice physicalDevice( static_cast<VkPhysicalDevice>( groupProperties[i].physicalDevices[0] ),
instance.getDispatcher() );
vk::raii::PhysicalDevice physicalDevice(
instance, static_cast<VkPhysicalDevice>( groupProperties[i].physicalDevices[0] ) );
// get the QueueFamilyProperties of the first PhysicalDevice
std::vector<vk::QueueFamilyProperties> queueFamilyProperties = physicalDevice.getQueueFamilyProperties();

File diff suppressed because it is too large Load Diff

View File

@ -409,7 +409,7 @@ private:
std::string generateBitmasks( std::vector<RequireData> const & requireData,
std::set<std::string> & listedBitmasks,
std::string const & title ) const;
std::string generateCallArgumentsEnhanced( std::vector<ParamData> const & params,
std::string generateCallArgumentsEnhanced( CommandData const & commandData,
size_t initialSkipCount,
bool nonConstPointerAsNullptr,
std::set<size_t> const & singularParams,
@ -1090,18 +1090,21 @@ private:
std::map<size_t, size_t> 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 ) const;
std::string generateRAIIHandleConstructorArguments( std::pair<std::string, HandleData> const & handle,
std::vector<ParamData> const & params,
std::string generateRAIIHandleConstructorArgument( ParamData const & param,
bool definition,
bool singular,
bool skipLeadingGrandParent,
bool encounteredArgument ) const;
std::string generateRAIIHandleConstructorCallArguments( std::string const & handleType,
std::vector<ParamData> const & params,
bool takesOwnership ) const;
std::string generateRAIIHandleConstructorArguments(
std::pair<std::string, HandleData> const & handle,
std::map<std::string, VulkanHppGenerator::CommandData>::const_iterator constructorIt,
bool singular,
bool takesOwnership ) const;
std::string generateRAIIHandleConstructorCallArguments(
std::pair<std::string, HandleData> const & handle,
std::map<std::string, VulkanHppGenerator::CommandData>::const_iterator constructorIt,
bool nonConstPointerAsNullptr,
std::set<size_t> const & singularParams,
bool allocatorIsMemberVariable,
bool skipLeadingGrandParent ) const;
bool allocatorIsMemberVariable ) const;
std::string generateRAIIHandleConstructorEnumerate( std::pair<std::string, HandleData> const & handle,
std::map<std::string, CommandData>::const_iterator constructorIt,
std::vector<ParamData>::const_iterator handleParamIt,
@ -1109,10 +1112,10 @@ private:
std::string const & enter,
std::string const & leave ) const;
std::string
generateRAIIHandleConstructorInitializationList( std::string const & handleType,
generateRAIIHandleConstructorInitializationList( std::pair<std::string, HandleData> const & handle,
std::map<std::string, CommandData>::const_iterator constructorIt,
std::map<std::string, CommandData>::const_iterator destructorIt,
bool hasSecondLevelCommands ) const;
bool takesOwnership ) const;
std::string generateRAIIHandleConstructorResult( std::pair<std::string, HandleData> const & handle,
std::map<std::string, CommandData>::const_iterator constructorIt,
std::string const & enter,
@ -1136,10 +1139,12 @@ private:
std::string generateRAIIHandleContext( std::pair<std::string, HandleData> const & handle,
std::set<std::string> const & specialFunctions ) const;
std::pair<std::string, std::string>
generateRAIIHandleDestructor( std::string const & handleType,
generateRAIIHandleDestructor( std::string const & parentType,
std::string const & handleType,
std::map<std::string, CommandData>::const_iterator destructorIt,
std::string const & enter ) const;
std::string generateRAIIHandleDestructorCallArguments( std::string const & handleType,
std::string generateRAIIHandleDestructorCallArguments( std::string const & parentType,
std::string const & handleType,
std::vector<ParamData> const & params ) const;
std::tuple<std::string, std::string, std::string, std::string>
generateRAIIHandleDetails( std::pair<std::string, HandleData> const & handle,
@ -1149,7 +1154,6 @@ private:
std::string generateRAIIHandleSingularConstructorArguments(
std::pair<std::string, HandleData> const & handle,
std::map<std::string, CommandData>::const_iterator constructorIt ) const;
std::string generateRAIIHandleUpgradeConstructor( std::pair<std::string, HandleData> const & handle ) const;
std::string generateRAIIHandleVectorSizeCheck( std::string const & name,
CommandData const & commandData,
size_t initialSkipCount,
@ -1188,6 +1192,7 @@ private:
size_t initialSkipCount,
std::map<size_t, std::vector<size_t>> const & countToVectorMap,
std::set<size_t> const & skippedParams ) const;
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,
@ -1292,6 +1297,7 @@ private:
std::set<std::string> const & handleCommands,
std::set<std::string> & listedCommands ) const;
void setVulkanLicenseHeader( int line, std::string const & comment );
bool skipLeadingGrandParent( std::pair<std::string, HandleData> const & handle ) const;
std::string toString( TypeCategory category );
private:

File diff suppressed because it is too large Load Diff