From 7958babb39ccd53efc7c67edc0e9a3d1c860f8f4 Mon Sep 17 00:00:00 2001 From: Giovanni Mascellani Date: Sat, 1 Jun 2024 21:50:31 +0200 Subject: [PATCH] vkd3d: Do not synchronize with the tessellation shader stages if they're not enabled. Similarly to a54187f3c9c9ad4a5d1357721104f28c498ac112, this fixes some validation errors on devices that do not support tessellation; the Adreno 540 on my OnePlus 5 phone in my specific case. --- libs/vkd3d/command.c | 5 +++-- libs/vkd3d/device.c | 1 + libs/vkd3d/vkd3d_private.h | 1 + 3 files changed, 5 insertions(+), 2 deletions(-) diff --git a/libs/vkd3d/command.c b/libs/vkd3d/command.c index 6c463be8..2354938c 100644 --- a/libs/vkd3d/command.c +++ b/libs/vkd3d/command.c @@ -2034,11 +2034,12 @@ static bool vk_barrier_parameters_from_d3d12_resource_state(unsigned int state, if (vk_queue_flags & VK_QUEUE_GRAPHICS_BIT) { queue_shader_stages |= VK_PIPELINE_STAGE_VERTEX_SHADER_BIT - | VK_PIPELINE_STAGE_TESSELLATION_CONTROL_SHADER_BIT - | VK_PIPELINE_STAGE_TESSELLATION_EVALUATION_SHADER_BIT | VK_PIPELINE_STAGE_FRAGMENT_SHADER_BIT; if (device->vk_info.geometry_shaders) queue_shader_stages |= VK_PIPELINE_STAGE_GEOMETRY_SHADER_BIT; + if (device->vk_info.tessellation_shaders) + queue_shader_stages |= VK_PIPELINE_STAGE_TESSELLATION_CONTROL_SHADER_BIT + | VK_PIPELINE_STAGE_TESSELLATION_EVALUATION_SHADER_BIT; } if (vk_queue_flags & VK_QUEUE_COMPUTE_BIT) queue_shader_stages |= VK_PIPELINE_STAGE_COMPUTE_SHADER_BIT; diff --git a/libs/vkd3d/device.c b/libs/vkd3d/device.c index 674e46fe..2bbc1705 100644 --- a/libs/vkd3d/device.c +++ b/libs/vkd3d/device.c @@ -1644,6 +1644,7 @@ static HRESULT vkd3d_init_device_caps(struct d3d12_device *device, vulkan_info->device_limits = physical_device_info->properties2.properties.limits; vulkan_info->sparse_properties = physical_device_info->properties2.properties.sparseProperties; vulkan_info->geometry_shaders = physical_device_info->features2.features.geometryShader; + vulkan_info->tessellation_shaders = physical_device_info->features2.features.tessellationShader; vulkan_info->sparse_binding = features->sparseBinding; vulkan_info->sparse_residency_3d = features->sparseResidencyImage3D; vulkan_info->rasterization_stream = physical_device_info->xfb_properties.transformFeedbackRasterizationStreamSelect; diff --git a/libs/vkd3d/vkd3d_private.h b/libs/vkd3d/vkd3d_private.h index 226b71fe..733163e3 100644 --- a/libs/vkd3d/vkd3d_private.h +++ b/libs/vkd3d/vkd3d_private.h @@ -147,6 +147,7 @@ struct vkd3d_vulkan_info bool rasterization_stream; bool transform_feedback_queries; bool geometry_shaders; + bool tessellation_shaders; bool uav_read_without_format;