From a8ff253688dccdf42da109f4b53c462ac9b9bc1f Mon Sep 17 00:00:00 2001 From: Pawel Ksiezopolski Date: Wed, 18 Sep 2019 14:16:22 +0200 Subject: [PATCH] gen_ext_deps.py made independent from VK versions Script gen_ext_deps.py has been modified so that it's independent from incoming Vulkan versions ( it uses information from vk.xml to establish what VK versions will be required ). Accompanying CTS tests have been modified to take advantage of this modification. Components: Vulkan Framework VK-GL-CTS issue: 1954 Change-Id: I2b691e1bd64a6bcb8d1cb7193318aca6bc70655c --- .../vulkan/vkApiExtensionDependencyInfo.inl | 389 ++++++++++----------- .../modules/vulkan/api/vktApiFeatureInfo.cpp | 99 +++--- external/vulkancts/scripts/gen_ext_deps.py | 117 ++++--- 3 files changed, 319 insertions(+), 286 deletions(-) diff --git a/external/vulkancts/framework/vulkan/vkApiExtensionDependencyInfo.inl b/external/vulkancts/framework/vulkan/vkApiExtensionDependencyInfo.inl index 2c45c30..0426b96 100644 --- a/external/vulkancts/framework/vulkan/vkApiExtensionDependencyInfo.inl +++ b/external/vulkancts/framework/vulkan/vkApiExtensionDependencyInfo.inl @@ -3,204 +3,203 @@ * * Generated from Khronos Vulkan API description (vk.xml) revision c5261decf68cb2ef8cd934b8a3e4824bfde81cda. */ -static const std::pair instanceExtensionDependencies_1_0[] = +static const std::tuple instanceExtensionDependencies[] = { - std::make_pair("VK_EXT_acquire_xlib_display", "VK_EXT_direct_mode_display"), - std::make_pair("VK_EXT_direct_mode_display", "VK_KHR_display"), - std::make_pair("VK_EXT_display_surface_counter", "VK_KHR_display"), - std::make_pair("VK_EXT_headless_surface", "VK_KHR_surface"), - std::make_pair("VK_EXT_metal_surface", "VK_KHR_surface"), - std::make_pair("VK_EXT_swapchain_colorspace", "VK_KHR_surface"), - std::make_pair("VK_FUCHSIA_imagepipe_surface", "VK_KHR_surface"), - std::make_pair("VK_GGP_stream_descriptor_surface", "VK_KHR_surface"), - std::make_pair("VK_KHR_android_surface", "VK_KHR_surface"), - std::make_pair("VK_KHR_display", "VK_KHR_surface"), - std::make_pair("VK_KHR_external_fence_capabilities", "VK_KHR_get_physical_device_properties2"), - std::make_pair("VK_KHR_external_memory_capabilities", "VK_KHR_get_physical_device_properties2"), - std::make_pair("VK_KHR_external_semaphore_capabilities", "VK_KHR_get_physical_device_properties2"), - std::make_pair("VK_KHR_get_display_properties2", "VK_KHR_display"), - std::make_pair("VK_KHR_get_surface_capabilities2", "VK_KHR_surface"), - std::make_pair("VK_KHR_wayland_surface", "VK_KHR_surface"), - std::make_pair("VK_KHR_win32_surface", "VK_KHR_surface"), - std::make_pair("VK_KHR_xcb_surface", "VK_KHR_surface"), - std::make_pair("VK_KHR_xlib_surface", "VK_KHR_surface"), - std::make_pair("VK_MVK_ios_surface", "VK_KHR_surface"), - std::make_pair("VK_MVK_macos_surface", "VK_KHR_surface"), - std::make_pair("VK_NN_vi_surface", "VK_KHR_surface"), + std::make_tuple(1, 0, "VK_EXT_acquire_xlib_display", "VK_EXT_direct_mode_display"), + std::make_tuple(1, 1, "VK_EXT_acquire_xlib_display", "VK_EXT_direct_mode_display"), + std::make_tuple(1, 0, "VK_EXT_direct_mode_display", "VK_KHR_display"), + std::make_tuple(1, 1, "VK_EXT_direct_mode_display", "VK_KHR_display"), + std::make_tuple(1, 0, "VK_EXT_display_surface_counter", "VK_KHR_display"), + std::make_tuple(1, 1, "VK_EXT_display_surface_counter", "VK_KHR_display"), + std::make_tuple(1, 0, "VK_EXT_headless_surface", "VK_KHR_surface"), + std::make_tuple(1, 1, "VK_EXT_headless_surface", "VK_KHR_surface"), + std::make_tuple(1, 0, "VK_EXT_metal_surface", "VK_KHR_surface"), + std::make_tuple(1, 1, "VK_EXT_metal_surface", "VK_KHR_surface"), + std::make_tuple(1, 0, "VK_EXT_swapchain_colorspace", "VK_KHR_surface"), + std::make_tuple(1, 1, "VK_EXT_swapchain_colorspace", "VK_KHR_surface"), + std::make_tuple(1, 0, "VK_FUCHSIA_imagepipe_surface", "VK_KHR_surface"), + std::make_tuple(1, 1, "VK_FUCHSIA_imagepipe_surface", "VK_KHR_surface"), + std::make_tuple(1, 0, "VK_GGP_stream_descriptor_surface", "VK_KHR_surface"), + std::make_tuple(1, 1, "VK_GGP_stream_descriptor_surface", "VK_KHR_surface"), + std::make_tuple(1, 0, "VK_KHR_android_surface", "VK_KHR_surface"), + std::make_tuple(1, 1, "VK_KHR_android_surface", "VK_KHR_surface"), + std::make_tuple(1, 0, "VK_KHR_display", "VK_KHR_surface"), + std::make_tuple(1, 1, "VK_KHR_display", "VK_KHR_surface"), + std::make_tuple(1, 0, "VK_KHR_external_fence_capabilities", "VK_KHR_get_physical_device_properties2"), + std::make_tuple(1, 0, "VK_KHR_external_memory_capabilities", "VK_KHR_get_physical_device_properties2"), + std::make_tuple(1, 0, "VK_KHR_external_semaphore_capabilities", "VK_KHR_get_physical_device_properties2"), + std::make_tuple(1, 0, "VK_KHR_get_display_properties2", "VK_KHR_display"), + std::make_tuple(1, 1, "VK_KHR_get_display_properties2", "VK_KHR_display"), + std::make_tuple(1, 0, "VK_KHR_get_surface_capabilities2", "VK_KHR_surface"), + std::make_tuple(1, 1, "VK_KHR_get_surface_capabilities2", "VK_KHR_surface"), + std::make_tuple(1, 1, "VK_KHR_surface_protected_capabilities", "VK_KHR_get_surface_capabilities2"), + std::make_tuple(1, 0, "VK_KHR_wayland_surface", "VK_KHR_surface"), + std::make_tuple(1, 1, "VK_KHR_wayland_surface", "VK_KHR_surface"), + std::make_tuple(1, 0, "VK_KHR_win32_surface", "VK_KHR_surface"), + std::make_tuple(1, 1, "VK_KHR_win32_surface", "VK_KHR_surface"), + std::make_tuple(1, 0, "VK_KHR_xcb_surface", "VK_KHR_surface"), + std::make_tuple(1, 1, "VK_KHR_xcb_surface", "VK_KHR_surface"), + std::make_tuple(1, 0, "VK_KHR_xlib_surface", "VK_KHR_surface"), + std::make_tuple(1, 1, "VK_KHR_xlib_surface", "VK_KHR_surface"), + std::make_tuple(1, 0, "VK_MVK_ios_surface", "VK_KHR_surface"), + std::make_tuple(1, 1, "VK_MVK_ios_surface", "VK_KHR_surface"), + std::make_tuple(1, 0, "VK_MVK_macos_surface", "VK_KHR_surface"), + std::make_tuple(1, 1, "VK_MVK_macos_surface", "VK_KHR_surface"), + std::make_tuple(1, 0, "VK_NN_vi_surface", "VK_KHR_surface"), + std::make_tuple(1, 1, "VK_NN_vi_surface", "VK_KHR_surface"), }; -static const std::pair instanceExtensionDependencies_1_1[] = +static const std::tuple deviceExtensionDependencies[] = { - std::make_pair("VK_EXT_acquire_xlib_display", "VK_EXT_direct_mode_display"), - std::make_pair("VK_EXT_direct_mode_display", "VK_KHR_display"), - std::make_pair("VK_EXT_display_surface_counter", "VK_KHR_display"), - std::make_pair("VK_EXT_headless_surface", "VK_KHR_surface"), - std::make_pair("VK_EXT_metal_surface", "VK_KHR_surface"), - std::make_pair("VK_EXT_swapchain_colorspace", "VK_KHR_surface"), - std::make_pair("VK_FUCHSIA_imagepipe_surface", "VK_KHR_surface"), - std::make_pair("VK_GGP_stream_descriptor_surface", "VK_KHR_surface"), - std::make_pair("VK_KHR_android_surface", "VK_KHR_surface"), - std::make_pair("VK_KHR_display", "VK_KHR_surface"), - std::make_pair("VK_KHR_get_display_properties2", "VK_KHR_display"), - std::make_pair("VK_KHR_get_surface_capabilities2", "VK_KHR_surface"), - std::make_pair("VK_KHR_surface_protected_capabilities", "VK_KHR_get_surface_capabilities2"), - std::make_pair("VK_KHR_wayland_surface", "VK_KHR_surface"), - std::make_pair("VK_KHR_win32_surface", "VK_KHR_surface"), - std::make_pair("VK_KHR_xcb_surface", "VK_KHR_surface"), - std::make_pair("VK_KHR_xlib_surface", "VK_KHR_surface"), - std::make_pair("VK_MVK_ios_surface", "VK_KHR_surface"), - std::make_pair("VK_MVK_macos_surface", "VK_KHR_surface"), - std::make_pair("VK_NN_vi_surface", "VK_KHR_surface"), + std::make_tuple(1, 0, "VK_AMD_display_native_hdr", "VK_KHR_get_physical_device_properties2"), + std::make_tuple(1, 0, "VK_AMD_display_native_hdr", "VK_KHR_get_surface_capabilities2"), + std::make_tuple(1, 0, "VK_AMD_display_native_hdr", "VK_KHR_swapchain"), + std::make_tuple(1, 1, "VK_AMD_display_native_hdr", "VK_KHR_get_surface_capabilities2"), + std::make_tuple(1, 1, "VK_AMD_display_native_hdr", "VK_KHR_swapchain"), + std::make_tuple(1, 0, "VK_AMD_shader_core_properties", "VK_KHR_get_physical_device_properties2"), + std::make_tuple(1, 0, "VK_AMD_shader_core_properties2", "VK_AMD_shader_core_properties"), + std::make_tuple(1, 1, "VK_AMD_shader_core_properties2", "VK_AMD_shader_core_properties"), + std::make_tuple(1, 0, "VK_AMD_texture_gather_bias_lod", "VK_KHR_get_physical_device_properties2"), + std::make_tuple(1, 0, "VK_ANDROID_external_memory_android_hardware_buffer", "VK_KHR_sampler_ycbcr_conversion"), + std::make_tuple(1, 0, "VK_ANDROID_external_memory_android_hardware_buffer", "VK_KHR_external_memory"), + std::make_tuple(1, 0, "VK_ANDROID_external_memory_android_hardware_buffer", "VK_EXT_queue_family_foreign"), + std::make_tuple(1, 1, "VK_ANDROID_external_memory_android_hardware_buffer", "VK_EXT_queue_family_foreign"), + std::make_tuple(1, 0, "VK_EXT_astc_decode_mode", "VK_KHR_get_physical_device_properties2"), + std::make_tuple(1, 0, "VK_EXT_buffer_device_address", "VK_KHR_get_physical_device_properties2"), + std::make_tuple(1, 0, "VK_EXT_conservative_rasterization", "VK_KHR_get_physical_device_properties2"), + std::make_tuple(1, 0, "VK_EXT_debug_marker", "VK_EXT_debug_report"), + std::make_tuple(1, 1, "VK_EXT_debug_marker", "VK_EXT_debug_report"), + std::make_tuple(1, 0, "VK_EXT_descriptor_indexing", "VK_KHR_get_physical_device_properties2"), + std::make_tuple(1, 0, "VK_EXT_descriptor_indexing", "VK_KHR_maintenance3"), + std::make_tuple(1, 0, "VK_EXT_discard_rectangles", "VK_KHR_get_physical_device_properties2"), + std::make_tuple(1, 0, "VK_EXT_display_control", "VK_EXT_display_surface_counter"), + std::make_tuple(1, 0, "VK_EXT_display_control", "VK_KHR_swapchain"), + std::make_tuple(1, 1, "VK_EXT_display_control", "VK_EXT_display_surface_counter"), + std::make_tuple(1, 1, "VK_EXT_display_control", "VK_KHR_swapchain"), + std::make_tuple(1, 0, "VK_EXT_external_memory_dma_buf", "VK_KHR_external_memory_fd"), + std::make_tuple(1, 1, "VK_EXT_external_memory_dma_buf", "VK_KHR_external_memory_fd"), + std::make_tuple(1, 0, "VK_EXT_external_memory_host", "VK_KHR_external_memory"), + std::make_tuple(1, 0, "VK_EXT_filter_cubic", "VK_IMG_filter_cubic"), + std::make_tuple(1, 1, "VK_EXT_filter_cubic", "VK_IMG_filter_cubic"), + std::make_tuple(1, 0, "VK_EXT_fragment_density_map", "VK_KHR_get_physical_device_properties2"), + std::make_tuple(1, 0, "VK_EXT_fragment_shader_interlock", "VK_KHR_get_physical_device_properties2"), + std::make_tuple(1, 0, "VK_EXT_full_screen_exclusive", "VK_KHR_get_physical_device_properties2"), + std::make_tuple(1, 0, "VK_EXT_full_screen_exclusive", "VK_KHR_surface"), + std::make_tuple(1, 0, "VK_EXT_full_screen_exclusive", "VK_KHR_get_surface_capabilities2"), + std::make_tuple(1, 0, "VK_EXT_full_screen_exclusive", "VK_KHR_swapchain"), + std::make_tuple(1, 1, "VK_EXT_full_screen_exclusive", "VK_KHR_surface"), + std::make_tuple(1, 1, "VK_EXT_full_screen_exclusive", "VK_KHR_get_surface_capabilities2"), + std::make_tuple(1, 1, "VK_EXT_full_screen_exclusive", "VK_KHR_swapchain"), + std::make_tuple(1, 0, "VK_EXT_hdr_metadata", "VK_KHR_swapchain"), + std::make_tuple(1, 1, "VK_EXT_hdr_metadata", "VK_KHR_swapchain"), + std::make_tuple(1, 0, "VK_EXT_host_query_reset", "VK_KHR_get_physical_device_properties2"), + std::make_tuple(1, 0, "VK_EXT_image_drm_format_modifier", "VK_KHR_bind_memory2"), + std::make_tuple(1, 0, "VK_EXT_image_drm_format_modifier", "VK_KHR_get_physical_device_properties2"), + std::make_tuple(1, 0, "VK_EXT_image_drm_format_modifier", "VK_KHR_image_format_list"), + std::make_tuple(1, 0, "VK_EXT_image_drm_format_modifier", "VK_KHR_sampler_ycbcr_conversion"), + std::make_tuple(1, 1, "VK_EXT_image_drm_format_modifier", "VK_KHR_image_format_list"), + std::make_tuple(1, 0, "VK_EXT_inline_uniform_block", "VK_KHR_get_physical_device_properties2"), + std::make_tuple(1, 0, "VK_EXT_inline_uniform_block", "VK_KHR_maintenance1"), + std::make_tuple(1, 0, "VK_EXT_line_rasterization", "VK_KHR_get_physical_device_properties2"), + std::make_tuple(1, 0, "VK_EXT_memory_budget", "VK_KHR_get_physical_device_properties2"), + std::make_tuple(1, 0, "VK_EXT_memory_priority", "VK_KHR_get_physical_device_properties2"), + std::make_tuple(1, 0, "VK_EXT_pci_bus_info", "VK_KHR_get_physical_device_properties2"), + std::make_tuple(1, 0, "VK_EXT_queue_family_foreign", "VK_KHR_external_memory"), + std::make_tuple(1, 0, "VK_EXT_sample_locations", "VK_KHR_get_physical_device_properties2"), + std::make_tuple(1, 0, "VK_EXT_sampler_filter_minmax", "VK_KHR_get_physical_device_properties2"), + std::make_tuple(1, 0, "VK_EXT_scalar_block_layout", "VK_KHR_get_physical_device_properties2"), + std::make_tuple(1, 0, "VK_EXT_shader_demote_to_helper_invocation", "VK_KHR_get_physical_device_properties2"), + std::make_tuple(1, 0, "VK_EXT_texel_buffer_alignment", "VK_KHR_get_physical_device_properties2"), + std::make_tuple(1, 0, "VK_EXT_texture_compression_astc_hdr", "VK_KHR_get_physical_device_properties2"), + std::make_tuple(1, 0, "VK_EXT_transform_feedback", "VK_KHR_get_physical_device_properties2"), + std::make_tuple(1, 0, "VK_EXT_vertex_attribute_divisor", "VK_KHR_get_physical_device_properties2"), + std::make_tuple(1, 0, "VK_EXT_ycbcr_image_arrays", "VK_KHR_sampler_ycbcr_conversion"), + std::make_tuple(1, 0, "VK_GGP_frame_token", "VK_KHR_swapchain"), + std::make_tuple(1, 0, "VK_GGP_frame_token", "VK_GGP_stream_descriptor_surface"), + std::make_tuple(1, 1, "VK_GGP_frame_token", "VK_KHR_swapchain"), + std::make_tuple(1, 1, "VK_GGP_frame_token", "VK_GGP_stream_descriptor_surface"), + std::make_tuple(1, 0, "VK_GOOGLE_display_timing", "VK_KHR_swapchain"), + std::make_tuple(1, 1, "VK_GOOGLE_display_timing", "VK_KHR_swapchain"), + std::make_tuple(1, 0, "VK_INTEL_shader_integer_functions2", "VK_KHR_get_physical_device_properties2"), + std::make_tuple(1, 0, "VK_KHR_16bit_storage", "VK_KHR_get_physical_device_properties2"), + std::make_tuple(1, 0, "VK_KHR_16bit_storage", "VK_KHR_storage_buffer_storage_class"), + std::make_tuple(1, 0, "VK_KHR_8bit_storage", "VK_KHR_get_physical_device_properties2"), + std::make_tuple(1, 0, "VK_KHR_8bit_storage", "VK_KHR_storage_buffer_storage_class"), + std::make_tuple(1, 0, "VK_KHR_create_renderpass2", "VK_KHR_multiview"), + std::make_tuple(1, 0, "VK_KHR_create_renderpass2", "VK_KHR_maintenance2"), + std::make_tuple(1, 0, "VK_KHR_dedicated_allocation", "VK_KHR_get_memory_requirements2"), + std::make_tuple(1, 0, "VK_KHR_depth_stencil_resolve", "VK_KHR_create_renderpass2"), + std::make_tuple(1, 1, "VK_KHR_depth_stencil_resolve", "VK_KHR_create_renderpass2"), + std::make_tuple(1, 0, "VK_KHR_device_group", "VK_KHR_device_group_creation"), + std::make_tuple(1, 0, "VK_KHR_display_swapchain", "VK_KHR_swapchain"), + std::make_tuple(1, 0, "VK_KHR_display_swapchain", "VK_KHR_display"), + std::make_tuple(1, 1, "VK_KHR_display_swapchain", "VK_KHR_swapchain"), + std::make_tuple(1, 1, "VK_KHR_display_swapchain", "VK_KHR_display"), + std::make_tuple(1, 0, "VK_KHR_driver_properties", "VK_KHR_get_physical_device_properties2"), + std::make_tuple(1, 0, "VK_KHR_external_fence", "VK_KHR_external_fence_capabilities"), + std::make_tuple(1, 0, "VK_KHR_external_fence_fd", "VK_KHR_external_fence"), + std::make_tuple(1, 0, "VK_KHR_external_fence_win32", "VK_KHR_external_fence"), + std::make_tuple(1, 0, "VK_KHR_external_memory", "VK_KHR_external_memory_capabilities"), + std::make_tuple(1, 0, "VK_KHR_external_memory_fd", "VK_KHR_external_memory"), + std::make_tuple(1, 0, "VK_KHR_external_memory_win32", "VK_KHR_external_memory"), + std::make_tuple(1, 0, "VK_KHR_external_semaphore", "VK_KHR_external_semaphore_capabilities"), + std::make_tuple(1, 0, "VK_KHR_external_semaphore_fd", "VK_KHR_external_semaphore"), + std::make_tuple(1, 0, "VK_KHR_external_semaphore_win32", "VK_KHR_external_semaphore"), + std::make_tuple(1, 0, "VK_KHR_imageless_framebuffer", "VK_KHR_maintenance2"), + std::make_tuple(1, 0, "VK_KHR_imageless_framebuffer", "VK_KHR_image_format_list"), + std::make_tuple(1, 1, "VK_KHR_imageless_framebuffer", "VK_KHR_image_format_list"), + std::make_tuple(1, 0, "VK_KHR_incremental_present", "VK_KHR_swapchain"), + std::make_tuple(1, 1, "VK_KHR_incremental_present", "VK_KHR_swapchain"), + std::make_tuple(1, 0, "VK_KHR_maintenance3", "VK_KHR_get_physical_device_properties2"), + std::make_tuple(1, 0, "VK_KHR_multiview", "VK_KHR_get_physical_device_properties2"), + std::make_tuple(1, 0, "VK_KHR_push_descriptor", "VK_KHR_get_physical_device_properties2"), + std::make_tuple(1, 0, "VK_KHR_sampler_ycbcr_conversion", "VK_KHR_maintenance1"), + std::make_tuple(1, 0, "VK_KHR_sampler_ycbcr_conversion", "VK_KHR_bind_memory2"), + std::make_tuple(1, 0, "VK_KHR_sampler_ycbcr_conversion", "VK_KHR_get_memory_requirements2"), + std::make_tuple(1, 0, "VK_KHR_sampler_ycbcr_conversion", "VK_KHR_get_physical_device_properties2"), + std::make_tuple(1, 0, "VK_KHR_shader_atomic_int64", "VK_KHR_get_physical_device_properties2"), + std::make_tuple(1, 0, "VK_KHR_shader_float16_int8", "VK_KHR_get_physical_device_properties2"), + std::make_tuple(1, 0, "VK_KHR_shader_float_controls", "VK_KHR_get_physical_device_properties2"), + std::make_tuple(1, 0, "VK_KHR_shared_presentable_image", "VK_KHR_swapchain"), + std::make_tuple(1, 0, "VK_KHR_shared_presentable_image", "VK_KHR_get_physical_device_properties2"), + std::make_tuple(1, 0, "VK_KHR_shared_presentable_image", "VK_KHR_get_surface_capabilities2"), + std::make_tuple(1, 1, "VK_KHR_shared_presentable_image", "VK_KHR_swapchain"), + std::make_tuple(1, 1, "VK_KHR_shared_presentable_image", "VK_KHR_get_surface_capabilities2"), + std::make_tuple(1, 0, "VK_KHR_swapchain", "VK_KHR_surface"), + std::make_tuple(1, 1, "VK_KHR_swapchain", "VK_KHR_surface"), + std::make_tuple(1, 0, "VK_KHR_swapchain_mutable_format", "VK_KHR_swapchain"), + std::make_tuple(1, 0, "VK_KHR_swapchain_mutable_format", "VK_KHR_maintenance2"), + std::make_tuple(1, 0, "VK_KHR_swapchain_mutable_format", "VK_KHR_image_format_list"), + std::make_tuple(1, 1, "VK_KHR_swapchain_mutable_format", "VK_KHR_swapchain"), + std::make_tuple(1, 1, "VK_KHR_swapchain_mutable_format", "VK_KHR_image_format_list"), + std::make_tuple(1, 0, "VK_KHR_uniform_buffer_standard_layout", "VK_KHR_get_physical_device_properties2"), + std::make_tuple(1, 0, "VK_KHR_variable_pointers", "VK_KHR_get_physical_device_properties2"), + std::make_tuple(1, 0, "VK_KHR_variable_pointers", "VK_KHR_storage_buffer_storage_class"), + std::make_tuple(1, 0, "VK_KHR_win32_keyed_mutex", "VK_KHR_external_memory_win32"), + std::make_tuple(1, 1, "VK_KHR_win32_keyed_mutex", "VK_KHR_external_memory_win32"), + std::make_tuple(1, 0, "VK_NVX_multiview_per_view_attributes", "VK_KHR_multiview"), + std::make_tuple(1, 0, "VK_NV_compute_shader_derivatives", "VK_KHR_get_physical_device_properties2"), + std::make_tuple(1, 0, "VK_NV_cooperative_matrix", "VK_KHR_get_physical_device_properties2"), + std::make_tuple(1, 0, "VK_NV_corner_sampled_image", "VK_KHR_get_physical_device_properties2"), + std::make_tuple(1, 0, "VK_NV_coverage_reduction_mode", "VK_NV_framebuffer_mixed_samples"), + std::make_tuple(1, 1, "VK_NV_coverage_reduction_mode", "VK_NV_framebuffer_mixed_samples"), + std::make_tuple(1, 0, "VK_NV_dedicated_allocation_image_aliasing", "VK_KHR_dedicated_allocation"), + std::make_tuple(1, 0, "VK_NV_device_diagnostic_checkpoints", "VK_KHR_get_physical_device_properties2"), + std::make_tuple(1, 0, "VK_NV_external_memory", "VK_NV_external_memory_capabilities"), + std::make_tuple(1, 1, "VK_NV_external_memory", "VK_NV_external_memory_capabilities"), + std::make_tuple(1, 0, "VK_NV_external_memory_win32", "VK_NV_external_memory"), + std::make_tuple(1, 1, "VK_NV_external_memory_win32", "VK_NV_external_memory"), + std::make_tuple(1, 0, "VK_NV_fragment_shader_barycentric", "VK_KHR_get_physical_device_properties2"), + std::make_tuple(1, 0, "VK_NV_mesh_shader", "VK_KHR_get_physical_device_properties2"), + std::make_tuple(1, 0, "VK_NV_ray_tracing", "VK_KHR_get_physical_device_properties2"), + std::make_tuple(1, 0, "VK_NV_ray_tracing", "VK_KHR_get_memory_requirements2"), + std::make_tuple(1, 0, "VK_NV_scissor_exclusive", "VK_KHR_get_physical_device_properties2"), + std::make_tuple(1, 0, "VK_NV_shader_image_footprint", "VK_KHR_get_physical_device_properties2"), + std::make_tuple(1, 0, "VK_NV_shading_rate_image", "VK_KHR_get_physical_device_properties2"), + std::make_tuple(1, 0, "VK_NV_win32_keyed_mutex", "VK_NV_external_memory_win32"), + std::make_tuple(1, 1, "VK_NV_win32_keyed_mutex", "VK_NV_external_memory_win32"), }; -static const std::pair deviceExtensionDependencies_1_0[] = +static const std::tuple releasedApiVersions[] = { - std::make_pair("VK_AMD_display_native_hdr", "VK_KHR_get_physical_device_properties2"), - std::make_pair("VK_AMD_display_native_hdr", "VK_KHR_get_surface_capabilities2"), - std::make_pair("VK_AMD_display_native_hdr", "VK_KHR_swapchain"), - std::make_pair("VK_AMD_shader_core_properties", "VK_KHR_get_physical_device_properties2"), - std::make_pair("VK_AMD_shader_core_properties2", "VK_AMD_shader_core_properties"), - std::make_pair("VK_AMD_texture_gather_bias_lod", "VK_KHR_get_physical_device_properties2"), - std::make_pair("VK_ANDROID_external_memory_android_hardware_buffer", "VK_KHR_sampler_ycbcr_conversion"), - std::make_pair("VK_ANDROID_external_memory_android_hardware_buffer", "VK_KHR_external_memory"), - std::make_pair("VK_ANDROID_external_memory_android_hardware_buffer", "VK_EXT_queue_family_foreign"), - std::make_pair("VK_EXT_astc_decode_mode", "VK_KHR_get_physical_device_properties2"), - std::make_pair("VK_EXT_buffer_device_address", "VK_KHR_get_physical_device_properties2"), - std::make_pair("VK_EXT_conservative_rasterization", "VK_KHR_get_physical_device_properties2"), - std::make_pair("VK_EXT_debug_marker", "VK_EXT_debug_report"), - std::make_pair("VK_EXT_descriptor_indexing", "VK_KHR_get_physical_device_properties2"), - std::make_pair("VK_EXT_descriptor_indexing", "VK_KHR_maintenance3"), - std::make_pair("VK_EXT_discard_rectangles", "VK_KHR_get_physical_device_properties2"), - std::make_pair("VK_EXT_display_control", "VK_EXT_display_surface_counter"), - std::make_pair("VK_EXT_display_control", "VK_KHR_swapchain"), - std::make_pair("VK_EXT_external_memory_dma_buf", "VK_KHR_external_memory_fd"), - std::make_pair("VK_EXT_external_memory_host", "VK_KHR_external_memory"), - std::make_pair("VK_EXT_filter_cubic", "VK_IMG_filter_cubic"), - std::make_pair("VK_EXT_fragment_density_map", "VK_KHR_get_physical_device_properties2"), - std::make_pair("VK_EXT_fragment_shader_interlock", "VK_KHR_get_physical_device_properties2"), - std::make_pair("VK_EXT_full_screen_exclusive", "VK_KHR_get_physical_device_properties2"), - std::make_pair("VK_EXT_full_screen_exclusive", "VK_KHR_surface"), - std::make_pair("VK_EXT_full_screen_exclusive", "VK_KHR_get_surface_capabilities2"), - std::make_pair("VK_EXT_full_screen_exclusive", "VK_KHR_swapchain"), - std::make_pair("VK_EXT_hdr_metadata", "VK_KHR_swapchain"), - std::make_pair("VK_EXT_host_query_reset", "VK_KHR_get_physical_device_properties2"), - std::make_pair("VK_EXT_image_drm_format_modifier", "VK_KHR_bind_memory2"), - std::make_pair("VK_EXT_image_drm_format_modifier", "VK_KHR_get_physical_device_properties2"), - std::make_pair("VK_EXT_image_drm_format_modifier", "VK_KHR_image_format_list"), - std::make_pair("VK_EXT_image_drm_format_modifier", "VK_KHR_sampler_ycbcr_conversion"), - std::make_pair("VK_EXT_inline_uniform_block", "VK_KHR_get_physical_device_properties2"), - std::make_pair("VK_EXT_inline_uniform_block", "VK_KHR_maintenance1"), - std::make_pair("VK_EXT_line_rasterization", "VK_KHR_get_physical_device_properties2"), - std::make_pair("VK_EXT_memory_budget", "VK_KHR_get_physical_device_properties2"), - std::make_pair("VK_EXT_memory_priority", "VK_KHR_get_physical_device_properties2"), - std::make_pair("VK_EXT_pci_bus_info", "VK_KHR_get_physical_device_properties2"), - std::make_pair("VK_EXT_queue_family_foreign", "VK_KHR_external_memory"), - std::make_pair("VK_EXT_sample_locations", "VK_KHR_get_physical_device_properties2"), - std::make_pair("VK_EXT_sampler_filter_minmax", "VK_KHR_get_physical_device_properties2"), - std::make_pair("VK_EXT_scalar_block_layout", "VK_KHR_get_physical_device_properties2"), - std::make_pair("VK_EXT_shader_demote_to_helper_invocation", "VK_KHR_get_physical_device_properties2"), - std::make_pair("VK_EXT_texel_buffer_alignment", "VK_KHR_get_physical_device_properties2"), - std::make_pair("VK_EXT_texture_compression_astc_hdr", "VK_KHR_get_physical_device_properties2"), - std::make_pair("VK_EXT_transform_feedback", "VK_KHR_get_physical_device_properties2"), - std::make_pair("VK_EXT_vertex_attribute_divisor", "VK_KHR_get_physical_device_properties2"), - std::make_pair("VK_EXT_ycbcr_image_arrays", "VK_KHR_sampler_ycbcr_conversion"), - std::make_pair("VK_GGP_frame_token", "VK_KHR_swapchain"), - std::make_pair("VK_GGP_frame_token", "VK_GGP_stream_descriptor_surface"), - std::make_pair("VK_GOOGLE_display_timing", "VK_KHR_swapchain"), - std::make_pair("VK_INTEL_shader_integer_functions2", "VK_KHR_get_physical_device_properties2"), - std::make_pair("VK_KHR_16bit_storage", "VK_KHR_get_physical_device_properties2"), - std::make_pair("VK_KHR_16bit_storage", "VK_KHR_storage_buffer_storage_class"), - std::make_pair("VK_KHR_8bit_storage", "VK_KHR_get_physical_device_properties2"), - std::make_pair("VK_KHR_8bit_storage", "VK_KHR_storage_buffer_storage_class"), - std::make_pair("VK_KHR_create_renderpass2", "VK_KHR_multiview"), - std::make_pair("VK_KHR_create_renderpass2", "VK_KHR_maintenance2"), - std::make_pair("VK_KHR_dedicated_allocation", "VK_KHR_get_memory_requirements2"), - std::make_pair("VK_KHR_depth_stencil_resolve", "VK_KHR_create_renderpass2"), - std::make_pair("VK_KHR_device_group", "VK_KHR_device_group_creation"), - std::make_pair("VK_KHR_display_swapchain", "VK_KHR_swapchain"), - std::make_pair("VK_KHR_display_swapchain", "VK_KHR_display"), - std::make_pair("VK_KHR_driver_properties", "VK_KHR_get_physical_device_properties2"), - std::make_pair("VK_KHR_external_fence", "VK_KHR_external_fence_capabilities"), - std::make_pair("VK_KHR_external_fence_fd", "VK_KHR_external_fence"), - std::make_pair("VK_KHR_external_fence_win32", "VK_KHR_external_fence"), - std::make_pair("VK_KHR_external_memory", "VK_KHR_external_memory_capabilities"), - std::make_pair("VK_KHR_external_memory_fd", "VK_KHR_external_memory"), - std::make_pair("VK_KHR_external_memory_win32", "VK_KHR_external_memory"), - std::make_pair("VK_KHR_external_semaphore", "VK_KHR_external_semaphore_capabilities"), - std::make_pair("VK_KHR_external_semaphore_fd", "VK_KHR_external_semaphore"), - std::make_pair("VK_KHR_external_semaphore_win32", "VK_KHR_external_semaphore"), - std::make_pair("VK_KHR_imageless_framebuffer", "VK_KHR_maintenance2"), - std::make_pair("VK_KHR_imageless_framebuffer", "VK_KHR_image_format_list"), - std::make_pair("VK_KHR_incremental_present", "VK_KHR_swapchain"), - std::make_pair("VK_KHR_maintenance3", "VK_KHR_get_physical_device_properties2"), - std::make_pair("VK_KHR_multiview", "VK_KHR_get_physical_device_properties2"), - std::make_pair("VK_KHR_push_descriptor", "VK_KHR_get_physical_device_properties2"), - std::make_pair("VK_KHR_sampler_ycbcr_conversion", "VK_KHR_maintenance1"), - std::make_pair("VK_KHR_sampler_ycbcr_conversion", "VK_KHR_bind_memory2"), - std::make_pair("VK_KHR_sampler_ycbcr_conversion", "VK_KHR_get_memory_requirements2"), - std::make_pair("VK_KHR_sampler_ycbcr_conversion", "VK_KHR_get_physical_device_properties2"), - std::make_pair("VK_KHR_shader_atomic_int64", "VK_KHR_get_physical_device_properties2"), - std::make_pair("VK_KHR_shader_float16_int8", "VK_KHR_get_physical_device_properties2"), - std::make_pair("VK_KHR_shader_float_controls", "VK_KHR_get_physical_device_properties2"), - std::make_pair("VK_KHR_shared_presentable_image", "VK_KHR_swapchain"), - std::make_pair("VK_KHR_shared_presentable_image", "VK_KHR_get_physical_device_properties2"), - std::make_pair("VK_KHR_shared_presentable_image", "VK_KHR_get_surface_capabilities2"), - std::make_pair("VK_KHR_swapchain", "VK_KHR_surface"), - std::make_pair("VK_KHR_swapchain_mutable_format", "VK_KHR_swapchain"), - std::make_pair("VK_KHR_swapchain_mutable_format", "VK_KHR_maintenance2"), - std::make_pair("VK_KHR_swapchain_mutable_format", "VK_KHR_image_format_list"), - std::make_pair("VK_KHR_uniform_buffer_standard_layout", "VK_KHR_get_physical_device_properties2"), - std::make_pair("VK_KHR_variable_pointers", "VK_KHR_get_physical_device_properties2"), - std::make_pair("VK_KHR_variable_pointers", "VK_KHR_storage_buffer_storage_class"), - std::make_pair("VK_KHR_win32_keyed_mutex", "VK_KHR_external_memory_win32"), - std::make_pair("VK_NVX_multiview_per_view_attributes", "VK_KHR_multiview"), - std::make_pair("VK_NV_compute_shader_derivatives", "VK_KHR_get_physical_device_properties2"), - std::make_pair("VK_NV_cooperative_matrix", "VK_KHR_get_physical_device_properties2"), - std::make_pair("VK_NV_corner_sampled_image", "VK_KHR_get_physical_device_properties2"), - std::make_pair("VK_NV_coverage_reduction_mode", "VK_NV_framebuffer_mixed_samples"), - std::make_pair("VK_NV_dedicated_allocation_image_aliasing", "VK_KHR_dedicated_allocation"), - std::make_pair("VK_NV_device_diagnostic_checkpoints", "VK_KHR_get_physical_device_properties2"), - std::make_pair("VK_NV_external_memory", "VK_NV_external_memory_capabilities"), - std::make_pair("VK_NV_external_memory_win32", "VK_NV_external_memory"), - std::make_pair("VK_NV_fragment_shader_barycentric", "VK_KHR_get_physical_device_properties2"), - std::make_pair("VK_NV_mesh_shader", "VK_KHR_get_physical_device_properties2"), - std::make_pair("VK_NV_ray_tracing", "VK_KHR_get_physical_device_properties2"), - std::make_pair("VK_NV_ray_tracing", "VK_KHR_get_memory_requirements2"), - std::make_pair("VK_NV_scissor_exclusive", "VK_KHR_get_physical_device_properties2"), - std::make_pair("VK_NV_shader_image_footprint", "VK_KHR_get_physical_device_properties2"), - std::make_pair("VK_NV_shading_rate_image", "VK_KHR_get_physical_device_properties2"), - std::make_pair("VK_NV_win32_keyed_mutex", "VK_NV_external_memory_win32"), -}; -static const std::pair deviceExtensionDependencies_1_1[] = -{ - std::make_pair("VK_AMD_display_native_hdr", "VK_KHR_get_surface_capabilities2"), - std::make_pair("VK_AMD_display_native_hdr", "VK_KHR_swapchain"), - std::make_pair("VK_AMD_shader_core_properties2", "VK_AMD_shader_core_properties"), - std::make_pair("VK_ANDROID_external_memory_android_hardware_buffer", "VK_EXT_queue_family_foreign"), - std::make_pair("VK_EXT_debug_marker", "VK_EXT_debug_report"), - std::make_pair("VK_EXT_display_control", "VK_EXT_display_surface_counter"), - std::make_pair("VK_EXT_display_control", "VK_KHR_swapchain"), - std::make_pair("VK_EXT_external_memory_dma_buf", "VK_KHR_external_memory_fd"), - std::make_pair("VK_EXT_filter_cubic", "VK_IMG_filter_cubic"), - std::make_pair("VK_EXT_full_screen_exclusive", "VK_KHR_surface"), - std::make_pair("VK_EXT_full_screen_exclusive", "VK_KHR_get_surface_capabilities2"), - std::make_pair("VK_EXT_full_screen_exclusive", "VK_KHR_swapchain"), - std::make_pair("VK_EXT_hdr_metadata", "VK_KHR_swapchain"), - std::make_pair("VK_EXT_image_drm_format_modifier", "VK_KHR_image_format_list"), - std::make_pair("VK_GGP_frame_token", "VK_KHR_swapchain"), - std::make_pair("VK_GGP_frame_token", "VK_GGP_stream_descriptor_surface"), - std::make_pair("VK_GOOGLE_display_timing", "VK_KHR_swapchain"), - std::make_pair("VK_KHR_depth_stencil_resolve", "VK_KHR_create_renderpass2"), - std::make_pair("VK_KHR_display_swapchain", "VK_KHR_swapchain"), - std::make_pair("VK_KHR_display_swapchain", "VK_KHR_display"), - std::make_pair("VK_KHR_imageless_framebuffer", "VK_KHR_image_format_list"), - std::make_pair("VK_KHR_incremental_present", "VK_KHR_swapchain"), - std::make_pair("VK_KHR_shared_presentable_image", "VK_KHR_swapchain"), - std::make_pair("VK_KHR_shared_presentable_image", "VK_KHR_get_surface_capabilities2"), - std::make_pair("VK_KHR_swapchain", "VK_KHR_surface"), - std::make_pair("VK_KHR_swapchain_mutable_format", "VK_KHR_swapchain"), - std::make_pair("VK_KHR_swapchain_mutable_format", "VK_KHR_image_format_list"), - std::make_pair("VK_KHR_win32_keyed_mutex", "VK_KHR_external_memory_win32"), - std::make_pair("VK_NV_coverage_reduction_mode", "VK_NV_framebuffer_mixed_samples"), - std::make_pair("VK_NV_external_memory", "VK_NV_external_memory_capabilities"), - std::make_pair("VK_NV_external_memory_win32", "VK_NV_external_memory"), - std::make_pair("VK_NV_win32_keyed_mutex", "VK_NV_external_memory_win32"), + std::make_tuple(4198400, 1, 1), + std::make_tuple(4194304, 1, 0), }; diff --git a/external/vulkancts/modules/vulkan/api/vktApiFeatureInfo.cpp b/external/vulkancts/modules/vulkan/api/vktApiFeatureInfo.cpp index e32dd1d..0346736 100644 --- a/external/vulkancts/modules/vulkan/api/vktApiFeatureInfo.cpp +++ b/external/vulkancts/modules/vulkan/api/vktApiFeatureInfo.cpp @@ -706,34 +706,50 @@ void checkDeviceExtensions (tcu::ResultCollector& results, const vector& checkDuplicateExtensions(results, extensions); } -void checkInstanceExtensionDependencies(tcu::ResultCollector& results, - int dependencyLength, - const std::pair* dependencies, - const vector& extensionProperties) +void checkInstanceExtensionDependencies(tcu::ResultCollector& results, + int dependencyLength, + const std::tuple* dependencies, + deUint32 versionMajor, + deUint32 versionMinor, + const vector& extensionProperties) { for (int ndx = 0; ndx < dependencyLength; ndx++) { - if (isExtensionSupported(extensionProperties, RequiredExtension(dependencies[ndx].first)) && - !isExtensionSupported(extensionProperties, RequiredExtension(dependencies[ndx].second))) + deUint32 currentVersionMajor, currentVersionMinor; + const char* extensionFirst; + const char* extensionSecond; + std::tie(currentVersionMajor, currentVersionMinor, extensionFirst, extensionSecond) = dependencies[ndx]; + if (currentVersionMajor != versionMajor || currentVersionMinor != versionMinor) + continue; + if (isExtensionSupported(extensionProperties, RequiredExtension(extensionFirst)) && + !isExtensionSupported(extensionProperties, RequiredExtension(extensionSecond))) { - results.fail("Extension " + string(dependencies[ndx].first) + " is missing dependency: " + string(dependencies[ndx].second)); + results.fail("Extension " + string(extensionFirst) + " is missing dependency: " + string(extensionSecond)); } } } -void checkDeviceExtensionDependencies(tcu::ResultCollector& results, - int dependencyLength, - const std::pair* dependencies, - const vector& instanceExtensionProperties, - const vector& deviceExtensionProperties) +void checkDeviceExtensionDependencies(tcu::ResultCollector& results, + int dependencyLength, + const std::tuple* dependencies, + deUint32 versionMajor, + deUint32 versionMinor, + const vector& instanceExtensionProperties, + const vector& deviceExtensionProperties) { for (int ndx = 0; ndx < dependencyLength; ndx++) { - if (isExtensionSupported(deviceExtensionProperties, RequiredExtension(dependencies[ndx].first)) && - !isExtensionSupported(deviceExtensionProperties, RequiredExtension(dependencies[ndx].second)) && - !isExtensionSupported(instanceExtensionProperties, RequiredExtension(dependencies[ndx].second))) + deUint32 currentVersionMajor, currentVersionMinor; + const char* extensionFirst; + const char* extensionSecond; + std::tie(currentVersionMajor, currentVersionMinor, extensionFirst, extensionSecond) = dependencies[ndx]; + if (currentVersionMajor != versionMajor || currentVersionMinor != versionMinor) + continue; + if (isExtensionSupported(deviceExtensionProperties, RequiredExtension(extensionFirst)) && + !isExtensionSupported(deviceExtensionProperties, RequiredExtension(extensionSecond)) && + !isExtensionSupported(instanceExtensionProperties, RequiredExtension(extensionSecond))) { - results.fail("Extension " + string(dependencies[ndx].first) + " is missing dependency: " + string(dependencies[ndx].second)); + results.fail("Extension " + string(extensionFirst) + " is missing dependency: " + string(extensionSecond)); } } } @@ -778,17 +794,20 @@ tcu::TestStatus enumerateInstanceExtensions (Context& context) checkInstanceExtensions(results, extensionNames); CheckEnumerateInstanceExtensionPropertiesIncompleteResult()(context, results, properties.size()); - if (context.contextSupports(vk::ApiVersion(1, 1, 0))) - { - checkInstanceExtensionDependencies(results, - DE_LENGTH_OF_ARRAY(instanceExtensionDependencies_1_1), - instanceExtensionDependencies_1_1, properties); - } - else if (context.contextSupports(vk::ApiVersion(1, 0, 0))) + for (const auto& version : releasedApiVersions) { - checkInstanceExtensionDependencies(results, - DE_LENGTH_OF_ARRAY(instanceExtensionDependencies_1_0), - instanceExtensionDependencies_1_0, properties); + deUint32 versionMajor, versionMinor; + std::tie(std::ignore, versionMajor, versionMinor) = version; + if (context.contextSupports(vk::ApiVersion(versionMajor, versionMinor, 0))) + { + checkInstanceExtensionDependencies(results, + DE_LENGTH_OF_ARRAY(instanceExtensionDependencies), + instanceExtensionDependencies, + versionMajor, + versionMinor, + properties); + break; + } } } @@ -899,21 +918,21 @@ tcu::TestStatus enumerateDeviceExtensions (Context& context) checkDeviceExtensions(results, deviceExtensionNames); CheckEnumerateDeviceExtensionPropertiesIncompleteResult()(context, results, deviceExtensionProperties.size()); - if (context.contextSupports(vk::ApiVersion(1, 1, 0))) - { - checkDeviceExtensionDependencies(results, - DE_LENGTH_OF_ARRAY(deviceExtensionDependencies_1_1), - deviceExtensionDependencies_1_1, - instanceExtensionProperties, - deviceExtensionProperties); - } - else if (context.contextSupports(vk::ApiVersion(1, 0, 0))) + for (const auto& version : releasedApiVersions) { - checkDeviceExtensionDependencies(results, - DE_LENGTH_OF_ARRAY(deviceExtensionDependencies_1_0), - deviceExtensionDependencies_1_0, - instanceExtensionProperties, - deviceExtensionProperties); + deUint32 versionMajor, versionMinor; + std::tie(std::ignore, versionMajor, versionMinor) = version; + if (context.contextSupports(vk::ApiVersion(versionMajor, versionMinor, 0))) + { + checkDeviceExtensionDependencies(results, + DE_LENGTH_OF_ARRAY(instanceExtensionDependencies), + instanceExtensionDependencies, + versionMajor, + versionMinor, + instanceExtensionProperties, + deviceExtensionProperties); + break; + } } } diff --git a/external/vulkancts/scripts/gen_ext_deps.py b/external/vulkancts/scripts/gen_ext_deps.py index 96d3af3..5a5d590 100644 --- a/external/vulkancts/scripts/gen_ext_deps.py +++ b/external/vulkancts/scripts/gen_ext_deps.py @@ -27,6 +27,7 @@ sys.path.append(os.path.join(os.path.dirname(__file__), "..", "..", "..", "scrip import khr_util.format import khr_util.registry_cache +from collections import defaultdict VK_SOURCE = khr_util.registry_cache.RegistrySource( "https://github.com/KhronosGroup/Vulkan-Docs.git", @@ -39,23 +40,19 @@ VK_INL_HEADER = khr_util.format.genInlHeader("Khronos Vulkan API description def VK_MAKE_VERSION(major, minor, patch): return (((major) << 22) | ((minor) << 12) | (patch)) -VK_API_VERSION_1_0 = VK_MAKE_VERSION(1, 0, 0) -VK_API_VERSION_1_1 = VK_MAKE_VERSION(1, 1, 0) VK_EXT_NOT_PROMOTED = 0xFFFFFFFF -VK_EXT_TYPE_INST = 0 -VK_EXT_TYPE_DEV = 1 -VK_INST_EXT_DEP_1_0 = 'instanceExtensionDependencies_1_0' -VK_INST_EXT_DEP_1_1 = 'instanceExtensionDependencies_1_1' -VK_DEV_EXT_DEP_1_0 = 'deviceExtensionDependencies_1_0' -VK_DEV_EXT_DEP_1_1 = 'deviceExtensionDependencies_1_1' +VK_EXT_TYPE_INSTANCE = 0 +VK_EXT_TYPE_DEVICE = 1 +VK_EXT_DEP_INSTANCE = 'instanceExtensionDependencies' +VK_EXT_DEP_DEVICE = 'deviceExtensionDependencies' +VK_EXT_API_VERSIONS = 'releasedApiVersions' VK_XML_EXT_DEPS = 'requires' VK_XML_EXT_NAME = 'name' VK_XML_EXT_PROMO = 'promotedto' -VK_XML_EXT_PROMO_1_1 = 'VK_VERSION_1_1' VK_XML_EXT_REQUIRES_CORE = 'requiresCore' -VK_XML_EXT_REQUIRES_CORE_1_1 = '1.1' VK_XML_EXT_SUPPORTED = 'supported' VK_XML_EXT_SUPPORTED_VULKAN = 'vulkan' +VK_XML_EXT_API = 'api' VK_XML_EXT_TYPE = 'type' VK_XML_EXT_TYPE_DEVICE = 'device' VK_XML_EXT_TYPE_INSTANCE = 'instance' @@ -64,31 +61,35 @@ def writeInlFile(filename, lines): khr_util.format.writeInlFile(filename, VK_INL_HEADER, lines) def genExtDepArray(extDepsName, extDepsDict): - yield 'static const std::pair\t%s[]\t=' % extDepsName + yield 'static const std::tuple\t{}[]\t='.format(extDepsName) yield '{' - for ext in sorted(extDepsDict.keys()): - for dep in extDepsDict[ext]: - yield '\tstd::make_pair("%s", "%s"),' % (ext, dep) + for ( major, minor, ext, extDeps ) in extDepsDict: + for dep in extDeps: + yield '\tstd::make_tuple({}, {}, "{}", "{}"),'.format(major, minor, ext, dep) yield '};' -def genExtDepInl(allExtDepsDict): +def genApiVersions(name, apiVersions): + yield 'static const std::tuple\t{}[]\t='.format(name) + yield '{' + for ( version, major, minor ) in apiVersions: + yield '\tstd::make_tuple({}, {}, {}),'.format(version, major, minor) + yield '};' + +def genExtDepInl(dependenciesAndVersions): + allExtDepsDict, apiVersions = dependenciesAndVersions + apiVersions.reverse() lines = [] - if VK_INST_EXT_DEP_1_0 in allExtDepsDict: - lines = lines + [line for line in genExtDepArray(VK_INST_EXT_DEP_1_0, allExtDepsDict[VK_INST_EXT_DEP_1_0])] - if VK_INST_EXT_DEP_1_1 in allExtDepsDict: - lines = lines + [line for line in genExtDepArray(VK_INST_EXT_DEP_1_1, allExtDepsDict[VK_INST_EXT_DEP_1_1])] - if VK_DEV_EXT_DEP_1_0 in allExtDepsDict: - lines = lines + [line for line in genExtDepArray(VK_DEV_EXT_DEP_1_0, allExtDepsDict[VK_DEV_EXT_DEP_1_0])] - if VK_DEV_EXT_DEP_1_1 in allExtDepsDict: - lines = lines + [line for line in genExtDepArray(VK_DEV_EXT_DEP_1_1, allExtDepsDict[VK_DEV_EXT_DEP_1_1])] + lines = lines + [line for line in genExtDepArray(VK_EXT_DEP_INSTANCE, allExtDepsDict[VK_EXT_TYPE_INSTANCE])] + lines = lines + [line for line in genExtDepArray(VK_EXT_DEP_DEVICE, allExtDepsDict[VK_EXT_TYPE_DEVICE])] + lines = lines + [line for line in genApiVersions(VK_EXT_API_VERSIONS, apiVersions)] writeInlFile(VK_INL_FILE, lines) class extInfo: def __init__(self): - self.type = VK_EXT_TYPE_INST - self.core = VK_API_VERSION_1_0 + self.type = VK_EXT_TYPE_INSTANCE + self.core = VK_MAKE_VERSION(1, 0, 0) self.promo = VK_EXT_NOT_PROMOTED self.deps = [] @@ -103,51 +104,65 @@ def genExtDepsOnApiVersion(ext, extInfoDict, apiVersion): return deps -def genExtDeps(extInfoDict): - allExtDepsDict = {} - allExtDepsDict[VK_INST_EXT_DEP_1_0] = {} - allExtDepsDict[VK_INST_EXT_DEP_1_1] = {} - allExtDepsDict[VK_DEV_EXT_DEP_1_0] = {} - allExtDepsDict[VK_DEV_EXT_DEP_1_1] = {} +def genExtDeps(extensionsAndVersions): + extInfoDict, apiVersionID = extensionsAndVersions + + allExtDepsDict = defaultdict(list) + apiVersions = [] + + for (major,minor) in apiVersionID: + apiVersions.append((VK_MAKE_VERSION(major, minor, 0),major,minor)) + apiVersions.sort(key=lambda x: x[0]) for ext, info in extInfoDict.items(): if info.deps == None: continue - if info.type == VK_EXT_TYPE_INST: - allExtDepsDict[VK_INST_EXT_DEP_1_1][ext] = genExtDepsOnApiVersion(ext, extInfoDict, VK_API_VERSION_1_1); - if info.core >= VK_API_VERSION_1_1: - continue - allExtDepsDict[VK_INST_EXT_DEP_1_0][ext] = genExtDepsOnApiVersion(ext, extInfoDict, VK_API_VERSION_1_0); - else: - allExtDepsDict[VK_DEV_EXT_DEP_1_1][ext] = genExtDepsOnApiVersion(ext, extInfoDict, VK_API_VERSION_1_1); - if info.core >= VK_API_VERSION_1_1: - continue - allExtDepsDict[VK_DEV_EXT_DEP_1_0][ext] = genExtDepsOnApiVersion(ext, extInfoDict, VK_API_VERSION_1_0); + for (version,major,minor) in apiVersions: + if info.core <= version: + extDeps = genExtDepsOnApiVersion(ext, extInfoDict, version) + if extDeps == None: + continue + allExtDepsDict[info.type].append( ( major, minor, ext, extDeps ) ) - return allExtDepsDict + for key, value in allExtDepsDict.items(): + value.sort(key=lambda x: x[2]) + return allExtDepsDict, apiVersions def getExtInfoDict(vkRegistry): extInfoDict = {} + apiVersionID = [] + + for feature in vkRegistry.features: + if feature.attrib[VK_XML_EXT_API] != VK_XML_EXT_SUPPORTED_VULKAN: + continue + featureName = feature.attrib[VK_XML_EXT_NAME].split('_') + if len(featureName)!=4 or featureName[0] != 'VK' or featureName[1] != 'VERSION' : + continue + apiVersionID.append( (int(featureName[2]), int(featureName[3])) ) + + apiVersionsByName = {} + apiVersionsByNumber = {} + for (major,minor) in apiVersionID: + apiVersionsByName['VK_VERSION_{}_{}'.format(major,minor)] = VK_MAKE_VERSION(major, minor, 0); + apiVersionsByNumber['{}.{}'.format(major,minor)] = VK_MAKE_VERSION(major, minor, 0); for ext in vkRegistry.extensions: - if (ext.attrib[VK_XML_EXT_SUPPORTED] != VK_XML_EXT_SUPPORTED_VULKAN): + if ext.attrib[VK_XML_EXT_SUPPORTED] != VK_XML_EXT_SUPPORTED_VULKAN: continue name = ext.attrib[VK_XML_EXT_NAME] extInfoDict[name] = extInfo() if ext.attrib[VK_XML_EXT_TYPE] == VK_XML_EXT_TYPE_DEVICE: - extInfoDict[name].type = VK_EXT_TYPE_DEV - if VK_XML_EXT_REQUIRES_CORE in ext.attrib: - if ext.attrib[VK_XML_EXT_REQUIRES_CORE] == VK_XML_EXT_REQUIRES_CORE_1_1: - extInfoDict[name].core = VK_API_VERSION_1_1 - if VK_XML_EXT_PROMO in ext.attrib: - if ext.attrib[VK_XML_EXT_PROMO] == VK_XML_EXT_PROMO_1_1: - extInfoDict[name].promo = VK_API_VERSION_1_1 + extInfoDict[name].type = VK_EXT_TYPE_DEVICE + if VK_XML_EXT_REQUIRES_CORE in ext.attrib and ext.attrib[VK_XML_EXT_REQUIRES_CORE] in apiVersionsByNumber: + extInfoDict[name].core = apiVersionsByNumber[ext.attrib[VK_XML_EXT_REQUIRES_CORE]] + if VK_XML_EXT_PROMO in ext.attrib and ext.attrib[VK_XML_EXT_PROMO] in apiVersionsByName : + extInfoDict[name].promo = apiVersionsByName[ext.attrib[VK_XML_EXT_PROMO]] if VK_XML_EXT_DEPS in ext.attrib: extInfoDict[name].deps = ext.attrib[VK_XML_EXT_DEPS].split(',') - return extInfoDict + return extInfoDict, apiVersionID def getVKRegistry(): return khr_util.registry_cache.getRegistry(VK_SOURCE) -- 2.7.4