From 00e4c054c2db54f3976689cad0588e5d15f06ac1 Mon Sep 17 00:00:00 2001 From: Tobin Ehlis Date: Mon, 12 Mar 2018 11:26:39 -0600 Subject: layers:Check secondary command buffer renderArea Fixes #2480 Fixes #1501 Add delayed function call to verify secondary command buffer renderArea against vkCmdClearAttachments() rects at vkCmdExecuteCommands() time. Updated the lambda function container for delayed secondary command buffer checks to include a reference to the primary command buffer. Add lambda call at vkCmdClearAttachments() for secondary command buffer and pass in primary command buffer reference so that area restriction can be appropriately checked at vkCmdExecuteCommands() time when renderArea of renderPass is known. --- layers/core_validation.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'layers/core_validation.cpp') diff --git a/layers/core_validation.cpp b/layers/core_validation.cpp index 4ecb82ee..e0c4789b 100644 --- a/layers/core_validation.cpp +++ b/layers/core_validation.cpp @@ -7374,7 +7374,7 @@ static bool ValidateRenderPassImageBarriers(layer_data *device_data, const char if (VK_NULL_HANDLE == cb_state->activeFramebuffer) { assert(VK_COMMAND_BUFFER_LEVEL_SECONDARY == cb_state->createInfo.level); // Secondary CB case w/o FB specified delay validation - cb_state->cmd_execute_commands_functions.emplace_back([=](VkFramebuffer fb) { + cb_state->cmd_execute_commands_functions.emplace_back([=](GLOBAL_CB_NODE *primary_cb, VkFramebuffer fb) { return ValidateImageBarrierImage(device_data, funcName, cb_state, fb, active_subpass, sub_desc, rp_handle, i, img_barrier); }); @@ -9437,10 +9437,10 @@ VKAPI_ATTR void VKAPI_CALL CmdExecuteCommands(VkCommandBuffer commandBuffer, uin // If framebuffer for secondary CB is not NULL, then it must match active FB from primaryCB skip |= validateFramebuffer(dev_data, commandBuffer, pCB, pCommandBuffers[i], pSubCB, "vkCmdExecuteCommands()"); - if (VK_NULL_HANDLE == pSubCB->activeFramebuffer) { + if (!pSubCB->cmd_execute_commands_functions.empty()) { // Inherit primary's activeFramebuffer and while running validate functions for (auto &function : pSubCB->cmd_execute_commands_functions) { - skip |= function(pCB->activeFramebuffer); + skip |= function(pCB, pCB->activeFramebuffer); } } } -- cgit v1.2.3