diff options
| author | Chris Forbes <chrisforbes@google.com> | 2016-09-08 15:25:24 +1200 |
|---|---|---|
| committer | Chris Forbes <chrisforbes@google.com> | 2016-09-09 14:55:31 +1200 |
| commit | d777c6edeab70b31ca0359cdf76adbaa31af3866 (patch) | |
| tree | 471613111b8816dfeea02e35ece5b9cd3c051854 /layers/core_validation.cpp | |
| parent | 92ac2d806b24a578899af8b9e24932a1aeffc7b6 (diff) | |
| download | usermoji-d777c6edeab70b31ca0359cdf76adbaa31af3866.tar.xz | |
layers: CmdClearAttachments colorAttachment is index into subpass
We were previously treating this as being an index into the renderpass
attachment descriptions, but that's nonsense. It's also well-defined
what happens if an out-of-range index is provided, so downgrade to a
warning.
Signed-off-by: Chris Forbes <chrisforbes@google.com>
Diffstat (limited to 'layers/core_validation.cpp')
| -rw-r--r-- | layers/core_validation.cpp | 13 |
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)) { |
