From 39c8c02de00e93aa65fbb5840f7cded1e71b2aab Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andreas=20S=C3=BC=C3=9Fenbach?= Date: Mon, 18 Sep 2023 18:03:18 +0200 Subject: [PATCH] Make the tag on constants uppercase. (#1657) --- VulkanHppGenerator.cpp | 9 +++++---- vulkan/vulkan.cppm | 24 ++++++++++++------------ vulkan/vulkan.hpp | 24 ++++++++++++------------ 3 files changed, 29 insertions(+), 28 deletions(-) diff --git a/VulkanHppGenerator.cpp b/VulkanHppGenerator.cpp index e1ec0ec..bf4ae8e 100644 --- a/VulkanHppGenerator.cpp +++ b/VulkanHppGenerator.cpp @@ -572,8 +572,7 @@ ${macros} std::string str = replaceWithMap( macrosTemplate, - { { "licenseHeader", m_vulkanLicenseHeader }, - { "macros", replaceWithMap( readSnippet( "macros.hpp" ), { { "vulkan_hpp", m_api + ".hpp" } } ) } } ); + { { "licenseHeader", m_vulkanLicenseHeader }, { "macros", replaceWithMap( readSnippet( "macros.hpp" ), { { "vulkan_hpp", m_api + ".hpp" } } ) } } ); writeToFile( str, macros_hpp ); } @@ -4775,9 +4774,10 @@ std::string VulkanHppGenerator::generateConstexprDefines() const constIt = m_constants.find( aliasIt->second.name ); assert( constIt != m_constants.end() ); } + std::string tag = findTag( constant ); constants += replaceWithMap( constexprValueTemplate, { { "type", constIt->second.type }, - { "constName", stripPrefix( toCamelCase( constant ), "Vk" ) }, + { "constName", stripPrefix( toCamelCase( stripPostfix( constant, tag ) ), "Vk" ) + tag }, { "deprecated", "" }, { "value", constant } } ); listedConstants.insert( constant ); @@ -4907,7 +4907,8 @@ std::string VulkanHppGenerator::generateConstexprUsings() const constIt = m_constants.find( aliasIt->second.name ); assert( constIt != m_constants.end() ); } - constants += replaceWithMap( constexprUsingTemplate, { { "constName", stripPrefix( toCamelCase( constant ), "Vk" ) } } ); + std::string tag = findTag( constant ); + constants += replaceWithMap( constexprUsingTemplate, { { "constName", stripPrefix( toCamelCase( stripPostfix( constant, tag ) ), "Vk" ) + tag } } ); listedConstants.insert( constant ); } } diff --git a/vulkan/vulkan.cppm b/vulkan/vulkan.cppm index f4d26a3..7ff79b5 100644 --- a/vulkan/vulkan.cppm +++ b/vulkan/vulkan.cppm @@ -933,40 +933,40 @@ export namespace VULKAN_HPP_NAMESPACE using VULKAN_HPP_NAMESPACE::MaxDriverNameSize; //=== VK_KHR_device_group_creation === - using VULKAN_HPP_NAMESPACE::MaxDeviceGroupSizeKhr; + using VULKAN_HPP_NAMESPACE::MaxDeviceGroupSizeKHR; //=== VK_KHR_external_memory_capabilities === - using VULKAN_HPP_NAMESPACE::LuidSizeKhr; + using VULKAN_HPP_NAMESPACE::LuidSizeKHR; //=== VK_KHR_external_memory === - using VULKAN_HPP_NAMESPACE::QueueFamilyExternalKhr; + using VULKAN_HPP_NAMESPACE::QueueFamilyExternalKHR; #if defined( VK_ENABLE_BETA_EXTENSIONS ) //=== VK_AMDX_shader_enqueue === - using VULKAN_HPP_NAMESPACE::ShaderIndexUnusedAmdx; + using VULKAN_HPP_NAMESPACE::ShaderIndexUnusedAMDX; #endif /*VK_ENABLE_BETA_EXTENSIONS*/ //=== VK_KHR_ray_tracing_pipeline === - using VULKAN_HPP_NAMESPACE::ShaderUnusedKhr; + using VULKAN_HPP_NAMESPACE::ShaderUnusedKHR; //=== VK_NV_ray_tracing === - using VULKAN_HPP_NAMESPACE::ShaderUnusedNv; + using VULKAN_HPP_NAMESPACE::ShaderUnusedNV; //=== VK_KHR_global_priority === - using VULKAN_HPP_NAMESPACE::MaxGlobalPrioritySizeKhr; + using VULKAN_HPP_NAMESPACE::MaxGlobalPrioritySizeKHR; //=== VK_KHR_driver_properties === - using VULKAN_HPP_NAMESPACE::MaxDriverInfoSizeKhr; - using VULKAN_HPP_NAMESPACE::MaxDriverNameSizeKhr; + using VULKAN_HPP_NAMESPACE::MaxDriverInfoSizeKHR; + using VULKAN_HPP_NAMESPACE::MaxDriverNameSizeKHR; //=== VK_EXT_global_priority_query === - using VULKAN_HPP_NAMESPACE::MaxGlobalPrioritySizeExt; + using VULKAN_HPP_NAMESPACE::MaxGlobalPrioritySizeEXT; //=== VK_EXT_image_sliced_view_of_3d === - using VULKAN_HPP_NAMESPACE::Remaining3DSlicesExt; + using VULKAN_HPP_NAMESPACE::Remaining3DSlicesEXT; //=== VK_EXT_shader_module_identifier === - using VULKAN_HPP_NAMESPACE::MaxShaderModuleIdentifierSizeExt; + using VULKAN_HPP_NAMESPACE::MaxShaderModuleIdentifierSizeEXT; //======================== //=== CONSTEXPR VALUEs === diff --git a/vulkan/vulkan.hpp b/vulkan/vulkan.hpp index 5e1f4c9..a3c2682 100644 --- a/vulkan/vulkan.hpp +++ b/vulkan/vulkan.hpp @@ -6643,40 +6643,40 @@ namespace VULKAN_HPP_NAMESPACE VULKAN_HPP_CONSTEXPR_INLINE uint32_t MaxDriverInfoSize = VK_MAX_DRIVER_INFO_SIZE; //=== VK_KHR_device_group_creation === - VULKAN_HPP_CONSTEXPR_INLINE uint32_t MaxDeviceGroupSizeKhr = VK_MAX_DEVICE_GROUP_SIZE_KHR; + VULKAN_HPP_CONSTEXPR_INLINE uint32_t MaxDeviceGroupSizeKHR = VK_MAX_DEVICE_GROUP_SIZE_KHR; //=== VK_KHR_external_memory_capabilities === - VULKAN_HPP_CONSTEXPR_INLINE uint32_t LuidSizeKhr = VK_LUID_SIZE_KHR; + VULKAN_HPP_CONSTEXPR_INLINE uint32_t LuidSizeKHR = VK_LUID_SIZE_KHR; //=== VK_KHR_external_memory === - VULKAN_HPP_CONSTEXPR_INLINE uint32_t QueueFamilyExternalKhr = VK_QUEUE_FAMILY_EXTERNAL_KHR; + VULKAN_HPP_CONSTEXPR_INLINE uint32_t QueueFamilyExternalKHR = VK_QUEUE_FAMILY_EXTERNAL_KHR; #if defined( VK_ENABLE_BETA_EXTENSIONS ) //=== VK_AMDX_shader_enqueue === - VULKAN_HPP_CONSTEXPR_INLINE uint32_t ShaderIndexUnusedAmdx = VK_SHADER_INDEX_UNUSED_AMDX; + VULKAN_HPP_CONSTEXPR_INLINE uint32_t ShaderIndexUnusedAMDX = VK_SHADER_INDEX_UNUSED_AMDX; #endif /*VK_ENABLE_BETA_EXTENSIONS*/ //=== VK_KHR_ray_tracing_pipeline === - VULKAN_HPP_CONSTEXPR_INLINE uint32_t ShaderUnusedKhr = VK_SHADER_UNUSED_KHR; + VULKAN_HPP_CONSTEXPR_INLINE uint32_t ShaderUnusedKHR = VK_SHADER_UNUSED_KHR; //=== VK_NV_ray_tracing === - VULKAN_HPP_CONSTEXPR_INLINE uint32_t ShaderUnusedNv = VK_SHADER_UNUSED_NV; + VULKAN_HPP_CONSTEXPR_INLINE uint32_t ShaderUnusedNV = VK_SHADER_UNUSED_NV; //=== VK_KHR_global_priority === - VULKAN_HPP_CONSTEXPR_INLINE uint32_t MaxGlobalPrioritySizeKhr = VK_MAX_GLOBAL_PRIORITY_SIZE_KHR; + VULKAN_HPP_CONSTEXPR_INLINE uint32_t MaxGlobalPrioritySizeKHR = VK_MAX_GLOBAL_PRIORITY_SIZE_KHR; //=== VK_KHR_driver_properties === - VULKAN_HPP_CONSTEXPR_INLINE uint32_t MaxDriverNameSizeKhr = VK_MAX_DRIVER_NAME_SIZE_KHR; - VULKAN_HPP_CONSTEXPR_INLINE uint32_t MaxDriverInfoSizeKhr = VK_MAX_DRIVER_INFO_SIZE_KHR; + VULKAN_HPP_CONSTEXPR_INLINE uint32_t MaxDriverNameSizeKHR = VK_MAX_DRIVER_NAME_SIZE_KHR; + VULKAN_HPP_CONSTEXPR_INLINE uint32_t MaxDriverInfoSizeKHR = VK_MAX_DRIVER_INFO_SIZE_KHR; //=== VK_EXT_global_priority_query === - VULKAN_HPP_CONSTEXPR_INLINE uint32_t MaxGlobalPrioritySizeExt = VK_MAX_GLOBAL_PRIORITY_SIZE_EXT; + VULKAN_HPP_CONSTEXPR_INLINE uint32_t MaxGlobalPrioritySizeEXT = VK_MAX_GLOBAL_PRIORITY_SIZE_EXT; //=== VK_EXT_image_sliced_view_of_3d === - VULKAN_HPP_CONSTEXPR_INLINE uint32_t Remaining3DSlicesExt = VK_REMAINING_3D_SLICES_EXT; + VULKAN_HPP_CONSTEXPR_INLINE uint32_t Remaining3DSlicesEXT = VK_REMAINING_3D_SLICES_EXT; //=== VK_EXT_shader_module_identifier === - VULKAN_HPP_CONSTEXPR_INLINE uint32_t MaxShaderModuleIdentifierSizeExt = VK_MAX_SHADER_MODULE_IDENTIFIER_SIZE_EXT; + VULKAN_HPP_CONSTEXPR_INLINE uint32_t MaxShaderModuleIdentifierSizeEXT = VK_MAX_SHADER_MODULE_IDENTIFIER_SIZE_EXT; //======================== //=== CONSTEXPR VALUEs ===