From 5e6b1003ec2e90f4751db8327fe17d3372285e45 Mon Sep 17 00:00:00 2001 From: kd-11 Date: Sun, 16 Feb 2020 17:15:44 +0300 Subject: [PATCH] vk: Only declare explicit subpass dependencies for RADV --- rpcs3/Emu/RSX/VK/VKRenderPass.cpp | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/rpcs3/Emu/RSX/VK/VKRenderPass.cpp b/rpcs3/Emu/RSX/VK/VKRenderPass.cpp index 88eba5fff9..6d75deaff5 100644 --- a/rpcs3/Emu/RSX/VK/VKRenderPass.cpp +++ b/rpcs3/Emu/RSX/VK/VKRenderPass.cpp @@ -218,8 +218,19 @@ namespace vk rp_info.pAttachments = attachments.data(); rp_info.subpassCount = 1; rp_info.pSubpasses = &subpass; - rp_info.dependencyCount = 2; - rp_info.pDependencies = null_subpass_dependencies; + + if (vk::get_driver_vendor() == vk::driver_vendor::RADV) + { + // So, according to spec, if you do not explicitly define the relationship between a subpass and its neighbours, + // a full pipeline barrier will be inserted for you, which is awful for performance. + // However, only RADV seems to do this and it does not work for other vendors. + // NVIDIA specifically slows to a crawl even with a TOP_OF_PIPE->TOP_OF_PIPE dependency with no dependent access. + // RPCS3 does not actually want to declare any dependency here, we have explicit pipeline barriers for our tasks. + // Workaround: Only provide this null dep chain for RADV + + rp_info.dependencyCount = 2; + rp_info.pDependencies = null_subpass_dependencies; + } VkRenderPass result; CHECK_RESULT(vkCreateRenderPass(dev, &rp_info, NULL, &result));