Fixes #2587
The lambda function was only capturing the pRect pointer by value so
the underlying rect value could still be changed between when the
command was submitted to a secondary CB and when the rect was validated
at CmdExecuteCommands() time.
Copy the actual rect value so that it can't change.
j);
}
} else {
+ const auto local_rect =
+ pRects[j].rect; // local copy of rect captured by value below to preserve original contents
cb_node->cmd_execute_commands_functions.emplace_back([=](GLOBAL_CB_NODE *prim_cb, VkFramebuffer fb) {
- if (false == ContainsRect(prim_cb->activeRenderPassBeginInfo.renderArea, pRects[j].rect)) {
+ if (false == ContainsRect(prim_cb->activeRenderPassBeginInfo.renderArea, local_rect)) {
return log_msg(
report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_COMMAND_BUFFER_EXT,
HandleToUint64(commandBuffer), VALIDATION_ERROR_18600020,