diff options
| author | Mark Lobodzinski <mark@lunarg.com> | 2017-02-22 10:55:30 -0700 |
|---|---|---|
| committer | Mark Lobodzinski <mark@lunarg.com> | 2017-02-23 09:54:26 -0700 |
| commit | 6a9e67afaaccfeeef572bda3240b6b900e12f270 (patch) | |
| tree | 93d759888f9b3258c68ce1e3cd96c5e44d93ca34 /layers/buffer_validation.cpp | |
| parent | 70887210f9c26ef6a3be1a208baa708a08c9265e (diff) | |
| download | usermoji-6a9e67afaaccfeeef572bda3240b6b900e12f270.tar.xz | |
layers: GH1489, fix CmdClearAttachments validation
Calling CmdClearAttachments in a secondary command buffer could
result in bad validation errors as existing checks rely upon
RenderPass begin info data that may not yet be present. Good
validation for this case will come in a follow-on patch series.
Change-Id: Ib169e26f506124f0c1ad75f57de3b6b5146df872
Diffstat (limited to 'layers/buffer_validation.cpp')
| -rw-r--r-- | layers/buffer_validation.cpp | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/layers/buffer_validation.cpp b/layers/buffer_validation.cpp index 41bfb9d8..e5fb7983 100644 --- a/layers/buffer_validation.cpp +++ b/layers/buffer_validation.cpp @@ -1392,8 +1392,8 @@ bool PreCallValidateCmdClearAttachments(layer_data *device_data, VkCommandBuffer if (!hasDrawCmd(cb_node) && (cb_node->activeRenderPassBeginInfo.renderArea.extent.width == pRects[0].rect.extent.width) && (cb_node->activeRenderPassBeginInfo.renderArea.extent.height == pRects[0].rect.extent.height)) { // There are times where app needs to use ClearAttachments (generally when reusing a buffer inside of a render pass) - // Can we make this warning more specific? I'd like to avoid triggering this test if we can tell it's a use that must - // call CmdClearAttachments. Otherwise this seems more like a performance warning. + // This warning should be made more specific. It'd be best to avoid triggering this test if it's a use that must call + // CmdClearAttachments. skip |= log_msg(report_data, VK_DEBUG_REPORT_PERFORMANCE_WARNING_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_COMMAND_BUFFER_EXT, reinterpret_cast<uint64_t &>(commandBuffer), 0, DRAWSTATE_CLEAR_CMD_BEFORE_DRAW, "DS", @@ -1470,7 +1470,9 @@ bool PreCallValidateCmdClearAttachments(layer_data *device_data, VkCommandBuffer for (uint32_t j = 0; j < rectCount; j++) { // The rectangular region specified by a given element of pRects must be contained within the render area of // the current render pass instance - if (false == ContainsRect(cb_node->activeRenderPassBeginInfo.renderArea, pRects[j].rect)) { + // TODO: This check should be moved to CmdExecuteCommands or QueueSubmit to cover secondary CB cases + if ((cb_node->createInfo.level == VK_COMMAND_BUFFER_LEVEL_PRIMARY) && + (false == ContainsRect(cb_node->activeRenderPassBeginInfo.renderArea, pRects[j].rect))) { skip |= log_msg(report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT, 0, __LINE__, VALIDATION_ERROR_01115, "DS", "vkCmdClearAttachments(): The area defined by pRects[%d] is not contained in the area of " |
