diff --git a/VulkanHppGenerator.cpp b/VulkanHppGenerator.cpp index 24ab4a6..b7d954b 100644 --- a/VulkanHppGenerator.cpp +++ b/VulkanHppGenerator.cpp @@ -1165,7 +1165,7 @@ void writeVersionCheck(std::ostream & os, std::string const& version) void skipFeatureRequire(tinyxml2::XMLElement const* element) { std::map attributes = getAttributes(element); - checkAttributes(attributes, element->GetLineNum(), { { "name",{} } }, {}); + checkAttributes(attributes, element->GetLineNum(), {}, { { "name",{} } }); checkElements(getChildElements(element), {}); } @@ -1179,7 +1179,7 @@ void skipImplicitExternSyncParams(tinyxml2::XMLElement const* element) void skipTypeEnum(tinyxml2::XMLElement const* element, std::map const& attributes) { - checkAttributes(attributes, element->GetLineNum(), { { "category",{ "enum" } } }, { { "name",{} } }); + checkAttributes(attributes, element->GetLineNum(), { { "category",{ "enum" } } }, { { "alias", {} }, { "name",{} } }); checkElements(getChildElements(element), {}); } @@ -1196,25 +1196,17 @@ void skipTypeInclude(tinyxml2::XMLElement const* element, std::map +void VulkanHppGenerator::checkAlias(std::map const& data, std::string const& name, int line) { - auto aliasIt = m_aliases.find(newName); - if (aliasIt == m_aliases.end()) + if (data.find(name) == data.end()) { - m_aliases.insert(std::make_pair(newName, AliasData(category, aliasName, protect))); - // we have to add the type to the set of vulkan types to ensure that the require type conversion takes place - m_vkTypes.insert(newName); + std::stringstream ss; + ss << line; + std::string lineNumber = ss.str(); - assert(std::find_if(m_dependencies.begin(), m_dependencies.end(), [newName](DependencyData const& dd) {return dd.name == newName; }) == m_dependencies.end()); - m_dependencies.push_back(DependencyData(DependencyData::Category::ALIAS, newName)); - m_dependencies.back().dependencies.insert(aliasName); - } - else - { - assert(aliasIt->second.protect == protect); - auto dependencyIt = std::find_if(m_dependencies.begin(), m_dependencies.end(), [newName](DependencyData const& dd) {return dd.name == newName; }); - assert((dependencyIt != m_dependencies.end()) && (dependencyIt->dependencies.size() == 1) && (dependencyIt->dependencies.find(aliasName) != dependencyIt->dependencies.end())); + assert(false); + throw std::runtime_error("Spec error on line " + lineNumber + ": missing alias <" + name + ">"); } } @@ -1242,36 +1234,18 @@ std::map VulkanHppGenerator::createDefaults() assert(defaultValues.find(dependency.name) == defaultValues.end()); switch (dependency.category) { - case DependencyData::Category::ALIAS: - { - auto aliasIt = m_aliases.find(dependency.name); - switch (aliasIt->second.category) - { - case DependencyData::Category::ENUM: - assert((aliasIt != m_aliases.end()) && (m_enums.find(aliasIt->second.value) != m_enums.end())); - setDefault(dependency.name, defaultValues, m_enums.find(aliasIt->second.value)->second); - break; - case DependencyData::Category::STRUCT: - defaultValues[dependency.name] = dependency.name + "()"; - break; - default: - assert(false); - break; - } - } - break; + case DependencyData::Category::BITMASK: + case DependencyData::Category::HANDLE: + case DependencyData::Category::STRUCT: + case DependencyData::Category::UNION: // just call the default constructor for bitmasks, handles, structs, and unions (which are mapped to classes) + defaultValues[dependency.name] = dependency.name + "()"; + break; case DependencyData::Category::COMMAND: // commands should never be asked for defaults break; case DependencyData::Category::ENUM: assert(m_enums.find(dependency.name) != m_enums.end()); setDefault(dependency.name, defaultValues, m_enums.find(dependency.name)->second); break; - case DependencyData::Category::FLAGS: - case DependencyData::Category::HANDLE: - case DependencyData::Category::STRUCT: - case DependencyData::Category::UNION: // just call the default constructor for flags, structs, and structs (which are mapped to classes) - defaultValues[dependency.name] = dependency.name + "()"; - break; case DependencyData::Category::FUNC_POINTER: // func_pointers default to nullptr defaultValues[dependency.name] = "nullptr"; break; @@ -1579,61 +1553,86 @@ void VulkanHppGenerator::readCommandsCommand(tinyxml2::XMLElement const* element { std::map attributes = getAttributes(element); checkAttributes(attributes, element->GetLineNum(), {}, - { { "cmdbufferlevel",{ "primary", "secondary" } }, + { { "alias", {} }, + { "cmdbufferlevel",{ "primary", "secondary" } }, { "comment",{} }, { "errorcodes",{} }, + { "name", {} }, { "pipeline",{ "compute", "graphics", "transfer" } }, { "queues",{ "compute", "graphics", "sparse_binding", "transfer" } }, { "renderpass",{ "both", "inside", "outside" } }, { "successcodes",{} } }); std::vector children = getChildElements(element); - assert(!children.empty()); - checkElements(children, { "implicitexternsyncparams", "param", "proto" }); CommandData commandData; - - // read the success codes - auto successcodesAttribute = attributes.find("successcodes"); - if (successcodesAttribute != attributes.end()) + auto aliasIt = attributes.find("alias"); + if (aliasIt != attributes.end()) { - commandData.successCodes = tokenize(successcodesAttribute->second, ','); - for (auto & code : commandData.successCodes) - { - std::string tag = findTag(code, m_tags); - // on each success code: prepend 'e', strip "VK_" and a tag, convert it to camel case, and add the tag again - code = std::string("e") + toCamelCase(strip(code, "VK_", tag)) + tag; - } + // for command aliases, create a copy of the aliased command + checkAttributes(attributes, element->GetLineNum(), { { "alias",{} },{ "name",{} } }, {}); // re-check on alias type! + checkElements(children, {}); + + std::string alias = startLowerCase(strip(aliasIt->second, "vk")); + checkAlias(m_commands, alias, element->GetLineNum()); + + auto commandsIt = m_commands.find(alias); + assert(commandsIt != m_commands.end()); + commandData = commandsIt->second; + commandData.fullName = startLowerCase(strip(attributes.find("name")->second, "vk")); + determineReducedName(commandData); + linkCommandToHandle(commandData); + + // add a DependencyData to this name + m_dependencies.push_back(DependencyData(DependencyData::Category::COMMAND, commandData.fullName)); + m_dependencies.back().dependencies.insert(alias); } - - for (auto child : children) + else { - std::string value = child->Value(); - if (value == "param") + checkElements(children, { "implicitexternsyncparams", "param", "proto" }); + + // read the success codes + auto successcodesAttribute = attributes.find("successcodes"); + if (successcodesAttribute != attributes.end()) { - commandData.twoStep |= readCommandParam(child, m_dependencies.back().dependencies, commandData.params); + commandData.successCodes = tokenize(successcodesAttribute->second, ','); + for (auto & code : commandData.successCodes) + { + std::string tag = findTag(code, m_tags); + // on each success code: prepend 'e', strip "VK_" and a tag, convert it to camel case, and add the tag again + code = std::string("e") + toCamelCase(strip(code, "VK_", tag)) + tag; + } } - else if (value == "proto") + + for (auto child : children) { - readCommandProto(child, commandData.returnType, commandData.fullName); - } + std::string value = child->Value(); + if (value == "param") + { + commandData.twoStep |= readCommandParam(child, m_dependencies.back().dependencies, commandData.params); + } + else if (value == "proto") + { + readCommandProto(child, commandData.returnType, commandData.fullName); + } #if !defined(NDEBUG) - else - { - assert(value == "implicitexternsyncparams"); - skipImplicitExternSyncParams(child); - } + else + { + assert(value == "implicitexternsyncparams"); + skipImplicitExternSyncParams(child); + } #endif - } + } - determineReducedName(commandData); - linkCommandToHandle(commandData); - registerDeleter(commandData); - determineVectorParams(commandData); - determineReturnParam(commandData); - determineTemplateParam(commandData); - determineEnhancedReturnType(commandData); - determineSkippedParams(commandData); + determineReducedName(commandData); + linkCommandToHandle(commandData); + registerDeleter(commandData); + determineVectorParams(commandData); + determineReturnParam(commandData); + determineTemplateParam(commandData); + determineEnhancedReturnType(commandData); + determineSkippedParams(commandData); + } // insert the commandData into the commands-map, assert(m_commands.find(commandData.fullName) == m_commands.end()); @@ -1848,119 +1847,22 @@ void VulkanHppGenerator::readEnumsEnum(tinyxml2::XMLElement const* element, Enum void VulkanHppGenerator::readEnumsConstant(tinyxml2::XMLElement const* element) { std::map attributes = getAttributes(element); - checkAttributes(attributes, element->GetLineNum(), { { "name",{} },{ "value",{} } }, { { "comment",{} } }); + checkAttributes(attributes, element->GetLineNum(), { { "name",{} } }, { { "alias", {}}, { "comment",{} }, { "value",{} } }); checkElements(getChildElements(element), {}); std::string name = attributes.find("name")->second; assert(m_constants.find(name) == m_constants.end()); - m_constants[name] = attributes.find("value")->second; -} -void VulkanHppGenerator::readExtensionAlias(tinyxml2::XMLElement const* element, std::string const& protect, std::string const& tag) -{ - std::map attributes = getAttributes(element); - checkAttributes(attributes, element->GetLineNum(), { { "name",{} },{ "value",{} } }, {}); - checkElements(getChildElements(element), {}); - - std::string name = attributes.find("name")->second; - std::string value = attributes.find("value")->second; - - auto commandsIt = m_commands.find(startLowerCase(strip(value, "vk"))); - if (commandsIt != m_commands.end()) + auto aliasIt = attributes.find("alias"); + if (aliasIt != attributes.end()) { - // the alias is on a command -> add a command with that name - CommandData commandData = commandsIt->second; - commandData.fullName = startLowerCase(strip(name, "vk")); - assert(m_commands.find(commandData.fullName) == m_commands.end()); - - determineReducedName(commandData); - m_commands.insert(std::make_pair(commandData.fullName, commandData)); - linkCommandToHandle(commandData); - - // add an empty DependencyData to this name - m_dependencies.push_back(DependencyData(DependencyData::Category::COMMAND, commandData.fullName)); + checkAttributes(attributes, element->GetLineNum(), { {"alias", {}}, { "name", {}} }, {}); // re-check on alias type + checkAlias(m_constants, aliasIt->second, element->GetLineNum()); + m_constants[name] = m_constants.find(aliasIt->second)->second; } else { - auto constantsIt = m_constants.find(value); - if (constantsIt != m_constants.end()) - { - // alias on a constant -> just add it to the set of constants... we're doing nothing with them - auto it = m_constants.find(name); - assert((m_constants.find(name) == m_constants.end()) || (m_constants.find(name)->second == constantsIt->second)); - m_constants[name] = constantsIt->second; - } - else - { - std::string strippedValue = strip(value, "Vk"); - std::string strippedName = strip(name, "Vk"); - - auto enumsIt = m_enums.find(strippedValue); - if (enumsIt != m_enums.end()) - { - // the alias is on an enum -> set the alias, which will map to a using directive - assert(m_enums.find(strippedName) == m_enums.end()); - aliasType(DependencyData::Category::ENUM, enumsIt->first, strippedName, protect); - } - else - { - auto flagsIt = m_flags.find(strippedValue); - if (flagsIt != m_flags.end()) - { - // the alias is on a flags -> set the alias, which will map to a using directive - assert(m_flags.find(strippedName) == m_flags.end()); - assert(flagsIt->second.alias.empty()); - flagsIt->second.alias = strippedName; - - // adjust the generated enum name as well, if it's empty (and therefore auto-generated) - std::string enumName = generateEnumNameForFlags(strippedValue); - std::map::iterator enumsIt = m_enums.find(enumName); - assert(enumsIt != m_enums.end()); - if (enumsIt->second.values.empty()) - { - aliasType(DependencyData::Category::ENUM, enumsIt->first, generateEnumNameForFlags(flagsIt->second.alias), protect); - } - } - else - { - auto handlesIt = m_handles.find(strippedValue); - if (handlesIt != m_handles.end()) - { - assert(m_handles.find(strippedName) == m_handles.end()); - assert(handlesIt->second.protect == protect); - assert(handlesIt->second.alias.empty()); - handlesIt->second.alias = strippedName; - } - else - { - auto structsIt = m_structs.find(strippedValue); - if (structsIt != m_structs.end()) - { - // the alias is on a structure -> set the alias, which will map to a using directive - assert(m_structs.find(strippedName) == m_structs.end()); - aliasType(DependencyData::Category::STRUCT, structsIt->first, strippedName, protect); - } - else - { - // final catch: it has to be an enum value - bool found = false; - for (auto & e : m_enums) - { - auto valueIt = std::find_if(e.second.values.begin(), e.second.values.end(), [&value](EnumValueData const& evd) { return evd.value == value; }); - if (valueIt != e.second.values.end()) - { - assert(std::find_if(e.second.values.begin(), e.second.values.end(), [&name](EnumValueData const& evd) {return evd.value == name; }) == e.second.values.end()); - assert(valueIt->alias.empty()); - valueIt->alias = createEnumValueName(name, e.second.prefix, e.second.postfix, e.second.bitmask, tag); - found = true; - break; - } - } - assert(found); - } - } - } - } - } + checkAttributes(attributes, element->GetLineNum(), { { "name",{} }, { "value", {}} }, { {"comment", {} } }); // re-check on non-alias type + m_constants[name] = attributes.find("value")->second; } } @@ -1983,19 +1885,44 @@ void VulkanHppGenerator::readExtensionCommand(tinyxml2::XMLElement const* elemen void VulkanHppGenerator::readExtensionEnum(tinyxml2::XMLElement const* element, std::string const& tag) { std::map attributes = getAttributes(element); - checkAttributes(attributes, element->GetLineNum(), { { "name",{} } }, { { "bitpos",{} },{ "comment",{} },{ "dir",{ "-" } },{ "extends",{} },{ "offset",{} },{ "value",{} } }); + checkAttributes(attributes, element->GetLineNum(), + { + { "name", {} } + }, + { + { "alias", {} }, + { "bitpos", {} }, + { "comment", {} }, + { "dir", { "-" } }, + { "extends", {} }, + { "extnumber", {} }, + { "offset", {} }, + { "value", {} } + }); checkElements(getChildElements(element), {}); // TODO process enums which don't extend existing enums - auto extendsAttribute = attributes.find("extends"); - if (extendsAttribute != attributes.end()) + auto extendsIt = attributes.find("extends"); + if (extendsIt != attributes.end()) { - std::string extends = strip(extendsAttribute->second, "Vk"); - assert(m_enums.find(extends) != m_enums.end()); - assert((attributes.find("bitpos") != attributes.end()) + (attributes.find("offset") != attributes.end()) + (attributes.find("value") != attributes.end()) == 1); + std::string extends = strip(extendsIt->second, "Vk"); auto enumIt = m_enums.find(extends); assert(enumIt != m_enums.end()); - enumIt->second.addEnumValue(attributes.find("name")->second, tag, m_nameMap); + + auto aliasIt = attributes.find("alias"); + if (aliasIt != attributes.end()) + { + checkAttributes(attributes, element->GetLineNum(), { { "alias", {} }, { "extends", {} }, { "name", {} } }, {}); + 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); + } + else + { + assert((attributes.find("bitpos") != attributes.end()) + (attributes.find("offset") != attributes.end()) + (attributes.find("value") != attributes.end()) == 1); + enumIt->second.addEnumValue(attributes.find("name")->second, tag, m_nameMap); + } } } @@ -2004,17 +1931,13 @@ void VulkanHppGenerator::readExtensionRequire(tinyxml2::XMLElement const* elemen std::map attributes = getAttributes(element); checkAttributes(attributes, element->GetLineNum(), {}, { { "extension",{} },{ "feature",{} } }); std::vector children = getChildElements(element); - checkElements(children, { "alias", "command", "comment", "enum", "type" }); + checkElements(children, { "command", "comment", "enum", "type" }); for (auto child : children) { std::string value = child->Value(); - if (value == "alias") - { - readExtensionAlias(child, protect, tag); - } - else if (value == "command") + if (value == "command") { readExtensionCommand(child, protect); } @@ -2060,6 +1983,7 @@ void VulkanHppGenerator::readExtensionsExtension(tinyxml2::XMLElement const* ele }, { { "author",{} }, + { "comment", {} }, { "contact",{} }, { "platform",{} }, { "protect",{} }, @@ -2126,26 +2050,26 @@ void VulkanHppGenerator::readExtensionType(tinyxml2::XMLElement const* element, if (!protect.empty()) { std::string name = strip(attributes.find("name")->second, "Vk"); - std::map::iterator eit = m_enums.find(name); - if (eit != m_enums.end()) + std::map::iterator bitmasksIt = m_bitmasks.find(name); + if (bitmasksIt != m_bitmasks.end()) { - eit->second.protect = protect; + bitmasksIt->second.protect = protect; + + // if the enum of this flags is auto-generated, protect it as well + std::string enumName = generateEnumNameForFlags(name); + std::map::iterator enumsIt = m_enums.find(enumName); + assert(enumsIt != m_enums.end()); + if (enumsIt->second.values.empty()) + { + enumsIt->second.protect = protect; + } } else { - std::map::iterator fit = m_flags.find(name); - if (fit != m_flags.end()) + std::map::iterator eit = m_enums.find(name); + if (eit != m_enums.end()) { - fit->second.protect = protect; - - // if the enum of this flags is auto-generated, protect it as well - std::string enumName = generateEnumNameForFlags(name); - std::map::iterator eit = m_enums.find(enumName); - assert(eit != m_enums.end()); - if (eit->second.values.empty()) - { - eit->second.protect = protect; - } + eit->second.protect = protect; } else { @@ -2197,7 +2121,7 @@ void VulkanHppGenerator::readFeatureRequire(tinyxml2::XMLElement const* element) std::map attributes = getAttributes(element); checkAttributes(attributes, element->GetLineNum(), {}, { { "comment",{} } }); std::vector children = getChildElements(element); - checkElements(children, { "command", "enum", "type" }); + checkElements(children, { "command", "comment", "enum", "type" }); for (auto child : children) { @@ -2209,7 +2133,7 @@ void VulkanHppGenerator::readFeatureRequire(tinyxml2::XMLElement const* element) #if !defined(NDEBUG) else { - assert((value == "command") || (value == "type")); + assert((value == "command") || (value == "comment") || (value == "type")); skipFeatureRequire(child); } #endif @@ -2219,7 +2143,19 @@ void VulkanHppGenerator::readFeatureRequire(tinyxml2::XMLElement const* element) void VulkanHppGenerator::readFeatureRequireEnum(tinyxml2::XMLElement const* element) { std::map attributes = getAttributes(element); - checkAttributes(attributes, element->GetLineNum(), { { "name",{} } }, { { "bitpos",{} },{ "comment",{} },{ "extends",{} },{ "value",{} } }); + checkAttributes(attributes, element->GetLineNum(), + { + { "name",{} } + }, + { + { "bitpos",{} }, + { "comment",{} }, + { "dir", { "-" } }, + { "extends",{} }, + { "extnumber", {} }, + { "offset", {} }, + { "value",{} } + }); checkElements(getChildElements(element), {}); auto extendsAttribute = attributes.find("extends"); @@ -2361,39 +2297,58 @@ void VulkanHppGenerator::readTypeBasetype(tinyxml2::XMLElement const* element, s void VulkanHppGenerator::readTypeBitmask(tinyxml2::XMLElement const* element, std::map const& attributes) { - checkAttributes(attributes, element->GetLineNum(), { { "category",{ "bitmask" } } }, { { "requires",{} } }); + checkAttributes(attributes, element->GetLineNum(), { { "category", { "bitmask" } } }, { { "alias", {} }, { "name", {}}, { "requires", {} } }); std::vector children = getChildElements(element); - checkOrderedElements(children, { "type", "name" }); - checkEmptyElement(children[0]); - checkEmptyElement(children[1]); - assert(strcmp(children[0]->GetText(), "VkFlags") == 0); - - std::string name = strip(children[1]->GetText(), "Vk"); - - std::string requires; - auto requiresIt = attributes.find("requires"); - if (requiresIt != attributes.end()) + auto aliasIt = attributes.find("alias"); + if (aliasIt != attributes.end()) { - requires = strip(requiresIt->second, "Vk"); + checkAttributes(attributes, element->GetLineNum(), { { "alias", {} }, { "category", {"bitmask"} }, { "name", {} } }, {}); // re-check on alias type! + checkElements(children, {}); + + std::string alias = strip(aliasIt->second, "Vk"); + checkAlias(m_bitmasks, alias, element->GetLineNum()); + + std::string name = strip(attributes.find("name")->second, "Vk"); + + auto bitmasksIt = m_bitmasks.find(alias); + assert((bitmasksIt != m_bitmasks.end()) && bitmasksIt->second.alias.empty()); + bitmasksIt->second.alias = name; } else { - // Generate FlagBits name, add a DependencyData for that name, and add it to the list of enums and vulkan types - requires = generateEnumNameForFlags(name); - m_dependencies.push_back(DependencyData(DependencyData::Category::ENUM, requires)); - m_enums.insert(std::make_pair(requires, EnumData(requires, true))); - m_vkTypes.insert(requires); + checkOrderedElements(children, { "type", "name" }); + checkEmptyElement(children[0]); + checkEmptyElement(children[1]); + + assert(strcmp(children[0]->GetText(), "VkFlags") == 0); + + std::string name = strip(children[1]->GetText(), "Vk"); + + std::string requires; + auto requiresIt = attributes.find("requires"); + if (requiresIt != attributes.end()) + { + requires = strip(requiresIt->second, "Vk"); + } + else + { + // Generate FlagBits name, add a DependencyData for that name, and add it to the list of enums and vulkan types + requires = generateEnumNameForFlags(name); + m_dependencies.push_back(DependencyData(DependencyData::Category::ENUM, requires)); + m_enums.insert(std::make_pair(requires, EnumData(requires, true))); + m_vkTypes.insert(requires); + } + + // add a DependencyData for the bitmask name, with the required type as its first dependency + m_dependencies.push_back(DependencyData(DependencyData::Category::BITMASK, name)); + m_dependencies.back().dependencies.insert(requires); + + m_bitmasks.insert(std::make_pair(name, BitmaskData())); + + assert(m_vkTypes.find(name) == m_vkTypes.end()); + m_vkTypes.insert(name); } - - // add a DependencyData for the bitmask name, with the required type as its first dependency - m_dependencies.push_back(DependencyData(DependencyData::Category::FLAGS, name)); - m_dependencies.back().dependencies.insert(requires); - - m_flags.insert(std::make_pair(name, FlagData())); - - assert(m_vkTypes.find(name) == m_vkTypes.end()); - m_vkTypes.insert(name); } void VulkanHppGenerator::readTypeDefine(tinyxml2::XMLElement const* element, std::map const& attributes) @@ -2454,24 +2409,44 @@ void VulkanHppGenerator::readTypeFuncpointer(tinyxml2::XMLElement const* element void VulkanHppGenerator::readTypeHandle(tinyxml2::XMLElement const* element, std::map const& attributes) { - checkAttributes(attributes, element->GetLineNum(), { { "category",{ "handle" } } }, { { "parent",{} } }); + checkAttributes(attributes, element->GetLineNum(), { { "category",{ "handle" } } }, { { "alias",{} }, { "name",{} }, { "parent",{} } }); std::vector children = getChildElements(element); - checkOrderedElements(children, { "type", "name" }); - checkEmptyElement(children[0]); - checkEmptyElement(children[1]); + + auto aliasIt = attributes.find("alias"); + if (aliasIt != attributes.end()) + { + checkAttributes(attributes, element->GetLineNum(), { { "alias",{} },{ "category",{ "handle" } },{ "name",{} } }, {}); // re-check on alias type! + checkElements(children, {}); + + std::string alias = strip(aliasIt->second, "Vk"); + checkAlias(m_handles, alias, element->GetLineNum()); + + std::string name = strip(attributes.find("name")->second, "Vk"); + + auto handlesIt = m_handles.find(alias); + assert((handlesIt != m_handles.end()) && handlesIt->second.alias.empty()); + handlesIt->second.alias = name; + } + else + { + checkOrderedElements(children, { "type", "name" }); + checkEmptyElement(children[0]); + checkEmptyElement(children[1]); #if !defined(NDEBUG) - std::string type = children[0]->GetText(); - assert((type.find("VK_DEFINE_HANDLE") == 0) || (type.find("VK_DEFINE_NON_DISPATCHABLE_HANDLE") == 0)); + std::string type = children[0]->GetText(); + assert((type.find("VK_DEFINE_HANDLE") == 0) || (type.find("VK_DEFINE_NON_DISPATCHABLE_HANDLE") == 0)); #endif - std::string name = strip(children[1]->GetText(), "Vk"); + std::string name = strip(children[1]->GetText(), "Vk"); - m_dependencies.push_back(DependencyData(DependencyData::Category::HANDLE, name)); - assert(m_vkTypes.find(name) == m_vkTypes.end()); - m_vkTypes.insert(name); - assert(m_handles.find(name) == m_handles.end()); - m_handles[name]; + m_dependencies.push_back(DependencyData(DependencyData::Category::HANDLE, name)); + + assert(m_vkTypes.find(name) == m_vkTypes.end()); + m_vkTypes.insert(name); + assert(m_handles.find(name) == m_handles.end()); + m_handles.insert(std::make_pair(name, HandleData())); + } } void VulkanHppGenerator::readTypeName(tinyxml2::XMLElement const* element, std::map const& attributes) @@ -2515,6 +2490,7 @@ void VulkanHppGenerator::readTypeStruct(tinyxml2::XMLElement const* element, boo { "name",{} } }, { + { "alias", {} }, { "comment",{} }, { "returnedonly",{ "true" } }, { "structextends",{} } @@ -2522,48 +2498,65 @@ void VulkanHppGenerator::readTypeStruct(tinyxml2::XMLElement const* element, boo std::vector children = getChildElements(element); checkElements(children, { "comment", "member" }); - std::string name = strip(attributes.find("name")->second, "Vk"); - - m_dependencies.push_back(DependencyData(isUnion ? DependencyData::Category::UNION : DependencyData::Category::STRUCT, name)); - - assert(m_structs.find(name) == m_structs.end()); - std::map::iterator it = m_structs.insert(std::make_pair(name, StructData())).first; - it->second.returnedOnly = (attributes.find("returnedonly") != attributes.end()); - it->second.isUnion = isUnion; - - auto attributesIt = attributes.find("structextends"); - if (attributesIt != attributes.end()) + auto aliasIt = attributes.find("alias"); + if (aliasIt != attributes.end()) { - std::vector structExtends = tokenize(attributesIt->second, ','); - for (auto const& s : structExtends) - { - assert(s.substr(0, 2) == "Vk"); - std::string strippedName = s.substr(2); - it->second.structExtends.push_back(strippedName); - m_extendedStructs.insert(strippedName); - } - assert(!it->second.structExtends.empty()); + checkAttributes(attributes, element->GetLineNum(), { { "alias", {}}, {"category", {"struct"}}, { "name", {}} }, {}); // re-check on alias type! + + std::string alias = strip(aliasIt->second, "Vk"); + checkAlias(m_structs, alias, element->GetLineNum()); + + std::string name = strip(attributes.find("name")->second, "Vk"); + + auto structsIt = m_structs.find(alias); + assert((structsIt != m_structs.end()) && structsIt->second.alias.empty()); + structsIt->second.alias = name; } - - for (auto child : children) + else { - assert(child->Value()); - std::string value = child->Value(); - if (value == "member") + std::string name = strip(attributes.find("name")->second, "Vk"); + + m_dependencies.push_back(DependencyData(isUnion ? DependencyData::Category::UNION : DependencyData::Category::STRUCT, name)); + + assert(m_structs.find(name) == m_structs.end()); + std::map::iterator it = m_structs.insert(std::make_pair(name, StructData())).first; + it->second.returnedOnly = (attributes.find("returnedonly") != attributes.end()); + it->second.isUnion = isUnion; + + auto attributesIt = attributes.find("structextends"); + if (attributesIt != attributes.end()) { - readTypeStructMember(child, it->second); + std::vector structExtends = tokenize(attributesIt->second, ','); + for (auto const& s : structExtends) + { + assert(s.substr(0, 2) == "Vk"); + std::string strippedName = s.substr(2); + it->second.structExtends.push_back(strippedName); + m_extendedStructs.insert(strippedName); + } + assert(!it->second.structExtends.empty()); } + + for (auto child : children) + { + assert(child->Value()); + std::string value = child->Value(); + if (value == "member") + { + readTypeStructMember(child, it->second); + } #if !defined(NDEBUG) - else - { - assert(value == "comment"); - checkEmptyElement(child); - } + else + { + assert(value == "comment"); + checkEmptyElement(child); + } #endif - } + } - assert(m_vkTypes.find(name) == m_vkTypes.end()); - m_vkTypes.insert(name); + assert(m_vkTypes.find(name) == m_vkTypes.end()); + m_vkTypes.insert(name); + } } void VulkanHppGenerator::readTypeStructMember(tinyxml2::XMLElement const* element, StructData & structData) @@ -2723,6 +2716,35 @@ void VulkanHppGenerator::sortDependencies() m_dependencies.swap(sortedDependencies); } +void VulkanHppGenerator::writeBitmaskToString(std::ostream & os, std::string const& bitmaskName, EnumData const &enumData) +{ + // the helper functions to make strings out of flag values + enterProtect(os, enumData.protect); + os << " VULKAN_HPP_INLINE std::string to_string(" << bitmaskName << (enumData.values.empty() ? ")" : " value)") << std::endl + << " {" << std::endl; + if (enumData.values.empty()) + { + // no flags values in this enum -> return "{}" + os << " return \"{}\";" << std::endl; + } + else + { + os << " if (!value) return \"{}\";" << std::endl + << " std::string result;" << std::endl; + + // 'or' together all the bits in the value + for (auto valuesIt = enumData.values.begin(); valuesIt != enumData.values.end(); ++valuesIt) + { + os << " if (value & " << enumData.name << "::" << valuesIt->name << ") result += \"" << valuesIt->name.substr(1) << " | \";" << std::endl; + } + // cut off the last three characters from the result (being " | ") + os << " return \"{\" + result.substr(0, result.size() - 3) + \"}\";" << std::endl; + } + os << " }" << std::endl; + leaveProtect(os, enumData.protect); + os << std::endl; +} + void VulkanHppGenerator::writeCall(std::ostream & os, CommandData const& commandData, bool firstCall, bool singular) { // get the parameter indices of the counter for vector parameters @@ -3155,35 +3177,6 @@ void VulkanHppGenerator::writeExceptionsForEnum(std::ostream & os, EnumData cons os << std::endl; } -void VulkanHppGenerator::writeFlagsToString(std::ostream & os, std::string const& flagsName, EnumData const &enumData) -{ - // the helper functions to make strings out of flag values - enterProtect(os, enumData.protect); - os << " VULKAN_HPP_INLINE std::string to_string(" << flagsName << (enumData.values.empty() ? ")" : " value)") << std::endl - << " {" << std::endl; - if (enumData.values.empty()) - { - // no flags values in this enum -> return "{}" - os << " return \"{}\";" << std::endl; - } - else - { - os << " if (!value) return \"{}\";" << std::endl - << " std::string result;" << std::endl; - - // 'or' together all the bits in the value - for (auto valuesIt = enumData.values.begin(); valuesIt != enumData.values.end(); ++valuesIt) - { - os << " if (value & " << enumData.name << "::" << valuesIt->name << ") result += \"" << valuesIt->name.substr(1) << " | \";" << std::endl; - } - // cut off the last three characters from the result (being " | ") - os << " return \"{\" + result.substr(0, result.size() - 3) + \"}\";" << std::endl; - } - os << " }" << std::endl; - leaveProtect(os, enumData.protect); - os << std::endl; -} - void VulkanHppGenerator::writeFunction(std::ostream & os, std::string const& indentation, CommandData const& commandData, bool definition, bool enhanced, bool singular, bool unique, bool isStructureChain) { if (enhanced && (!singular || isStructureChain)) @@ -3739,11 +3732,11 @@ void VulkanHppGenerator::writeFunctionHeaderArgumentsEnhanced(std::ostream & os, if (withDefaults && (lastArgument == i)) { // check if the very last argument is a flag without any bits -> provide some empty default for it - std::map::const_iterator flagIt = m_flags.find(commandData.params[i].pureType); - if (flagIt != m_flags.end()) + std::map::const_iterator bitmasksIt = m_bitmasks.find(commandData.params[i].pureType); + if (bitmasksIt != m_bitmasks.end()) { // get the enum corresponding to this flag, to check if it's empty - std::list::const_iterator depIt = std::find_if(m_dependencies.begin(), m_dependencies.end(), [&flagIt](DependencyData const& dd) { return(dd.name == flagIt->first); }); + std::list::const_iterator depIt = std::find_if(m_dependencies.begin(), m_dependencies.end(), [&bitmasksIt](DependencyData const& dd) { return(dd.name == bitmasksIt->first); }); assert((depIt != m_dependencies.end()) && (depIt->dependencies.size() == 1)); std::map::const_iterator enumIt = m_enums.find(*depIt->dependencies.begin()); assert(enumIt != m_enums.end()); @@ -4137,17 +4130,13 @@ void VulkanHppGenerator::writeStructureChainValidation(std::ostream & os, Depend // write out allowed structure chains for (auto extendName : it->second.structExtends) { - // We do not have to generate the templates for aliased structs; - if (m_aliases.find(extendName) == m_aliases.end()) - { - std::map::const_iterator itExtend = m_structs.find(extendName); - assert(itExtend != m_structs.end()); - enterProtect(os, itExtend->second.protect); + std::map::const_iterator itExtend = m_structs.find(extendName); + assert(itExtend != m_structs.end()); + enterProtect(os, itExtend->second.protect); - os << " template <> struct isStructureChainValid<" << extendName << ", " << dependencyData.name << ">{ enum { value = true }; };" << std::endl; + os << " template <> struct isStructureChainValid<" << extendName << ", " << dependencyData.name << ">{ enum { value = true }; };" << std::endl; - leaveProtect(os, itExtend->second.protect); - } + leaveProtect(os, itExtend->second.protect); } leaveProtect(os, it->second.protect); } @@ -4187,27 +4176,65 @@ void VulkanHppGenerator::writeToStringFunctions(std::ostream & os) { switch (it->category) { + case DependencyData::Category::BITMASK: + writeBitmaskToString(os, it->name, m_enums.find(*it->dependencies.begin())->second); + break; case DependencyData::Category::ENUM: assert(m_enums.find(it->name) != m_enums.end()); writeEnumsToString(os, m_enums.find(it->name)->second); break; - case DependencyData::Category::FLAGS: - writeFlagsToString(os, it->name, m_enums.find(*it->dependencies.begin())->second); - break; } } } -void VulkanHppGenerator::writeTypeAlias(std::ostream & os, DependencyData const& dependencyData) +void VulkanHppGenerator::writeTypeBitmask(std::ostream & os, std::string const& bitmaskName, BitmaskData const& bitmaskData, EnumData const& enumData) { - auto aliasIt = m_aliases.find(dependencyData.name); - assert(aliasIt != m_aliases.end()); - assert(((aliasIt->second.category == DependencyData::Category::ENUM) && (m_enums.find(aliasIt->second.value) != m_enums.end())) - || ((aliasIt->second.category == DependencyData::Category::STRUCT) && (m_structs.find(aliasIt->second.value) != m_structs.end()))); + enterProtect(os, bitmaskData.protect); - enterProtect(os, aliasIt->second.protect); - os << " using " << aliasIt->first << " = " << aliasIt->second.value << ";" << std::endl; - leaveProtect(os, aliasIt->second.protect); + // each Flags class is using on the class 'Flags' with the corresponding FlagBits enum as the template parameter + os << " using " << bitmaskName << " = Flags<" << enumData.name << ", Vk" << bitmaskName << ">;" << std::endl; + + std::stringstream allFlags; + for (size_t i = 0; i < enumData.values.size(); i++) + { + if (i != 0) + { + allFlags << " | "; + } + allFlags << "VkFlags(" << enumData.name << "::" << enumData.values[i].name << ")"; + } + + if (!enumData.values.empty()) + { + const std::string templateString = R"( + VULKAN_HPP_INLINE ${bitmaskName} operator|( ${enumName} bit0, ${enumName} bit1 ) + { + return ${bitmaskName}( bit0 ) | bit1; + } + + VULKAN_HPP_INLINE ${bitmaskName} operator~( ${enumName} bits ) + { + return ~( ${bitmaskName}( bits ) ); + } + + template <> struct FlagTraits<${enumName}> + { + enum + { + allFlags = ${allFlags} + }; + }; +)"; + os << replaceWithMap(templateString, { { "bitmaskName", bitmaskName },{ "enumName", enumData.name },{ "allFlags", allFlags.str() } }); + } + + if (!bitmaskData.alias.empty()) + { + os << std::endl + << " using " << bitmaskData.alias << " = " << bitmaskName << ";" << std::endl; + } + + leaveProtect(os, bitmaskData.protect); os << std::endl; } @@ -4281,6 +4308,7 @@ void VulkanHppGenerator::writeTypeCommand(std::ostream & os, std::string const& // and write one or both of them writeStandardOrEnhanced(os, standard.str(), enhanced.str()); + leaveProtect(os, commandData.protect); os << std::endl; } @@ -4311,56 +4339,6 @@ void VulkanHppGenerator::writeTypeEnum(std::ostream & os, EnumData const& enumDa os << std::endl; } -void VulkanHppGenerator::writeTypeFlags(std::ostream & os, std::string const& flagsName, FlagData const& flagData, EnumData const& enumData) -{ - enterProtect(os, flagData.protect); - // each Flags class is using on the class 'Flags' with the corresponding FlagBits enum as the template parameter - os << " using " << flagsName << " = Flags<" << enumData.name << ", Vk" << flagsName << ">;" << std::endl; - - std::stringstream allFlags; - for (size_t i = 0; i < enumData.values.size(); i++) - { - if (i != 0) - { - allFlags << " | "; - } - allFlags << "VkFlags(" << enumData.name << "::" << enumData.values[i].name << ")"; - } - - if (!enumData.values.empty()) - { - const std::string templateString = R"( - VULKAN_HPP_INLINE ${flagsName} operator|( ${enumName} bit0, ${enumName} bit1 ) - { - return ${flagsName}( bit0 ) | bit1; - } - - VULKAN_HPP_INLINE ${flagsName} operator~( ${enumName} bits ) - { - return ~( ${flagsName}( bits ) ); - } - - template <> struct FlagTraits<${enumName}> - { - enum - { - allFlags = ${allFlags} - }; - }; -)"; - os << replaceWithMap(templateString, { { "flagsName", flagsName },{ "enumName", enumData.name },{ "allFlags", allFlags.str() } }); - } - - if (!flagData.alias.empty()) - { - os << std::endl - << " using " << flagData.alias << " = " << flagsName << ";" << std::endl; - } - - leaveProtect(os, flagData.protect); - os << std::endl; -} - void VulkanHppGenerator::writeTypeHandle(std::ostream & os, DependencyData const& dependencyData, HandleData const& handleData) { enterProtect(os, handleData.protect); @@ -4398,7 +4376,7 @@ void VulkanHppGenerator::writeTypeHandle(std::ostream & os, DependencyData const {} VULKAN_HPP_TYPESAFE_EXPLICIT ${className}( Vk${className} ${memberName} ) - : m_${memberName}( ${memberName} ) + : m_${memberName}( ${memberName} ) {} #if defined(VULKAN_HPP_TYPESAFE_CONVERSION) @@ -4471,12 +4449,6 @@ ${commands} { "commands", commands.str() } }); - if (!handleData.alias.empty()) - { - os << " using " << handleData.alias << " = " << dependencyData.name << ";" << std::endl - << std::endl; - } - // then the actual Deleter classes can be listed deleterTypesIt = m_deleterTypes.find(dependencyData.name); if (deleterTypesIt != m_deleterTypes.end()) @@ -4495,6 +4467,12 @@ ${commands} writeTypeCommand(os, " ", cit->second, true); } + if (!handleData.alias.empty()) + { + os << " using " << handleData.alias << " = " << dependencyData.name << ";" << std::endl + << std::endl; + } + leaveProtect(os, handleData.protect); } @@ -4506,8 +4484,9 @@ void VulkanHppGenerator::writeTypes(std::ostream & os, std::mapcategory) { - case DependencyData::Category::ALIAS: - writeTypeAlias(os, *it); + case DependencyData::Category::BITMASK: + assert(m_bitmasks.find(it->name) != m_bitmasks.end()); + writeTypeBitmask(os, it->name, m_bitmasks.find(it->name)->second, m_enums.find(generateEnumNameForFlags(it->name))->second); break; case DependencyData::Category::COMMAND: writeTypeCommand(os, *it); @@ -4516,10 +4495,6 @@ void VulkanHppGenerator::writeTypes(std::ostream & os, std::mapname) != m_enums.end()); writeTypeEnum(os, m_enums.find(it->name)->second); break; - case DependencyData::Category::FLAGS: - assert(m_flags.find(it->name) != m_flags.end()); - writeTypeFlags(os, it->name, m_flags.find(it->name)->second, m_enums.find(generateEnumNameForFlags(it->name))->second); - break; case DependencyData::Category::FUNC_POINTER: case DependencyData::Category::REQUIRED: // skip FUNC_POINTER and REQUIRED, they just needed to be in the dependencies list to resolve dependencies @@ -4636,6 +4611,12 @@ void VulkanHppGenerator::writeTypeStruct(std::ostream & os, DependencyData const os << " };" << std::endl << " static_assert( sizeof( " << dependencyData.name << " ) == sizeof( Vk" << dependencyData.name << " ), \"struct and wrapper have different size!\" );" << std::endl; + if (!it->second.alias.empty()) + { + os << std::endl + << " using " << it->second.alias << " = " << dependencyData.name << ";" << std::endl; + } + leaveProtect(os, it->second.protect); os << std::endl; } diff --git a/VulkanHppGenerator.hpp b/VulkanHppGenerator.hpp index 6e1b40a..f521494 100644 --- a/VulkanHppGenerator.hpp +++ b/VulkanHppGenerator.hpp @@ -27,7 +27,7 @@ class VulkanHppGenerator public: VulkanHppGenerator() { - m_handles[""]; // insert the default "handle" without class (for createInstance, and such) + m_handles.insert(std::make_pair("", HandleData())); // insert the default "handle" without class (for createInstance, and such) } std::map createDefaults(); @@ -52,14 +52,19 @@ class VulkanHppGenerator #endif private: + struct BitmaskData + { + std::string protect; + std::string alias; + }; + struct DependencyData { enum class Category { - ALIAS, + BITMASK, COMMAND, ENUM, - FLAGS, FUNC_POINTER, HANDLE, REQUIRED, @@ -79,19 +84,6 @@ class VulkanHppGenerator std::set forwardDependencies; }; - struct AliasData - { - AliasData(DependencyData::Category c, std::string const& v, std::string const& p) - : category(c) - , value(v) - , protect(p) - {} - - DependencyData::Category category; - std::string value; - std::string protect; - }; - struct ParamData { std::string type; @@ -155,12 +147,6 @@ class VulkanHppGenerator bool bitmask; }; - struct FlagData - { - std::string protect; - std::string alias; - }; - struct HandleData { std::vector commands; @@ -193,6 +179,7 @@ class VulkanHppGenerator std::vector members; std::string protect; std::vector structExtends; + std::string alias; }; #if !defined(NDEBUG) @@ -211,7 +198,7 @@ class VulkanHppGenerator #endif private: - void aliasType(DependencyData::Category category, std::string const& aliasName, std::string const& newName, std::string const& protect); + template void checkAlias(std::map const& data, std::string const& name, int line); bool containsUnion(std::string const& type, std::map const& structs); void determineEnhancedReturnType(CommandData & commandData); void determineReducedName(CommandData & commandData); @@ -228,7 +215,6 @@ class VulkanHppGenerator void readDisabledExtensionRequire(tinyxml2::XMLElement const* element); void readEnumsEnum(tinyxml2::XMLElement const* element, EnumData & enumData, std::string const& tag); void readEnumsConstant(tinyxml2::XMLElement const* element); - void readExtensionAlias(tinyxml2::XMLElement const* element, std::string const& protect, std::string const& tag); void readExtensionCommand(tinyxml2::XMLElement const* element, std::string const& protect); void readExtensionEnum(tinyxml2::XMLElement const* element, std::string const& tag); void readExtensionRequire(tinyxml2::XMLElement const* element, std::string const& protect, std::string const& tag); @@ -248,6 +234,7 @@ class VulkanHppGenerator void readTypeStructMember(tinyxml2::XMLElement const* element, StructData & structData); void registerDeleter(CommandData const& commandData); void setDefault(std::string const& name, std::map & defaultValues, EnumData const& enumData); + void writeBitmaskToString(std::ostream & os, std::string const& flagsName, EnumData const &enumData); void writeCall(std::ostream & os, CommandData const& commandData, bool firstCall, bool singular); void writeCallCountParameter(std::ostream & os, CommandData const& commandData, bool singular, std::map::const_iterator it); void writeCallPlainTypeParameter(std::ostream & os, ParamData const& paramData); @@ -257,7 +244,6 @@ class VulkanHppGenerator void writeDeleterClasses(std::ostream & os, std::pair> const& deleterTypes); void writeDeleterForwardDeclarations(std::ostream &os, std::pair> const& deleterTypes); void writeExceptionsForEnum(std::ostream & os, EnumData const& enumData); - void writeFlagsToString(std::ostream & os, std::string const& flagsName, EnumData const &enumData); void writeFunction(std::ostream & os, std::string const& indentation, CommandData const& commandData, bool definition, bool enhanced, bool singular, bool unique, bool isStructureChain); void writeFunctionBodyEnhanced(std::ostream & os, std::string const& indentation, CommandData const& commandData, bool singular, bool isStructureChain); void writeFunctionBodyEnhanced(std::ostream & os, std::string const& templateString, std::string const& indentation, CommandData const& commandData, bool singular); @@ -282,11 +268,10 @@ class VulkanHppGenerator void writeStructSetter(std::ostream & os, std::string const& structureName, MemberData const& memberData); void writeStructureChainValidation(std::ostream & os, DependencyData const& dependencyData); void writeThrowExceptions(std::ostream& os, EnumData const& enumData); - void writeTypeAlias(std::ostream & os, DependencyData const& dependencyData); + void writeTypeBitmask(std::ostream & os, std::string const& flagsName, BitmaskData const& bitmaskData, EnumData const& enumData); void writeTypeCommand(std::ostream & os, DependencyData const& dependencyData); void writeTypeCommand(std::ostream &os, std::string const& indentation, CommandData const& commandData, bool definition); void writeTypeEnum(std::ostream & os, EnumData const& enumData); - void writeTypeFlags(std::ostream & os, std::string const& flagsName, FlagData const& flagData, EnumData const& enumData); void writeTypeHandle(std::ostream & os, DependencyData const& dependencyData, HandleData const& handle); void writeTypeScalar(std::ostream & os, DependencyData const& dependencyData); void writeTypeStruct(std::ostream & os, DependencyData const& dependencyData, std::map const& defaultValues); @@ -296,7 +281,7 @@ class VulkanHppGenerator #endif private: - std::map m_aliases; + std::map m_bitmasks; std::map m_commands; std::map m_constants; std::set m_defines; @@ -305,7 +290,6 @@ class VulkanHppGenerator std::list m_dependencies; std::map m_enums; std::set m_extendedStructs; // structs which are referenced by the structextends tag - std::map m_flags; std::map m_handles; std::map m_nameMap; std::map m_scalars; diff --git a/vulkan/vulkan.hpp b/vulkan/vulkan.hpp index 005361b..24e2b60 100644 --- a/vulkan/vulkan.hpp +++ b/vulkan/vulkan.hpp @@ -1265,7 +1265,7 @@ namespace VULKAN_HPP_NAMESPACE {} VULKAN_HPP_TYPESAFE_EXPLICIT DeviceMemory( VkDeviceMemory deviceMemory ) - : m_deviceMemory( deviceMemory ) + : m_deviceMemory( deviceMemory ) {} #if defined(VULKAN_HPP_TYPESAFE_CONVERSION) @@ -1332,7 +1332,7 @@ namespace VULKAN_HPP_NAMESPACE {} VULKAN_HPP_TYPESAFE_EXPLICIT CommandPool( VkCommandPool commandPool ) - : m_commandPool( commandPool ) + : m_commandPool( commandPool ) {} #if defined(VULKAN_HPP_TYPESAFE_CONVERSION) @@ -1399,7 +1399,7 @@ namespace VULKAN_HPP_NAMESPACE {} VULKAN_HPP_TYPESAFE_EXPLICIT Buffer( VkBuffer buffer ) - : m_buffer( buffer ) + : m_buffer( buffer ) {} #if defined(VULKAN_HPP_TYPESAFE_CONVERSION) @@ -1466,7 +1466,7 @@ namespace VULKAN_HPP_NAMESPACE {} VULKAN_HPP_TYPESAFE_EXPLICIT BufferView( VkBufferView bufferView ) - : m_bufferView( bufferView ) + : m_bufferView( bufferView ) {} #if defined(VULKAN_HPP_TYPESAFE_CONVERSION) @@ -1533,7 +1533,7 @@ namespace VULKAN_HPP_NAMESPACE {} VULKAN_HPP_TYPESAFE_EXPLICIT Image( VkImage image ) - : m_image( image ) + : m_image( image ) {} #if defined(VULKAN_HPP_TYPESAFE_CONVERSION) @@ -1600,7 +1600,7 @@ namespace VULKAN_HPP_NAMESPACE {} VULKAN_HPP_TYPESAFE_EXPLICIT ImageView( VkImageView imageView ) - : m_imageView( imageView ) + : m_imageView( imageView ) {} #if defined(VULKAN_HPP_TYPESAFE_CONVERSION) @@ -1667,7 +1667,7 @@ namespace VULKAN_HPP_NAMESPACE {} VULKAN_HPP_TYPESAFE_EXPLICIT ShaderModule( VkShaderModule shaderModule ) - : m_shaderModule( shaderModule ) + : m_shaderModule( shaderModule ) {} #if defined(VULKAN_HPP_TYPESAFE_CONVERSION) @@ -1734,7 +1734,7 @@ namespace VULKAN_HPP_NAMESPACE {} VULKAN_HPP_TYPESAFE_EXPLICIT Pipeline( VkPipeline pipeline ) - : m_pipeline( pipeline ) + : m_pipeline( pipeline ) {} #if defined(VULKAN_HPP_TYPESAFE_CONVERSION) @@ -1801,7 +1801,7 @@ namespace VULKAN_HPP_NAMESPACE {} VULKAN_HPP_TYPESAFE_EXPLICIT PipelineLayout( VkPipelineLayout pipelineLayout ) - : m_pipelineLayout( pipelineLayout ) + : m_pipelineLayout( pipelineLayout ) {} #if defined(VULKAN_HPP_TYPESAFE_CONVERSION) @@ -1868,7 +1868,7 @@ namespace VULKAN_HPP_NAMESPACE {} VULKAN_HPP_TYPESAFE_EXPLICIT Sampler( VkSampler sampler ) - : m_sampler( sampler ) + : m_sampler( sampler ) {} #if defined(VULKAN_HPP_TYPESAFE_CONVERSION) @@ -1935,7 +1935,7 @@ namespace VULKAN_HPP_NAMESPACE {} VULKAN_HPP_TYPESAFE_EXPLICIT DescriptorSet( VkDescriptorSet descriptorSet ) - : m_descriptorSet( descriptorSet ) + : m_descriptorSet( descriptorSet ) {} #if defined(VULKAN_HPP_TYPESAFE_CONVERSION) @@ -2002,7 +2002,7 @@ namespace VULKAN_HPP_NAMESPACE {} VULKAN_HPP_TYPESAFE_EXPLICIT DescriptorSetLayout( VkDescriptorSetLayout descriptorSetLayout ) - : m_descriptorSetLayout( descriptorSetLayout ) + : m_descriptorSetLayout( descriptorSetLayout ) {} #if defined(VULKAN_HPP_TYPESAFE_CONVERSION) @@ -2069,7 +2069,7 @@ namespace VULKAN_HPP_NAMESPACE {} VULKAN_HPP_TYPESAFE_EXPLICIT DescriptorPool( VkDescriptorPool descriptorPool ) - : m_descriptorPool( descriptorPool ) + : m_descriptorPool( descriptorPool ) {} #if defined(VULKAN_HPP_TYPESAFE_CONVERSION) @@ -2136,7 +2136,7 @@ namespace VULKAN_HPP_NAMESPACE {} VULKAN_HPP_TYPESAFE_EXPLICIT Fence( VkFence fence ) - : m_fence( fence ) + : m_fence( fence ) {} #if defined(VULKAN_HPP_TYPESAFE_CONVERSION) @@ -2203,7 +2203,7 @@ namespace VULKAN_HPP_NAMESPACE {} VULKAN_HPP_TYPESAFE_EXPLICIT Semaphore( VkSemaphore semaphore ) - : m_semaphore( semaphore ) + : m_semaphore( semaphore ) {} #if defined(VULKAN_HPP_TYPESAFE_CONVERSION) @@ -2270,7 +2270,7 @@ namespace VULKAN_HPP_NAMESPACE {} VULKAN_HPP_TYPESAFE_EXPLICIT Event( VkEvent event ) - : m_event( event ) + : m_event( event ) {} #if defined(VULKAN_HPP_TYPESAFE_CONVERSION) @@ -2337,7 +2337,7 @@ namespace VULKAN_HPP_NAMESPACE {} VULKAN_HPP_TYPESAFE_EXPLICIT QueryPool( VkQueryPool queryPool ) - : m_queryPool( queryPool ) + : m_queryPool( queryPool ) {} #if defined(VULKAN_HPP_TYPESAFE_CONVERSION) @@ -2404,7 +2404,7 @@ namespace VULKAN_HPP_NAMESPACE {} VULKAN_HPP_TYPESAFE_EXPLICIT Framebuffer( VkFramebuffer framebuffer ) - : m_framebuffer( framebuffer ) + : m_framebuffer( framebuffer ) {} #if defined(VULKAN_HPP_TYPESAFE_CONVERSION) @@ -2471,7 +2471,7 @@ namespace VULKAN_HPP_NAMESPACE {} VULKAN_HPP_TYPESAFE_EXPLICIT RenderPass( VkRenderPass renderPass ) - : m_renderPass( renderPass ) + : m_renderPass( renderPass ) {} #if defined(VULKAN_HPP_TYPESAFE_CONVERSION) @@ -2538,7 +2538,7 @@ namespace VULKAN_HPP_NAMESPACE {} VULKAN_HPP_TYPESAFE_EXPLICIT PipelineCache( VkPipelineCache pipelineCache ) - : m_pipelineCache( pipelineCache ) + : m_pipelineCache( pipelineCache ) {} #if defined(VULKAN_HPP_TYPESAFE_CONVERSION) @@ -2605,7 +2605,7 @@ namespace VULKAN_HPP_NAMESPACE {} VULKAN_HPP_TYPESAFE_EXPLICIT ObjectTableNVX( VkObjectTableNVX objectTableNVX ) - : m_objectTableNVX( objectTableNVX ) + : m_objectTableNVX( objectTableNVX ) {} #if defined(VULKAN_HPP_TYPESAFE_CONVERSION) @@ -2672,7 +2672,7 @@ namespace VULKAN_HPP_NAMESPACE {} VULKAN_HPP_TYPESAFE_EXPLICIT IndirectCommandsLayoutNVX( VkIndirectCommandsLayoutNVX indirectCommandsLayoutNVX ) - : m_indirectCommandsLayoutNVX( indirectCommandsLayoutNVX ) + : m_indirectCommandsLayoutNVX( indirectCommandsLayoutNVX ) {} #if defined(VULKAN_HPP_TYPESAFE_CONVERSION) @@ -2739,7 +2739,7 @@ namespace VULKAN_HPP_NAMESPACE {} VULKAN_HPP_TYPESAFE_EXPLICIT DescriptorUpdateTemplateKHR( VkDescriptorUpdateTemplateKHR descriptorUpdateTemplateKHR ) - : m_descriptorUpdateTemplateKHR( descriptorUpdateTemplateKHR ) + : m_descriptorUpdateTemplateKHR( descriptorUpdateTemplateKHR ) {} #if defined(VULKAN_HPP_TYPESAFE_CONVERSION) @@ -2806,7 +2806,7 @@ namespace VULKAN_HPP_NAMESPACE {} VULKAN_HPP_TYPESAFE_EXPLICIT SamplerYcbcrConversionKHR( VkSamplerYcbcrConversionKHR samplerYcbcrConversionKHR ) - : m_samplerYcbcrConversionKHR( samplerYcbcrConversionKHR ) + : m_samplerYcbcrConversionKHR( samplerYcbcrConversionKHR ) {} #if defined(VULKAN_HPP_TYPESAFE_CONVERSION) @@ -2873,7 +2873,7 @@ namespace VULKAN_HPP_NAMESPACE {} VULKAN_HPP_TYPESAFE_EXPLICIT ValidationCacheEXT( VkValidationCacheEXT validationCacheEXT ) - : m_validationCacheEXT( validationCacheEXT ) + : m_validationCacheEXT( validationCacheEXT ) {} #if defined(VULKAN_HPP_TYPESAFE_CONVERSION) @@ -2940,7 +2940,7 @@ namespace VULKAN_HPP_NAMESPACE {} VULKAN_HPP_TYPESAFE_EXPLICIT DisplayKHR( VkDisplayKHR displayKHR ) - : m_displayKHR( displayKHR ) + : m_displayKHR( displayKHR ) {} #if defined(VULKAN_HPP_TYPESAFE_CONVERSION) @@ -3007,7 +3007,7 @@ namespace VULKAN_HPP_NAMESPACE {} VULKAN_HPP_TYPESAFE_EXPLICIT DisplayModeKHR( VkDisplayModeKHR displayModeKHR ) - : m_displayModeKHR( displayModeKHR ) + : m_displayModeKHR( displayModeKHR ) {} #if defined(VULKAN_HPP_TYPESAFE_CONVERSION) @@ -3074,7 +3074,7 @@ namespace VULKAN_HPP_NAMESPACE {} VULKAN_HPP_TYPESAFE_EXPLICIT SurfaceKHR( VkSurfaceKHR surfaceKHR ) - : m_surfaceKHR( surfaceKHR ) + : m_surfaceKHR( surfaceKHR ) {} #if defined(VULKAN_HPP_TYPESAFE_CONVERSION) @@ -3141,7 +3141,7 @@ namespace VULKAN_HPP_NAMESPACE {} VULKAN_HPP_TYPESAFE_EXPLICIT SwapchainKHR( VkSwapchainKHR swapchainKHR ) - : m_swapchainKHR( swapchainKHR ) + : m_swapchainKHR( swapchainKHR ) {} #if defined(VULKAN_HPP_TYPESAFE_CONVERSION) @@ -3208,7 +3208,7 @@ namespace VULKAN_HPP_NAMESPACE {} VULKAN_HPP_TYPESAFE_EXPLICIT DebugReportCallbackEXT( VkDebugReportCallbackEXT debugReportCallbackEXT ) - : m_debugReportCallbackEXT( debugReportCallbackEXT ) + : m_debugReportCallbackEXT( debugReportCallbackEXT ) {} #if defined(VULKAN_HPP_TYPESAFE_CONVERSION) @@ -26802,7 +26802,7 @@ namespace VULKAN_HPP_NAMESPACE {} VULKAN_HPP_TYPESAFE_EXPLICIT CommandBuffer( VkCommandBuffer commandBuffer ) - : m_commandBuffer( commandBuffer ) + : m_commandBuffer( commandBuffer ) {} #if defined(VULKAN_HPP_TYPESAFE_CONVERSION) @@ -27696,7 +27696,7 @@ namespace VULKAN_HPP_NAMESPACE {} VULKAN_HPP_TYPESAFE_EXPLICIT Queue( VkQueue queue ) - : m_queue( queue ) + : m_queue( queue ) {} #if defined(VULKAN_HPP_TYPESAFE_CONVERSION) @@ -27917,7 +27917,7 @@ namespace VULKAN_HPP_NAMESPACE {} VULKAN_HPP_TYPESAFE_EXPLICIT Device( VkDevice device ) - : m_device( device ) + : m_device( device ) {} #if defined(VULKAN_HPP_TYPESAFE_CONVERSION) @@ -31276,7 +31276,7 @@ namespace VULKAN_HPP_NAMESPACE {} VULKAN_HPP_TYPESAFE_EXPLICIT PhysicalDevice( VkPhysicalDevice physicalDevice ) - : m_physicalDevice( physicalDevice ) + : m_physicalDevice( physicalDevice ) {} #if defined(VULKAN_HPP_TYPESAFE_CONVERSION) @@ -32589,7 +32589,7 @@ namespace VULKAN_HPP_NAMESPACE {} VULKAN_HPP_TYPESAFE_EXPLICIT Instance( VkInstance instance ) - : m_instance( instance ) + : m_instance( instance ) {} #if defined(VULKAN_HPP_TYPESAFE_CONVERSION)