From 587833bb5d9326a46c7bbf373915f1e80d73d95d Mon Sep 17 00:00:00 2001 From: asuessenbach Date: Wed, 2 Sep 2020 17:22:26 +0200 Subject: [PATCH] Make the name of the singular version in appendCommandFixedSizeVector singular. --- VulkanHppGenerator.cpp | 15 ++++++++++----- vulkan/vulkan.hpp | 38 +++++++++++++++++++------------------- 2 files changed, 29 insertions(+), 24 deletions(-) diff --git a/VulkanHppGenerator.cpp b/VulkanHppGenerator.cpp index 389eaaf..6182177 100644 --- a/VulkanHppGenerator.cpp +++ b/VulkanHppGenerator.cpp @@ -1481,6 +1481,9 @@ void VulkanHppGenerator::appendCommandFixedSizeVector( std::string & str, assert( ( vectorParamIndices.size() == 1 ) && ( vectorParamIndices.find( templateParamIndex ) != vectorParamIndices.end() ) ); + std::string commandName = startLowerCase( stripPrefix( name, "vk" ) ); + std::string commandNameSingular = stripPluralS( commandName ); + if ( definition ) { std::string const functionTemplate = R"( @@ -1508,7 +1511,7 @@ ${enter} template } template - VULKAN_HPP_NODISCARD_WHEN_NO_EXCEPTIONS typename ResultValueType::type ${className}::${commandName}( ${argumentListEnhancedSingular} ) const + VULKAN_HPP_NODISCARD_WHEN_NO_EXCEPTIONS typename ResultValueType::type ${className}::${commandNameSingular}( ${argumentListEnhancedSingular} ) const { T ${dataName}; ${functionCallSingular} @@ -1537,7 +1540,8 @@ ${leave} commandData, templateParamIndex, templateParamIndex, vectorParamIndices, true, false, false ) }, { "argumentListStandard", constructFunctionHeaderArgumentsStandard( commandData, false ) }, { "className", stripPrefix( commandData.handle, "Vk" ) }, - { "commandName", startLowerCase( stripPrefix( name, "vk" ) ) }, + { "commandName", commandName }, + { "commandNameSingular", commandNameSingular }, { "dataName", startLowerCase( stripPrefix( commandData.params[templateParamIndex].name, "p" ) ) }, { "dataSize", commandData.params[templateParamIndex].len }, { "enter", enter }, @@ -1571,7 +1575,7 @@ ${enter} template template , typename Dispatch = VULKAN_HPP_DEFAULT_DISPATCHER_TYPE> VULKAN_HPP_NODISCARD_WHEN_NO_EXCEPTIONS typename ResultValueType>::type ${commandName}( ${argumentListEnhanced} ) const; template - VULKAN_HPP_NODISCARD_WHEN_NO_EXCEPTIONS typename ResultValueType::type ${commandName}( ${argumentListEnhancedSingular} ) const; + VULKAN_HPP_NODISCARD_WHEN_NO_EXCEPTIONS typename ResultValueType::type ${commandNameSingular}( ${argumentListEnhancedSingular} ) const; #endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ ${leave} )"; @@ -1589,7 +1593,8 @@ ${leave} constructFunctionHeaderArgumentsEnhanced( commandData, templateParamIndex, templateParamIndex, vectorParamIndices, true, true, false ) }, { "argumentListStandard", constructFunctionHeaderArgumentsStandard( commandData, true ) }, - { "commandName", startLowerCase( stripPrefix( name, "vk" ) ) }, + { "commandName", commandName }, + { "commandNameSingular", commandNameSingular }, { "enter", enter }, { "leave", leave } } ) ); } @@ -2322,7 +2327,7 @@ std::string VulkanHppGenerator::appendFunctionBodyEnhancedLocalReturnVariable( { // For StructureChains use the template parameters str += "StructureChain structureChain;\n" + indentation + " " + enhancedReturnType + "& " + - returnName + " = structureChain.template get<" + enhancedReturnType + ">()"; + returnName + " = structureChain.template get<" + enhancedReturnType + ">()"; returnName = "structureChain"; } else diff --git a/vulkan/vulkan.hpp b/vulkan/vulkan.hpp index 750b77b..196d59e 100644 --- a/vulkan/vulkan.hpp +++ b/vulkan/vulkan.hpp @@ -53753,11 +53753,11 @@ namespace VULKAN_HPP_NAMESPACE VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const; template VULKAN_HPP_NODISCARD_WHEN_NO_EXCEPTIONS typename ResultValueType::type - getRayTracingCaptureReplayShaderGroupHandlesKHR( VULKAN_HPP_NAMESPACE::Pipeline pipeline, - uint32_t firstGroup, - uint32_t groupCount, - Dispatch const & d - VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const; + getRayTracingCaptureReplayShaderGroupHandleKHR( VULKAN_HPP_NAMESPACE::Pipeline pipeline, + uint32_t firstGroup, + uint32_t groupCount, + Dispatch const & d + VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const; # endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ #endif /*VK_ENABLE_BETA_EXTENSIONS*/ @@ -53789,10 +53789,10 @@ namespace VULKAN_HPP_NAMESPACE Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const; template VULKAN_HPP_NODISCARD_WHEN_NO_EXCEPTIONS typename ResultValueType::type - getRayTracingShaderGroupHandlesKHR( VULKAN_HPP_NAMESPACE::Pipeline pipeline, - uint32_t firstGroup, - uint32_t groupCount, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const; + getRayTracingShaderGroupHandleKHR( VULKAN_HPP_NAMESPACE::Pipeline pipeline, + uint32_t firstGroup, + uint32_t groupCount, + Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const; # endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ #endif /*VK_ENABLE_BETA_EXTENSIONS*/ @@ -53823,10 +53823,10 @@ namespace VULKAN_HPP_NAMESPACE Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const; template VULKAN_HPP_NODISCARD_WHEN_NO_EXCEPTIONS typename ResultValueType::type - getRayTracingShaderGroupHandlesNV( VULKAN_HPP_NAMESPACE::Pipeline pipeline, - uint32_t firstGroup, - uint32_t groupCount, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const; + getRayTracingShaderGroupHandleNV( VULKAN_HPP_NAMESPACE::Pipeline pipeline, + uint32_t firstGroup, + uint32_t groupCount, + Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const; #endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ template @@ -97603,10 +97603,10 @@ namespace VULKAN_HPP_NAMESPACE template VULKAN_HPP_NODISCARD_WHEN_NO_EXCEPTIONS typename ResultValueType::type - Device::getRayTracingCaptureReplayShaderGroupHandlesKHR( VULKAN_HPP_NAMESPACE::Pipeline pipeline, - uint32_t firstGroup, - uint32_t groupCount, - Dispatch const & d ) const + Device::getRayTracingCaptureReplayShaderGroupHandleKHR( VULKAN_HPP_NAMESPACE::Pipeline pipeline, + uint32_t firstGroup, + uint32_t groupCount, + Dispatch const & d ) const { T data; Result result = @@ -97681,7 +97681,7 @@ namespace VULKAN_HPP_NAMESPACE } template - VULKAN_HPP_NODISCARD_WHEN_NO_EXCEPTIONS typename ResultValueType::type Device::getRayTracingShaderGroupHandlesKHR( + VULKAN_HPP_NODISCARD_WHEN_NO_EXCEPTIONS typename ResultValueType::type Device::getRayTracingShaderGroupHandleKHR( VULKAN_HPP_NAMESPACE::Pipeline pipeline, uint32_t firstGroup, uint32_t groupCount, Dispatch const & d ) const { T data; @@ -97754,7 +97754,7 @@ namespace VULKAN_HPP_NAMESPACE } template - VULKAN_HPP_NODISCARD_WHEN_NO_EXCEPTIONS typename ResultValueType::type Device::getRayTracingShaderGroupHandlesNV( + VULKAN_HPP_NODISCARD_WHEN_NO_EXCEPTIONS typename ResultValueType::type Device::getRayTracingShaderGroupHandleNV( VULKAN_HPP_NAMESPACE::Pipeline pipeline, uint32_t firstGroup, uint32_t groupCount, Dispatch const & d ) const { T data;