diff --git a/Vulkan-Docs b/Vulkan-Docs index ff0c233..dd99197 160000 --- a/Vulkan-Docs +++ b/Vulkan-Docs @@ -1 +1 @@ -Subproject commit ff0c2339083b76aba0414afafdb195bba15c78d8 +Subproject commit dd9919749a56177c2eb9b6525c0979722a3c24ff diff --git a/VulkanHppGenerator.cpp b/VulkanHppGenerator.cpp index fb117ce..d241228 100644 --- a/VulkanHppGenerator.cpp +++ b/VulkanHppGenerator.cpp @@ -949,7 +949,7 @@ void checkAttributes(std::map const& attributes, int l auto optionalIt = optional.find(a.first); if (optionalIt == optional.end()) { - std::cerr << "warning: " << "Unknown attribute " + a.first + " in line " + lineNumber + "!"; + std::cerr << "warning: " << "Unknown attribute " + a.first + " in line " + lineNumber + "!" << std::endl; continue; } if (!optionalIt->second.empty()) @@ -1921,7 +1921,7 @@ void VulkanHppGenerator::readDisabledExtensionRequire(tinyxml2::XMLElement const { assert(value == "enum"); std::map attributes = getAttributes(child); - checkAttributes(attributes, child->GetLineNum(), { { "name",{} } }, { { "extends",{} },{ "offset",{} },{ "value",{} } }); + checkAttributes(attributes, child->GetLineNum(), { { "name",{} } }, { { "bitpos", {} }, { "extends",{} },{ "offset",{} },{ "value",{} } }); } } } @@ -2018,10 +2018,20 @@ void VulkanHppGenerator::readEnums(tinyxml2::XMLElement const* element) void VulkanHppGenerator::readEnumsEnum(tinyxml2::XMLElement const* element, EnumData & enumData, std::string const& tag) { std::map attributes = getAttributes(element); - checkAttributes(attributes, element->GetLineNum(), { { "name",{} } }, { { "bitpos",{} },{ "comment",{} },{ "value",{} } }); - assert((attributes.find("bitpos") != attributes.end()) + (attributes.find("value") != attributes.end()) == 1); + checkAttributes(attributes, element->GetLineNum(), { { "name",{} } }, { {"alias", {} }, { "bitpos",{} },{ "comment",{} },{ "value",{} } }); + assert((attributes.find("alias") != attributes.end()) + (attributes.find("bitpos") != attributes.end()) + (attributes.find("value") != attributes.end()) == 1); checkElements(getChildElements(element), {}); - enumData.addEnumValue(attributes.find("name")->second, tag, m_nameMap); + auto aliasIt = attributes.find("alias"); + if (aliasIt != attributes.end()) + { + auto enumIt = std::find_if(enumData.values.begin(), enumData.values.end(), [&aliasIt](EnumValueData const& evd) { return evd.value == aliasIt->second; }); + assert((enumIt != enumData.values.end()) && enumIt->alias.empty()); + enumIt->alias = createEnumValueName(attributes.find("name")->second, enumData.prefix, enumData.postfix, enumData.bitmask, tag); + } + else + { + enumData.addEnumValue(attributes.find("name")->second, tag, m_nameMap); + } } void VulkanHppGenerator::readEnumsConstant(tinyxml2::XMLElement const* element) @@ -2092,11 +2102,16 @@ void VulkanHppGenerator::readExtensionEnum(tinyxml2::XMLElement const* element, auto aliasIt = attributes.find("alias"); if (aliasIt != attributes.end()) { - checkAttributes(attributes, element->GetLineNum(), { { "alias", {} }, { "extends", {} }, { "name", {} } }, {}); + checkAttributes(attributes, element->GetLineNum(), { { "alias", {} }, { "extends", {} }, { "name", {} } }, { { "comment",{} } }); std::string alias = createEnumValueName(aliasIt->second, enumIt->second.prefix, enumIt->second.postfix, enumIt->second.bitmask, tag); auto evdIt = std::find_if(enumIt->second.values.begin(), enumIt->second.values.end(), [&alias](EnumValueData const& evd) { return evd.name == alias; }); assert(evdIt != enumIt->second.values.end()); evdIt->alias = createEnumValueName(attributes.find("name")->second, enumIt->second.prefix, enumIt->second.postfix, enumIt->second.bitmask, tag); + if (evdIt->name == evdIt->alias) + { + // skip alias, that would result in the very same enum name + evdIt->alias.clear(); + } } else { diff --git a/vulkan/vulkan.hpp b/vulkan/vulkan.hpp index 82b6058..4832cd1 100644 --- a/vulkan/vulkan.hpp +++ b/vulkan/vulkan.hpp @@ -70,7 +70,7 @@ #undef MemoryBarrier #endif -static_assert( VK_HEADER_VERSION == 82 , "Wrong VK_HEADER_VERSION!" ); +static_assert( VK_HEADER_VERSION == 83 , "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 @@ -8676,6 +8676,7 @@ public: eAndroidSurfaceCreateInfoKHR = VK_STRUCTURE_TYPE_ANDROID_SURFACE_CREATE_INFO_KHR, eWin32SurfaceCreateInfoKHR = VK_STRUCTURE_TYPE_WIN32_SURFACE_CREATE_INFO_KHR, eDebugReportCallbackCreateInfoEXT = VK_STRUCTURE_TYPE_DEBUG_REPORT_CALLBACK_CREATE_INFO_EXT, + eDebugReportCreateInfoEXT = VK_STRUCTURE_TYPE_DEBUG_REPORT_CALLBACK_CREATE_INFO_EXT, ePipelineRasterizationStateRasterizationOrderAMD = VK_STRUCTURE_TYPE_PIPELINE_RASTERIZATION_STATE_RASTERIZATION_ORDER_AMD, eDebugMarkerObjectNameInfoEXT = VK_STRUCTURE_TYPE_DEBUG_MARKER_OBJECT_NAME_INFO_EXT, eDebugMarkerObjectTagInfoEXT = VK_STRUCTURE_TYPE_DEBUG_MARKER_OBJECT_TAG_INFO_EXT, @@ -24776,6 +24777,7 @@ public: enum class ColorSpaceKHR { eSrgbNonlinear = VK_COLOR_SPACE_SRGB_NONLINEAR_KHR, + eVkColorspaceSrgbNonlinear = VK_COLOR_SPACE_SRGB_NONLINEAR_KHR, eDisplayP3NonlinearEXT = VK_COLOR_SPACE_DISPLAY_P3_NONLINEAR_EXT, eExtendedSrgbLinearEXT = VK_COLOR_SPACE_EXTENDED_SRGB_LINEAR_EXT, eDciP3LinearEXT = VK_COLOR_SPACE_DCI_P3_LINEAR_EXT, @@ -25385,11 +25387,13 @@ public: eSurfaceKhr = VK_DEBUG_REPORT_OBJECT_TYPE_SURFACE_KHR_EXT, eSwapchainKhr = VK_DEBUG_REPORT_OBJECT_TYPE_SWAPCHAIN_KHR_EXT, eDebugReportCallbackExt = VK_DEBUG_REPORT_OBJECT_TYPE_DEBUG_REPORT_CALLBACK_EXT_EXT, + eDebugReport = VK_DEBUG_REPORT_OBJECT_TYPE_DEBUG_REPORT_CALLBACK_EXT_EXT, eDisplayKhr = VK_DEBUG_REPORT_OBJECT_TYPE_DISPLAY_KHR_EXT, eDisplayModeKhr = VK_DEBUG_REPORT_OBJECT_TYPE_DISPLAY_MODE_KHR_EXT, eObjectTableNvx = VK_DEBUG_REPORT_OBJECT_TYPE_OBJECT_TABLE_NVX_EXT, eIndirectCommandsLayoutNvx = VK_DEBUG_REPORT_OBJECT_TYPE_INDIRECT_COMMANDS_LAYOUT_NVX_EXT, eValidationCacheExt = VK_DEBUG_REPORT_OBJECT_TYPE_VALIDATION_CACHE_EXT_EXT, + eValidationCache = VK_DEBUG_REPORT_OBJECT_TYPE_VALIDATION_CACHE_EXT_EXT, eSamplerYcbcrConversion = VK_DEBUG_REPORT_OBJECT_TYPE_SAMPLER_YCBCR_CONVERSION_EXT, eSamplerYcbcrConversionKHR = VK_DEBUG_REPORT_OBJECT_TYPE_SAMPLER_YCBCR_CONVERSION_EXT, eDescriptorUpdateTemplate = VK_DEBUG_REPORT_OBJECT_TYPE_DESCRIPTOR_UPDATE_TEMPLATE_EXT,