aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMark Lobodzinski <mark@lunarg.com>2015-12-08 13:47:14 -0700
committerMark Lobodzinski <mark@lunarg.com>2015-12-08 16:32:57 -0700
commita21d6ab01286d7bbc540811f39ce8d232680771f (patch)
tree704351cfd5ce8924361a8038341cca7f40db9728
parent1497b2a9fd0888fbfc64d779afae2884371414df (diff)
downloadusermoji-a21d6ab01286d7bbc540811f39ce8d232680771f.tar.xz
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.
-rw-r--r--layers/draw_state.cpp6
1 files 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."