From 128261aa4517aaf3b30809a27311dd7e1cb5dbea Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andreas=20S=C3=BC=C3=9Fenbach?= Date: Tue, 19 Sep 2023 17:40:35 +0200 Subject: [PATCH] Add missing header in vulkan.cppm. (#1659) --- VulkanHppGenerator.cpp | 1 + vulkan/vulkan.cppm | 1 + vulkan/vulkansc.cppm | 1 + vulkan/vulkansc_shared.hpp | 67 ++++++++++++++++++++++++++++++-------- 4 files changed, 56 insertions(+), 14 deletions(-) diff --git a/VulkanHppGenerator.cpp b/VulkanHppGenerator.cpp index 5ee4719..0636d93 100644 --- a/VulkanHppGenerator.cpp +++ b/VulkanHppGenerator.cpp @@ -772,6 +772,7 @@ module; #include #include #include +#include export module ${api}_hpp; diff --git a/vulkan/vulkan.cppm b/vulkan/vulkan.cppm index 1bed8f3..179bf7e 100644 --- a/vulkan/vulkan.cppm +++ b/vulkan/vulkan.cppm @@ -15,6 +15,7 @@ module; #include #include #include +#include export module vulkan_hpp; diff --git a/vulkan/vulkansc.cppm b/vulkan/vulkansc.cppm index a4ea657..b7c5aee 100644 --- a/vulkan/vulkansc.cppm +++ b/vulkan/vulkansc.cppm @@ -15,6 +15,7 @@ module; #include #include #include +#include export module vulkansc_hpp; diff --git a/vulkan/vulkansc_shared.hpp b/vulkan/vulkansc_shared.hpp index b664254..61ccc13 100644 --- a/vulkan/vulkansc_shared.hpp +++ b/vulkan/vulkansc_shared.hpp @@ -60,6 +60,12 @@ namespace VULKAN_HPP_NAMESPACE template struct SharedHeader { + SharedHeader( SharedHandle parent, Deleter deleter = Deleter() ) VULKAN_HPP_NOEXCEPT + : parent( std::move( parent ) ) + , deleter( std::move( deleter ) ) + { + } + SharedHandle parent; Deleter deleter; }; @@ -67,6 +73,8 @@ namespace VULKAN_HPP_NAMESPACE template struct SharedHeader { + SharedHeader( Deleter deleter = Deleter() ) VULKAN_HPP_NOEXCEPT : deleter( std::move( deleter ) ) {} + Deleter deleter; }; @@ -77,7 +85,10 @@ namespace VULKAN_HPP_NAMESPACE { public: template - ReferenceCounter( Args &&... control_args ) : m_header( std::forward( control_args )... ){}; + ReferenceCounter( Args &&... control_args ) : m_header( std::forward( control_args )... ) + { + } + ReferenceCounter( const ReferenceCounter & ) = delete; ReferenceCounter & operator=( const ReferenceCounter & ) = delete; @@ -257,6 +268,12 @@ namespace VULKAN_HPP_NAMESPACE template class SharedHandleTraits; +// Silence the function cast warnings. +# if defined( __GNUC__ ) && !defined( __clang__ ) && !defined( __INTEL_COMPILER ) +# pragma GCC diagnostic push +# pragma GCC diagnostic ignored "-Wcast-function-type" +# endif + template class ObjectDestroyShared { @@ -395,6 +412,10 @@ namespace VULKAN_HPP_NAMESPACE SharedHandle m_pool{}; }; +# if defined( __GNUC__ ) && !defined( __clang__ ) && !defined( __INTEL_COMPILER ) +# pragma GCC diagnostic pop +# endif + //====================== //=== SHARED HANDLEs === //====================== @@ -632,11 +653,19 @@ namespace VULKAN_HPP_NAMESPACE yes, }; - struct ImageHeader + struct ImageHeader : SharedHeader, typename SharedHandleTraits::deleter> { - SharedHandle> parent{}; - typename SharedHandleTraits::deleter deleter{}; - SwapchainOwns swapchainOwned = SwapchainOwns::no; + ImageHeader( + SharedHandle> parent, + typename SharedHandleTraits::deleter deleter = typename SharedHandleTraits::deleter(), + SwapchainOwns swapchainOwned = SwapchainOwns::no ) VULKAN_HPP_NOEXCEPT + : SharedHeader, typename SharedHandleTraits::deleter>( std::move( parent ), + std::move( deleter ) ) + , swapchainOwned( swapchainOwned ) + { + } + + SwapchainOwns swapchainOwned = SwapchainOwns::no; }; template <> @@ -649,10 +678,10 @@ namespace VULKAN_HPP_NAMESPACE public: SharedHandle() = default; - explicit SharedHandle( VULKAN_HPP_NAMESPACE::Image handle, - SharedHandle> parent, - SwapchainOwns swapchain_owned = SwapchainOwns::no, - DeleterType deleter = DeleterType() ) VULKAN_HPP_NOEXCEPT + explicit SharedHandle( VULKAN_HPP_NAMESPACE::Image handle, + SharedHandle> parent, + SwapchainOwns swapchain_owned = SwapchainOwns::no, + DeleterType deleter = DeleterType() ) VULKAN_HPP_NOEXCEPT : BaseType( handle, std::move( parent ), std::move( deleter ), swapchain_owned ) { } @@ -669,8 +698,18 @@ namespace VULKAN_HPP_NAMESPACE struct SwapchainHeader { + SwapchainHeader( SharedHandle surface, + SharedHandle> parent, + typename SharedHandleTraits::deleter deleter = + typename SharedHandleTraits::deleter() ) VULKAN_HPP_NOEXCEPT + : surface( std::move( surface ) ) + , parent( std::move( parent ) ) + , deleter( std::move( deleter ) ) + { + } + SharedHandle surface{}; - SharedHandle> parent{}; + SharedHandle> parent{}; typename SharedHandleTraits::deleter deleter{}; }; @@ -684,10 +723,10 @@ namespace VULKAN_HPP_NAMESPACE public: SharedHandle() = default; - explicit SharedHandle( VULKAN_HPP_NAMESPACE::SwapchainKHR handle, - SharedHandle> parent, - SharedHandle surface, - DeleterType deleter = DeleterType() ) VULKAN_HPP_NOEXCEPT + explicit SharedHandle( VULKAN_HPP_NAMESPACE::SwapchainKHR handle, + SharedHandle> parent, + SharedHandle surface, + DeleterType deleter = DeleterType() ) VULKAN_HPP_NOEXCEPT : BaseType( handle, std::move( surface ), std::move( parent ), std::move( deleter ) ) { }