aboutsummaryrefslogtreecommitdiff
path: root/layers/core_validation.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'layers/core_validation.cpp')
-rw-r--r--layers/core_validation.cpp13
1 files changed, 3 insertions, 10 deletions
diff --git a/layers/core_validation.cpp b/layers/core_validation.cpp
index 8b5e9f63..b25eea89 100644
--- a/layers/core_validation.cpp
+++ b/layers/core_validation.cpp
@@ -8102,18 +8102,11 @@ VKAPI_ATTR void VKAPI_CALL CmdClearAttachments(VkCommandBuffer commandBuffer, ui
for (uint32_t attachment_idx = 0; attachment_idx < attachmentCount; attachment_idx++) {
const VkClearAttachment *attachment = &pAttachments[attachment_idx];
if (attachment->aspectMask & VK_IMAGE_ASPECT_COLOR_BIT) {
- bool found = false;
- for (uint32_t i = 0; i < pSD->colorAttachmentCount; i++) {
- if (attachment->colorAttachment == pSD->pColorAttachments[i].attachment) {
- found = true;
- break;
- }
- }
- if (!found) {
+ if (attachment->colorAttachment >= pSD->colorAttachmentCount) {
skip_call |= log_msg(
- dev_data->report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_COMMAND_BUFFER_EXT,
+ dev_data->report_data, VK_DEBUG_REPORT_WARNING_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_COMMAND_BUFFER_EXT,
(uint64_t)commandBuffer, __LINE__, DRAWSTATE_MISSING_ATTACHMENT_REFERENCE, "DS",
- "vkCmdClearAttachments() attachment index %d not found in attachment reference array of active subpass %d",
+ "vkCmdClearAttachments() color attachment index %d out of range for active subpass %d; ignored",
attachment->colorAttachment, pCB->activeSubpass);
}
} else if (attachment->aspectMask & (VK_IMAGE_ASPECT_DEPTH_BIT | VK_IMAGE_ASPECT_STENCIL_BIT)) {