radv: Conditionally expose VK_KHR_present_wait on RADV.

Gate it behind driconf query for now.

Signed-off-by: Hans-Kristian Arntzen <post@arntzen-software.no>
Reviewed-by: Joshua Ashton <joshua@froggi.es>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19279>
This commit is contained in:
Hans-Kristian Arntzen 2022-10-24 13:48:11 +02:00 committed by Marge Bot
parent c66248fb5b
commit f1f78fa297

View file

@ -523,6 +523,15 @@ radv_physical_device_get_supported_extensions(const struct radv_physical_device
.KHR_performance_query = radv_perf_query_supported(device),
.KHR_pipeline_executable_properties = true,
.KHR_pipeline_library = !device->use_llvm,
/* 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,
.KHR_ray_query = radv_enable_rt(device, false),
.KHR_ray_tracing_maintenance1 = radv_enable_rt(device, false),
@ -1109,6 +1118,7 @@ static const driOptionDescription radv_dri_options[] = {
DRI_CONF_VK_X11_OVERRIDE_MIN_IMAGE_COUNT(0)
DRI_CONF_VK_X11_STRICT_IMAGE_COUNT(false)
DRI_CONF_VK_X11_ENSURE_MIN_IMAGE_COUNT(false)
DRI_CONF_VK_KHR_PRESENT_WAIT(false)
DRI_CONF_VK_XWAYLAND_WAIT_READY(true)
DRI_CONF_RADV_REPORT_LLVM9_VERSION_STRING(false)
DRI_CONF_RADV_ENABLE_MRT_OUTPUT_NAN_FIXUP(false)
@ -1745,6 +1755,18 @@ radv_GetPhysicalDeviceFeatures2(VkPhysicalDevice physicalDevice,
features->sparseImageFloat32AtomicMinMax = has_shader_image_float_minmax;
break;
}
case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PRESENT_ID_FEATURES_KHR: {
VkPhysicalDevicePresentIdFeaturesKHR *features =
(VkPhysicalDevicePresentIdFeaturesKHR *) ext;
features->presentId = pdevice->vk.supported_extensions.KHR_present_id;
break;
}
case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PRESENT_WAIT_FEATURES_KHR: {
VkPhysicalDevicePresentWaitFeaturesKHR *features =
(VkPhysicalDevicePresentWaitFeaturesKHR *) ext;
features->presentWait = pdevice->vk.supported_extensions.KHR_present_wait;
break;
}
case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PRIMITIVE_TOPOLOGY_LIST_RESTART_FEATURES_EXT: {
VkPhysicalDevicePrimitiveTopologyListRestartFeaturesEXT *features =
(VkPhysicalDevicePrimitiveTopologyListRestartFeaturesEXT *)ext;