layers:Minor refactor for clarity
authorTobin Ehlis <tobine@google.com>
Fri, 21 Jul 2017 19:45:31 +0000 (13:45 -0600)
committerTobin Ehlis <tobine@google.com>
Mon, 24 Jul 2017 21:28:18 +0000 (15:28 -0600)
Add comment and move VkSubpassDescription local variable assignment to
clarify what's going on.

layers/core_validation.cpp

index 7e1fdda..6a66a5f 100644 (file)
@@ -6174,8 +6174,9 @@ static bool ValidateRenderPassPipelineBarriers(layer_data *device_data, const ch
                         funcName, active_subpass, rp_handle, validation_error_map[VALIDATION_ERROR_1b800928]);
     } else {
         assert(rp_state->subpass_to_dependency_index[cb_state->activeSubpass] != -1);
-        const auto &sub_dep = rp_state->createInfo.pDependencies[rp_state->subpass_to_dependency_index[active_subpass]];
+        // Grab ref to current subpassDescription up-front for use below
         const auto &sub_desc = rp_state->createInfo.pSubpasses[active_subpass];
+        const auto &sub_dep = rp_state->createInfo.pDependencies[rp_state->subpass_to_dependency_index[active_subpass]];
         const auto &sub_src_stage_mask = ExpandPipelineStageFlags(sub_dep.srcStageMask);
         const auto &sub_dst_stage_mask = ExpandPipelineStageFlags(sub_dep.dstStageMask);
         if ((sub_src_stage_mask != VK_PIPELINE_STAGE_ALL_COMMANDS_BIT) &&