layers: LX222, suppress warning on partial CmdClearAttachment calls
Drawstate will warn if this call is made in a renderpass BEFORE making a draw
call. However, this is OK if only a subset of the attachment is being cleared.
diff --git a/layers/draw_state.cpp b/layers/draw_state.cpp
index 2dd1542..4cccdd1 100644
--- a/layers/draw_state.cpp
+++ b/layers/draw_state.cpp
@@ -4242,8 +4242,10 @@
GLOBAL_CB_NODE* pCB = getCBNode(dev_data, commandBuffer);
if (pCB) {
if (pCB->state == CB_UPDATE_ACTIVE) {
- // Warn if this is issued prior to Draw Cmd
- if (!hasDrawCmd(pCB)) {
+ // Warn if this is issued prior to Draw Cmd and clearing the entire attachment
+ if (!hasDrawCmd(pCB) &&
+ (pCB->activeRenderPassBeginInfo.renderArea.extent.width == pRects[0].rect.extent.width) &&
+ (pCB->activeRenderPassBeginInfo.renderArea.extent.height == pRects[0].rect.extent.height)) {
// TODO : commandBuffer should be srcObj
skipCall |= log_msg(dev_data->report_data, VK_DBG_REPORT_WARN_BIT, VK_OBJECT_TYPE_COMMAND_BUFFER, 0, 0, DRAWSTATE_CLEAR_CMD_BEFORE_DRAW, "DS",
"vkCmdClearAttachments() issued on CB object 0x%" PRIxLEAST64 " prior to any Draw Cmds."