vk: Remove RADV workaround regarding renderpass barriers

- The situation was clarified in the official vulkan spec to allow this
  behavior.
  Barriers are now only inserted by the driver when layout
transitions are requested.
This commit is contained in:
kd-11 2020-03-31 19:19:34 +03:00 committed by kd-11
parent b327e329d6
commit 8c847d3a4b

View File

@ -194,28 +194,6 @@ namespace vk
attachment_references.push_back({ attachment_count, dsv_layout });
}
VkSubpassDependency null_subpass_dependencies[2] =
{
{
.srcSubpass = VK_SUBPASS_EXTERNAL,
.dstSubpass = 0,
.srcStageMask = VK_PIPELINE_STAGE_TOP_OF_PIPE_BIT,
.dstStageMask = VK_PIPELINE_STAGE_TOP_OF_PIPE_BIT,
.srcAccessMask = 0,
.dstAccessMask = 0,
.dependencyFlags = VK_DEPENDENCY_BY_REGION_BIT
},
{
.srcSubpass = 0,
.dstSubpass = VK_SUBPASS_EXTERNAL,
.srcStageMask = VK_PIPELINE_STAGE_TOP_OF_PIPE_BIT,
.dstStageMask = VK_PIPELINE_STAGE_TOP_OF_PIPE_BIT,
.srcAccessMask = 0,
.dstAccessMask = 0,
.dependencyFlags = VK_DEPENDENCY_BY_REGION_BIT
}
};
VkSubpassDescription subpass = {};
subpass.pipelineBindPoint = VK_PIPELINE_BIND_POINT_GRAPHICS;
subpass.colorAttachmentCount = attachment_count;
@ -229,19 +207,6 @@ namespace vk
rp_info.subpassCount = 1;
rp_info.pSubpasses = &subpass;
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));