Add missing header in vulkan.cppm. (#1659)

This commit is contained in:
Andreas Süßenbach 2023-09-19 17:40:35 +02:00 committed by GitHub
parent 5d0d3b7bd9
commit 128261aa45
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 56 additions and 14 deletions

View File

@ -772,6 +772,7 @@ module;
#include <vulkan/${api}_format_traits.hpp> #include <vulkan/${api}_format_traits.hpp>
#include <vulkan/${api}_hash.hpp> #include <vulkan/${api}_hash.hpp>
#include <vulkan/${api}_raii.hpp> #include <vulkan/${api}_raii.hpp>
#include <vulkan/${api}_shared.hpp>
export module ${api}_hpp; export module ${api}_hpp;

View File

@ -15,6 +15,7 @@ module;
#include <vulkan/vulkan_format_traits.hpp> #include <vulkan/vulkan_format_traits.hpp>
#include <vulkan/vulkan_hash.hpp> #include <vulkan/vulkan_hash.hpp>
#include <vulkan/vulkan_raii.hpp> #include <vulkan/vulkan_raii.hpp>
#include <vulkan/vulkan_shared.hpp>
export module vulkan_hpp; export module vulkan_hpp;

View File

@ -15,6 +15,7 @@ module;
#include <vulkan/vulkansc_format_traits.hpp> #include <vulkan/vulkansc_format_traits.hpp>
#include <vulkan/vulkansc_hash.hpp> #include <vulkan/vulkansc_hash.hpp>
#include <vulkan/vulkansc_raii.hpp> #include <vulkan/vulkansc_raii.hpp>
#include <vulkan/vulkansc_shared.hpp>
export module vulkansc_hpp; export module vulkansc_hpp;

View File

@ -60,6 +60,12 @@ namespace VULKAN_HPP_NAMESPACE
template <typename DestructorType, typename Deleter> template <typename DestructorType, typename Deleter>
struct SharedHeader struct SharedHeader
{ {
SharedHeader( SharedHandle<DestructorType> parent, Deleter deleter = Deleter() ) VULKAN_HPP_NOEXCEPT
: parent( std::move( parent ) )
, deleter( std::move( deleter ) )
{
}
SharedHandle<DestructorType> parent; SharedHandle<DestructorType> parent;
Deleter deleter; Deleter deleter;
}; };
@ -67,6 +73,8 @@ namespace VULKAN_HPP_NAMESPACE
template <typename Deleter> template <typename Deleter>
struct SharedHeader<NoDestructor, Deleter> struct SharedHeader<NoDestructor, Deleter>
{ {
SharedHeader( Deleter deleter = Deleter() ) VULKAN_HPP_NOEXCEPT : deleter( std::move( deleter ) ) {}
Deleter deleter; Deleter deleter;
}; };
@ -77,7 +85,10 @@ namespace VULKAN_HPP_NAMESPACE
{ {
public: public:
template <typename... Args> template <typename... Args>
ReferenceCounter( Args &&... control_args ) : m_header( std::forward<Args>( control_args )... ){}; ReferenceCounter( Args &&... control_args ) : m_header( std::forward<Args>( control_args )... )
{
}
ReferenceCounter( const ReferenceCounter & ) = delete; ReferenceCounter( const ReferenceCounter & ) = delete;
ReferenceCounter & operator=( const ReferenceCounter & ) = delete; ReferenceCounter & operator=( const ReferenceCounter & ) = delete;
@ -257,6 +268,12 @@ namespace VULKAN_HPP_NAMESPACE
template <typename HandleType> template <typename HandleType>
class SharedHandleTraits; 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 <typename HandleType> template <typename HandleType>
class ObjectDestroyShared class ObjectDestroyShared
{ {
@ -395,6 +412,10 @@ namespace VULKAN_HPP_NAMESPACE
SharedHandle<PoolType> m_pool{}; SharedHandle<PoolType> m_pool{};
}; };
# if defined( __GNUC__ ) && !defined( __clang__ ) && !defined( __INTEL_COMPILER )
# pragma GCC diagnostic pop
# endif
//====================== //======================
//=== SHARED HANDLEs === //=== SHARED HANDLEs ===
//====================== //======================
@ -632,10 +653,18 @@ namespace VULKAN_HPP_NAMESPACE
yes, yes,
}; };
struct ImageHeader struct ImageHeader : SharedHeader<DestructorTypeOf<VULKAN_HPP_NAMESPACE::Image>, typename SharedHandleTraits<VULKAN_HPP_NAMESPACE::Image>::deleter>
{ {
SharedHandle<DeleteDestructorOf<VULKAN_HPP_NAMESPACE::Image>> parent{}; ImageHeader(
typename SharedHandleTraits<VULKAN_HPP_NAMESPACE::Image>::deleter deleter{}; SharedHandle<DestructorTypeOf<VULKAN_HPP_NAMESPACE::Image>> parent,
typename SharedHandleTraits<VULKAN_HPP_NAMESPACE::Image>::deleter deleter = typename SharedHandleTraits<VULKAN_HPP_NAMESPACE::Image>::deleter(),
SwapchainOwns swapchainOwned = SwapchainOwns::no ) VULKAN_HPP_NOEXCEPT
: SharedHeader<DestructorTypeOf<VULKAN_HPP_NAMESPACE::Image>, typename SharedHandleTraits<VULKAN_HPP_NAMESPACE::Image>::deleter>( std::move( parent ),
std::move( deleter ) )
, swapchainOwned( swapchainOwned )
{
}
SwapchainOwns swapchainOwned = SwapchainOwns::no; SwapchainOwns swapchainOwned = SwapchainOwns::no;
}; };
@ -650,7 +679,7 @@ namespace VULKAN_HPP_NAMESPACE
SharedHandle() = default; SharedHandle() = default;
explicit SharedHandle( VULKAN_HPP_NAMESPACE::Image handle, explicit SharedHandle( VULKAN_HPP_NAMESPACE::Image handle,
SharedHandle<DeleteDestructorOf<VULKAN_HPP_NAMESPACE::Image>> parent, SharedHandle<DestructorTypeOf<VULKAN_HPP_NAMESPACE::Image>> parent,
SwapchainOwns swapchain_owned = SwapchainOwns::no, SwapchainOwns swapchain_owned = SwapchainOwns::no,
DeleterType deleter = DeleterType() ) VULKAN_HPP_NOEXCEPT DeleterType deleter = DeleterType() ) VULKAN_HPP_NOEXCEPT
: BaseType( handle, std::move( parent ), std::move( deleter ), swapchain_owned ) : BaseType( handle, std::move( parent ), std::move( deleter ), swapchain_owned )
@ -669,8 +698,18 @@ namespace VULKAN_HPP_NAMESPACE
struct SwapchainHeader struct SwapchainHeader
{ {
SwapchainHeader( SharedHandle<VULKAN_HPP_NAMESPACE::SurfaceKHR> surface,
SharedHandle<DestructorTypeOf<VULKAN_HPP_NAMESPACE::SwapchainKHR>> parent,
typename SharedHandleTraits<VULKAN_HPP_NAMESPACE::SwapchainKHR>::deleter deleter =
typename SharedHandleTraits<VULKAN_HPP_NAMESPACE::SwapchainKHR>::deleter() ) VULKAN_HPP_NOEXCEPT
: surface( std::move( surface ) )
, parent( std::move( parent ) )
, deleter( std::move( deleter ) )
{
}
SharedHandle<VULKAN_HPP_NAMESPACE::SurfaceKHR> surface{}; SharedHandle<VULKAN_HPP_NAMESPACE::SurfaceKHR> surface{};
SharedHandle<DeleteDestructorOf<VULKAN_HPP_NAMESPACE::SwapchainKHR>> parent{}; SharedHandle<DestructorTypeOf<VULKAN_HPP_NAMESPACE::SwapchainKHR>> parent{};
typename SharedHandleTraits<VULKAN_HPP_NAMESPACE::SwapchainKHR>::deleter deleter{}; typename SharedHandleTraits<VULKAN_HPP_NAMESPACE::SwapchainKHR>::deleter deleter{};
}; };
@ -685,7 +724,7 @@ namespace VULKAN_HPP_NAMESPACE
SharedHandle() = default; SharedHandle() = default;
explicit SharedHandle( VULKAN_HPP_NAMESPACE::SwapchainKHR handle, explicit SharedHandle( VULKAN_HPP_NAMESPACE::SwapchainKHR handle,
SharedHandle<DeleteDestructorOf<VULKAN_HPP_NAMESPACE::SwapchainKHR>> parent, SharedHandle<DestructorTypeOf<VULKAN_HPP_NAMESPACE::SwapchainKHR>> parent,
SharedHandle<VULKAN_HPP_NAMESPACE::SurfaceKHR> surface, SharedHandle<VULKAN_HPP_NAMESPACE::SurfaceKHR> surface,
DeleterType deleter = DeleterType() ) VULKAN_HPP_NOEXCEPT DeleterType deleter = DeleterType() ) VULKAN_HPP_NOEXCEPT
: BaseType( handle, std::move( surface ), std::move( parent ), std::move( deleter ) ) : BaseType( handle, std::move( surface ), std::move( parent ), std::move( deleter ) )