From 243e0fa7aa06e9fe3bf187c8a9a535ab78c6a72c Mon Sep 17 00:00:00 2001 From: asuessenbach Date: Wed, 21 Oct 2020 23:12:54 +0200 Subject: [PATCH] Refactor commands getting a pointer to a IDirectFB. --- VulkanHppGenerator.cpp | 19 +++++++++++-------- vulkan/vulkan.hpp | 1 + 2 files changed, 12 insertions(+), 8 deletions(-) diff --git a/VulkanHppGenerator.cpp b/VulkanHppGenerator.cpp index c210f61..a2bec46 100644 --- a/VulkanHppGenerator.cpp +++ b/VulkanHppGenerator.cpp @@ -3694,9 +3694,9 @@ std::string VulkanHppGenerator::constructCallArgument( ParamData const & param, argument = startLowerCase( stripPrefix( param.name, "p" ) ); argument = param.optional ? ( argument + " ? " + argument + "->c_str() : nullptr" ) : ( argument + ".c_str()" ); } - else if ( enhanced && ( param.type.type == "Display" ) ) + else if ( enhanced && ( ( param.type.type == "Display" ) || ( param.type.type == "IDirectFB" ) ) ) { - // very special handling for type "Display", which originally gets in as a pointer, but is mapped to a reference + // very special handling for type "Display" and "IDirectFB", which originally gets in as a pointer, but is mapped to a reference argument = "&" + param.name; } else @@ -4057,7 +4057,8 @@ std::string VulkanHppGenerator::constructCommandResultEnumerate( std::string con std::set skippedParams = determineSkippedParams( commandData.handle, commandData.params, { vectorParamIndices }, - { vectorParamIndices.second, vectorParamIndices.first }, false ); + { vectorParamIndices.second, vectorParamIndices.first }, + false ); std::string argumentList = constructArgumentListEnhanced( commandData.params, skippedParams, INVALID_INDEX, definition, withAllocator ); @@ -7324,7 +7325,8 @@ size_t VulkanHppGenerator::determineReturnParamIndex( CommandData const & std::set VulkanHppGenerator::determineSkippedParams( std::string const & handleType, std::vector const & params, std::map const & vectorParamIndices, - std::vector const & returnParamIndices, bool singular ) const + std::vector const & returnParamIndices, + bool singular ) const { std::set skippedParams = { returnParamIndices.begin(), returnParamIndices.end() }; @@ -7399,8 +7401,9 @@ std::vector VulkanHppGenerator::determineConstPointerParamIndices( std:: for ( size_t i = 0; i < params.size(); i++ ) { + // very special handling for type Display and IDirectFB, which come in as non-const pointers, but are meant as const-pointers if ( params[i].type.isConstPointer() || - ( params[i].type.isNonConstPointer() && ( params[i].type.type == "Display" ) ) ) + ( params[i].type.isNonConstPointer() && ( ( params[i].type.type == "Display" ) || ( params[i].type.type == "IDirectFB" ) ) ) ) { constPointerParamIndices.push_back( i ); } @@ -7415,10 +7418,10 @@ std::vector for ( size_t i = 0; i < params.size(); i++ ) { - // very special handling of parameters of type "Display", which is an X11 type that always comes as a non-const + // very special handling of parameters of type "Display" and "IDirectFB", which always comes as a non-const // pointer but is not meant to be a potential return value! - assert( ( params[i].type.type != "Display" ) || params[i].type.isNonConstPointer() ); - if ( params[i].type.isNonConstPointer() && ( params[i].type.type != "Display" ) ) + if ( params[i].type.isNonConstPointer() && ( params[i].type.type != "Display" ) && + ( params[i].type.type != "IDirectFB" ) ) { nonConstPointerParamIndices.push_back( i ); } diff --git a/vulkan/vulkan.hpp b/vulkan/vulkan.hpp index 49984fa..6527424 100644 --- a/vulkan/vulkan.hpp +++ b/vulkan/vulkan.hpp @@ -104201,6 +104201,7 @@ namespace VULKAN_HPP_NAMESPACE return static_cast( d.vkGetPhysicalDeviceDirectFBPresentationSupportEXT( m_physicalDevice, queueFamilyIndex, dfb ) ); } + # ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE template VULKAN_HPP_INLINE Bool32 PhysicalDevice::getDirectFBPresentationSupportEXT(