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}_hash.hpp>
#include <vulkan/${api}_raii.hpp>
#include <vulkan/${api}_shared.hpp>
export module ${api}_hpp;

View File

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

View File

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

View File

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