From e11af93696d518b85296977ed6c255861b18ac92 Mon Sep 17 00:00:00 2001 From: Chris Forbes Date: Wed, 26 Oct 2016 15:45:33 +1300 Subject: layers: Don't put self-dep edges in the subpass DAG, or any other junk We'd already excluded edges to/from VK_SUBPASS_EXTERNAL, but we don't want any of the other weird cases either; if we attempted to trace use of an attachment, and found a subpass which /didn't/ use it, but had a self-dependency, we'd get stuck chasing that dependency recursively until we exhausted the stack. Fixes #1094 Signed-off-by: Chris Forbes --- layers/core_validation.cpp | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) (limited to 'layers/core_validation.cpp') diff --git a/layers/core_validation.cpp b/layers/core_validation.cpp index b4b080a6..3b3fe52c 100644 --- a/layers/core_validation.cpp +++ b/layers/core_validation.cpp @@ -10033,21 +10033,16 @@ static bool CreatePassDAG(const layer_data *dev_data, VkDevice device, const VkR log_msg(dev_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(dev_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 == dependency.dstSubpass) { has_self_dependency[dependency.srcSubpass] = true; + } else { + subpass_to_node[dependency.dstSubpass].prev.push_back(dependency.srcSubpass); + 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