diff --git a/Vulkan-Docs b/Vulkan-Docs index c51545d..e665b9e 160000 --- a/Vulkan-Docs +++ b/Vulkan-Docs @@ -1 +1 @@ -Subproject commit c51545d33f4fd791dc4109d0d338e79b572f6286 +Subproject commit e665b9e6910e54caf754ad1e83aaa500d1de44f3 diff --git a/VulkanHppGenerator.cpp b/VulkanHppGenerator.cpp index 362871d..a645d60 100644 --- a/VulkanHppGenerator.cpp +++ b/VulkanHppGenerator.cpp @@ -2778,7 +2778,7 @@ void VulkanHppGenerator::readTypeStructMember(tinyxml2::XMLElement const* elemen if (child->ToText()) { std::string value = trim(child->Value()); - assert((value == "const") || (value == "struct")); + assert((value == "const") || (value == "struct") || value == "const struct"); member.type = value + " "; child = child->NextSibling(); assert(child); @@ -2876,7 +2876,8 @@ void VulkanHppGenerator::sortDependencies() if (depIt->dependencies.find(it->name) != depIt->dependencies.end()) { // we only have just one case, for now! - assert((it->category == DependencyData::Category::HANDLE) && (depIt->category == DependencyData::Category::STRUCT)); + assert((it->category == DependencyData::Category::HANDLE) && (depIt->category == DependencyData::Category::STRUCT) + || (it->category == DependencyData::Category::STRUCT) && (depIt->category == DependencyData::Category::STRUCT)); it->forwardDependencies.insert(*dit); it->dependencies.erase(*dit); found = true; @@ -4682,13 +4683,20 @@ void VulkanHppGenerator::writeTypeStruct(std::ostream & os, DependencyData const if (it->second.members[i].type == "StructureType") { assert((i == 0) && (it->second.members[i].name == "sType")); - assert(!it->second.members[i].values.empty()); - auto nameIt = m_nameMap.find(it->second.members[i].values); - assert(nameIt != m_nameMap.end()); - os << " private:" << std::endl - << " StructureType sType = " << nameIt->second << ";" << std::endl - << std::endl - << " public:" << std::endl; + if (!it->second.members[i].values.empty()) + { + assert(!it->second.members[i].values.empty()); + auto nameIt = m_nameMap.find(it->second.members[i].values); + assert(nameIt != m_nameMap.end()); + os << " private:" << std::endl + << " StructureType sType = " << nameIt->second << ";" << std::endl + << std::endl + << " public:" << std::endl; + } + else + { + os << " StructureType sType;" << std::endl; + } } else { diff --git a/vulkan/vulkan.hpp b/vulkan/vulkan.hpp index bf96c05..32048b1 100644 --- a/vulkan/vulkan.hpp +++ b/vulkan/vulkan.hpp @@ -36,7 +36,7 @@ # include # define VULKAN_HPP_ASSERT assert #endif -static_assert( VK_HEADER_VERSION == 74 , "Wrong VK_HEADER_VERSION!" ); +static_assert( VK_HEADER_VERSION == 75 , "Wrong VK_HEADER_VERSION!" ); // 32-bit vulkan is not typesafe for handles, so don't allow copy constructors on this platform by default. // To enable this feature on 32-bit platforms please define VULKAN_HPP_TYPESAFE_CONVERSION @@ -38511,6 +38511,92 @@ public: #endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ + struct BaseOutStructure + { + BaseOutStructure( ) + { + } + + BaseOutStructure( VkBaseOutStructure const & rhs ) + { + memcpy( this, &rhs, sizeof( BaseOutStructure ) ); + } + + BaseOutStructure& operator=( VkBaseOutStructure const & rhs ) + { + memcpy( this, &rhs, sizeof( BaseOutStructure ) ); + return *this; + } + BaseOutStructure& setPNext( struct BaseOutStructure* pNext_ ) + { + pNext = pNext_; + return *this; + } + + operator const VkBaseOutStructure&() const + { + return *reinterpret_cast(this); + } + + bool operator==( BaseOutStructure const& rhs ) const + { + return ( sType == rhs.sType ) + && ( pNext == rhs.pNext ); + } + + bool operator!=( BaseOutStructure const& rhs ) const + { + return !operator==( rhs ); + } + + StructureType sType; + struct BaseOutStructure* pNext = nullptr; + }; + static_assert( sizeof( BaseOutStructure ) == sizeof( VkBaseOutStructure ), "struct and wrapper have different size!" ); + + struct BaseInStructure + { + BaseInStructure( ) + { + } + + BaseInStructure( VkBaseInStructure const & rhs ) + { + memcpy( this, &rhs, sizeof( BaseInStructure ) ); + } + + BaseInStructure& operator=( VkBaseInStructure const & rhs ) + { + memcpy( this, &rhs, sizeof( BaseInStructure ) ); + return *this; + } + BaseInStructure& setPNext( const struct BaseInStructure* pNext_ ) + { + pNext = pNext_; + return *this; + } + + operator const VkBaseInStructure&() const + { + return *reinterpret_cast(this); + } + + bool operator==( BaseInStructure const& rhs ) const + { + return ( sType == rhs.sType ) + && ( pNext == rhs.pNext ); + } + + bool operator!=( BaseInStructure const& rhs ) const + { + return !operator==( rhs ); + } + + StructureType sType; + const struct BaseInStructure* pNext = nullptr; + }; + static_assert( sizeof( BaseInStructure ) == sizeof( VkBaseInStructure ), "struct and wrapper have different size!" ); + template <> struct isStructureChainValid{ enum { value = true }; }; template <> struct isStructureChainValid{ enum { value = true }; }; template <> struct isStructureChainValid{ enum { value = true }; };