aboutsummaryrefslogtreecommitdiff
path: root/layers/buffer_validation.cpp
diff options
context:
space:
mode:
authorTobin Ehlis <tobine@google.com>2018-04-17 16:14:26 -0600
committerTobin Ehlis <tobine@google.com>2018-04-18 06:25:15 -0600
commit5251b1bd5d9002c4e289a93e0e24ce83dd45a383 (patch)
tree9363e14e085b5076021d2e1c5faf051aec39129e /layers/buffer_validation.cpp
parent7ea6c8637ba179b6f34f2e513dcf5d38d52b4f4e (diff)
downloadusermoji-5251b1bd5d9002c4e289a93e0e24ce83dd45a383.tar.xz
layers:Capture rect by value to validate 2nd cb
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.
Diffstat (limited to 'layers/buffer_validation.cpp')
-rw-r--r--layers/buffer_validation.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/layers/buffer_validation.cpp b/layers/buffer_validation.cpp
index 7be395e8..99b3fa06 100644
--- a/layers/buffer_validation.cpp
+++ b/layers/buffer_validation.cpp
@@ -2198,8 +2198,10 @@ bool PreCallValidateCmdClearAttachments(layer_data *device_data, VkCommandBuffer
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,