diff --git a/src/amd/vulkan/radv_instance.c b/src/amd/vulkan/radv_instance.c
index 9dc4eab67fd..09837b86b88 100644
--- a/src/amd/vulkan/radv_instance.c
+++ b/src/amd/vulkan/radv_instance.c
@@ -169,6 +169,7 @@ static const driOptionDescription radv_dri_options[] = {
DRI_CONF_VK_LOWER_TERMINATE_TO_DISCARD(false)
DRI_CONF_VK_WSI_FORCE_BGRA8_UNORM_FIRST(false)
DRI_CONF_VK_WSI_FORCE_SWAPCHAIN_TO_CURRENT_EXTENT(false)
+ DRI_CONF_VK_WSI_DISABLE_UNORDERED_SUBMITS(false)
DRI_CONF_VK_X11_IGNORE_SUBOPTIMAL(false)
DRI_CONF_VK_REQUIRE_ETC2(false)
DRI_CONF_VK_REQUIRE_ASTC(false)
diff --git a/src/util/00-radv-defaults.conf b/src/util/00-radv-defaults.conf
index f64c11459d2..1a52db8a613 100644
--- a/src/util/00-radv-defaults.conf
+++ b/src/util/00-radv-defaults.conf
@@ -70,6 +70,10 @@ Application bugs worked around in this file:
+
+
+
+
diff --git a/src/util/driconf.h b/src/util/driconf.h
index 4012e427493..33019346786 100644
--- a/src/util/driconf.h
+++ b/src/util/driconf.h
@@ -449,6 +449,10 @@
DRI_CONF_OPT_B(vk_wsi_force_swapchain_to_current_extent, def, \
"Force VkSwapchainCreateInfoKHR::imageExtent to be VkSurfaceCapabilities2KHR::currentExtent")
+#define DRI_CONF_VK_WSI_DISABLE_UNORDERED_SUBMITS(def) \
+ DRI_CONF_OPT_B(vk_wsi_disable_unordered_submits, def, \
+ "Disable unordered WSI submits to workaround application synchronization bugs")
+
#define DRI_CONF_VK_X11_OVERRIDE_MIN_IMAGE_COUNT(def) \
DRI_CONF_OPT_I(vk_x11_override_min_image_count, def, 0, 999, \
"Override the VkSurfaceCapabilitiesKHR::minImageCount (0 = no override)")
diff --git a/src/vulkan/wsi/wsi_common.c b/src/vulkan/wsi/wsi_common.c
index a6fa7ced888..286a6019f0f 100644
--- a/src/vulkan/wsi/wsi_common.c
+++ b/src/vulkan/wsi/wsi_common.c
@@ -281,6 +281,12 @@ wsi_device_init(struct wsi_device *wsi,
wsi->force_swapchain_to_currentExtent =
driQueryOptionb(dri_options, "vk_wsi_force_swapchain_to_current_extent");
}
+
+ if (driCheckOption(dri_options, "vk_wsi_disable_unordered_submits", DRI_BOOL)) {
+ wsi->disable_unordered_submits =
+ driQueryOptionb(dri_options, "vk_wsi_disable_unordered_submits");
+ }
+
}
/* can_present_on_device is a function pointer used to determine if images
@@ -1366,7 +1372,8 @@ wsi_queue_submit2_unordered(const struct wsi_device *wsi,
uint32_t fence_count,
const VkFence *fences)
{
- if (info->commandBufferInfoCount == 0 &&
+ if (!wsi->disable_unordered_submits &&
+ info->commandBufferInfoCount == 0 &&
queue->base.device->copy_sync_payloads != NULL) {
/* This helper is unordered so if there are no command buffers, we can
* just signal the signal semaphores and fences with the wait semaphores
diff --git a/src/vulkan/wsi/wsi_common.h b/src/vulkan/wsi/wsi_common.h
index c72e6ce4c39..abe771b5bfc 100644
--- a/src/vulkan/wsi/wsi_common.h
+++ b/src/vulkan/wsi/wsi_common.h
@@ -100,6 +100,8 @@ struct wsi_device {
bool force_swapchain_to_currentExtent;
+ bool disable_unordered_submits;
+
struct {
/* Override the minimum number of images on the swapchain.
* 0 = no override */