diff options
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 " |
