From bf73d74aa9564bf9f8bb8a0e6d4f483e9a3cbed2 Mon Sep 17 00:00:00 2001 From: asuessenbach Date: Tue, 16 Nov 2021 12:07:35 +0100 Subject: [PATCH] Remove deprecated versions of function PhysicalDevice::enumerateQueueFamilyPerformanceQueryCountersKHR --- README.md | 1 - VulkanHppGenerator.cpp | 116 +------------------------------------- VulkanHppGenerator.hpp | 25 ++------ vulkan/vulkan_funcs.hpp | 91 ------------------------------ vulkan/vulkan_handles.hpp | 18 ------ 5 files changed, 7 insertions(+), 244 deletions(-) diff --git a/README.md b/README.md index 33aaaac..9928f83 100644 --- a/README.md +++ b/README.md @@ -618,7 +618,6 @@ The affected functions are Device::getRayTracingShaderGroupHandlesKHR Device::getRayTracingShaderGroupHandlesNV Device::writeAccelerationStructuresPropertiesKHR - PhysicalDevice::enumerateQueueFamilyPerformanceQueryCountersKHR ``` All those elements will be removed around November 2021. diff --git a/VulkanHppGenerator.cpp b/VulkanHppGenerator.cpp index bb53f8c..639e41c 100644 --- a/VulkanHppGenerator.cpp +++ b/VulkanHppGenerator.cpp @@ -3161,88 +3161,6 @@ std::string } } -std::string VulkanHppGenerator::generateCommandResultEnumerateTwoVectorsDeprecated( - std::string const & name, - CommandData const & commandData, - size_t initialSkipCount, - bool definition, - std::map const & vectorParamIndices, - bool withAllocators ) const -{ - std::vector returnParamIndices = determineReturnParamIndices( commandData.params ); - assert( !returnParamIndices.empty() && ( returnParamIndices.back() + 1 == commandData.params.size() ) ); - size_t returnParamIndex = returnParamIndices.back(); - - std::string argumentList = generateFunctionHeaderArgumentsEnhanced( commandData, - returnParamIndex, - returnParamIndex, - initialSkipCount, - vectorParamIndices, - !definition, - withAllocators ); - std::string commandName = generateCommandName( name, commandData.params, initialSkipCount, m_tags ); - std::string nodiscard = generateNoDiscard( 1 < commandData.successCodes.size(), 1 < commandData.errorCodes.size() ); - std::string returnType = generateEnhancedReturnType( commandData, returnParamIndex, false ); - std::string templateType = stripPrefix( commandData.params[returnParamIndex].type.type, "Vk" ); - - if ( definition ) - { - const std::string functionTemplate = - R"( template - VULKAN_HPP_DEPRECATED( "This function is deprecated. Use one of the other flavours of it.") - ${nodiscard}VULKAN_HPP_INLINE typename ResultValueType<${returnType}>::type ${className}${classSeparator}${commandName}( ${argumentList} ) const - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - ${functionBody} - })"; - - std::string typeCheck = withAllocators - ? ", typename B, typename std::enable_if::value, int>::type" - : ""; - - return replaceWithMap( - functionTemplate, - { { "argumentList", argumentList }, - { "className", - initialSkipCount ? stripPrefix( commandData.params[initialSkipCount - 1].type.type, "Vk" ) : "" }, - { "classSeparator", commandData.handle.empty() ? "" : "::" }, - { "commandName", commandName }, - { "functionBody", - generateFunctionBodyEnhanced( name, - commandData, - initialSkipCount, - returnParamIndex, - returnParamIndex, - vectorParamIndices, - true, - returnType, - withAllocators ) }, - { "nodiscard", nodiscard }, - { "returnType", returnType }, - { "typeCheck", typeCheck } } ); - } - else - { - const std::string functionTemplate = - R"( template , typename Dispatch = VULKAN_HPP_DEFAULT_DISPATCHER_TYPE${typeCheck}> - ${nodiscard}typename ResultValueType<${returnType}>::type ${commandName}( ${argumentList} ) const;)"; - - std::string typeCheck = - withAllocators ? ", typename B = Allocator, typename std::enable_if::value, int>::type = 0" - : ""; - - return replaceWithMap( functionTemplate, - { { "argumentList", argumentList }, - { "commandName", commandName }, - { "nodiscard", nodiscard }, - { "returnType", returnType }, - { "templateType", templateType }, - { "typeCheck", typeCheck } } ); - } -} - std::string VulkanHppGenerator::generateCommandResultGetChain( std::string const & name, CommandData const & commandData, size_t initialSkipCount, @@ -4546,13 +4464,9 @@ std::string VulkanHppGenerator::generateCommandResultMultiSuccessWithErrors3Retu { if ( returnParamIndices[2] == std::next( vectorParamIndices.begin() )->first ) { - return generateCommandSetStandardEnhancedWithAllocatorDeprecated2( + return generateCommandSetStandardEnhancedWithAllocator( definition, generateCommandStandard( name, commandData, initialSkipCount, definition ), - generateCommandResultEnumerateTwoVectorsDeprecated( - name, commandData, initialSkipCount, definition, vectorParamIndices, false ), - generateCommandResultEnumerateTwoVectorsDeprecated( - name, commandData, initialSkipCount, definition, vectorParamIndices, true ), generateCommandResultEnumerateTwoVectors( name, commandData, initialSkipCount, definition, vectorParamIndices, returnParamIndices, false ), generateCommandResultEnumerateTwoVectors( @@ -5161,34 +5075,6 @@ ${commandEnhancedSingular} { "newlineOnDefinition", definition ? "\n" : "" } } ) ); } -std::string VulkanHppGenerator::generateCommandSetStandardEnhancedWithAllocatorDeprecated2( - bool definition, - std::string const & standard, - std::string const & enhancedDeprecated, - std::string const & enhancedWithAllocatorDeprecated, - std::string const & enhanced, - std::string const & enhancedWithAllocator ) const -{ - const std::string commandTemplate = R"( -${commandStandard}${newlineOnDefinition} -#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE -${commandEnhancedDeprecated}${newlineOnDefinition} -${commandEnhancedWithAllocatorDeprecated}${newlineOnDefinition} -${commandEnhanced}${newlineOnDefinition} -${commandEnhancedWithAllocator} -#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ -)"; - - return replaceWithMap( - commandTemplate, - std::map( { { "commandEnhanced", enhanced }, - { "commandEnhancedDeprecated", enhancedDeprecated }, - { "commandEnhancedWithAllocator", enhancedWithAllocator }, - { "commandEnhancedWithAllocatorDeprecated", enhancedWithAllocatorDeprecated }, - { "commandStandard", standard }, - { "newlineOnDefinition", definition ? "\n" : "" } } ) ); -} - std::string VulkanHppGenerator::generateCommandSetStandardEnhancedWithAllocatorSingular( bool definition, std::string const & standard, diff --git a/VulkanHppGenerator.hpp b/VulkanHppGenerator.hpp index 4dccbe5..6fe73b1 100644 --- a/VulkanHppGenerator.hpp +++ b/VulkanHppGenerator.hpp @@ -471,12 +471,6 @@ private: std::map const & vectorParamIndices, std::vector const & returnParamIndices, bool withAllocators ) const; - std::string generateCommandResultEnumerateTwoVectorsDeprecated( std::string const & name, - CommandData const & commandData, - size_t initialSkipCount, - bool definition, - std::map const & vectorParamIndices, - bool withAllocators ) const; std::string generateCommandResultGetChain( std::string const & name, CommandData const & commandData, size_t initialSkipCount, @@ -684,19 +678,12 @@ private: std::string const & enhancedChained, std::string const & enhancedChainedWithAllocator ) const; std::string - generateCommandSetStandardEnhancedWithAllocatorSingularDeprecated( bool definition, - std::string const & standard, - std::string const & enhancedDeprecated, - std::string const & enhanced, - std::string const & enhancedWithAllocator, - std::string const & enhancedSingular ) const; - std::string - generateCommandSetStandardEnhancedWithAllocatorDeprecated2( bool definition, - std::string const & standard, - std::string const & enhancedDeprecated, - std::string const & enhancedWithAllocatorDeprecated, - std::string const & enhanced, - std::string const & enhancedWithAllocator ) const; + generateCommandSetStandardEnhancedWithAllocatorSingularDeprecated( bool definition, + std::string const & standard, + std::string const & enhancedDeprecated, + std::string const & enhanced, + std::string const & enhancedWithAllocator, + std::string const & enhancedSingular ) const; std::string generateCommandSetStandardEnhancedWithAllocatorSingular( bool definition, std::string const & standard, std::string const & enhanced, diff --git a/vulkan/vulkan_funcs.hpp b/vulkan/vulkan_funcs.hpp index 7606580..a3d1293 100644 --- a/vulkan/vulkan_funcs.hpp +++ b/vulkan/vulkan_funcs.hpp @@ -12309,97 +12309,6 @@ namespace VULKAN_HPP_NAMESPACE } #ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template - VULKAN_HPP_DEPRECATED( "This function is deprecated. Use one of the other flavours of it." ) - VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE - typename ResultValueType>::type - PhysicalDevice::enumerateQueueFamilyPerformanceQueryCountersKHR( - uint32_t queueFamilyIndex, - ArrayProxy const & counters, - Dispatch const & d ) const - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - std::vector counterDescriptions; - uint32_t counterCount; - Result result; - do - { - result = static_cast( d.vkEnumeratePhysicalDeviceQueueFamilyPerformanceQueryCountersKHR( - m_physicalDevice, - queueFamilyIndex, - counters.size(), - reinterpret_cast( counters.data() ), - nullptr ) ); - if ( ( result == Result::eSuccess ) && counterCount ) - { - counterDescriptions.resize( counterCount ); - result = static_cast( d.vkEnumeratePhysicalDeviceQueueFamilyPerformanceQueryCountersKHR( - m_physicalDevice, - queueFamilyIndex, - counters.size(), - reinterpret_cast( counters.data() ), - reinterpret_cast( counterDescriptions.data() ) ) ); - } - } while ( result == Result::eIncomplete ); - if ( result == Result::eSuccess ) - { - VULKAN_HPP_ASSERT( counterCount <= counterDescriptions.size() ); - counterDescriptions.resize( counterCount ); - } - return createResultValue( result, - counterDescriptions, - VULKAN_HPP_NAMESPACE_STRING - "::PhysicalDevice::enumerateQueueFamilyPerformanceQueryCountersKHR" ); - } - - template < - typename Allocator, - typename Dispatch, - typename B, - typename std::enable_if::value, int>::type> - VULKAN_HPP_DEPRECATED( "This function is deprecated. Use one of the other flavours of it." ) - VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE - typename ResultValueType>::type - PhysicalDevice::enumerateQueueFamilyPerformanceQueryCountersKHR( - uint32_t queueFamilyIndex, - ArrayProxy const & counters, - Allocator const & vectorAllocator, - Dispatch const & d ) const - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - std::vector counterDescriptions( vectorAllocator ); - uint32_t counterCount; - Result result; - do - { - result = static_cast( d.vkEnumeratePhysicalDeviceQueueFamilyPerformanceQueryCountersKHR( - m_physicalDevice, - queueFamilyIndex, - counters.size(), - reinterpret_cast( counters.data() ), - nullptr ) ); - if ( ( result == Result::eSuccess ) && counterCount ) - { - counterDescriptions.resize( counterCount ); - result = static_cast( d.vkEnumeratePhysicalDeviceQueueFamilyPerformanceQueryCountersKHR( - m_physicalDevice, - queueFamilyIndex, - counters.size(), - reinterpret_cast( counters.data() ), - reinterpret_cast( counterDescriptions.data() ) ) ); - } - } while ( result == Result::eIncomplete ); - if ( result == Result::eSuccess ) - { - VULKAN_HPP_ASSERT( counterCount <= counterDescriptions.size() ); - counterDescriptions.resize( counterCount ); - } - return createResultValue( result, - counterDescriptions, - VULKAN_HPP_NAMESPACE_STRING - "::PhysicalDevice::enumerateQueueFamilyPerformanceQueryCountersKHR" ); - } - template diff --git a/vulkan/vulkan_handles.hpp b/vulkan/vulkan_handles.hpp index e9cb8b6..9d16a3b 100644 --- a/vulkan/vulkan_handles.hpp +++ b/vulkan/vulkan_handles.hpp @@ -13145,24 +13145,6 @@ namespace VULKAN_HPP_NAMESPACE VULKAN_HPP_NAMESPACE::PerformanceCounterDescriptionKHR * pCounterDescriptions, Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const VULKAN_HPP_NOEXCEPT; #ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template , - typename Dispatch = VULKAN_HPP_DEFAULT_DISPATCHER_TYPE> - VULKAN_HPP_NODISCARD typename ResultValueType>::type - enumerateQueueFamilyPerformanceQueryCountersKHR( - uint32_t queueFamilyIndex, - ArrayProxy const & counters, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const; - template , - typename Dispatch = VULKAN_HPP_DEFAULT_DISPATCHER_TYPE, - typename B = Allocator, - typename std::enable_if::value, - int>::type = 0> - VULKAN_HPP_NODISCARD typename ResultValueType>::type - enumerateQueueFamilyPerformanceQueryCountersKHR( - uint32_t queueFamilyIndex, - ArrayProxy const & counters, - Allocator const & vectorAllocator, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const; template , typename PerformanceCounterDescriptionKHRAllocator = std::allocator, typename Dispatch = VULKAN_HPP_DEFAULT_DISPATCHER_TYPE>