From fc2c4909752fb1ff0db8ec8e42e03b971ddaf366 Mon Sep 17 00:00:00 2001 From: Yiwei Zhang Date: Mon, 18 Aug 2025 22:09:22 -0700 Subject: [PATCH] anv: advertise present_id/wait behind ANV_USE_WSI_PLATFORM wsi_common_vk_instance_supports_present_wait returns true for all supported wsi platforms here, so we can unconditionally advertise them behind ANV_USE_WSI_PLATFORM like the other wsi extensions (also to not tangle with Android). v2: guard presentId2 and presentWait2 features as well Acked-by: Lionel Landwerlin (v1) Acked-by: Daniel Stone (v1) Part-of: --- src/intel/vulkan/anv_instance.c | 1 - src/intel/vulkan/anv_physical_device.c | 25 +++++++++++-------------- 2 files changed, 11 insertions(+), 15 deletions(-) diff --git a/src/intel/vulkan/anv_instance.c b/src/intel/vulkan/anv_instance.c index 268a5f3425b..fee3da92581 100644 --- a/src/intel/vulkan/anv_instance.c +++ b/src/intel/vulkan/anv_instance.c @@ -12,7 +12,6 @@ static const driOptionDescription anv_dri_options[] = { DRI_CONF_ADAPTIVE_SYNC(true) DRI_CONF_VK_X11_OVERRIDE_MIN_IMAGE_COUNT(0) DRI_CONF_VK_X11_STRICT_IMAGE_COUNT(false) - DRI_CONF_VK_KHR_PRESENT_WAIT(false) DRI_CONF_VK_XWAYLAND_WAIT_READY(false) DRI_CONF_ANV_ASSUME_FULL_SUBGROUPS(0) DRI_CONF_ANV_ASSUME_FULL_SUBGROUPS_WITH_BARRIER(false) diff --git a/src/intel/vulkan/anv_physical_device.c b/src/intel/vulkan/anv_physical_device.c index ef30995c27e..310c48672a4 100644 --- a/src/intel/vulkan/anv_physical_device.c +++ b/src/intel/vulkan/anv_physical_device.c @@ -205,20 +205,13 @@ get_device_extensions(const struct anv_physical_device *device, !(device->instance->debug & ANV_DEBUG_NO_SECONDARY_CALL), .KHR_pipeline_executable_properties = true, .KHR_pipeline_library = 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. */ - .KHR_present_id = - driQueryOptionb(&device->instance->dri_options, "vk_khr_present_wait") || - wsi_common_vk_instance_supports_present_wait(&device->instance->vk), - .KHR_present_wait = - driQueryOptionb(&device->instance->dri_options, "vk_khr_present_wait") || - wsi_common_vk_instance_supports_present_wait(&device->instance->vk), - .KHR_push_descriptor = true, +#ifdef ANV_USE_WSI_PLATFORM + .KHR_present_id = true, .KHR_present_id2 = true, + .KHR_present_wait = true, .KHR_present_wait2 = true, +#endif + .KHR_push_descriptor = true, .KHR_ray_query = rt_enabled, .KHR_ray_tracing_maintenance1 = rt_enabled, .KHR_ray_tracing_pipeline = rt_enabled, @@ -842,11 +835,13 @@ get_features(const struct anv_physical_device *pdevice, /* VK_EXT_depth_clip_control */ .depthClipControl = true, +#ifdef ANV_USE_WSI_PLATFORM /* VK_KHR_present_id */ - .presentId = pdevice->vk.supported_extensions.KHR_present_id, + .presentId = true, /* VK_KHR_present_wait */ - .presentWait = pdevice->vk.supported_extensions.KHR_present_wait, + .presentWait = true, +#endif /* VK_EXT_vertex_input_dynamic_state */ .vertexInputDynamicState = true, @@ -974,11 +969,13 @@ get_features(const struct anv_physical_device *pdevice, /* VK_KHR_maintenance9 */ .maintenance9 = true, +#ifdef ANV_USE_WSI_PLATFORM /* VK_KHR_present_id2 */ .presentId2 = true, /* VK_KHR_present_wait2 */ .presentWait2 = true, +#endif /* VK_KHR_shader_untyped_pointers */ .shaderUntypedPointers = true,