Skip to content

Commit

Permalink
vk: Explicitly declare null subpass dependencies
Browse files Browse the repository at this point in the history
- We do not want any actual dependencies, but it turns out removing them
  entirely makes the driver add even worse dependencies.
  • Loading branch information
kd-11 committed Feb 15, 2020
1 parent 4018b83 commit 23f1515
Showing 1 changed file with 24 additions and 2 deletions.
26 changes: 24 additions & 2 deletions rpcs3/Emu/RSX/VK/VKRenderPass.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -184,6 +184,28 @@ 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;
Expand All @@ -196,8 +218,8 @@ namespace vk
rp_info.pAttachments = attachments.data();
rp_info.subpassCount = 1;
rp_info.pSubpasses = &subpass;
rp_info.pDependencies = nullptr;
rp_info.dependencyCount = 0;
rp_info.dependencyCount = 2;
rp_info.pDependencies = null_subpass_dependencies;

VkRenderPass result;
CHECK_RESULT(vkCreateRenderPass(dev, &rp_info, NULL, &result));
Expand Down

0 comments on commit 23f1515

Please sign in to comment.