diff options
author | Jason Ekstrand <[email protected]> | 2018-04-24 12:57:39 -0700 |
---|---|---|
committer | Jason Ekstrand <[email protected]> | 2018-07-09 10:11:53 -0700 |
commit | 144626946e18d34111d4cc3013771cbc3bb8e740 (patch) | |
tree | 873cbfdcbc542c932f5916d5521446c67737c152 /src/intel/vulkan/anv_pass.c | |
parent | 6f9485d21f795730fc2af32adeab205d0810b95b (diff) |
anv/pass: Move some dependency setup into a helper
This new helper takes a VkSubpassDependency2KHR for future-proofing.
Reviewed-by: Lionel Landwerlin <[email protected]>
Diffstat (limited to 'src/intel/vulkan/anv_pass.c')
-rw-r--r-- | src/intel/vulkan/anv_pass.c | 52 |
1 files changed, 34 insertions, 18 deletions
diff --git a/src/intel/vulkan/anv_pass.c b/src/intel/vulkan/anv_pass.c index fe9b3d69819..b70de87a82b 100644 --- a/src/intel/vulkan/anv_pass.c +++ b/src/intel/vulkan/anv_pass.c @@ -25,6 +25,29 @@ #include "vk_util.h" +static void +anv_render_pass_add_subpass_dep(struct anv_render_pass *pass, + const VkSubpassDependency2KHR *dep) +{ + if (dep->dstSubpass == VK_SUBPASS_EXTERNAL) { + pass->subpass_flushes[pass->subpass_count] |= + anv_pipe_invalidate_bits_for_access_flags(dep->dstAccessMask); + } else { + assert(dep->dstSubpass < pass->subpass_count); + pass->subpass_flushes[dep->dstSubpass] |= + anv_pipe_invalidate_bits_for_access_flags(dep->dstAccessMask); + } + + if (dep->srcSubpass == VK_SUBPASS_EXTERNAL) { + pass->subpass_flushes[0] |= + anv_pipe_flush_bits_for_access_flags(dep->srcAccessMask); + } else { + assert(dep->srcSubpass < pass->subpass_count); + pass->subpass_flushes[dep->srcSubpass + 1] |= + anv_pipe_flush_bits_for_access_flags(dep->srcAccessMask); + } +} + /* Do a second "compile" step on a render pass */ static void anv_render_pass_compile(struct anv_render_pass *pass) @@ -223,24 +246,17 @@ VkResult anv_CreateRenderPass( } for (uint32_t i = 0; i < pCreateInfo->dependencyCount; i++) { - const VkSubpassDependency *dep = &pCreateInfo->pDependencies[i]; - if (dep->dstSubpass == VK_SUBPASS_EXTERNAL) { - pass->subpass_flushes[pass->subpass_count] |= - anv_pipe_invalidate_bits_for_access_flags(dep->dstAccessMask); - } else { - assert(dep->dstSubpass < pass->subpass_count); - pass->subpass_flushes[dep->dstSubpass] |= - anv_pipe_invalidate_bits_for_access_flags(dep->dstAccessMask); - } - - if (dep->srcSubpass == VK_SUBPASS_EXTERNAL) { - pass->subpass_flushes[0] |= - anv_pipe_flush_bits_for_access_flags(dep->srcAccessMask); - } else { - assert(dep->srcSubpass < pass->subpass_count); - pass->subpass_flushes[dep->srcSubpass + 1] |= - anv_pipe_flush_bits_for_access_flags(dep->srcAccessMask); - } + /* Convert to a Dependency2KHR */ + struct VkSubpassDependency2KHR dep2 = { + .srcSubpass = pCreateInfo->pDependencies[i].srcSubpass, + .dstSubpass = pCreateInfo->pDependencies[i].dstSubpass, + .srcStageMask = pCreateInfo->pDependencies[i].srcStageMask, + .dstStageMask = pCreateInfo->pDependencies[i].dstStageMask, + .srcAccessMask = pCreateInfo->pDependencies[i].srcAccessMask, + .dstAccessMask = pCreateInfo->pDependencies[i].dstAccessMask, + .dependencyFlags = pCreateInfo->pDependencies[i].dependencyFlags, + }; + anv_render_pass_add_subpass_dep(pass, &dep2); } /* From the Vulkan 1.0.39 spec: |