diff --git a/VulkanHppGenerator.cpp b/VulkanHppGenerator.cpp index 926ac99..2eedb47 100644 --- a/VulkanHppGenerator.cpp +++ b/VulkanHppGenerator.cpp @@ -11484,18 +11484,17 @@ std::string VulkanHppGenerator::generateStructConstructors( std::pair( &rhs ) ) {} ${enhancedConstructors} -${popIgnored} )"; std::vector arguments, initializers; @@ -11509,46 +11508,11 @@ ${popIgnored} arguments.push_back( argument ); } - if ( member.deprecated.empty() ) + // gather the initializers; skip members with exactly one legal value + if ( member.value.empty() ) { - // gather the initializers; skip members with exactly one legal value - if ( member.value.empty() ) - { - initializers.push_back( member.name + "{ " + member.name + "_ }" ); - } + initializers.push_back( member.name + "{ " + member.name + "_ }" ); } - else - { - ignores += "detail::ignore( " + member.name + "_ );\n"; - } - } - - std::string pushIgnored, popIgnored; - if ( !ignores.empty() ) - { - pushIgnored = R"( -#if defined( _MSC_VER ) -// no need to ignore this warning with MSVC -#elif defined( __clang__ ) -// no need to ignore this warning with clang -#elif defined( __GNUC__ ) -# pragma GCC diagnostic push -# pragma GCC diagnostic ignored "-Wdeprecated-declarations" -#else -// unknown compiler... just ignore the warnings for yourselves ;) -#endif -)"; - popIgnored = R"( -#if defined( _MSC_VER ) -// no need to ignore this warning with MSVC -#elif defined( __clang__ ) -// no need to ignore this warning with clang -#elif defined( __GNUC__ ) -# pragma GCC diagnostic pop -#else -// unknown compiler... just ignore the warnings for yourselves ;) -#endif -)"; } auto pNextIt = std::ranges::find_if( structData.second.members, []( MemberData const & md ) { return md.name == "pNext"; } ); @@ -11561,10 +11525,7 @@ ${popIgnored} std::string str = replaceWithMap( constructors, { { "arguments", generateList( arguments, "", ", " ) }, { "constexpr", generateConstexprString( structData ) }, - { "copyConstructor", generateStructCopyConstructor( structData ) }, { "enhancedConstructors", structData.second.returnedOnly ? "" : generateStructConstructorsEnhanced( structData ) }, - { "popIgnored", popIgnored }, - { "pushIgnored", pushIgnored }, { "structName", stripPrefix( structData.first, "Vk" ) }, { "ignores", ignores }, { "initializers", generateList( initializers, ": ", ", " ) }, @@ -11828,77 +11789,6 @@ std::string VulkanHppGenerator::generateStructConstructorArgument( MemberData co return str; } -std::string VulkanHppGenerator::generateStructCopyAssignment( std::pair const & structData ) const -{ - std::string copyAssignment; - if ( containsDeprecated( structData.second.members ) ) - { - static const std::string copyAssignmentTemplate = R"(${structName} & operator=( ${structName} const & rhs ) VULKAN_HPP_NOEXCEPT - { - if ( this != &rhs ) - { - ${initializers} - } - return *this; - })"; - - std::vector initializers; - for ( auto const & member : structData.second.members ) - { - if ( member.deprecated.empty() && ( member.type.type != "VkStructureType" ) ) - { - initializers.push_back( member.name + " = rhs." + member.name + ";" ); - } - } - copyAssignment = replaceWithMap( copyAssignmentTemplate, - { { "initializers", generateList( initializers, "", "\n" ) }, { "structName", stripPrefix( structData.first, "Vk" ) } } ); - } - else - { - static const std::string copyAssignmentTemplate = R"( - ${structName} & operator=( ${structName} const & rhs ) VULKAN_HPP_NOEXCEPT = default;)"; - - copyAssignment = replaceWithMap( copyAssignmentTemplate, { { "structName", stripPrefix( structData.first, "Vk" ) } } ); - } - return copyAssignment; -} - -std::string VulkanHppGenerator::generateStructCopyConstructor( std::pair const & structData ) const -{ - std::string copyConstructor; - if ( containsDeprecated( structData.second.members ) ) - { - static const std::string copyConstructorTemplate = R"(${constexpr}${structName}( ${structName} const & rhs ) VULKAN_HPP_NOEXCEPT - ${initializers} - {})"; - - std::vector initializers; - for ( auto const & member : structData.second.members ) - { - if ( member.deprecated.empty() && ( member.type.type != "VkStructureType" ) ) - { - initializers.push_back( member.name + "{ rhs." + member.name + " }" ); - } - } - - copyConstructor = replaceWithMap( copyConstructorTemplate, - { { "constexpr", generateConstexprString( structData ) }, - { "initializers", generateList( initializers, ": ", ", " ) }, - { "structName", stripPrefix( structData.first, "Vk" ) } } ); - } - else - { - static const std::string copyConstructorTemplate = R"( - ${constexpr}${structName}( ${structName} const & rhs ) VULKAN_HPP_NOEXCEPT = default; -)"; - - copyConstructor = replaceWithMap( copyConstructorTemplate, - { { "constexpr", generateConstexprString( structData ) }, { "structName", stripPrefix( structData.first, "Vk" ) } } ); - } - - return copyConstructor; -} - std::string VulkanHppGenerator::generateStructHashStructure( std::pair const & structure, std::set & listedStructs ) const { @@ -12140,10 +12030,10 @@ std::string VulkanHppGenerator::generateStructure( std::pair const & structData ) const; std::string generateStructConstructorsEnhanced( std::pair const & structData ) const; std::string generateStructConstructorArgument( MemberData const & memberData, bool withDefault ) const; - std::string generateStructCopyAssignment( std::pair const & structData ) const; - std::string generateStructCopyConstructor( std::pair const & structData ) const; std::string generateStructHashStructure( std::pair const & structure, std::set & listedStructs ) const; std::string generateStructHashStructures() const; std::string generateStructHashSum( std::string const & structName, std::vector const & members ) const; diff --git a/vulkan/vulkan_structs.hpp b/vulkan/vulkan_structs.hpp index c3f3b84..9c703fe 100644 --- a/vulkan/vulkan_structs.hpp +++ b/vulkan/vulkan_structs.hpp @@ -35997,15 +35997,18 @@ namespace VULKAN_HPP_NAMESPACE #if !defined( VULKAN_HPP_NO_CONSTRUCTORS ) && !defined( VULKAN_HPP_NO_STRUCT_CONSTRUCTORS ) # if defined( _MSC_VER ) -// no need to ignore this warning with MSVC +# pragma warning( push ) +# pragma warning( disable : 4996 ) // 'function': was declared deprecated # elif defined( __clang__ ) -// no need to ignore this warning with clang +# pragma clang diagnostic push +# pragma clang diagnostic ignored "-Wdeprecated-declarations" # elif defined( __GNUC__ ) # pragma GCC diagnostic push # pragma GCC diagnostic ignored "-Wdeprecated-declarations" # else // unknown compiler... just ignore the warnings for yourselves ;) # endif + VULKAN_HPP_CONSTEXPR_17 DeviceCreateInfo( DeviceCreateFlags flags_ = {}, uint32_t queueCreateInfoCount_ = {}, const DeviceQueueCreateInfo * pQueueCreateInfos_ = {}, @@ -36019,24 +36022,15 @@ namespace VULKAN_HPP_NAMESPACE , flags{ flags_ } , queueCreateInfoCount{ queueCreateInfoCount_ } , pQueueCreateInfos{ pQueueCreateInfos_ } + , enabledLayerCount{ enabledLayerCount_ } + , ppEnabledLayerNames{ ppEnabledLayerNames_ } , enabledExtensionCount{ enabledExtensionCount_ } , ppEnabledExtensionNames{ ppEnabledExtensionNames_ } , pEnabledFeatures{ pEnabledFeatures_ } { - detail::ignore( enabledLayerCount_ ); - detail::ignore( ppEnabledLayerNames_ ); } - VULKAN_HPP_CONSTEXPR_17 DeviceCreateInfo( DeviceCreateInfo const & rhs ) VULKAN_HPP_NOEXCEPT - : pNext{ rhs.pNext } - , flags{ rhs.flags } - , queueCreateInfoCount{ rhs.queueCreateInfoCount } - , pQueueCreateInfos{ rhs.pQueueCreateInfos } - , enabledExtensionCount{ rhs.enabledExtensionCount } - , ppEnabledExtensionNames{ rhs.ppEnabledExtensionNames } - , pEnabledFeatures{ rhs.pEnabledFeatures } - { - } + VULKAN_HPP_CONSTEXPR_17 DeviceCreateInfo( DeviceCreateInfo const & rhs ) VULKAN_HPP_NOEXCEPT = default; DeviceCreateInfo( VkDeviceCreateInfo const & rhs ) VULKAN_HPP_NOEXCEPT : DeviceCreateInfo( *reinterpret_cast( &rhs ) ) {} @@ -36059,30 +36053,18 @@ namespace VULKAN_HPP_NAMESPACE } # endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ + DeviceCreateInfo & operator=( DeviceCreateInfo const & rhs ) VULKAN_HPP_NOEXCEPT = default; + # if defined( _MSC_VER ) -// no need to ignore this warning with MSVC +# pragma warning( pop ) # elif defined( __clang__ ) -// no need to ignore this warning with clang +# pragma clang diagnostic pop # elif defined( __GNUC__ ) # pragma GCC diagnostic pop # else // unknown compiler... just ignore the warnings for yourselves ;) # endif - DeviceCreateInfo & operator=( DeviceCreateInfo const & rhs ) VULKAN_HPP_NOEXCEPT - { - if ( this != &rhs ) - { - pNext = rhs.pNext; - flags = rhs.flags; - queueCreateInfoCount = rhs.queueCreateInfoCount; - pQueueCreateInfos = rhs.pQueueCreateInfos; - enabledExtensionCount = rhs.enabledExtensionCount; - ppEnabledExtensionNames = rhs.ppEnabledExtensionNames; - pEnabledFeatures = rhs.pEnabledFeatures; - } - return *this; - } #endif /*VULKAN_HPP_NO_CONSTRUCTORS*/ DeviceCreateInfo & operator=( VkDeviceCreateInfo const & rhs ) VULKAN_HPP_NOEXCEPT