diff --git a/layers/best_practices.h b/layers/best_practices.h index 35b7d7f29ec..0941091f628 100644 --- a/layers/best_practices.h +++ b/layers/best_practices.h @@ -121,7 +121,8 @@ class BestPractices : public ValidationStateTracker { void PostCallRecordQueueBindSparse(VkQueue queue, uint32_t bindInfoCount, const VkBindSparseInfo* pBindInfo, VkFence fence, VkResult result); bool PreCallValidateCmdClearAttachments(VkCommandBuffer commandBuffer, uint32_t attachmentCount, - const VkClearAttachment* pAttachments, uint32_t rectCount, const VkClearRect* pRects); + const VkClearAttachment* pAttachments, uint32_t rectCount, + const VkClearRect* pRects) const; private: uint32_t instance_api_version; diff --git a/layers/buffer_validation.cpp b/layers/buffer_validation.cpp index cfc486fb59e..e763811bff1 100644 --- a/layers/buffer_validation.cpp +++ b/layers/buffer_validation.cpp @@ -2853,18 +2853,6 @@ bool CoreChecks::PreCallValidateCmdClearAttachments(VkCommandBuffer commandBuffe skip |= ValidateCmdQueueFlags(cb_node, "vkCmdClearAttachments()", VK_QUEUE_GRAPHICS_BIT, "VUID-vkCmdClearAttachments-commandBuffer-cmdpool"); skip |= ValidateCmd(cb_node, CMD_CLEARATTACHMENTS, "vkCmdClearAttachments()"); - // Warn if this is issued prior to Draw Cmd and clearing the entire attachment - if (!cb_node->hasDrawCmd && (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) - // 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, - HandleToUint64(commandBuffer), kVUID_Core_DrawState_ClearCmdBeforeDraw, - "vkCmdClearAttachments() issued on %s prior to any Draw Cmds. It is recommended you " - "use RenderPass LOAD_OP_CLEAR on Attachments prior to any Draw.", - report_data->FormatHandle(commandBuffer).c_str()); - } skip |= OutsideRenderPass(cb_node, "vkCmdClearAttachments()", "VUID-vkCmdClearAttachments-renderpass"); // Validate that attachment is in reference list of active subpass