Commit 503d196f by Chris Forbes

Allow depth/stencil attachment to be VK_ATTACHMENT_UNUSED in clear

Test: dEQP-VK.renderpass.suballocation.unused_clear_attachments.*depth* Bug: b/144280552 Change-Id: I37072270105caf206ed3ab6cb2895d32ef22f653 Reviewed-on: https://swiftshader-review.googlesource.com/c/SwiftShader/+/38108Tested-by: 's avatarChris Forbes <chrisforbes@google.com> Presubmit-Ready: Chris Forbes <chrisforbes@google.com> Reviewed-by: 's avatarNicolas Capens <nicolascapens@google.com> Kokoro-Presubmit: kokoro <noreply+kokoro@google.com>
parent 3c4707d6
...@@ -96,17 +96,22 @@ void Framebuffer::clearAttachment(const RenderPass* renderPass, uint32_t subpass ...@@ -96,17 +96,22 @@ void Framebuffer::clearAttachment(const RenderPass* renderPass, uint32_t subpass
} }
else if (attachment.aspectMask & (VK_IMAGE_ASPECT_DEPTH_BIT | VK_IMAGE_ASPECT_STENCIL_BIT)) else if (attachment.aspectMask & (VK_IMAGE_ASPECT_DEPTH_BIT | VK_IMAGE_ASPECT_STENCIL_BIT))
{ {
ASSERT(subpass.pDepthStencilAttachment->attachment < attachmentCount); uint32_t attachmentIndex = subpass.pDepthStencilAttachment->attachment;
ImageView *imageView = attachments[subpass.pDepthStencilAttachment->attachment];
if (renderPass->isMultiView()) if (attachmentIndex != VK_ATTACHMENT_UNUSED)
{
imageView->clearWithLayerMask(attachment.clearValue, attachment.aspectMask, rect.rect,
renderPass->getViewMask(subpassIndex));
}
else
{ {
imageView->clear(attachment.clearValue, attachment.aspectMask, rect); ASSERT(attachmentIndex < attachmentCount);
ImageView *imageView = attachments[attachmentIndex];
if (renderPass->isMultiView())
{
imageView->clearWithLayerMask(attachment.clearValue, attachment.aspectMask, rect.rect,
renderPass->getViewMask(subpassIndex));
}
else
{
imageView->clear(attachment.clearValue, attachment.aspectMask, rect);
}
} }
} }
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment