mirror of
https://github.com/KhronosGroup/Vulkan-Hpp.git
synced 2025-09-12 05:16:21 -04:00
Add template CppType to get from C-struct types to vk-struct types, valid with C++20 and above. (#2274)
This commit is contained in:
parent
8f2955ba0d
commit
db104e1c01
4
.github/workflows/ci-ubuntu-22.yml
vendored
4
.github/workflows/ci-ubuntu-22.yml
vendored
@ -101,9 +101,11 @@ jobs:
|
||||
run: |
|
||||
for CXX_STANDARD in 11 14 17 20 23; do
|
||||
for BUILD_TYPE in Debug Release; do
|
||||
if [ ${{matrix.compiler}} == g++-10 ] && [ $CXX_STANDARD == 23 ]; then
|
||||
if [ ${{matrix.compiler}} == g++-10 ]; then
|
||||
if [ $CXX_STANDARD == 20 ] || [ $CXX_STANDARD == 23 ]; then
|
||||
continue
|
||||
fi
|
||||
fi
|
||||
|
||||
echo "================================================================================="
|
||||
echo "Building C++$CXX_STANDARD in $BUILD_TYPE"
|
||||
|
@ -11997,6 +11997,14 @@ ${compareOperators}
|
||||
public:
|
||||
${members}
|
||||
};
|
||||
|
||||
#if 20 <= VULKAN_HPP_CPP_VERSION
|
||||
template <>
|
||||
struct CppType<Vk${structureType}>
|
||||
{
|
||||
using Type = ${structureType};
|
||||
};
|
||||
#endif
|
||||
)";
|
||||
|
||||
std::string allowDuplicate, typeValue;
|
||||
@ -12767,6 +12775,14 @@ ${setters}
|
||||
|
||||
${members}
|
||||
};
|
||||
|
||||
#if 20 <= VULKAN_HPP_CPP_VERSION
|
||||
template <>
|
||||
struct CppType<Vk${unionName}>
|
||||
{
|
||||
using Type = ${unionName};
|
||||
};
|
||||
#endif
|
||||
${leave})";
|
||||
|
||||
return replaceWithMap(
|
||||
|
@ -30,6 +30,12 @@ static_assert( std::is_same<vk::CppType<vk::IndexType, vk::IndexType::eUint16>::
|
||||
static_assert( std::is_same<vk::CppType<vk::ObjectType, vk::ObjectType::eInstance>::Type, vk::Instance>::value, "" );
|
||||
static_assert( std::is_same<vk::CppType<vk::DebugReportObjectTypeEXT, vk::DebugReportObjectTypeEXT ::eInstance>::Type, vk::Instance>::value, "" );
|
||||
|
||||
#if 20 <= VULKAN_HPP_CPP_VERSION
|
||||
static_assert( std::is_same<vk::CppType<VkAabbPositionsKHR>::Type, vk::AabbPositionsKHR>::value, "" );
|
||||
static_assert( std::is_same<vk::CppType<VkDeviceOrHostAddressConstKHR>::Type, vk::DeviceOrHostAddressConstKHR>::value, "" );
|
||||
static_assert( std::is_same<vk::CppType<VkAccelerationStructureGeometryTrianglesDataKHR>::Type, vk::AccelerationStructureGeometryTrianglesDataKHR>::value, "" );
|
||||
#endif
|
||||
|
||||
#if ( VK_USE_64_BIT_PTR_DEFINES == 1 )
|
||||
static_assert( std::is_same<vk::CppType<VkInstance>::Type, vk::Instance>::value, "" );
|
||||
#endif
|
||||
|
File diff suppressed because it is too large
Load Diff
3047
vulkan/vulkansc.cppm
3047
vulkan/vulkansc.cppm
File diff suppressed because it is too large
Load Diff
8626
vulkan/vulkansc.hpp
8626
vulkan/vulkansc.hpp
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@ -1,739 +0,0 @@
|
||||
// Copyright 2015-2024 The Khronos Group Inc.
|
||||
//
|
||||
// SPDX-License-Identifier: Apache-2.0 OR MIT
|
||||
//
|
||||
|
||||
// This header is generated from the Khronos Vulkan XML API Registry.
|
||||
|
||||
#ifndef VULKAN_EXTENSION_INSPECTION_HPP
|
||||
#define VULKAN_EXTENSION_INSPECTION_HPP
|
||||
|
||||
#if defined( VULKAN_HPP_ENABLE_STD_MODULE ) && defined( VULKAN_HPP_STD_MODULE )
|
||||
import VULKAN_HPP_STD_MODULE;
|
||||
#else
|
||||
# include <map>
|
||||
# include <set>
|
||||
# include <string>
|
||||
# include <vector>
|
||||
# include <vulkan/vulkansc.hpp>
|
||||
#endif
|
||||
|
||||
namespace VULKAN_HPP_NAMESPACE
|
||||
{
|
||||
//======================================
|
||||
//=== Extension inspection functions ===
|
||||
//======================================
|
||||
|
||||
std::set<std::string> const & getDeviceExtensions();
|
||||
std::set<std::string> const & getInstanceExtensions();
|
||||
std::map<std::string, std::string> const & getDeprecatedExtensions();
|
||||
std::map<std::string, std::vector<std::vector<std::string>>> const & getExtensionDepends( std::string const & extension );
|
||||
|
||||
std::map<std::string, std::string> const & getObsoletedExtensions();
|
||||
std::map<std::string, std::string> const & getPromotedExtensions();
|
||||
VULKAN_HPP_CONSTEXPR_20 std::string getExtensionDeprecatedBy( std::string const & extension );
|
||||
VULKAN_HPP_CONSTEXPR_20 std::string getExtensionObsoletedBy( std::string const & extension );
|
||||
VULKAN_HPP_CONSTEXPR_20 std::string getExtensionPromotedTo( std::string const & extension );
|
||||
VULKAN_HPP_CONSTEXPR_20 bool isDeprecatedExtension( std::string const & extension );
|
||||
VULKAN_HPP_CONSTEXPR_20 bool isDeviceExtension( std::string const & extension );
|
||||
VULKAN_HPP_CONSTEXPR_20 bool isInstanceExtension( std::string const & extension );
|
||||
VULKAN_HPP_CONSTEXPR_20 bool isObsoletedExtension( std::string const & extension );
|
||||
VULKAN_HPP_CONSTEXPR_20 bool isPromotedExtension( std::string const & extension );
|
||||
|
||||
//=====================================================
|
||||
//=== Extension inspection function implementations ===
|
||||
//=====================================================
|
||||
|
||||
VULKAN_HPP_INLINE std::map<std::string, std::string> const & getDeprecatedExtensions()
|
||||
{
|
||||
static const std::map<std::string, std::string> deprecatedExtensions = {
|
||||
{ "VK_EXT_validation_features", "VK_EXT_layer_settings" },
|
||||
#if defined( VK_USE_PLATFORM_SCI )
|
||||
{ "VK_NV_external_sci_sync", "VK_NV_external_sci_sync2" }
|
||||
#endif /*VK_USE_PLATFORM_SCI*/
|
||||
};
|
||||
return deprecatedExtensions;
|
||||
}
|
||||
|
||||
VULKAN_HPP_INLINE std::set<std::string> const & getDeviceExtensions()
|
||||
{
|
||||
static const std::set<std::string> deviceExtensions = {
|
||||
"VK_KHR_swapchain",
|
||||
"VK_KHR_display_swapchain",
|
||||
"VK_EXT_depth_range_unrestricted",
|
||||
"VK_NV_private_vendor_info",
|
||||
"VK_EXT_texture_compression_astc_hdr",
|
||||
"VK_EXT_astc_decode_mode",
|
||||
"VK_KHR_external_memory_fd",
|
||||
"VK_KHR_external_semaphore_fd",
|
||||
"VK_KHR_incremental_present",
|
||||
"VK_EXT_display_control",
|
||||
"VK_EXT_discard_rectangles",
|
||||
"VK_EXT_conservative_rasterization",
|
||||
"VK_EXT_depth_clip_enable",
|
||||
"VK_EXT_hdr_metadata",
|
||||
"VK_KHR_shared_presentable_image",
|
||||
"VK_KHR_external_fence_fd",
|
||||
"VK_KHR_performance_query",
|
||||
"VK_EXT_external_memory_dma_buf",
|
||||
"VK_EXT_queue_family_foreign",
|
||||
"VK_EXT_shader_stencil_export",
|
||||
"VK_EXT_sample_locations",
|
||||
"VK_EXT_blend_operation_advanced",
|
||||
"VK_EXT_post_depth_coverage",
|
||||
"VK_EXT_image_drm_format_modifier",
|
||||
"VK_EXT_filter_cubic",
|
||||
"VK_EXT_external_memory_host",
|
||||
"VK_KHR_shader_clock",
|
||||
"VK_KHR_global_priority",
|
||||
"VK_KHR_swapchain_mutable_format",
|
||||
"VK_EXT_pci_bus_info",
|
||||
"VK_KHR_shader_terminate_invocation",
|
||||
"VK_EXT_subgroup_size_control",
|
||||
"VK_KHR_fragment_shading_rate",
|
||||
"VK_EXT_shader_image_atomic_int64",
|
||||
"VK_EXT_memory_budget",
|
||||
"VK_EXT_fragment_shader_interlock",
|
||||
"VK_EXT_ycbcr_image_arrays",
|
||||
"VK_EXT_line_rasterization",
|
||||
"VK_EXT_shader_atomic_float",
|
||||
"VK_EXT_index_type_uint8",
|
||||
"VK_EXT_extended_dynamic_state",
|
||||
"VK_EXT_shader_demote_to_helper_invocation",
|
||||
"VK_EXT_texel_buffer_alignment",
|
||||
"VK_EXT_robustness2",
|
||||
"VK_EXT_custom_border_color",
|
||||
"VK_KHR_object_refresh",
|
||||
"VK_KHR_synchronization2",
|
||||
"VK_EXT_ycbcr_2plane_444_formats",
|
||||
"VK_EXT_image_robustness",
|
||||
"VK_KHR_copy_commands2",
|
||||
"VK_EXT_4444_formats",
|
||||
#if defined( VK_USE_PLATFORM_WIN32_KHR )
|
||||
"VK_NV_acquire_winrt_display",
|
||||
#endif /*VK_USE_PLATFORM_WIN32_KHR*/
|
||||
"VK_EXT_vertex_input_dynamic_state",
|
||||
#if defined( VK_USE_PLATFORM_SCI )
|
||||
"VK_NV_external_sci_sync",
|
||||
"VK_NV_external_memory_sci_buf",
|
||||
#endif /*VK_USE_PLATFORM_SCI*/
|
||||
"VK_EXT_extended_dynamic_state2",
|
||||
"VK_EXT_color_write_enable",
|
||||
#if defined( VK_USE_PLATFORM_SCI )
|
||||
"VK_NV_external_sci_sync2",
|
||||
#endif /*VK_USE_PLATFORM_SCI*/
|
||||
"VK_KHR_vertex_attribute_divisor",
|
||||
#if defined( VK_USE_PLATFORM_SCREEN_QNX )
|
||||
"VK_QNX_external_memory_screen_buffer",
|
||||
#endif /*VK_USE_PLATFORM_SCREEN_QNX*/
|
||||
"VK_KHR_index_type_uint8",
|
||||
"VK_KHR_line_rasterization",
|
||||
"VK_KHR_calibrated_timestamps"
|
||||
};
|
||||
return deviceExtensions;
|
||||
}
|
||||
|
||||
VULKAN_HPP_INLINE std::set<std::string> const & getInstanceExtensions()
|
||||
{
|
||||
static const std::set<std::string> instanceExtensions = { "VK_KHR_surface",
|
||||
"VK_KHR_display",
|
||||
"VK_EXT_direct_mode_display",
|
||||
"VK_EXT_display_surface_counter",
|
||||
"VK_EXT_swapchain_colorspace",
|
||||
"VK_KHR_get_surface_capabilities2",
|
||||
"VK_KHR_get_display_properties2",
|
||||
"VK_EXT_debug_utils",
|
||||
"VK_EXT_validation_features",
|
||||
"VK_EXT_headless_surface",
|
||||
"VK_EXT_application_parameters",
|
||||
"VK_EXT_layer_settings" };
|
||||
return instanceExtensions;
|
||||
}
|
||||
|
||||
VULKAN_HPP_INLINE std::map<std::string, std::vector<std::vector<std::string>>> const & getExtensionDepends( std::string const & extension )
|
||||
{
|
||||
static const std::map<std::string, std::vector<std::vector<std::string>>> noDependencies;
|
||||
static const std::map<std::string, std::map<std::string, std::vector<std::vector<std::string>>>> dependencies = {
|
||||
{ "VK_KHR_swapchain",
|
||||
{ { "VK_VERSION_1_0",
|
||||
{ {
|
||||
"VK_KHR_surface",
|
||||
} } } } },
|
||||
{ "VK_KHR_display",
|
||||
{ { "VK_VERSION_1_0",
|
||||
{ {
|
||||
"VK_KHR_surface",
|
||||
} } } } },
|
||||
{ "VK_KHR_display_swapchain",
|
||||
{ { "VK_VERSION_1_0",
|
||||
{ {
|
||||
"VK_KHR_swapchain",
|
||||
"VK_KHR_display",
|
||||
} } } } },
|
||||
{ "VK_EXT_texture_compression_astc_hdr",
|
||||
{ { "VK_VERSION_1_0",
|
||||
{ {
|
||||
"VK_KHR_get_physical_device_properties2",
|
||||
} } },
|
||||
{ "VK_VERSION_1_1", { {} } } } },
|
||||
{ "VK_EXT_astc_decode_mode",
|
||||
{ { "VK_VERSION_1_0",
|
||||
{ {
|
||||
"VK_KHR_get_physical_device_properties2",
|
||||
} } },
|
||||
{ "VK_VERSION_1_1", { {} } } } },
|
||||
{ "VK_KHR_external_memory_fd",
|
||||
{ { "VK_VERSION_1_0",
|
||||
{ {
|
||||
"VK_KHR_external_memory",
|
||||
} } },
|
||||
{ "VK_VERSION_1_1", { {} } } } },
|
||||
{ "VK_KHR_external_semaphore_fd",
|
||||
{ { "VK_VERSION_1_0",
|
||||
{ {
|
||||
"VK_KHR_external_semaphore",
|
||||
} } },
|
||||
{ "VK_VERSION_1_1", { {} } } } },
|
||||
{ "VK_KHR_incremental_present",
|
||||
{ { "VK_VERSION_1_0",
|
||||
{ {
|
||||
"VK_KHR_swapchain",
|
||||
} } } } },
|
||||
{ "VK_EXT_direct_mode_display",
|
||||
{ { "VK_VERSION_1_0",
|
||||
{ {
|
||||
"VK_KHR_display",
|
||||
} } } } },
|
||||
{ "VK_EXT_display_surface_counter",
|
||||
{ { "VK_VERSION_1_0",
|
||||
{ {
|
||||
"VK_KHR_display",
|
||||
} } } } },
|
||||
{ "VK_EXT_display_control",
|
||||
{ { "VK_VERSION_1_0",
|
||||
{ {
|
||||
"VK_EXT_display_surface_counter",
|
||||
"VK_KHR_swapchain",
|
||||
} } } } },
|
||||
{ "VK_EXT_discard_rectangles",
|
||||
{ { "VK_VERSION_1_0",
|
||||
{ {
|
||||
"VK_KHR_get_physical_device_properties2",
|
||||
} } },
|
||||
{ "VK_VERSION_1_1", { {} } } } },
|
||||
{ "VK_EXT_conservative_rasterization",
|
||||
{ { "VK_VERSION_1_0",
|
||||
{ {
|
||||
"VK_KHR_get_physical_device_properties2",
|
||||
} } },
|
||||
{ "VK_VERSION_1_1", { {} } } } },
|
||||
{ "VK_EXT_depth_clip_enable",
|
||||
{ { "VK_VERSION_1_0",
|
||||
{ {
|
||||
"VK_KHR_get_physical_device_properties2",
|
||||
} } },
|
||||
{ "VK_VERSION_1_1", { {} } } } },
|
||||
{ "VK_EXT_swapchain_colorspace",
|
||||
{ { "VK_VERSION_1_0",
|
||||
{ {
|
||||
"VK_KHR_surface",
|
||||
} } } } },
|
||||
{ "VK_EXT_hdr_metadata",
|
||||
{ { "VK_VERSION_1_0",
|
||||
{ {
|
||||
"VK_KHR_swapchain",
|
||||
} } } } },
|
||||
{ "VK_KHR_shared_presentable_image",
|
||||
{ { "VK_VERSION_1_0",
|
||||
{ {
|
||||
"VK_KHR_swapchain",
|
||||
"VK_KHR_get_surface_capabilities2",
|
||||
"VK_KHR_get_physical_device_properties2",
|
||||
} } },
|
||||
{ "VK_VERSION_1_1",
|
||||
{ {
|
||||
"VK_KHR_swapchain",
|
||||
"VK_KHR_get_surface_capabilities2",
|
||||
} } } } },
|
||||
{ "VK_KHR_external_fence_fd",
|
||||
{ { "VK_VERSION_1_0",
|
||||
{ {
|
||||
"VK_KHR_external_fence",
|
||||
} } },
|
||||
{ "VK_VERSION_1_1", { {} } } } },
|
||||
{ "VK_KHR_performance_query",
|
||||
{ { "VK_VERSION_1_0",
|
||||
{ {
|
||||
"VK_KHR_get_physical_device_properties2",
|
||||
} } },
|
||||
{ "VK_VERSION_1_1", { {} } } } },
|
||||
{ "VK_KHR_get_surface_capabilities2",
|
||||
{ { "VK_VERSION_1_0",
|
||||
{ {
|
||||
"VK_KHR_surface",
|
||||
} } } } },
|
||||
{ "VK_KHR_get_display_properties2",
|
||||
{ { "VK_VERSION_1_0",
|
||||
{ {
|
||||
"VK_KHR_display",
|
||||
} } } } },
|
||||
{ "VK_EXT_external_memory_dma_buf",
|
||||
{ { "VK_VERSION_1_0",
|
||||
{ {
|
||||
"VK_KHR_external_memory_fd",
|
||||
} } } } },
|
||||
{ "VK_EXT_queue_family_foreign",
|
||||
{ { "VK_VERSION_1_0",
|
||||
{ {
|
||||
"VK_KHR_external_memory",
|
||||
} } },
|
||||
{ "VK_VERSION_1_1", { {} } } } },
|
||||
{ "VK_EXT_sample_locations",
|
||||
{ { "VK_VERSION_1_0",
|
||||
{ {
|
||||
"VK_KHR_get_physical_device_properties2",
|
||||
} } },
|
||||
{ "VK_VERSION_1_1", { {} } } } },
|
||||
{ "VK_EXT_blend_operation_advanced",
|
||||
{ { "VK_VERSION_1_0",
|
||||
{ {
|
||||
"VK_KHR_get_physical_device_properties2",
|
||||
} } },
|
||||
{ "VK_VERSION_1_1", { {} } } } },
|
||||
{ "VK_EXT_image_drm_format_modifier",
|
||||
{ { "VK_VERSION_1_0",
|
||||
{ {
|
||||
"VK_KHR_bind_memory2",
|
||||
"VK_KHR_get_physical_device_properties2",
|
||||
"VK_KHR_sampler_ycbcr_conversion",
|
||||
} } },
|
||||
{ "VK_VERSION_1_1",
|
||||
{ {
|
||||
"VK_KHR_image_format_list",
|
||||
} } },
|
||||
{ "VK_VERSION_1_2", { {} } } } },
|
||||
{ "VK_EXT_external_memory_host",
|
||||
{ { "VK_VERSION_1_0",
|
||||
{ {
|
||||
"VK_KHR_external_memory",
|
||||
} } },
|
||||
{ "VK_VERSION_1_1", { {} } } } },
|
||||
{ "VK_KHR_shader_clock",
|
||||
{ { "VK_VERSION_1_0",
|
||||
{ {
|
||||
"VK_KHR_get_physical_device_properties2",
|
||||
} } },
|
||||
{ "VK_VERSION_1_1", { {} } } } },
|
||||
{ "VK_KHR_global_priority",
|
||||
{ { "VK_VERSION_1_0",
|
||||
{ {
|
||||
"VK_KHR_get_physical_device_properties2",
|
||||
} } },
|
||||
{ "VK_VERSION_1_1", { {} } } } },
|
||||
{ "VK_KHR_swapchain_mutable_format",
|
||||
{ { "VK_VERSION_1_0",
|
||||
{ {
|
||||
"VK_KHR_swapchain",
|
||||
"VK_KHR_maintenance2",
|
||||
"VK_KHR_image_format_list",
|
||||
} } },
|
||||
{ "VK_VERSION_1_1",
|
||||
{ {
|
||||
"VK_KHR_swapchain",
|
||||
"VK_KHR_image_format_list",
|
||||
} } },
|
||||
{ "VK_VERSION_1_2",
|
||||
{ {
|
||||
"VK_KHR_swapchain",
|
||||
} } } } },
|
||||
{ "VK_EXT_pci_bus_info",
|
||||
{ { "VK_VERSION_1_0",
|
||||
{ {
|
||||
"VK_KHR_get_physical_device_properties2",
|
||||
} } },
|
||||
{ "VK_VERSION_1_1", { {} } } } },
|
||||
{ "VK_KHR_shader_terminate_invocation",
|
||||
{ { "VK_VERSION_1_0",
|
||||
{ {
|
||||
"VK_KHR_get_physical_device_properties2",
|
||||
} } },
|
||||
{ "VK_VERSION_1_1", { {} } } } },
|
||||
{ "VK_EXT_subgroup_size_control", { { "VK_VERSION_1_1", { {} } } } },
|
||||
{ "VK_KHR_fragment_shading_rate",
|
||||
{ { "VK_VERSION_1_0",
|
||||
{ {
|
||||
"VK_KHR_get_physical_device_properties2",
|
||||
} } },
|
||||
{ "VK_VERSION_1_1",
|
||||
{ {
|
||||
"VK_KHR_create_renderpass2",
|
||||
} } },
|
||||
{ "VK_VERSION_1_2", { {} } } } },
|
||||
{ "VK_EXT_shader_image_atomic_int64",
|
||||
{ { "VK_VERSION_1_0",
|
||||
{ {
|
||||
"VK_KHR_get_physical_device_properties2",
|
||||
} } },
|
||||
{ "VK_VERSION_1_1", { {} } } } },
|
||||
{ "VK_EXT_memory_budget",
|
||||
{ { "VK_VERSION_1_0",
|
||||
{ {
|
||||
"VK_KHR_get_physical_device_properties2",
|
||||
} } },
|
||||
{ "VK_VERSION_1_1", { {} } } } },
|
||||
{ "VK_EXT_fragment_shader_interlock",
|
||||
{ { "VK_VERSION_1_0",
|
||||
{ {
|
||||
"VK_KHR_get_physical_device_properties2",
|
||||
} } },
|
||||
{ "VK_VERSION_1_1", { {} } } } },
|
||||
{ "VK_EXT_ycbcr_image_arrays",
|
||||
{ { "VK_VERSION_1_0",
|
||||
{ {
|
||||
"VK_KHR_sampler_ycbcr_conversion",
|
||||
} } },
|
||||
{ "VK_VERSION_1_1", { {} } } } },
|
||||
{ "VK_EXT_headless_surface",
|
||||
{ { "VK_VERSION_1_0",
|
||||
{ {
|
||||
"VK_KHR_surface",
|
||||
} } } } },
|
||||
{ "VK_EXT_line_rasterization",
|
||||
{ { "VK_VERSION_1_0",
|
||||
{ {
|
||||
"VK_KHR_get_physical_device_properties2",
|
||||
} } },
|
||||
{ "VK_VERSION_1_1", { {} } } } },
|
||||
{ "VK_EXT_shader_atomic_float",
|
||||
{ { "VK_VERSION_1_0",
|
||||
{ {
|
||||
"VK_KHR_get_physical_device_properties2",
|
||||
} } },
|
||||
{ "VK_VERSION_1_1", { {} } } } },
|
||||
{ "VK_EXT_index_type_uint8",
|
||||
{ { "VK_VERSION_1_0",
|
||||
{ {
|
||||
"VK_KHR_get_physical_device_properties2",
|
||||
} } },
|
||||
{ "VK_VERSION_1_1", { {} } } } },
|
||||
{ "VK_EXT_extended_dynamic_state",
|
||||
{ { "VK_VERSION_1_0",
|
||||
{ {
|
||||
"VK_KHR_get_physical_device_properties2",
|
||||
} } },
|
||||
{ "VK_VERSION_1_1", { {} } } } },
|
||||
{ "VK_EXT_shader_demote_to_helper_invocation",
|
||||
{ { "VK_VERSION_1_0",
|
||||
{ {
|
||||
"VK_KHR_get_physical_device_properties2",
|
||||
} } },
|
||||
{ "VK_VERSION_1_1", { {} } } } },
|
||||
{ "VK_EXT_texel_buffer_alignment",
|
||||
{ { "VK_VERSION_1_0",
|
||||
{ {
|
||||
"VK_KHR_get_physical_device_properties2",
|
||||
} } },
|
||||
{ "VK_VERSION_1_1", { {} } } } },
|
||||
{ "VK_EXT_robustness2",
|
||||
{ { "VK_VERSION_1_0",
|
||||
{ {
|
||||
"VK_KHR_get_physical_device_properties2",
|
||||
} } },
|
||||
{ "VK_VERSION_1_1", { {} } } } },
|
||||
{ "VK_EXT_custom_border_color",
|
||||
{ { "VK_VERSION_1_0",
|
||||
{ {
|
||||
"VK_KHR_get_physical_device_properties2",
|
||||
} } },
|
||||
{ "VK_VERSION_1_1", { {} } } } },
|
||||
{ "VK_KHR_synchronization2",
|
||||
{ { "VK_VERSION_1_0",
|
||||
{ {
|
||||
"VK_KHR_get_physical_device_properties2",
|
||||
} } },
|
||||
{ "VK_VERSION_1_1", { {} } } } },
|
||||
{ "VK_EXT_ycbcr_2plane_444_formats",
|
||||
{ { "VK_VERSION_1_0",
|
||||
{ {
|
||||
"VK_KHR_sampler_ycbcr_conversion",
|
||||
} } },
|
||||
{ "VK_VERSION_1_1", { {} } } } },
|
||||
{ "VK_EXT_image_robustness",
|
||||
{ { "VK_VERSION_1_0",
|
||||
{ {
|
||||
"VK_KHR_get_physical_device_properties2",
|
||||
} } },
|
||||
{ "VK_VERSION_1_1", { {} } } } },
|
||||
{ "VK_KHR_copy_commands2",
|
||||
{ { "VK_VERSION_1_0",
|
||||
{ {
|
||||
"VK_KHR_get_physical_device_properties2",
|
||||
} } },
|
||||
{ "VK_VERSION_1_1", { {} } } } },
|
||||
{ "VK_EXT_4444_formats",
|
||||
{ { "VK_VERSION_1_0",
|
||||
{ {
|
||||
"VK_KHR_get_physical_device_properties2",
|
||||
} } },
|
||||
{ "VK_VERSION_1_1", { {} } } } },
|
||||
#if defined( VK_USE_PLATFORM_WIN32_KHR )
|
||||
{ "VK_NV_acquire_winrt_display",
|
||||
{ { "VK_VERSION_1_0",
|
||||
{ {
|
||||
"VK_EXT_direct_mode_display",
|
||||
} } } } },
|
||||
#endif /*VK_USE_PLATFORM_WIN32_KHR*/
|
||||
{ "VK_EXT_vertex_input_dynamic_state",
|
||||
{ { "VK_VERSION_1_0",
|
||||
{ {
|
||||
"VK_KHR_get_physical_device_properties2",
|
||||
} } },
|
||||
{ "VK_VERSION_1_1", { {} } } } },
|
||||
#if defined( VK_USE_PLATFORM_SCI )
|
||||
{ "VK_NV_external_sci_sync", { { "VK_VERSION_1_1", { {} } } } },
|
||||
{ "VK_NV_external_memory_sci_buf", { { "VK_VERSION_1_1", { {} } } } },
|
||||
#endif /*VK_USE_PLATFORM_SCI*/
|
||||
{ "VK_EXT_extended_dynamic_state2",
|
||||
{ { "VK_VERSION_1_0",
|
||||
{ {
|
||||
"VK_KHR_get_physical_device_properties2",
|
||||
} } },
|
||||
{ "VK_VERSION_1_1", { {} } } } },
|
||||
{ "VK_EXT_color_write_enable",
|
||||
{ { "VK_VERSION_1_0",
|
||||
{ {
|
||||
"VK_KHR_get_physical_device_properties2",
|
||||
} } },
|
||||
{ "VK_VERSION_1_1", { {} } } } },
|
||||
#if defined( VK_USE_PLATFORM_SCI )
|
||||
{ "VK_NV_external_sci_sync2", { { "VK_VERSION_1_1", { {} } } } },
|
||||
#endif /*VK_USE_PLATFORM_SCI*/
|
||||
{ "VK_KHR_vertex_attribute_divisor",
|
||||
{ { "VK_VERSION_1_0",
|
||||
{ {
|
||||
"VK_KHR_get_physical_device_properties2",
|
||||
} } },
|
||||
{ "VK_VERSION_1_1", { {} } } } },
|
||||
#if defined( VK_USE_PLATFORM_SCREEN_QNX )
|
||||
{ "VK_QNX_external_memory_screen_buffer",
|
||||
{ { "VK_VERSION_1_0",
|
||||
{ {
|
||||
"VK_KHR_sampler_ycbcr_conversion",
|
||||
"VK_KHR_external_memory",
|
||||
"VK_KHR_dedicated_allocation",
|
||||
} } },
|
||||
{ "VK_VERSION_1_1",
|
||||
{ {
|
||||
"VK_EXT_queue_family_foreign",
|
||||
} } } } },
|
||||
#endif /*VK_USE_PLATFORM_SCREEN_QNX*/
|
||||
{ "VK_KHR_index_type_uint8",
|
||||
{ { "VK_VERSION_1_0",
|
||||
{ {
|
||||
"VK_KHR_get_physical_device_properties2",
|
||||
} } },
|
||||
{ "VK_VERSION_1_1", { {} } } } },
|
||||
{ "VK_KHR_line_rasterization",
|
||||
{ { "VK_VERSION_1_0",
|
||||
{ {
|
||||
"VK_KHR_get_physical_device_properties2",
|
||||
} } },
|
||||
{ "VK_VERSION_1_1", { {} } } } },
|
||||
{ "VK_KHR_calibrated_timestamps",
|
||||
{ { "VK_VERSION_1_0",
|
||||
{ {
|
||||
"VK_KHR_get_physical_device_properties2",
|
||||
} } },
|
||||
{ "VK_VERSION_1_1", { {} } } } }
|
||||
};
|
||||
auto depIt = dependencies.find( extension );
|
||||
return ( depIt != dependencies.end() ) ? depIt->second : noDependencies;
|
||||
}
|
||||
|
||||
VULKAN_HPP_INLINE std::map<std::string, std::string> const & getObsoletedExtensions()
|
||||
{
|
||||
static const std::map<std::string, std::string> obsoletedExtensions = {};
|
||||
return obsoletedExtensions;
|
||||
}
|
||||
|
||||
VULKAN_HPP_INLINE std::map<std::string, std::string> const & getPromotedExtensions()
|
||||
{
|
||||
static const std::map<std::string, std::string> promotedExtensions = { { "VK_EXT_texture_compression_astc_hdr", "VK_VERSION_1_3" },
|
||||
{ "VK_KHR_shader_terminate_invocation", "VK_VERSION_1_3" },
|
||||
{ "VK_EXT_subgroup_size_control", "VK_VERSION_1_3" },
|
||||
{ "VK_EXT_line_rasterization", "VK_KHR_line_rasterization" },
|
||||
{ "VK_EXT_index_type_uint8", "VK_KHR_index_type_uint8" },
|
||||
{ "VK_EXT_extended_dynamic_state", "VK_VERSION_1_3" },
|
||||
{ "VK_EXT_shader_demote_to_helper_invocation", "VK_VERSION_1_3" },
|
||||
{ "VK_EXT_texel_buffer_alignment", "VK_VERSION_1_3" },
|
||||
{ "VK_KHR_synchronization2", "VK_VERSION_1_3" },
|
||||
{ "VK_EXT_ycbcr_2plane_444_formats", "VK_VERSION_1_3" },
|
||||
{ "VK_EXT_image_robustness", "VK_VERSION_1_3" },
|
||||
{ "VK_KHR_copy_commands2", "VK_VERSION_1_3" },
|
||||
{ "VK_EXT_4444_formats", "VK_VERSION_1_3" },
|
||||
{ "VK_EXT_extended_dynamic_state2", "VK_VERSION_1_3" } };
|
||||
return promotedExtensions;
|
||||
}
|
||||
|
||||
VULKAN_HPP_INLINE VULKAN_HPP_CONSTEXPR_20 std::string getExtensionDeprecatedBy( std::string const & extension )
|
||||
{
|
||||
(void)extension;
|
||||
|
||||
if ( extension == "VK_EXT_validation_features" )
|
||||
{
|
||||
return "VK_EXT_layer_settings";
|
||||
}
|
||||
#if defined( VK_USE_PLATFORM_SCI )
|
||||
if ( extension == "VK_NV_external_sci_sync" )
|
||||
{
|
||||
return "VK_NV_external_sci_sync2";
|
||||
}
|
||||
#endif /*VK_USE_PLATFORM_SCI*/
|
||||
|
||||
return "";
|
||||
}
|
||||
|
||||
VULKAN_HPP_INLINE VULKAN_HPP_CONSTEXPR_20 std::string getExtensionObsoletedBy( std::string const & extension )
|
||||
{
|
||||
(void)extension;
|
||||
|
||||
return "";
|
||||
}
|
||||
|
||||
VULKAN_HPP_INLINE VULKAN_HPP_CONSTEXPR_20 std::string getExtensionPromotedTo( std::string const & extension )
|
||||
{
|
||||
if ( extension == "VK_EXT_texture_compression_astc_hdr" )
|
||||
{
|
||||
return "VK_VERSION_1_3";
|
||||
}
|
||||
if ( extension == "VK_KHR_shader_terminate_invocation" )
|
||||
{
|
||||
return "VK_VERSION_1_3";
|
||||
}
|
||||
if ( extension == "VK_EXT_subgroup_size_control" )
|
||||
{
|
||||
return "VK_VERSION_1_3";
|
||||
}
|
||||
if ( extension == "VK_EXT_line_rasterization" )
|
||||
{
|
||||
return "VK_KHR_line_rasterization";
|
||||
}
|
||||
if ( extension == "VK_EXT_index_type_uint8" )
|
||||
{
|
||||
return "VK_KHR_index_type_uint8";
|
||||
}
|
||||
if ( extension == "VK_EXT_extended_dynamic_state" )
|
||||
{
|
||||
return "VK_VERSION_1_3";
|
||||
}
|
||||
if ( extension == "VK_EXT_shader_demote_to_helper_invocation" )
|
||||
{
|
||||
return "VK_VERSION_1_3";
|
||||
}
|
||||
if ( extension == "VK_EXT_texel_buffer_alignment" )
|
||||
{
|
||||
return "VK_VERSION_1_3";
|
||||
}
|
||||
if ( extension == "VK_KHR_synchronization2" )
|
||||
{
|
||||
return "VK_VERSION_1_3";
|
||||
}
|
||||
if ( extension == "VK_EXT_ycbcr_2plane_444_formats" )
|
||||
{
|
||||
return "VK_VERSION_1_3";
|
||||
}
|
||||
if ( extension == "VK_EXT_image_robustness" )
|
||||
{
|
||||
return "VK_VERSION_1_3";
|
||||
}
|
||||
if ( extension == "VK_KHR_copy_commands2" )
|
||||
{
|
||||
return "VK_VERSION_1_3";
|
||||
}
|
||||
if ( extension == "VK_EXT_4444_formats" )
|
||||
{
|
||||
return "VK_VERSION_1_3";
|
||||
}
|
||||
if ( extension == "VK_EXT_extended_dynamic_state2" )
|
||||
{
|
||||
return "VK_VERSION_1_3";
|
||||
}
|
||||
return "";
|
||||
}
|
||||
|
||||
VULKAN_HPP_INLINE VULKAN_HPP_CONSTEXPR_20 bool isDeprecatedExtension( std::string const & extension )
|
||||
{
|
||||
(void)extension;
|
||||
return ( extension == "VK_EXT_validation_features" ) ||
|
||||
#if defined( VK_USE_PLATFORM_SCI )
|
||||
( extension == "VK_NV_external_sci_sync" )
|
||||
#endif /*VK_USE_PLATFORM_SCI*/
|
||||
;
|
||||
}
|
||||
|
||||
VULKAN_HPP_INLINE VULKAN_HPP_CONSTEXPR_20 bool isDeviceExtension( std::string const & extension )
|
||||
{
|
||||
return ( extension == "VK_KHR_swapchain" ) || ( extension == "VK_KHR_display_swapchain" ) || ( extension == "VK_EXT_depth_range_unrestricted" ) ||
|
||||
( extension == "VK_NV_private_vendor_info" ) || ( extension == "VK_EXT_texture_compression_astc_hdr" ) ||
|
||||
( extension == "VK_EXT_astc_decode_mode" ) || ( extension == "VK_KHR_external_memory_fd" ) || ( extension == "VK_KHR_external_semaphore_fd" ) ||
|
||||
( extension == "VK_KHR_incremental_present" ) || ( extension == "VK_EXT_display_control" ) || ( extension == "VK_EXT_discard_rectangles" ) ||
|
||||
( extension == "VK_EXT_conservative_rasterization" ) || ( extension == "VK_EXT_depth_clip_enable" ) || ( extension == "VK_EXT_hdr_metadata" ) ||
|
||||
( extension == "VK_KHR_shared_presentable_image" ) || ( extension == "VK_KHR_external_fence_fd" ) || ( extension == "VK_KHR_performance_query" ) ||
|
||||
( extension == "VK_EXT_external_memory_dma_buf" ) || ( extension == "VK_EXT_queue_family_foreign" ) ||
|
||||
( extension == "VK_EXT_shader_stencil_export" ) || ( extension == "VK_EXT_sample_locations" ) ||
|
||||
( extension == "VK_EXT_blend_operation_advanced" ) || ( extension == "VK_EXT_post_depth_coverage" ) ||
|
||||
( extension == "VK_EXT_image_drm_format_modifier" ) || ( extension == "VK_EXT_filter_cubic" ) || ( extension == "VK_EXT_external_memory_host" ) ||
|
||||
( extension == "VK_KHR_shader_clock" ) || ( extension == "VK_KHR_global_priority" ) || ( extension == "VK_KHR_swapchain_mutable_format" ) ||
|
||||
( extension == "VK_EXT_pci_bus_info" ) || ( extension == "VK_KHR_shader_terminate_invocation" ) || ( extension == "VK_EXT_subgroup_size_control" ) ||
|
||||
( extension == "VK_KHR_fragment_shading_rate" ) || ( extension == "VK_EXT_shader_image_atomic_int64" ) || ( extension == "VK_EXT_memory_budget" ) ||
|
||||
( extension == "VK_EXT_fragment_shader_interlock" ) || ( extension == "VK_EXT_ycbcr_image_arrays" ) ||
|
||||
( extension == "VK_EXT_line_rasterization" ) || ( extension == "VK_EXT_shader_atomic_float" ) || ( extension == "VK_EXT_index_type_uint8" ) ||
|
||||
( extension == "VK_EXT_extended_dynamic_state" ) || ( extension == "VK_EXT_shader_demote_to_helper_invocation" ) ||
|
||||
( extension == "VK_EXT_texel_buffer_alignment" ) || ( extension == "VK_EXT_robustness2" ) || ( extension == "VK_EXT_custom_border_color" ) ||
|
||||
( extension == "VK_KHR_object_refresh" ) || ( extension == "VK_KHR_synchronization2" ) || ( extension == "VK_EXT_ycbcr_2plane_444_formats" ) ||
|
||||
( extension == "VK_EXT_image_robustness" ) || ( extension == "VK_KHR_copy_commands2" ) || ( extension == "VK_EXT_4444_formats" )
|
||||
#if defined( VK_USE_PLATFORM_WIN32_KHR )
|
||||
|| ( extension == "VK_NV_acquire_winrt_display" )
|
||||
#endif /*VK_USE_PLATFORM_WIN32_KHR*/
|
||||
|| ( extension == "VK_EXT_vertex_input_dynamic_state" )
|
||||
#if defined( VK_USE_PLATFORM_SCI )
|
||||
|| ( extension == "VK_NV_external_sci_sync" ) || ( extension == "VK_NV_external_memory_sci_buf" )
|
||||
#endif /*VK_USE_PLATFORM_SCI*/
|
||||
|| ( extension == "VK_EXT_extended_dynamic_state2" ) || ( extension == "VK_EXT_color_write_enable" )
|
||||
#if defined( VK_USE_PLATFORM_SCI )
|
||||
|| ( extension == "VK_NV_external_sci_sync2" )
|
||||
#endif /*VK_USE_PLATFORM_SCI*/
|
||||
|| ( extension == "VK_KHR_vertex_attribute_divisor" )
|
||||
#if defined( VK_USE_PLATFORM_SCREEN_QNX )
|
||||
|| ( extension == "VK_QNX_external_memory_screen_buffer" )
|
||||
#endif /*VK_USE_PLATFORM_SCREEN_QNX*/
|
||||
|| ( extension == "VK_KHR_index_type_uint8" ) || ( extension == "VK_KHR_line_rasterization" ) || ( extension == "VK_KHR_calibrated_timestamps" );
|
||||
}
|
||||
|
||||
VULKAN_HPP_INLINE VULKAN_HPP_CONSTEXPR_20 bool isInstanceExtension( std::string const & extension )
|
||||
{
|
||||
return ( extension == "VK_KHR_surface" ) || ( extension == "VK_KHR_display" ) || ( extension == "VK_EXT_direct_mode_display" ) ||
|
||||
( extension == "VK_EXT_display_surface_counter" ) || ( extension == "VK_EXT_swapchain_colorspace" ) ||
|
||||
( extension == "VK_KHR_get_surface_capabilities2" ) || ( extension == "VK_KHR_get_display_properties2" ) || ( extension == "VK_EXT_debug_utils" ) ||
|
||||
( extension == "VK_EXT_validation_features" ) || ( extension == "VK_EXT_headless_surface" ) || ( extension == "VK_EXT_application_parameters" ) ||
|
||||
( extension == "VK_EXT_layer_settings" );
|
||||
}
|
||||
|
||||
VULKAN_HPP_INLINE VULKAN_HPP_CONSTEXPR_20 bool isObsoletedExtension( std::string const & extension )
|
||||
{
|
||||
(void)extension;
|
||||
return false;
|
||||
}
|
||||
|
||||
VULKAN_HPP_INLINE VULKAN_HPP_CONSTEXPR_20 bool isPromotedExtension( std::string const & extension )
|
||||
{
|
||||
return ( extension == "VK_EXT_texture_compression_astc_hdr" ) || ( extension == "VK_KHR_shader_terminate_invocation" ) ||
|
||||
( extension == "VK_EXT_subgroup_size_control" ) || ( extension == "VK_EXT_line_rasterization" ) || ( extension == "VK_EXT_index_type_uint8" ) ||
|
||||
( extension == "VK_EXT_extended_dynamic_state" ) || ( extension == "VK_EXT_shader_demote_to_helper_invocation" ) ||
|
||||
( extension == "VK_EXT_texel_buffer_alignment" ) || ( extension == "VK_KHR_synchronization2" ) ||
|
||||
( extension == "VK_EXT_ycbcr_2plane_444_formats" ) || ( extension == "VK_EXT_image_robustness" ) || ( extension == "VK_KHR_copy_commands2" ) ||
|
||||
( extension == "VK_EXT_4444_formats" ) || ( extension == "VK_EXT_extended_dynamic_state2" );
|
||||
}
|
||||
} // namespace VULKAN_HPP_NAMESPACE
|
||||
|
||||
#endif
|
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@ -1,326 +0,0 @@
|
||||
// Copyright 2015-2024 The Khronos Group Inc.
|
||||
//
|
||||
// SPDX-License-Identifier: Apache-2.0 OR MIT
|
||||
//
|
||||
|
||||
// This header is generated from the Khronos Vulkan XML API Registry.
|
||||
|
||||
#ifndef VULKAN_HPP_MACROS_HPP
|
||||
#define VULKAN_HPP_MACROS_HPP
|
||||
|
||||
#if defined( _MSVC_LANG )
|
||||
# define VULKAN_HPP_CPLUSPLUS _MSVC_LANG
|
||||
#else
|
||||
# define VULKAN_HPP_CPLUSPLUS __cplusplus
|
||||
#endif
|
||||
|
||||
#if 202002L < VULKAN_HPP_CPLUSPLUS
|
||||
# define VULKAN_HPP_CPP_VERSION 23
|
||||
#elif 201703L < VULKAN_HPP_CPLUSPLUS
|
||||
# define VULKAN_HPP_CPP_VERSION 20
|
||||
#elif 201402L < VULKAN_HPP_CPLUSPLUS
|
||||
# define VULKAN_HPP_CPP_VERSION 17
|
||||
#elif 201103L < VULKAN_HPP_CPLUSPLUS
|
||||
# define VULKAN_HPP_CPP_VERSION 14
|
||||
#elif 199711L < VULKAN_HPP_CPLUSPLUS
|
||||
# define VULKAN_HPP_CPP_VERSION 11
|
||||
#else
|
||||
# error "vulkansc.hpp needs at least c++ standard version 11"
|
||||
#endif
|
||||
|
||||
// include headers holding feature-test macros
|
||||
#if 20 <= VULKAN_HPP_CPP_VERSION
|
||||
# include <version>
|
||||
#else
|
||||
# include <ciso646>
|
||||
#endif
|
||||
|
||||
#if defined( VULKAN_HPP_DISABLE_ENHANCED_MODE )
|
||||
# if !defined( VULKAN_HPP_NO_SMART_HANDLE )
|
||||
# define VULKAN_HPP_NO_SMART_HANDLE
|
||||
# endif
|
||||
#endif
|
||||
|
||||
#if defined( VULKAN_HPP_NO_CONSTRUCTORS )
|
||||
# if !defined( VULKAN_HPP_NO_STRUCT_CONSTRUCTORS )
|
||||
# define VULKAN_HPP_NO_STRUCT_CONSTRUCTORS
|
||||
# endif
|
||||
# if !defined( VULKAN_HPP_NO_UNION_CONSTRUCTORS )
|
||||
# define VULKAN_HPP_NO_UNION_CONSTRUCTORS
|
||||
# endif
|
||||
#endif
|
||||
|
||||
#if defined( VULKAN_HPP_NO_SETTERS )
|
||||
# if !defined( VULKAN_HPP_NO_STRUCT_SETTERS )
|
||||
# define VULKAN_HPP_NO_STRUCT_SETTERS
|
||||
# endif
|
||||
# if !defined( VULKAN_HPP_NO_UNION_SETTERS )
|
||||
# define VULKAN_HPP_NO_UNION_SETTERS
|
||||
# endif
|
||||
#endif
|
||||
|
||||
#if !defined( VULKAN_HPP_ASSERT )
|
||||
# define VULKAN_HPP_ASSERT assert
|
||||
#endif
|
||||
|
||||
#if !defined( VULKAN_HPP_ASSERT_ON_RESULT )
|
||||
# define VULKAN_HPP_ASSERT_ON_RESULT VULKAN_HPP_ASSERT
|
||||
#endif
|
||||
|
||||
#if !defined( VULKAN_HPP_STATIC_ASSERT )
|
||||
# define VULKAN_HPP_STATIC_ASSERT static_assert
|
||||
#endif
|
||||
|
||||
#if !defined( VULKAN_HPP_ENABLE_DYNAMIC_LOADER_TOOL )
|
||||
# define VULKAN_HPP_ENABLE_DYNAMIC_LOADER_TOOL 1
|
||||
#endif
|
||||
|
||||
#if !defined( __has_include )
|
||||
# define __has_include( x ) false
|
||||
#endif
|
||||
|
||||
#if ( 201907 <= __cpp_lib_three_way_comparison ) && __has_include( <compare> ) && !defined( VULKAN_HPP_NO_SPACESHIP_OPERATOR )
|
||||
# define VULKAN_HPP_HAS_SPACESHIP_OPERATOR
|
||||
#endif
|
||||
|
||||
#if ( 201803 <= __cpp_lib_span )
|
||||
# define VULKAN_HPP_SUPPORT_SPAN
|
||||
#endif
|
||||
|
||||
#if defined( __cpp_lib_modules ) && !defined( VULKAN_HPP_STD_MODULE ) && defined( VULKAN_HPP_ENABLE_STD_MODULE )
|
||||
# define VULKAN_HPP_STD_MODULE std.compat
|
||||
#endif
|
||||
|
||||
#ifndef VK_USE_64_BIT_PTR_DEFINES
|
||||
# if defined( __LP64__ ) || defined( _WIN64 ) || ( defined( __x86_64__ ) && !defined( __ILP32__ ) ) || defined( _M_X64 ) || defined( __ia64 ) || \
|
||||
defined( _M_IA64 ) || defined( __aarch64__ ) || defined( __powerpc64__ ) || ( defined( __riscv ) && __riscv_xlen == 64 )
|
||||
# define VK_USE_64_BIT_PTR_DEFINES 1
|
||||
# else
|
||||
# define VK_USE_64_BIT_PTR_DEFINES 0
|
||||
# endif
|
||||
#endif
|
||||
|
||||
// 32-bit vulkan is not typesafe for non-dispatchable handles, so don't allow copy constructors on this platform by default.
|
||||
// To enable this feature on 32-bit platforms please #define VULKAN_HPP_TYPESAFE_CONVERSION 1
|
||||
// To disable this feature on 64-bit platforms please #define VULKAN_HPP_TYPESAFE_CONVERSION 0
|
||||
#if ( VK_USE_64_BIT_PTR_DEFINES == 1 )
|
||||
# if !defined( VULKAN_HPP_TYPESAFE_CONVERSION )
|
||||
# define VULKAN_HPP_TYPESAFE_CONVERSION 1
|
||||
# endif
|
||||
#endif
|
||||
|
||||
#if defined( __GNUC__ )
|
||||
# define GCC_VERSION ( __GNUC__ * 10000 + __GNUC_MINOR__ * 100 + __GNUC_PATCHLEVEL__ )
|
||||
#endif
|
||||
|
||||
#if !defined( VULKAN_HPP_HAS_UNRESTRICTED_UNIONS )
|
||||
# if defined( __clang__ )
|
||||
# if __has_feature( cxx_unrestricted_unions )
|
||||
# define VULKAN_HPP_HAS_UNRESTRICTED_UNIONS
|
||||
# endif
|
||||
# elif defined( __GNUC__ )
|
||||
# if 40600 <= GCC_VERSION
|
||||
# define VULKAN_HPP_HAS_UNRESTRICTED_UNIONS
|
||||
# endif
|
||||
# elif defined( _MSC_VER )
|
||||
# if 1900 <= _MSC_VER
|
||||
# define VULKAN_HPP_HAS_UNRESTRICTED_UNIONS
|
||||
# endif
|
||||
# endif
|
||||
#endif
|
||||
|
||||
#if !defined( VULKAN_HPP_INLINE )
|
||||
# if defined( __clang__ )
|
||||
# if __has_attribute( always_inline )
|
||||
# define VULKAN_HPP_INLINE __attribute__( ( always_inline ) ) __inline__
|
||||
# else
|
||||
# define VULKAN_HPP_INLINE inline
|
||||
# endif
|
||||
# elif defined( __GNUC__ )
|
||||
# define VULKAN_HPP_INLINE __attribute__( ( always_inline ) ) __inline__
|
||||
# elif defined( _MSC_VER )
|
||||
# define VULKAN_HPP_INLINE inline
|
||||
# else
|
||||
# define VULKAN_HPP_INLINE inline
|
||||
# endif
|
||||
#endif
|
||||
|
||||
#if ( VULKAN_HPP_TYPESAFE_CONVERSION == 1 )
|
||||
# define VULKAN_HPP_TYPESAFE_EXPLICIT
|
||||
#else
|
||||
# define VULKAN_HPP_TYPESAFE_EXPLICIT explicit
|
||||
#endif
|
||||
|
||||
#if defined( __cpp_constexpr )
|
||||
# define VULKAN_HPP_CONSTEXPR constexpr
|
||||
# if 201304 <= __cpp_constexpr
|
||||
# define VULKAN_HPP_CONSTEXPR_14 constexpr
|
||||
# else
|
||||
# define VULKAN_HPP_CONSTEXPR_14
|
||||
# endif
|
||||
# if ( 201907 <= __cpp_constexpr ) && ( !defined( __GNUC__ ) || ( 110400 < GCC_VERSION ) )
|
||||
# define VULKAN_HPP_CONSTEXPR_20 constexpr
|
||||
# else
|
||||
# define VULKAN_HPP_CONSTEXPR_20
|
||||
# endif
|
||||
# define VULKAN_HPP_CONST_OR_CONSTEXPR constexpr
|
||||
#else
|
||||
# define VULKAN_HPP_CONSTEXPR
|
||||
# define VULKAN_HPP_CONSTEXPR_14
|
||||
# define VULKAN_HPP_CONST_OR_CONSTEXPR const
|
||||
#endif
|
||||
|
||||
#if !defined( VULKAN_HPP_CONSTEXPR_INLINE )
|
||||
# if 201606L <= __cpp_inline_variables
|
||||
# define VULKAN_HPP_CONSTEXPR_INLINE VULKAN_HPP_CONSTEXPR inline
|
||||
# else
|
||||
# define VULKAN_HPP_CONSTEXPR_INLINE VULKAN_HPP_CONSTEXPR
|
||||
# endif
|
||||
#endif
|
||||
|
||||
#if !defined( VULKAN_HPP_NOEXCEPT )
|
||||
# if defined( _MSC_VER ) && ( _MSC_VER <= 1800 )
|
||||
# define VULKAN_HPP_NOEXCEPT
|
||||
# else
|
||||
# define VULKAN_HPP_NOEXCEPT noexcept
|
||||
# define VULKAN_HPP_HAS_NOEXCEPT 1
|
||||
# if defined( VULKAN_HPP_NO_EXCEPTIONS )
|
||||
# define VULKAN_HPP_NOEXCEPT_WHEN_NO_EXCEPTIONS noexcept
|
||||
# else
|
||||
# define VULKAN_HPP_NOEXCEPT_WHEN_NO_EXCEPTIONS
|
||||
# endif
|
||||
# endif
|
||||
#endif
|
||||
|
||||
#if 14 <= VULKAN_HPP_CPP_VERSION
|
||||
# define VULKAN_HPP_DEPRECATED( msg ) [[deprecated( msg )]]
|
||||
#else
|
||||
# define VULKAN_HPP_DEPRECATED( msg )
|
||||
#endif
|
||||
|
||||
#if 17 <= VULKAN_HPP_CPP_VERSION
|
||||
# define VULKAN_HPP_DEPRECATED_17( msg ) [[deprecated( msg )]]
|
||||
#else
|
||||
# define VULKAN_HPP_DEPRECATED_17( msg )
|
||||
#endif
|
||||
|
||||
#if ( 17 <= VULKAN_HPP_CPP_VERSION ) && !defined( VULKAN_HPP_NO_NODISCARD_WARNINGS )
|
||||
# define VULKAN_HPP_NODISCARD [[nodiscard]]
|
||||
# if defined( VULKAN_HPP_NO_EXCEPTIONS )
|
||||
# define VULKAN_HPP_NODISCARD_WHEN_NO_EXCEPTIONS [[nodiscard]]
|
||||
# else
|
||||
# define VULKAN_HPP_NODISCARD_WHEN_NO_EXCEPTIONS
|
||||
# endif
|
||||
#else
|
||||
# define VULKAN_HPP_NODISCARD
|
||||
# define VULKAN_HPP_NODISCARD_WHEN_NO_EXCEPTIONS
|
||||
#endif
|
||||
|
||||
#if !defined( VULKAN_HPP_NAMESPACE )
|
||||
# define VULKAN_HPP_NAMESPACE vk
|
||||
#endif
|
||||
|
||||
#define VULKAN_HPP_STRINGIFY2( text ) #text
|
||||
#define VULKAN_HPP_STRINGIFY( text ) VULKAN_HPP_STRINGIFY2( text )
|
||||
#define VULKAN_HPP_NAMESPACE_STRING VULKAN_HPP_STRINGIFY( VULKAN_HPP_NAMESPACE )
|
||||
|
||||
#if !defined( VULKAN_HPP_DISPATCH_LOADER_DYNAMIC )
|
||||
# if defined( VK_NO_PROTOTYPES )
|
||||
# define VULKAN_HPP_DISPATCH_LOADER_DYNAMIC 1
|
||||
# else
|
||||
# define VULKAN_HPP_DISPATCH_LOADER_DYNAMIC 0
|
||||
# endif
|
||||
#endif
|
||||
|
||||
#if !defined( VULKAN_HPP_STORAGE_API )
|
||||
# if defined( VULKAN_HPP_STORAGE_SHARED )
|
||||
# if defined( _MSC_VER )
|
||||
# if defined( VULKAN_HPP_STORAGE_SHARED_EXPORT )
|
||||
# define VULKAN_HPP_STORAGE_API __declspec( dllexport )
|
||||
# else
|
||||
# define VULKAN_HPP_STORAGE_API __declspec( dllimport )
|
||||
# endif
|
||||
# elif defined( __clang__ ) || defined( __GNUC__ )
|
||||
# if defined( VULKAN_HPP_STORAGE_SHARED_EXPORT )
|
||||
# define VULKAN_HPP_STORAGE_API __attribute__( ( visibility( "default" ) ) )
|
||||
# else
|
||||
# define VULKAN_HPP_STORAGE_API
|
||||
# endif
|
||||
# else
|
||||
# define VULKAN_HPP_STORAGE_API
|
||||
# pragma warning Unknown import / export semantics
|
||||
# endif
|
||||
# else
|
||||
# define VULKAN_HPP_STORAGE_API
|
||||
# endif
|
||||
#endif
|
||||
|
||||
namespace VULKAN_HPP_NAMESPACE
|
||||
{
|
||||
namespace detail
|
||||
{
|
||||
class DispatchLoaderDynamic;
|
||||
|
||||
#if !defined( VULKAN_HPP_DEFAULT_DISPATCHER )
|
||||
# if VULKAN_HPP_DISPATCH_LOADER_DYNAMIC == 1
|
||||
extern VULKAN_HPP_STORAGE_API DispatchLoaderDynamic defaultDispatchLoaderDynamic;
|
||||
# endif
|
||||
#endif
|
||||
} // namespace detail
|
||||
} // namespace VULKAN_HPP_NAMESPACE
|
||||
|
||||
#if !defined( VULKAN_HPP_DEFAULT_DISPATCHER )
|
||||
# if VULKAN_HPP_DISPATCH_LOADER_DYNAMIC == 1
|
||||
# define VULKAN_HPP_DEFAULT_DISPATCHER ::VULKAN_HPP_NAMESPACE::detail::defaultDispatchLoaderDynamic
|
||||
# define VULKAN_HPP_DEFAULT_DISPATCH_LOADER_DYNAMIC_STORAGE \
|
||||
namespace VULKAN_HPP_NAMESPACE \
|
||||
{ \
|
||||
namespace detail \
|
||||
{ \
|
||||
VULKAN_HPP_STORAGE_API DispatchLoaderDynamic defaultDispatchLoaderDynamic; \
|
||||
} \
|
||||
}
|
||||
# else
|
||||
# define VULKAN_HPP_DEFAULT_DISPATCHER ::VULKAN_HPP_NAMESPACE::detail::getDispatchLoaderStatic()
|
||||
# define VULKAN_HPP_DEFAULT_DISPATCH_LOADER_DYNAMIC_STORAGE
|
||||
# endif
|
||||
#endif
|
||||
|
||||
#if !defined( VULKAN_HPP_DEFAULT_DISPATCHER_TYPE )
|
||||
# if VULKAN_HPP_DISPATCH_LOADER_DYNAMIC == 1
|
||||
# define VULKAN_HPP_DEFAULT_DISPATCHER_TYPE ::VULKAN_HPP_NAMESPACE::detail::DispatchLoaderDynamic
|
||||
# else
|
||||
# define VULKAN_HPP_DEFAULT_DISPATCHER_TYPE ::VULKAN_HPP_NAMESPACE::detail::DispatchLoaderStatic
|
||||
# endif
|
||||
#endif
|
||||
|
||||
#if defined( VULKAN_HPP_NO_DEFAULT_DISPATCHER )
|
||||
# define VULKAN_HPP_DEFAULT_ARGUMENT_ASSIGNMENT
|
||||
# define VULKAN_HPP_DEFAULT_ARGUMENT_NULLPTR_ASSIGNMENT
|
||||
# define VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT
|
||||
#else
|
||||
# define VULKAN_HPP_DEFAULT_ARGUMENT_ASSIGNMENT = {}
|
||||
# define VULKAN_HPP_DEFAULT_ARGUMENT_NULLPTR_ASSIGNMENT = nullptr
|
||||
# define VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT = VULKAN_HPP_DEFAULT_DISPATCHER
|
||||
#endif
|
||||
|
||||
#if !defined( VULKAN_HPP_EXPECTED ) && ( 23 <= VULKAN_HPP_CPP_VERSION ) && defined( __cpp_lib_expected )
|
||||
# if !( defined( VULKAN_HPP_ENABLE_STD_MODULE ) && defined( VULKAN_HPP_STD_MODULE ) )
|
||||
# include <expected>
|
||||
# endif
|
||||
# define VULKAN_HPP_EXPECTED std::expected
|
||||
# define VULKAN_HPP_UNEXPECTED std::unexpected
|
||||
#endif
|
||||
|
||||
#if !defined( VULKAN_HPP_RAII_NAMESPACE )
|
||||
# define VULKAN_HPP_RAII_NAMESPACE raii
|
||||
#endif
|
||||
|
||||
#if defined( VULKAN_HPP_NO_EXCEPTIONS ) && defined( VULKAN_HPP_EXPECTED )
|
||||
# define VULKAN_HPP_RAII_NO_EXCEPTIONS
|
||||
# define VULKAN_HPP_RAII_CREATE_NOEXCEPT noexcept
|
||||
#else
|
||||
# define VULKAN_HPP_RAII_CREATE_NOEXCEPT
|
||||
#endif
|
||||
|
||||
#endif
|
11519
vulkan/vulkansc_raii.hpp
11519
vulkan/vulkansc_raii.hpp
File diff suppressed because it is too large
Load Diff
@ -1,984 +0,0 @@
|
||||
// Copyright 2015-2024 The Khronos Group Inc.
|
||||
//
|
||||
// SPDX-License-Identifier: Apache-2.0 OR MIT
|
||||
//
|
||||
|
||||
// This header is generated from the Khronos Vulkan XML API Registry.
|
||||
|
||||
#ifndef VULKAN_SHARED_HPP
|
||||
#define VULKAN_SHARED_HPP
|
||||
|
||||
#include <vulkan/vulkansc.hpp>
|
||||
|
||||
#if !( defined( VULKAN_HPP_ENABLE_STD_MODULE ) && defined( VULKAN_HPP_STD_MODULE ) )
|
||||
# include <atomic> // std::atomic_size_t
|
||||
#endif
|
||||
|
||||
namespace VULKAN_HPP_NAMESPACE
|
||||
{
|
||||
#if !defined( VULKAN_HPP_NO_SMART_HANDLE )
|
||||
|
||||
template <typename HandleType>
|
||||
class SharedHandleTraits;
|
||||
|
||||
class NoDestructor
|
||||
{
|
||||
};
|
||||
|
||||
template <typename HandleType, typename = void>
|
||||
struct HasDestructorType : std::false_type
|
||||
{
|
||||
};
|
||||
|
||||
template <typename HandleType>
|
||||
struct HasDestructorType<HandleType, decltype( (void)typename SharedHandleTraits<HandleType>::DestructorType() )> : std::true_type
|
||||
{
|
||||
};
|
||||
|
||||
template <typename HandleType, typename Enable = void>
|
||||
struct GetDestructorType
|
||||
{
|
||||
using type = NoDestructor;
|
||||
};
|
||||
|
||||
template <typename HandleType>
|
||||
struct GetDestructorType<HandleType, typename std::enable_if<HasDestructorType<HandleType>::value>::type>
|
||||
{
|
||||
using type = typename SharedHandleTraits<HandleType>::DestructorType;
|
||||
};
|
||||
|
||||
template <class HandleType>
|
||||
using DestructorTypeOf = typename GetDestructorType<HandleType>::type;
|
||||
|
||||
template <class HandleType>
|
||||
struct HasDestructor : std::integral_constant<bool, !std::is_same<DestructorTypeOf<HandleType>, NoDestructor>::value>
|
||||
{
|
||||
};
|
||||
|
||||
template <typename HandleType, typename = void>
|
||||
struct HasPoolType : std::false_type
|
||||
{
|
||||
};
|
||||
|
||||
template <typename HandleType>
|
||||
struct HasPoolType<HandleType, decltype( (void)typename SharedHandleTraits<HandleType>::deleter::PoolTypeExport() )> : std::true_type
|
||||
{
|
||||
};
|
||||
|
||||
template <typename HandleType, typename Enable = void>
|
||||
struct GetPoolType
|
||||
{
|
||||
using type = NoDestructor;
|
||||
};
|
||||
|
||||
template <typename HandleType>
|
||||
struct GetPoolType<HandleType, typename std::enable_if<HasPoolType<HandleType>::value>::type>
|
||||
{
|
||||
using type = typename SharedHandleTraits<HandleType>::deleter::PoolTypeExport;
|
||||
};
|
||||
|
||||
//=====================================================================================================================
|
||||
|
||||
template <typename HandleType>
|
||||
class SharedHandle;
|
||||
|
||||
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;
|
||||
};
|
||||
|
||||
template <typename Deleter>
|
||||
struct SharedHeader<NoDestructor, Deleter>
|
||||
{
|
||||
SharedHeader( Deleter deleter = Deleter() ) VULKAN_HPP_NOEXCEPT : deleter( std::move( deleter ) ) {}
|
||||
|
||||
Deleter deleter;
|
||||
};
|
||||
|
||||
//=====================================================================================================================
|
||||
|
||||
template <typename HeaderType>
|
||||
class ReferenceCounter
|
||||
{
|
||||
public:
|
||||
template <typename... Args>
|
||||
ReferenceCounter( Args &&... control_args ) : m_header( std::forward<Args>( control_args )... )
|
||||
{
|
||||
}
|
||||
|
||||
ReferenceCounter( const ReferenceCounter & ) = delete;
|
||||
ReferenceCounter & operator=( const ReferenceCounter & ) = delete;
|
||||
|
||||
public:
|
||||
size_t addRef() VULKAN_HPP_NOEXCEPT
|
||||
{
|
||||
// Relaxed memory order is sufficient since this does not impose any ordering on other operations
|
||||
return m_ref_cnt.fetch_add( 1, std::memory_order_relaxed );
|
||||
}
|
||||
|
||||
size_t release() VULKAN_HPP_NOEXCEPT
|
||||
{
|
||||
// A release memory order to ensure that all releases are ordered
|
||||
return m_ref_cnt.fetch_sub( 1, std::memory_order_release );
|
||||
}
|
||||
|
||||
public:
|
||||
std::atomic_size_t m_ref_cnt{ 1 };
|
||||
HeaderType m_header{};
|
||||
};
|
||||
|
||||
//=====================================================================================================================
|
||||
|
||||
template <typename HandleType, typename HeaderType, typename ForwardType = SharedHandle<HandleType>>
|
||||
class SharedHandleBase
|
||||
{
|
||||
public:
|
||||
SharedHandleBase() = default;
|
||||
|
||||
template <typename... Args>
|
||||
SharedHandleBase( HandleType handle, Args &&... control_args )
|
||||
: m_control( new ReferenceCounter<HeaderType>( std::forward<Args>( control_args )... ) ), m_handle( handle )
|
||||
{
|
||||
}
|
||||
|
||||
SharedHandleBase( const SharedHandleBase & o ) VULKAN_HPP_NOEXCEPT
|
||||
{
|
||||
o.addRef();
|
||||
m_handle = o.m_handle;
|
||||
m_control = o.m_control;
|
||||
}
|
||||
|
||||
SharedHandleBase( SharedHandleBase && o ) VULKAN_HPP_NOEXCEPT
|
||||
: m_control( o.m_control )
|
||||
, m_handle( o.m_handle )
|
||||
{
|
||||
o.m_handle = nullptr;
|
||||
o.m_control = nullptr;
|
||||
}
|
||||
|
||||
SharedHandleBase & operator=( const SharedHandleBase & o ) VULKAN_HPP_NOEXCEPT
|
||||
{
|
||||
SharedHandleBase( o ).swap( *this );
|
||||
return *this;
|
||||
}
|
||||
|
||||
SharedHandleBase & operator=( SharedHandleBase && o ) VULKAN_HPP_NOEXCEPT
|
||||
{
|
||||
SharedHandleBase( std::move( o ) ).swap( *this );
|
||||
return *this;
|
||||
}
|
||||
|
||||
~SharedHandleBase()
|
||||
{
|
||||
// only this function owns the last reference to the control block
|
||||
// the same principle is used in the default deleter of std::shared_ptr
|
||||
if ( m_control && ( m_control->release() == 1 ) )
|
||||
{
|
||||
// noop in x86, but does thread synchronization in ARM
|
||||
// it is required to ensure that last thread is getting to destroy the control block
|
||||
// by ordering all atomic operations before this fence
|
||||
std::atomic_thread_fence( std::memory_order_acquire );
|
||||
ForwardType::internalDestroy( getHeader(), m_handle );
|
||||
delete m_control;
|
||||
}
|
||||
}
|
||||
|
||||
public:
|
||||
HandleType get() const VULKAN_HPP_NOEXCEPT
|
||||
{
|
||||
return m_handle;
|
||||
}
|
||||
|
||||
HandleType operator*() const VULKAN_HPP_NOEXCEPT
|
||||
{
|
||||
return m_handle;
|
||||
}
|
||||
|
||||
explicit operator bool() const VULKAN_HPP_NOEXCEPT
|
||||
{
|
||||
return bool( m_handle );
|
||||
}
|
||||
|
||||
# if defined( VULKAN_HPP_SMART_HANDLE_IMPLICIT_CAST )
|
||||
operator HandleType() const VULKAN_HPP_NOEXCEPT
|
||||
{
|
||||
return m_handle;
|
||||
}
|
||||
# endif
|
||||
|
||||
const HandleType * operator->() const VULKAN_HPP_NOEXCEPT
|
||||
{
|
||||
return &m_handle;
|
||||
}
|
||||
|
||||
HandleType * operator->() VULKAN_HPP_NOEXCEPT
|
||||
{
|
||||
return &m_handle;
|
||||
}
|
||||
|
||||
void reset() VULKAN_HPP_NOEXCEPT
|
||||
{
|
||||
SharedHandleBase().swap( *this );
|
||||
}
|
||||
|
||||
void swap( SharedHandleBase & o ) VULKAN_HPP_NOEXCEPT
|
||||
{
|
||||
std::swap( m_handle, o.m_handle );
|
||||
std::swap( m_control, o.m_control );
|
||||
}
|
||||
|
||||
template <typename T = HandleType>
|
||||
typename std::enable_if<HasDestructor<T>::value, const SharedHandle<DestructorTypeOf<HandleType>> &>::type getDestructorType() const VULKAN_HPP_NOEXCEPT
|
||||
{
|
||||
return getHeader().parent;
|
||||
}
|
||||
|
||||
protected:
|
||||
template <typename T = HandleType>
|
||||
static typename std::enable_if<!HasDestructor<T>::value, void>::type internalDestroy( const HeaderType & control, HandleType handle ) VULKAN_HPP_NOEXCEPT
|
||||
{
|
||||
control.deleter.destroy( handle );
|
||||
}
|
||||
|
||||
template <typename T = HandleType>
|
||||
static typename std::enable_if<HasDestructor<T>::value, void>::type internalDestroy( const HeaderType & control, HandleType handle ) VULKAN_HPP_NOEXCEPT
|
||||
{
|
||||
control.deleter.destroy( control.parent.get(), handle );
|
||||
}
|
||||
|
||||
const HeaderType & getHeader() const VULKAN_HPP_NOEXCEPT
|
||||
{
|
||||
return m_control->m_header;
|
||||
}
|
||||
|
||||
private:
|
||||
void addRef() const VULKAN_HPP_NOEXCEPT
|
||||
{
|
||||
if ( m_control )
|
||||
m_control->addRef();
|
||||
}
|
||||
|
||||
protected:
|
||||
ReferenceCounter<HeaderType> * m_control = nullptr;
|
||||
HandleType m_handle{};
|
||||
};
|
||||
|
||||
template <typename HandleType>
|
||||
class SharedHandle : public SharedHandleBase<HandleType, SharedHeader<DestructorTypeOf<HandleType>, typename SharedHandleTraits<HandleType>::deleter>>
|
||||
{
|
||||
private:
|
||||
using BaseType = SharedHandleBase<HandleType, SharedHeader<DestructorTypeOf<HandleType>, typename SharedHandleTraits<HandleType>::deleter>>;
|
||||
using DeleterType = typename SharedHandleTraits<HandleType>::deleter;
|
||||
friend BaseType;
|
||||
|
||||
public:
|
||||
SharedHandle() = default;
|
||||
|
||||
template <typename T = HandleType, typename = typename std::enable_if<HasDestructor<T>::value && !HasPoolType<T>::value>::type>
|
||||
explicit SharedHandle( HandleType handle, SharedHandle<DestructorTypeOf<HandleType>> parent, DeleterType deleter = DeleterType() ) VULKAN_HPP_NOEXCEPT
|
||||
: BaseType( handle, std::move( parent ), std::move( deleter ) )
|
||||
{
|
||||
}
|
||||
|
||||
template <typename Dispatcher = VULKAN_HPP_DEFAULT_DISPATCHER_TYPE,
|
||||
typename T = HandleType,
|
||||
typename = typename std::enable_if<HasDestructor<T>::value && HasPoolType<T>::value>::type>
|
||||
explicit SharedHandle( HandleType handle,
|
||||
SharedHandle<DestructorTypeOf<HandleType>> parent,
|
||||
SharedHandle<typename GetPoolType<HandleType>::type> pool,
|
||||
const Dispatcher & dispatch VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) VULKAN_HPP_NOEXCEPT
|
||||
: BaseType( handle, std::move( parent ), DeleterType{ std::move( pool ), dispatch } )
|
||||
{
|
||||
}
|
||||
|
||||
template <typename T = HandleType, typename = typename std::enable_if<!HasDestructor<T>::value>::type>
|
||||
explicit SharedHandle( HandleType handle, DeleterType deleter = DeleterType() ) VULKAN_HPP_NOEXCEPT : BaseType( handle, std::move( deleter ) )
|
||||
{
|
||||
}
|
||||
|
||||
protected:
|
||||
using BaseType::internalDestroy;
|
||||
};
|
||||
|
||||
namespace detail
|
||||
{
|
||||
|
||||
// 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
|
||||
{
|
||||
public:
|
||||
using DestructorType = typename SharedHandleTraits<HandleType>::DestructorType;
|
||||
|
||||
template <class Dispatcher>
|
||||
using DestroyFunctionPointerType =
|
||||
typename std::conditional<HasDestructor<HandleType>::value,
|
||||
void ( DestructorType::* )( HandleType, const AllocationCallbacks *, const Dispatcher & ) const,
|
||||
void ( HandleType::* )( const AllocationCallbacks *, const Dispatcher & ) const>::type;
|
||||
|
||||
using SelectorType = typename std::conditional<HasDestructor<HandleType>::value, DestructorType, HandleType>::type;
|
||||
|
||||
template <typename Dispatcher = VULKAN_HPP_DEFAULT_DISPATCHER_TYPE>
|
||||
ObjectDestroyShared( Optional<const AllocationCallbacks> allocationCallbacks VULKAN_HPP_DEFAULT_ARGUMENT_NULLPTR_ASSIGNMENT,
|
||||
const Dispatcher & dispatch VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT )
|
||||
: m_destroy( reinterpret_cast<decltype( m_destroy )>( static_cast<DestroyFunctionPointerType<Dispatcher>>( &SelectorType::destroy ) ) )
|
||||
, m_dispatch( &dispatch )
|
||||
, m_allocationCallbacks( allocationCallbacks )
|
||||
{
|
||||
}
|
||||
|
||||
public:
|
||||
template <typename T = HandleType>
|
||||
typename std::enable_if<HasDestructor<T>::value, void>::type destroy( DestructorType parent, HandleType handle ) const VULKAN_HPP_NOEXCEPT
|
||||
{
|
||||
VULKAN_HPP_ASSERT( m_destroy && m_dispatch );
|
||||
( parent.*m_destroy )( handle, m_allocationCallbacks, *m_dispatch );
|
||||
}
|
||||
|
||||
template <typename T = HandleType>
|
||||
typename std::enable_if<!HasDestructor<T>::value, void>::type destroy( HandleType handle ) const VULKAN_HPP_NOEXCEPT
|
||||
{
|
||||
VULKAN_HPP_ASSERT( m_destroy && m_dispatch );
|
||||
( handle.*m_destroy )( m_allocationCallbacks, *m_dispatch );
|
||||
}
|
||||
|
||||
private:
|
||||
DestroyFunctionPointerType<detail::DispatchLoaderBase> m_destroy = nullptr;
|
||||
const detail::DispatchLoaderBase * m_dispatch = nullptr;
|
||||
Optional<const AllocationCallbacks> m_allocationCallbacks = nullptr;
|
||||
};
|
||||
|
||||
template <typename HandleType>
|
||||
class ObjectFreeShared
|
||||
{
|
||||
public:
|
||||
using DestructorType = typename SharedHandleTraits<HandleType>::DestructorType;
|
||||
|
||||
template <class Dispatcher>
|
||||
using DestroyFunctionPointerType = void ( DestructorType::* )( HandleType, const AllocationCallbacks *, const Dispatcher & ) const;
|
||||
|
||||
template <class Dispatcher = VULKAN_HPP_DEFAULT_DISPATCHER_TYPE>
|
||||
ObjectFreeShared( Optional<const AllocationCallbacks> allocationCallbacks VULKAN_HPP_DEFAULT_ARGUMENT_NULLPTR_ASSIGNMENT,
|
||||
const Dispatcher & dispatch VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT )
|
||||
: m_destroy( reinterpret_cast<decltype( m_destroy )>( static_cast<DestroyFunctionPointerType<Dispatcher>>( &DestructorType::free ) ) )
|
||||
, m_dispatch( &dispatch )
|
||||
, m_allocationCallbacks( allocationCallbacks )
|
||||
{
|
||||
}
|
||||
|
||||
public:
|
||||
void destroy( DestructorType parent, HandleType handle ) const VULKAN_HPP_NOEXCEPT
|
||||
{
|
||||
VULKAN_HPP_ASSERT( m_destroy && m_dispatch );
|
||||
( parent.*m_destroy )( handle, m_allocationCallbacks, *m_dispatch );
|
||||
}
|
||||
|
||||
private:
|
||||
DestroyFunctionPointerType<detail::DispatchLoaderBase> m_destroy = nullptr;
|
||||
const detail::DispatchLoaderBase * m_dispatch = nullptr;
|
||||
Optional<const AllocationCallbacks> m_allocationCallbacks = nullptr;
|
||||
};
|
||||
|
||||
template <typename HandleType>
|
||||
class ObjectReleaseShared
|
||||
{
|
||||
public:
|
||||
using DestructorType = typename SharedHandleTraits<HandleType>::DestructorType;
|
||||
|
||||
template <class Dispatcher>
|
||||
using DestroyFunctionPointerType = void ( DestructorType::* )( HandleType, const Dispatcher & ) const;
|
||||
|
||||
template <class Dispatcher = VULKAN_HPP_DEFAULT_DISPATCHER_TYPE>
|
||||
ObjectReleaseShared( const Dispatcher & dispatch VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT )
|
||||
: m_destroy( reinterpret_cast<decltype( m_destroy )>( static_cast<DestroyFunctionPointerType<Dispatcher>>( &DestructorType::release ) ) )
|
||||
, m_dispatch( &dispatch )
|
||||
{
|
||||
}
|
||||
|
||||
public:
|
||||
void destroy( DestructorType parent, HandleType handle ) const VULKAN_HPP_NOEXCEPT
|
||||
{
|
||||
VULKAN_HPP_ASSERT( m_destroy && m_dispatch );
|
||||
( parent.*m_destroy )( handle, *m_dispatch );
|
||||
}
|
||||
|
||||
private:
|
||||
DestroyFunctionPointerType<detail::DispatchLoaderBase> m_destroy = nullptr;
|
||||
const detail::DispatchLoaderBase * m_dispatch = nullptr;
|
||||
};
|
||||
|
||||
template <typename HandleType, typename PoolType>
|
||||
class PoolFreeShared
|
||||
{
|
||||
public:
|
||||
using DestructorType = typename SharedHandleTraits<HandleType>::DestructorType;
|
||||
|
||||
using PoolTypeExport = PoolType;
|
||||
|
||||
template <class Dispatcher>
|
||||
using ReturnType = decltype( std::declval<DestructorType>().free( PoolType(), 0u, nullptr, Dispatcher() ) );
|
||||
|
||||
template <class Dispatcher>
|
||||
using DestroyFunctionPointerType = ReturnType<Dispatcher> ( DestructorType::* )( PoolType, uint32_t, const HandleType *, const Dispatcher & ) const;
|
||||
|
||||
PoolFreeShared() = default;
|
||||
|
||||
template <class Dispatcher = VULKAN_HPP_DEFAULT_DISPATCHER_TYPE>
|
||||
PoolFreeShared( SharedHandle<PoolType> pool, const Dispatcher & dispatch VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT )
|
||||
: m_destroy( reinterpret_cast<decltype( m_destroy )>( static_cast<DestroyFunctionPointerType<Dispatcher>>( &DestructorType::free ) ) )
|
||||
, m_dispatch( &dispatch )
|
||||
, m_pool( std::move( pool ) )
|
||||
{
|
||||
}
|
||||
|
||||
public:
|
||||
void destroy( DestructorType parent, HandleType handle ) const VULKAN_HPP_NOEXCEPT
|
||||
{
|
||||
VULKAN_HPP_ASSERT( m_destroy && m_dispatch && m_pool );
|
||||
( parent.*m_destroy )( m_pool.get(), 1u, &handle, *m_dispatch );
|
||||
}
|
||||
|
||||
private:
|
||||
DestroyFunctionPointerType<detail::DispatchLoaderBase> m_destroy = nullptr;
|
||||
const detail::DispatchLoaderBase * m_dispatch = nullptr;
|
||||
SharedHandle<PoolType> m_pool{};
|
||||
};
|
||||
|
||||
# if defined( __GNUC__ ) && !defined( __clang__ ) && !defined( __INTEL_COMPILER )
|
||||
# pragma GCC diagnostic pop
|
||||
# endif
|
||||
|
||||
} // namespace detail
|
||||
|
||||
//======================
|
||||
//=== SHARED HANDLEs ===
|
||||
//======================
|
||||
|
||||
//=== VK_VERSION_1_0 ===
|
||||
template <>
|
||||
class SharedHandleTraits<Instance>
|
||||
{
|
||||
public:
|
||||
using DestructorType = NoDestructor;
|
||||
using deleter = detail::ObjectDestroyShared<Instance>;
|
||||
};
|
||||
|
||||
using SharedInstance = SharedHandle<Instance>;
|
||||
|
||||
template <>
|
||||
class SharedHandleTraits<Device>
|
||||
{
|
||||
public:
|
||||
using DestructorType = NoDestructor;
|
||||
using deleter = detail::ObjectDestroyShared<Device>;
|
||||
};
|
||||
|
||||
using SharedDevice = SharedHandle<Device>;
|
||||
|
||||
template <>
|
||||
class SharedHandleTraits<Fence>
|
||||
{
|
||||
public:
|
||||
using DestructorType = Device;
|
||||
using deleter = detail::ObjectDestroyShared<Fence>;
|
||||
};
|
||||
|
||||
using SharedFence = SharedHandle<Fence>;
|
||||
|
||||
template <>
|
||||
class SharedHandleTraits<Semaphore>
|
||||
{
|
||||
public:
|
||||
using DestructorType = Device;
|
||||
using deleter = detail::ObjectDestroyShared<Semaphore>;
|
||||
};
|
||||
|
||||
using SharedSemaphore = SharedHandle<Semaphore>;
|
||||
|
||||
template <>
|
||||
class SharedHandleTraits<Event>
|
||||
{
|
||||
public:
|
||||
using DestructorType = Device;
|
||||
using deleter = detail::ObjectDestroyShared<Event>;
|
||||
};
|
||||
|
||||
using SharedEvent = SharedHandle<Event>;
|
||||
|
||||
template <>
|
||||
class SharedHandleTraits<Buffer>
|
||||
{
|
||||
public:
|
||||
using DestructorType = Device;
|
||||
using deleter = detail::ObjectDestroyShared<Buffer>;
|
||||
};
|
||||
|
||||
using SharedBuffer = SharedHandle<Buffer>;
|
||||
|
||||
template <>
|
||||
class SharedHandleTraits<BufferView>
|
||||
{
|
||||
public:
|
||||
using DestructorType = Device;
|
||||
using deleter = detail::ObjectDestroyShared<BufferView>;
|
||||
};
|
||||
|
||||
using SharedBufferView = SharedHandle<BufferView>;
|
||||
|
||||
template <>
|
||||
class SharedHandleTraits<Image>
|
||||
{
|
||||
public:
|
||||
using DestructorType = Device;
|
||||
using deleter = detail::ObjectDestroyShared<Image>;
|
||||
};
|
||||
|
||||
using SharedImage = SharedHandle<Image>;
|
||||
|
||||
template <>
|
||||
class SharedHandleTraits<ImageView>
|
||||
{
|
||||
public:
|
||||
using DestructorType = Device;
|
||||
using deleter = detail::ObjectDestroyShared<ImageView>;
|
||||
};
|
||||
|
||||
using SharedImageView = SharedHandle<ImageView>;
|
||||
|
||||
template <>
|
||||
class SharedHandleTraits<PipelineCache>
|
||||
{
|
||||
public:
|
||||
using DestructorType = Device;
|
||||
using deleter = detail::ObjectDestroyShared<PipelineCache>;
|
||||
};
|
||||
|
||||
using SharedPipelineCache = SharedHandle<PipelineCache>;
|
||||
|
||||
template <>
|
||||
class SharedHandleTraits<Pipeline>
|
||||
{
|
||||
public:
|
||||
using DestructorType = Device;
|
||||
using deleter = detail::ObjectDestroyShared<Pipeline>;
|
||||
};
|
||||
|
||||
using SharedPipeline = SharedHandle<Pipeline>;
|
||||
|
||||
template <>
|
||||
class SharedHandleTraits<PipelineLayout>
|
||||
{
|
||||
public:
|
||||
using DestructorType = Device;
|
||||
using deleter = detail::ObjectDestroyShared<PipelineLayout>;
|
||||
};
|
||||
|
||||
using SharedPipelineLayout = SharedHandle<PipelineLayout>;
|
||||
|
||||
template <>
|
||||
class SharedHandleTraits<Sampler>
|
||||
{
|
||||
public:
|
||||
using DestructorType = Device;
|
||||
using deleter = detail::ObjectDestroyShared<Sampler>;
|
||||
};
|
||||
|
||||
using SharedSampler = SharedHandle<Sampler>;
|
||||
|
||||
template <>
|
||||
class SharedHandleTraits<DescriptorSet>
|
||||
{
|
||||
public:
|
||||
using DestructorType = Device;
|
||||
using deleter = detail::PoolFreeShared<DescriptorSet, DescriptorPool>;
|
||||
};
|
||||
|
||||
using SharedDescriptorSet = SharedHandle<DescriptorSet>;
|
||||
|
||||
template <>
|
||||
class SharedHandleTraits<DescriptorSetLayout>
|
||||
{
|
||||
public:
|
||||
using DestructorType = Device;
|
||||
using deleter = detail::ObjectDestroyShared<DescriptorSetLayout>;
|
||||
};
|
||||
|
||||
using SharedDescriptorSetLayout = SharedHandle<DescriptorSetLayout>;
|
||||
|
||||
template <>
|
||||
class SharedHandleTraits<Framebuffer>
|
||||
{
|
||||
public:
|
||||
using DestructorType = Device;
|
||||
using deleter = detail::ObjectDestroyShared<Framebuffer>;
|
||||
};
|
||||
|
||||
using SharedFramebuffer = SharedHandle<Framebuffer>;
|
||||
|
||||
template <>
|
||||
class SharedHandleTraits<RenderPass>
|
||||
{
|
||||
public:
|
||||
using DestructorType = Device;
|
||||
using deleter = detail::ObjectDestroyShared<RenderPass>;
|
||||
};
|
||||
|
||||
using SharedRenderPass = SharedHandle<RenderPass>;
|
||||
|
||||
template <>
|
||||
class SharedHandleTraits<CommandBuffer>
|
||||
{
|
||||
public:
|
||||
using DestructorType = Device;
|
||||
using deleter = detail::PoolFreeShared<CommandBuffer, CommandPool>;
|
||||
};
|
||||
|
||||
using SharedCommandBuffer = SharedHandle<CommandBuffer>;
|
||||
|
||||
//=== VK_VERSION_1_1 ===
|
||||
template <>
|
||||
class SharedHandleTraits<SamplerYcbcrConversion>
|
||||
{
|
||||
public:
|
||||
using DestructorType = Device;
|
||||
using deleter = detail::ObjectDestroyShared<SamplerYcbcrConversion>;
|
||||
};
|
||||
|
||||
using SharedSamplerYcbcrConversion = SharedHandle<SamplerYcbcrConversion>;
|
||||
using SharedSamplerYcbcrConversionKHR = SharedHandle<SamplerYcbcrConversion>;
|
||||
|
||||
//=== VK_VERSION_1_3 ===
|
||||
template <>
|
||||
class SharedHandleTraits<PrivateDataSlot>
|
||||
{
|
||||
public:
|
||||
using DestructorType = Device;
|
||||
using deleter = detail::ObjectDestroyShared<PrivateDataSlot>;
|
||||
};
|
||||
|
||||
using SharedPrivateDataSlot = SharedHandle<PrivateDataSlot>;
|
||||
using SharedPrivateDataSlotEXT = SharedHandle<PrivateDataSlot>;
|
||||
|
||||
//=== VK_KHR_surface ===
|
||||
template <>
|
||||
class SharedHandleTraits<SurfaceKHR>
|
||||
{
|
||||
public:
|
||||
using DestructorType = Instance;
|
||||
using deleter = detail::ObjectDestroyShared<SurfaceKHR>;
|
||||
};
|
||||
|
||||
using SharedSurfaceKHR = SharedHandle<SurfaceKHR>;
|
||||
|
||||
//=== VK_KHR_display ===
|
||||
template <>
|
||||
class SharedHandleTraits<DisplayKHR>
|
||||
{
|
||||
public:
|
||||
using DestructorType = PhysicalDevice;
|
||||
using deleter = detail::ObjectDestroyShared<DisplayKHR>;
|
||||
};
|
||||
|
||||
using SharedDisplayKHR = SharedHandle<DisplayKHR>;
|
||||
|
||||
//=== VK_EXT_debug_utils ===
|
||||
template <>
|
||||
class SharedHandleTraits<DebugUtilsMessengerEXT>
|
||||
{
|
||||
public:
|
||||
using DestructorType = Instance;
|
||||
using deleter = detail::ObjectDestroyShared<DebugUtilsMessengerEXT>;
|
||||
};
|
||||
|
||||
using SharedDebugUtilsMessengerEXT = SharedHandle<DebugUtilsMessengerEXT>;
|
||||
|
||||
enum class SwapchainOwns
|
||||
{
|
||||
no,
|
||||
yes,
|
||||
};
|
||||
|
||||
struct ImageHeader : SharedHeader<DestructorTypeOf<VULKAN_HPP_NAMESPACE::Image>, typename SharedHandleTraits<VULKAN_HPP_NAMESPACE::Image>::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;
|
||||
};
|
||||
|
||||
template <>
|
||||
class SharedHandle<VULKAN_HPP_NAMESPACE::Image> : public SharedHandleBase<VULKAN_HPP_NAMESPACE::Image, ImageHeader>
|
||||
{
|
||||
using BaseType = SharedHandleBase<VULKAN_HPP_NAMESPACE::Image, ImageHeader>;
|
||||
using DeleterType = typename SharedHandleTraits<VULKAN_HPP_NAMESPACE::Image>::deleter;
|
||||
friend BaseType;
|
||||
|
||||
public:
|
||||
SharedHandle() = default;
|
||||
|
||||
explicit SharedHandle( VULKAN_HPP_NAMESPACE::Image handle,
|
||||
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 )
|
||||
{
|
||||
}
|
||||
|
||||
protected:
|
||||
static void internalDestroy( const ImageHeader & control, VULKAN_HPP_NAMESPACE::Image handle ) VULKAN_HPP_NOEXCEPT
|
||||
{
|
||||
if ( control.swapchainOwned == SwapchainOwns::no )
|
||||
{
|
||||
control.deleter.destroy( control.parent.get(), handle );
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
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<DestructorTypeOf<VULKAN_HPP_NAMESPACE::SwapchainKHR>> parent{};
|
||||
typename SharedHandleTraits<VULKAN_HPP_NAMESPACE::SwapchainKHR>::deleter deleter{};
|
||||
};
|
||||
|
||||
template <>
|
||||
class SharedHandle<VULKAN_HPP_NAMESPACE::SwapchainKHR> : public SharedHandleBase<VULKAN_HPP_NAMESPACE::SwapchainKHR, SwapchainHeader>
|
||||
{
|
||||
using BaseType = SharedHandleBase<VULKAN_HPP_NAMESPACE::SwapchainKHR, SwapchainHeader>;
|
||||
using DeleterType = typename SharedHandleTraits<VULKAN_HPP_NAMESPACE::SwapchainKHR>::deleter;
|
||||
friend BaseType;
|
||||
|
||||
public:
|
||||
SharedHandle() = default;
|
||||
|
||||
explicit SharedHandle( VULKAN_HPP_NAMESPACE::SwapchainKHR handle,
|
||||
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 ) )
|
||||
{
|
||||
}
|
||||
|
||||
public:
|
||||
const SharedHandle<VULKAN_HPP_NAMESPACE::SurfaceKHR> & getSurface() const VULKAN_HPP_NOEXCEPT
|
||||
{
|
||||
return getHeader().surface;
|
||||
}
|
||||
|
||||
protected:
|
||||
using BaseType::internalDestroy;
|
||||
};
|
||||
|
||||
template <typename HandleType, typename DestructorType>
|
||||
class SharedHandleBaseNoDestroy : public SharedHandleBase<HandleType, DestructorType>
|
||||
{
|
||||
public:
|
||||
using SharedHandleBase<HandleType, DestructorType>::SharedHandleBase;
|
||||
|
||||
const DestructorType & getDestructorType() const VULKAN_HPP_NOEXCEPT
|
||||
{
|
||||
return SharedHandleBase<HandleType, DestructorType>::getHeader();
|
||||
}
|
||||
|
||||
protected:
|
||||
static void internalDestroy( const DestructorType &, HandleType ) VULKAN_HPP_NOEXCEPT {}
|
||||
};
|
||||
|
||||
//=== VK_VERSION_1_0 ===
|
||||
|
||||
template <>
|
||||
class SharedHandle<PhysicalDevice> : public SharedHandleBaseNoDestroy<PhysicalDevice, SharedInstance>
|
||||
{
|
||||
friend SharedHandleBase<PhysicalDevice, SharedInstance>;
|
||||
|
||||
public:
|
||||
SharedHandle() = default;
|
||||
|
||||
explicit SharedHandle( PhysicalDevice handle, SharedInstance parent ) noexcept
|
||||
: SharedHandleBaseNoDestroy<PhysicalDevice, SharedInstance>( handle, std::move( parent ) )
|
||||
{
|
||||
}
|
||||
};
|
||||
|
||||
using SharedPhysicalDevice = SharedHandle<PhysicalDevice>;
|
||||
|
||||
template <>
|
||||
class SharedHandle<Queue> : public SharedHandleBaseNoDestroy<Queue, SharedDevice>
|
||||
{
|
||||
friend SharedHandleBase<Queue, SharedDevice>;
|
||||
|
||||
public:
|
||||
SharedHandle() = default;
|
||||
|
||||
explicit SharedHandle( Queue handle, SharedDevice parent ) noexcept : SharedHandleBaseNoDestroy<Queue, SharedDevice>( handle, std::move( parent ) ) {}
|
||||
};
|
||||
|
||||
using SharedQueue = SharedHandle<Queue>;
|
||||
|
||||
template <>
|
||||
class SharedHandle<DeviceMemory> : public SharedHandleBaseNoDestroy<DeviceMemory, SharedDevice>
|
||||
{
|
||||
friend SharedHandleBase<DeviceMemory, SharedDevice>;
|
||||
|
||||
public:
|
||||
SharedHandle() = default;
|
||||
|
||||
explicit SharedHandle( DeviceMemory handle, SharedDevice parent ) noexcept
|
||||
: SharedHandleBaseNoDestroy<DeviceMemory, SharedDevice>( handle, std::move( parent ) )
|
||||
{
|
||||
}
|
||||
};
|
||||
|
||||
using SharedDeviceMemory = SharedHandle<DeviceMemory>;
|
||||
|
||||
template <>
|
||||
class SharedHandle<QueryPool> : public SharedHandleBaseNoDestroy<QueryPool, SharedDevice>
|
||||
{
|
||||
friend SharedHandleBase<QueryPool, SharedDevice>;
|
||||
|
||||
public:
|
||||
SharedHandle() = default;
|
||||
|
||||
explicit SharedHandle( QueryPool handle, SharedDevice parent ) noexcept : SharedHandleBaseNoDestroy<QueryPool, SharedDevice>( handle, std::move( parent ) )
|
||||
{
|
||||
}
|
||||
};
|
||||
|
||||
using SharedQueryPool = SharedHandle<QueryPool>;
|
||||
|
||||
template <>
|
||||
class SharedHandle<ShaderModule> : public SharedHandleBaseNoDestroy<ShaderModule, SharedDevice>
|
||||
{
|
||||
friend SharedHandleBase<ShaderModule, SharedDevice>;
|
||||
|
||||
public:
|
||||
SharedHandle() = default;
|
||||
|
||||
explicit SharedHandle( ShaderModule handle, SharedDevice parent ) noexcept
|
||||
: SharedHandleBaseNoDestroy<ShaderModule, SharedDevice>( handle, std::move( parent ) )
|
||||
{
|
||||
}
|
||||
};
|
||||
|
||||
using SharedShaderModule = SharedHandle<ShaderModule>;
|
||||
|
||||
template <>
|
||||
class SharedHandle<DescriptorPool> : public SharedHandleBaseNoDestroy<DescriptorPool, SharedDevice>
|
||||
{
|
||||
friend SharedHandleBase<DescriptorPool, SharedDevice>;
|
||||
|
||||
public:
|
||||
SharedHandle() = default;
|
||||
|
||||
explicit SharedHandle( DescriptorPool handle, SharedDevice parent ) noexcept
|
||||
: SharedHandleBaseNoDestroy<DescriptorPool, SharedDevice>( handle, std::move( parent ) )
|
||||
{
|
||||
}
|
||||
};
|
||||
|
||||
using SharedDescriptorPool = SharedHandle<DescriptorPool>;
|
||||
|
||||
template <>
|
||||
class SharedHandle<CommandPool> : public SharedHandleBaseNoDestroy<CommandPool, SharedDevice>
|
||||
{
|
||||
friend SharedHandleBase<CommandPool, SharedDevice>;
|
||||
|
||||
public:
|
||||
SharedHandle() = default;
|
||||
|
||||
explicit SharedHandle( CommandPool handle, SharedDevice parent ) noexcept
|
||||
: SharedHandleBaseNoDestroy<CommandPool, SharedDevice>( handle, std::move( parent ) )
|
||||
{
|
||||
}
|
||||
};
|
||||
|
||||
using SharedCommandPool = SharedHandle<CommandPool>;
|
||||
|
||||
//=== VK_KHR_swapchain ===
|
||||
|
||||
template <>
|
||||
class SharedHandle<SwapchainKHR> : public SharedHandleBaseNoDestroy<SwapchainKHR, SharedDevice>
|
||||
{
|
||||
friend SharedHandleBase<SwapchainKHR, SharedDevice>;
|
||||
|
||||
public:
|
||||
SharedHandle() = default;
|
||||
|
||||
explicit SharedHandle( SwapchainKHR handle, SharedDevice parent ) noexcept
|
||||
: SharedHandleBaseNoDestroy<SwapchainKHR, SharedDevice>( handle, std::move( parent ) )
|
||||
{
|
||||
}
|
||||
};
|
||||
|
||||
using SharedSwapchainKHR = SharedHandle<SwapchainKHR>;
|
||||
|
||||
//=== VK_KHR_display ===
|
||||
|
||||
template <>
|
||||
class SharedHandle<DisplayModeKHR> : public SharedHandleBaseNoDestroy<DisplayModeKHR, SharedDisplayKHR>
|
||||
{
|
||||
friend SharedHandleBase<DisplayModeKHR, SharedDisplayKHR>;
|
||||
|
||||
public:
|
||||
SharedHandle() = default;
|
||||
|
||||
explicit SharedHandle( DisplayModeKHR handle, SharedDisplayKHR parent ) noexcept
|
||||
: SharedHandleBaseNoDestroy<DisplayModeKHR, SharedDisplayKHR>( handle, std::move( parent ) )
|
||||
{
|
||||
}
|
||||
};
|
||||
|
||||
using SharedDisplayModeKHR = SharedHandle<DisplayModeKHR>;
|
||||
|
||||
# if defined( VK_USE_PLATFORM_SCI )
|
||||
//=== VK_NV_external_sci_sync2 ===
|
||||
|
||||
template <>
|
||||
class SharedHandle<SemaphoreSciSyncPoolNV> : public SharedHandleBaseNoDestroy<SemaphoreSciSyncPoolNV, SharedDevice>
|
||||
{
|
||||
friend SharedHandleBase<SemaphoreSciSyncPoolNV, SharedDevice>;
|
||||
|
||||
public:
|
||||
SharedHandle() = default;
|
||||
|
||||
explicit SharedHandle( SemaphoreSciSyncPoolNV handle, SharedDevice parent ) noexcept
|
||||
: SharedHandleBaseNoDestroy<SemaphoreSciSyncPoolNV, SharedDevice>( handle, std::move( parent ) )
|
||||
{
|
||||
}
|
||||
};
|
||||
|
||||
using SharedSemaphoreSciSyncPoolNV = SharedHandle<SemaphoreSciSyncPoolNV>;
|
||||
# endif /*VK_USE_PLATFORM_SCI*/
|
||||
#endif // !VULKAN_HPP_NO_SMART_HANDLE
|
||||
} // namespace VULKAN_HPP_NAMESPACE
|
||||
#endif // VULKAN_SHARED_HPP
|
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
Loading…
x
Reference in New Issue
Block a user