}
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;
}