From a21d6ab01286d7bbc540811f39ce8d232680771f Mon Sep 17 00:00:00 2001 From: Mark Lobodzinski Date: Tue, 8 Dec 2015 13:47:14 -0700 Subject: 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. --- layers/draw_state.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/layers/draw_state.cpp b/layers/draw_state.cpp index 2dd15424..4cccdd19 100644 --- a/layers/draw_state.cpp +++ b/layers/draw_state.cpp @@ -4242,8 +4242,10 @@ VK_LAYER_EXPORT VKAPI_ATTR void VKAPI_CALL vkCmdClearAttachments( 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." -- cgit v1.2.3