From 1fc65c0341b5bb7c75ed696e89e5ae51367b151c Mon Sep 17 00:00:00 2001 From: Chris Forbes Date: Tue, 27 Sep 2016 10:54:58 +1300 Subject: layers: Don't add VK_SUBPASS_EXTERNAL edges to subpass DAG. We don't use them, and handling them safely complicates other code that works with the DAG. Signed-off-by: Chris Forbes --- layers/core_validation.cpp | 26 +++++++++++++++----------- 1 file changed, 15 insertions(+), 11 deletions(-) (limited to 'layers/core_validation.cpp') diff --git a/layers/core_validation.cpp b/layers/core_validation.cpp index e041b755..9cb0c515 100644 --- a/layers/core_validation.cpp +++ b/layers/core_validation.cpp @@ -9791,23 +9791,27 @@ static bool CreatePassDAG(const layer_data *my_data, VkDevice device, const VkRe } for (uint32_t i = 0; i < pCreateInfo->dependencyCount; ++i) { const VkSubpassDependency &dependency = pCreateInfo->pDependencies[i]; - if (dependency.srcSubpass > dependency.dstSubpass && dependency.srcSubpass != VK_SUBPASS_EXTERNAL && - dependency.dstSubpass != VK_SUBPASS_EXTERNAL) { + if (dependency.srcSubpass == VK_SUBPASS_EXTERNAL || dependency.dstSubpass == VK_SUBPASS_EXTERNAL) { + if (dependency.srcSubpass == dependency.dstSubpass) { + skip_call |= + log_msg(my_data->report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, (VkDebugReportObjectTypeEXT)0, 0, __LINE__, + DRAWSTATE_INVALID_RENDERPASS, "DS", "The src and dest subpasses cannot both be external."); + } + + // We don't want to add edges to the DAG for dependencies to/from + // VK_SUBPASS_EXTERNAL. We don't use them for anything, and their + // presence complicates other code. + continue; + } else if (dependency.srcSubpass > dependency.dstSubpass) { skip_call |= log_msg(my_data->report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, (VkDebugReportObjectTypeEXT)0, 0, __LINE__, DRAWSTATE_INVALID_RENDERPASS, "DS", "Depedency graph must be specified such that an earlier pass cannot depend on a later pass."); - } else if (dependency.srcSubpass == VK_SUBPASS_EXTERNAL && dependency.dstSubpass == VK_SUBPASS_EXTERNAL) { - skip_call |= log_msg(my_data->report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, (VkDebugReportObjectTypeEXT)0, 0, __LINE__, - DRAWSTATE_INVALID_RENDERPASS, "DS", "The src and dest subpasses cannot both be external."); } else if (dependency.srcSubpass == dependency.dstSubpass) { has_self_dependency[dependency.srcSubpass] = true; } - if (dependency.dstSubpass != VK_SUBPASS_EXTERNAL) { - subpass_to_node[dependency.dstSubpass].prev.push_back(dependency.srcSubpass); - } - if (dependency.srcSubpass != VK_SUBPASS_EXTERNAL) { - subpass_to_node[dependency.srcSubpass].next.push_back(dependency.dstSubpass); - } + + subpass_to_node[dependency.dstSubpass].prev.push_back(dependency.srcSubpass); + subpass_to_node[dependency.srcSubpass].next.push_back(dependency.dstSubpass); } return skip_call; } -- cgit v1.2.3