Skip to content

Commit

Permalink
layers: Remove DrawCmd perf warning from Buf Val
Browse files Browse the repository at this point in the history
resolves #1307 which was tracked in #24

Change-Id: If34c89c4fd40d75803ea2d38539a2050570cf374
  • Loading branch information
camden-lunarg committed Nov 6, 2019
1 parent da0aec1 commit 920de2d
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 13 deletions.
3 changes: 2 additions & 1 deletion layers/best_practices.h
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
12 changes: 0 additions & 12 deletions layers/buffer_validation.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 920de2d

Please sign in to comment.