Correct includes in vulkansc-headers. (#1645)

This commit is contained in:
Andreas Süßenbach 2023-08-28 10:21:34 +02:00 committed by GitHub
parent 17fa2b92f7
commit ef0dbd602b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
8 changed files with 49 additions and 43 deletions

View File

@ -304,7 +304,7 @@ void VulkanHppGenerator::generateFormatTraitsHppFile() const
#ifndef VULKAN_FORMAT_TRAITS_HPP #ifndef VULKAN_FORMAT_TRAITS_HPP
# define VULKAN_FORMAT_TRAITS_HPP # define VULKAN_FORMAT_TRAITS_HPP
#include <vulkan/vulkan.hpp> #include <vulkan/${api}.hpp>
namespace VULKAN_HPP_NAMESPACE namespace VULKAN_HPP_NAMESPACE
{ {
@ -313,7 +313,8 @@ ${formatTraits}
#endif #endif
)"; )";
std::string str = replaceWithMap( vulkanFormatTraitsHppTemplate, { { "formatTraits", generateFormatTraits() }, { "licenseHeader", m_vulkanLicenseHeader } } ); std::string str = replaceWithMap( vulkanFormatTraitsHppTemplate,
{ { "api", m_api }, { "formatTraits", generateFormatTraits() }, { "licenseHeader", m_vulkanLicenseHeader } } );
writeToFile( str, vulkan_format_traits_hpp ); writeToFile( str, vulkan_format_traits_hpp );
} }
@ -403,7 +404,7 @@ void VulkanHppGenerator::generateHashHppFile() const
#ifndef VULKAN_HASH_HPP #ifndef VULKAN_HASH_HPP
# define VULKAN_HASH_HPP # define VULKAN_HASH_HPP
#include <vulkan/vulkan.hpp> #include <vulkan/${api}.hpp>
namespace std namespace std
{ {
@ -428,7 +429,8 @@ ${structHashStructures}
)"; )";
std::string str = replaceWithMap( vulkanHandlesHppTemplate, std::string str = replaceWithMap( vulkanHandlesHppTemplate,
{ { "handleHashStructures", generateHandleHashStructures() }, { { "api", m_api },
{ "handleHashStructures", generateHandleHashStructures() },
{ "licenseHeader", m_vulkanLicenseHeader }, { "licenseHeader", m_vulkanLicenseHeader },
{ "structHashStructures", generateStructHashStructures() } } ); { "structHashStructures", generateStructHashStructures() } } );
@ -481,9 +483,9 @@ ${PoolFree}
${baseTypes} ${baseTypes}
} // namespace VULKAN_HPP_NAMESPACE } // namespace VULKAN_HPP_NAMESPACE
#include <vulkan/vulkan_enums.hpp> #include <vulkan/${api}_enums.hpp>
#if !defined( VULKAN_HPP_NO_TO_STRING ) #if !defined( VULKAN_HPP_NO_TO_STRING )
#include <vulkan/vulkan_to_string.hpp> #include <vulkan/${api}_to_string.hpp>
#endif #endif
#ifndef VULKAN_HPP_NO_EXCEPTIONS #ifndef VULKAN_HPP_NO_EXCEPTIONS
@ -509,9 +511,9 @@ ${constexprDefines}
} // namespace VULKAN_HPP_NAMESPACE } // namespace VULKAN_HPP_NAMESPACE
// clang-format off // clang-format off
#include <vulkan/vulkan_handles.hpp> #include <vulkan/${api}_handles.hpp>
#include <vulkan/vulkan_structs.hpp> #include <vulkan/${api}_structs.hpp>
#include <vulkan/vulkan_funcs.hpp> #include <vulkan/${api}_funcs.hpp>
// clang-format on // clang-format on
namespace VULKAN_HPP_NAMESPACE namespace VULKAN_HPP_NAMESPACE
@ -528,7 +530,8 @@ ${DispatchLoaderDynamic}
std::string str = std::string str =
replaceWithMap( vulkanHppTemplate, replaceWithMap( vulkanHppTemplate,
{ { "ArrayProxy", readSnippet( "ArrayProxy.hpp" ) }, { { "api", m_api },
{ "ArrayProxy", readSnippet( "ArrayProxy.hpp" ) },
{ "ArrayProxyNoTemporaries", readSnippet( "ArrayProxyNoTemporaries.hpp" ) }, { "ArrayProxyNoTemporaries", readSnippet( "ArrayProxyNoTemporaries.hpp" ) },
{ "ArrayWrapper1D", readSnippet( "ArrayWrapper1D.hpp" ) }, { "ArrayWrapper1D", readSnippet( "ArrayWrapper1D.hpp" ) },
{ "ArrayWrapper2D", readSnippet( "ArrayWrapper2D.hpp" ) }, { "ArrayWrapper2D", readSnippet( "ArrayWrapper2D.hpp" ) },
@ -576,7 +579,7 @@ void VulkanHppGenerator::generateRAIIHppFile() const
#include <memory> #include <memory>
#include <utility> // std::exchange, std::forward #include <utility> // std::exchange, std::forward
#include <vulkan/vulkan.hpp> #include <vulkan/${api}.hpp>
#if !defined( VULKAN_HPP_RAII_NAMESPACE ) #if !defined( VULKAN_HPP_RAII_NAMESPACE )
# define VULKAN_HPP_RAII_NAMESPACE raii # define VULKAN_HPP_RAII_NAMESPACE raii
@ -609,7 +612,8 @@ ${RAIICommandDefinitions}
)"; )";
std::string str = replaceWithMap( vulkanHandlesHppTemplate, std::string str = replaceWithMap( vulkanHandlesHppTemplate,
{ { "licenseHeader", m_vulkanLicenseHeader }, { { "api", m_api },
{ "licenseHeader", m_vulkanLicenseHeader },
{ "RAIICommandDefinitions", generateRAIICommandDefinitions() }, { "RAIICommandDefinitions", generateRAIICommandDefinitions() },
{ "RAIIDispatchers", generateRAIIDispatchers() }, { "RAIIDispatchers", generateRAIIDispatchers() },
{ "RAIIHandles", generateRAIIHandles() } } ); { "RAIIHandles", generateRAIIHandles() } } );
@ -626,7 +630,7 @@ void VulkanHppGenerator::generateStaticAssertionsHppFile() const
#ifndef VULKAN_STATIC_ASSERTIONS_HPP #ifndef VULKAN_STATIC_ASSERTIONS_HPP
# define VULKAN_STATIC_ASSERTIONS_HPP # define VULKAN_STATIC_ASSERTIONS_HPP
#include <vulkan/vulkan.hpp> #include <vulkan/${api}.hpp>
//========================= //=========================
//=== static_assertions === //=== static_assertions ===
@ -636,8 +640,8 @@ ${staticAssertions}
#endif #endif
)"; )";
std::string str = std::string str = replaceWithMap( vulkanHandlesHppTemplate,
replaceWithMap( vulkanHandlesHppTemplate, { { "licenseHeader", m_vulkanLicenseHeader }, { "staticAssertions", generateStaticAssertions() } } ); { { "api", m_api }, { "licenseHeader", m_vulkanLicenseHeader }, { "staticAssertions", generateStaticAssertions() } } );
writeToFile( str, static_assertions_hpp ); writeToFile( str, static_assertions_hpp );
} }
@ -674,7 +678,7 @@ void VulkanHppGenerator::generateToStringHppFile() const
#ifndef VULKAN_TO_STRING_HPP #ifndef VULKAN_TO_STRING_HPP
# define VULKAN_TO_STRING_HPP # define VULKAN_TO_STRING_HPP
#include <vulkan/vulkan_enums.hpp> #include <vulkan/${api}_enums.hpp>
#if __cpp_lib_format #if __cpp_lib_format
# include <format> // std::format # include <format> // std::format
@ -690,9 +694,11 @@ ${enumsToString}
#endif #endif
)"; )";
std::string str = replaceWithMap( std::string str = replaceWithMap( vulkanHandlesHppTemplate,
vulkanHandlesHppTemplate, { { "api", m_api },
{ { "bitmasksToString", generateBitmasksToString() }, { "enumsToString", generateEnumsToString() }, { "licenseHeader", m_vulkanLicenseHeader } } ); { "bitmasksToString", generateBitmasksToString() },
{ "enumsToString", generateEnumsToString() },
{ "licenseHeader", m_vulkanLicenseHeader } } );
writeToFile( str, vulkan_to_string_hpp ); writeToFile( str, vulkan_to_string_hpp );
} }
@ -705,11 +711,11 @@ void VulkanHppGenerator::generateCppModuleFile() const
std::string const vulkanCppmTemplate = R"(${licenseHeader} std::string const vulkanCppmTemplate = R"(${licenseHeader}
module; module;
#include <vulkan/vulkan.hpp> #include <vulkan/${api}.hpp>
#include <vulkan/vulkan_extension_inspection.hpp> #include <vulkan/${api}_extension_inspection.hpp>
#include <vulkan/vulkan_format_traits.hpp> #include <vulkan/${api}_format_traits.hpp>
#include <vulkan/vulkan_hash.hpp> #include <vulkan/${api}_hash.hpp>
#include <vulkan/vulkan_raii.hpp> #include <vulkan/${api}_raii.hpp>
export module ${api}; export module ${api};
@ -726,10 +732,10 @@ export namespace VULKAN_HPP_NAMESPACE
)"; )";
auto const str = replaceWithMap( vulkanCppmTemplate, auto const str = replaceWithMap( vulkanCppmTemplate,
{ { "licenseHeader", m_vulkanLicenseHeader }, { { "api", m_api },
{ "api", m_api }, { "licenseHeader", m_vulkanLicenseHeader },
{ "usings", generateCppModuleUsings() }, { "raiiUsings", generateCppModuleRaiiUsings() },
{ "raiiUsings", generateCppModuleRaiiUsings() } } ); { "usings", generateCppModuleUsings() } } );
writeToFile( str, vulkan_cppm ); writeToFile( str, vulkan_cppm );
} }

View File

@ -7,11 +7,11 @@
module; module;
#include <vulkan/vulkan.hpp> #include <vulkan/vulkansc.hpp>
#include <vulkan/vulkan_extension_inspection.hpp> #include <vulkan/vulkansc_extension_inspection.hpp>
#include <vulkan/vulkan_format_traits.hpp> #include <vulkan/vulkansc_format_traits.hpp>
#include <vulkan/vulkan_hash.hpp> #include <vulkan/vulkansc_hash.hpp>
#include <vulkan/vulkan_raii.hpp> #include <vulkan/vulkansc_raii.hpp>
export module vulkansc; export module vulkansc;

View File

@ -3805,9 +3805,9 @@ namespace VULKAN_HPP_NAMESPACE
} // namespace VULKAN_HPP_NAMESPACE } // namespace VULKAN_HPP_NAMESPACE
#include <vulkan/vulkan_enums.hpp> #include <vulkan/vulkansc_enums.hpp>
#if !defined( VULKAN_HPP_NO_TO_STRING ) #if !defined( VULKAN_HPP_NO_TO_STRING )
# include <vulkan/vulkan_to_string.hpp> # include <vulkan/vulkansc_to_string.hpp>
#endif #endif
#ifndef VULKAN_HPP_NO_EXCEPTIONS #ifndef VULKAN_HPP_NO_EXCEPTIONS
@ -4434,9 +4434,9 @@ namespace VULKAN_HPP_NAMESPACE
} // namespace VULKAN_HPP_NAMESPACE } // namespace VULKAN_HPP_NAMESPACE
// clang-format off // clang-format off
#include <vulkan/vulkan_handles.hpp> #include <vulkan/vulkansc_handles.hpp>
#include <vulkan/vulkan_structs.hpp> #include <vulkan/vulkansc_structs.hpp>
#include <vulkan/vulkan_funcs.hpp> #include <vulkan/vulkansc_funcs.hpp>
// clang-format on // clang-format on

View File

@ -8,7 +8,7 @@
#ifndef VULKAN_FORMAT_TRAITS_HPP #ifndef VULKAN_FORMAT_TRAITS_HPP
#define VULKAN_FORMAT_TRAITS_HPP #define VULKAN_FORMAT_TRAITS_HPP
#include <vulkan/vulkan.hpp> #include <vulkan/vulkansc.hpp>
namespace VULKAN_HPP_NAMESPACE namespace VULKAN_HPP_NAMESPACE
{ {

View File

@ -8,7 +8,7 @@
#ifndef VULKAN_HASH_HPP #ifndef VULKAN_HASH_HPP
#define VULKAN_HASH_HPP #define VULKAN_HASH_HPP
#include <vulkan/vulkan.hpp> #include <vulkan/vulkansc.hpp>
namespace std namespace std
{ {

View File

@ -10,7 +10,7 @@
#include <memory> #include <memory>
#include <utility> // std::exchange, std::forward #include <utility> // std::exchange, std::forward
#include <vulkan/vulkan.hpp> #include <vulkan/vulkansc.hpp>
#if !defined( VULKAN_HPP_RAII_NAMESPACE ) #if !defined( VULKAN_HPP_RAII_NAMESPACE )
# define VULKAN_HPP_RAII_NAMESPACE raii # define VULKAN_HPP_RAII_NAMESPACE raii

View File

@ -8,7 +8,7 @@
#ifndef VULKAN_STATIC_ASSERTIONS_HPP #ifndef VULKAN_STATIC_ASSERTIONS_HPP
#define VULKAN_STATIC_ASSERTIONS_HPP #define VULKAN_STATIC_ASSERTIONS_HPP
#include <vulkan/vulkan.hpp> #include <vulkan/vulkansc.hpp>
//========================= //=========================
//=== static_assertions === //=== static_assertions ===

View File

@ -8,7 +8,7 @@
#ifndef VULKAN_TO_STRING_HPP #ifndef VULKAN_TO_STRING_HPP
#define VULKAN_TO_STRING_HPP #define VULKAN_TO_STRING_HPP
#include <vulkan/vulkan_enums.hpp> #include <vulkan/vulkansc_enums.hpp>
#if __cpp_lib_format #if __cpp_lib_format
# include <format> // std::format # include <format> // std::format