diff options
| author | Chris Forbes <chrisforbes@google.com> | 2016-09-27 10:54:58 +1300 |
|---|---|---|
| committer | Chris Forbes <chrisforbes@google.com> | 2016-09-27 12:38:58 +1300 |
| commit | 1fc65c0341b5bb7c75ed696e89e5ae51367b151c (patch) | |
| tree | f11c868ad7980cfda46a1fd66c9985fed0f35c4f /layers/core_validation.cpp | |
| parent | 8f74757a691d983e8d91f8ba0307c16b9495d112 (diff) | |
| download | usermoji-1fc65c0341b5bb7c75ed696e89e5ae51367b151c.tar.xz | |
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 <chrisforbes@google.com>
Diffstat (limited to 'layers/core_validation.cpp')
| -rw-r--r-- | layers/core_validation.cpp | 26 |
1 files changed, 15 insertions, 11 deletions
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; } |
