From 15f591fadac7024696e32de6999252e9dd62ca97 Mon Sep 17 00:00:00 2001 From: Mike Gorchak Date: Wed, 24 Feb 2021 11:47:19 -0500 Subject: [PATCH] Add support for QNX. --- VulkanHppGenerator.cpp | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/VulkanHppGenerator.cpp b/VulkanHppGenerator.cpp index 3554aa1..492abc1 100644 --- a/VulkanHppGenerator.cpp +++ b/VulkanHppGenerator.cpp @@ -89,7 +89,7 @@ const std::set ignoreLens = { "null-terminated", R"(latexmath:[\lceil{\mathit{rasterizationSamples} \over 32}\rceil])", "2*VK_UUID_SIZE", "2*ename:VK_UUID_SIZE" }; -const std::set specialPointerTypes = { "Display", "IDirectFB", "wl_display", "xcb_connection_t" }; +const std::set specialPointerTypes = { "Display", "IDirectFB", "wl_display", "xcb_connection_t", "_screen_window" }; void appendArgumentCount( std::string & str, size_t vectorIndex, @@ -1121,6 +1121,8 @@ void VulkanHppGenerator::appendCommand( std::string & str, bool appendedFunction = false; std::map vectorParamIndices = determineVectorParamIndicesNew( commandData.params ); std::vector nonConstPointerParamIndices = determineNonConstPointerParamIndices( commandData.params ); + + switch ( nonConstPointerParamIndices.size() ) { case 0: @@ -1958,7 +1960,7 @@ void VulkanHppGenerator::appendDispatchLoaderDynamic( std::string & str ) { if ( !vulkanLibraryName.empty() ) { -# if defined( __linux__ ) || defined( __APPLE__ ) +# if defined( __linux__ ) || defined( __APPLE__ ) || defined( __QNXNTO__ ) m_library = dlopen( vulkanLibraryName.c_str(), RTLD_NOW | RTLD_LOCAL ); # elif defined( _WIN32 ) m_library = ::LoadLibraryA( vulkanLibraryName.c_str() ); @@ -1968,7 +1970,7 @@ void VulkanHppGenerator::appendDispatchLoaderDynamic( std::string & str ) } else { -# if defined( __linux__ ) +# if defined( __linux__ ) || defined( __QNXNTO__ ) m_library = dlopen( "libvulkan.so", RTLD_NOW | RTLD_LOCAL ); if ( m_library == nullptr ) { @@ -2011,7 +2013,7 @@ void VulkanHppGenerator::appendDispatchLoaderDynamic( std::string & str ) { if ( m_library ) { -# if defined( __linux__ ) || defined( __APPLE__ ) +# if defined( __linux__ ) || defined( __APPLE__ ) || defined( __QNXNTO__ ) dlclose( m_library ); # elif defined( _WIN32 ) ::FreeLibrary( m_library ); @@ -2024,7 +2026,7 @@ void VulkanHppGenerator::appendDispatchLoaderDynamic( std::string & str ) template T getProcAddress( const char* function ) const VULKAN_HPP_NOEXCEPT { -# if defined( __linux__ ) || defined( __APPLE__ ) +# if defined( __linux__ ) || defined( __APPLE__ ) || defined( __QNXNTO__ ) return (T)dlsym( m_library, function ); # elif defined( _WIN32 ) return (T)::GetProcAddress( m_library, function ); @@ -2036,7 +2038,7 @@ void VulkanHppGenerator::appendDispatchLoaderDynamic( std::string & str ) bool success() const VULKAN_HPP_NOEXCEPT { return m_library != nullptr; } private: -# if defined( __linux__ ) || defined( __APPLE__ ) +# if defined( __linux__ ) || defined( __APPLE__ ) || defined( __QNXNTO__ ) void * m_library; # elif defined( _WIN32 ) ::HINSTANCE m_library; @@ -14848,7 +14850,7 @@ int main( int argc, char ** argv ) #endif #if VULKAN_HPP_ENABLE_DYNAMIC_LOADER_TOOL == 1 -# if defined( __linux__ ) || defined( __APPLE__ ) +# if defined( __linux__ ) || defined( __APPLE__ ) || defined( __QNXNTO__ ) # include # elif defined( _WIN32 ) typedef struct HINSTANCE__ * HINSTANCE;