From b3fd66c8899a1e8946173ef805b3b427b3d60eed Mon Sep 17 00:00:00 2001 From: Faith Ekstrand Date: Sun, 25 Feb 2024 14:06:17 -0600 Subject: [PATCH] nvk: Only expose VK_KHR_present_id/wait when we have WSI Also update docs/features.txt Part-of: --- docs/features.txt | 2 +- src/nouveau/vulkan/nvk_physical_device.c | 15 ++++++++++----- 2 files changed, 11 insertions(+), 6 deletions(-) diff --git a/docs/features.txt b/docs/features.txt index a90e4c53ecd..9dbb12c934c 100644 --- a/docs/features.txt +++ b/docs/features.txt @@ -529,7 +529,7 @@ Khronos extensions that are not part of any Vulkan version: VK_KHR_performance_query DONE (anv, radv/gfx10.3+, tu, v3dv) VK_KHR_pipeline_executable_properties DONE (anv, nvk, hasvk, radv, tu, v3dv) VK_KHR_pipeline_library DONE (anv, lvp, radv, tu, vn) - VK_KHR_present_wait DONE (anv, radv, tu, x11/display) + VK_KHR_present_wait DONE (anv, nvk, radv, tu, x11/display) VK_KHR_push_descriptor DONE (anv, hasvk, lvp, nvk, radv, tu, vn) VK_KHR_ray_query DONE (anv/gfx12.5+, radv/gfx10.3+) VK_KHR_ray_tracing_maintenance1 DONE (anv/gfx12.5+, radv/gfx10.3+) diff --git a/src/nouveau/vulkan/nvk_physical_device.c b/src/nouveau/vulkan/nvk_physical_device.c index 66d95ef9651..41366474dc4 100644 --- a/src/nouveau/vulkan/nvk_physical_device.c +++ b/src/nouveau/vulkan/nvk_physical_device.c @@ -113,15 +113,20 @@ nvk_get_device_extensions(const struct nvk_instance *instance, .KHR_map_memory2 = true, .KHR_multiview = true, .KHR_pipeline_executable_properties = true, - /* Hide these behind dri configs for now since we cannot implement it reliably on - * all surfaces yet. There is no surface capability query for present wait/id, - * but the feature is useful enough to hide behind an opt-in mechanism for now. - * If the instance only enables surface extensions that unconditionally support present wait, - * we can also expose the extension that way. */ + +#ifdef NVK_USE_WSI_PLATFORM + /* Hide these behind dri configs for now since we cannot implement it + * reliably on all surfaces yet. There is no surface capability query + * for present wait/id, but the feature is useful enough to hide behind + * an opt-in mechanism for now. If the instance only enables surface + * extensions that unconditionally support present wait, we can also + * expose the extension that way. + */ .KHR_present_id = driQueryOptionb(&instance->dri_options, "vk_khr_present_wait") || wsi_common_vk_instance_supports_present_wait(&instance->vk), .KHR_present_wait = driQueryOptionb(&instance->dri_options, "vk_khr_present_wait") || wsi_common_vk_instance_supports_present_wait(&instance->vk), +#endif .KHR_push_descriptor = true, .KHR_relaxed_block_layout = true, .KHR_sampler_mirror_clamp_to_edge = true,