Commit d87927c1 by Charlie Lao Committed by Commit Bot

Vulkan: Initialize stencil ops with DontCare for color attachments

Even though they shouldn't matter for color attachment, but Qualcomm's performance validation layer is producing tons of this warning message. This basically always set to DontCare even for color attachment. Bug: b/158708100 Change-Id: Iaba39e099c9cc4716548f337ded74fa5f29bb654 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2240498 Commit-Queue: Charlie Lao <cclao@google.com> Reviewed-by: 's avatarTim Van Patten <timvp@google.com> Reviewed-by: 's avatarShahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: 's avatarCourtney Goeltzenleuchter <courtneygo@google.com>
parent 1cbdeb86
...@@ -1593,6 +1593,9 @@ angle::Result FramebufferVk::startNewRenderPass(ContextVk *contextVk, ...@@ -1593,6 +1593,9 @@ angle::Result FramebufferVk::startNewRenderPass(ContextVk *contextVk,
packedClearValues.store(currentAttachmentCount, VK_IMAGE_ASPECT_COLOR_BIT, packedClearValues.store(currentAttachmentCount, VK_IMAGE_ASPECT_COLOR_BIT,
kUninitializedClearValue); kUninitializedClearValue);
} }
renderPassAttachmentOps.setStencilOps(currentAttachmentCount,
VK_ATTACHMENT_LOAD_OP_DONT_CARE,
VK_ATTACHMENT_STORE_OP_DONT_CARE);
ANGLE_TRY(colorRenderTarget->onColorDraw(contextVk)); ANGLE_TRY(colorRenderTarget->onColorDraw(contextVk));
...@@ -1646,22 +1649,18 @@ angle::Result FramebufferVk::startNewRenderPass(ContextVk *contextVk, ...@@ -1646,22 +1649,18 @@ angle::Result FramebufferVk::startNewRenderPass(ContextVk *contextVk,
} }
const vk::Format &format = depthStencilRenderTarget->getImageFormat(); const vk::Format &format = depthStencilRenderTarget->getImageFormat();
if (format.hasEmulatedImageChannels()) // If the format we picked has stencil but user did not ask for it due to hardware
// limitations, use DONT_CARE for load/store. The same logic for depth follows.
if (format.intendedFormat().stencilBits == 0)
{ {
// If the format we picked has stencil but user did not ask for it due to hardware stencilLoadOp = VK_ATTACHMENT_LOAD_OP_DONT_CARE;
// limitations, use DONT_CARE for load/store. The same logic for depth follows. stencilStoreOp = VK_ATTACHMENT_STORE_OP_DONT_CARE;
if (format.intendedFormat().stencilBits == 0) }
{ if (format.intendedFormat().depthBits == 0)
stencilLoadOp = VK_ATTACHMENT_LOAD_OP_DONT_CARE; {
stencilStoreOp = VK_ATTACHMENT_STORE_OP_DONT_CARE; depthLoadOp = VK_ATTACHMENT_LOAD_OP_DONT_CARE;
} depthStoreOp = VK_ATTACHMENT_STORE_OP_DONT_CARE;
if (format.intendedFormat().depthBits == 0)
{
depthLoadOp = VK_ATTACHMENT_LOAD_OP_DONT_CARE;
depthStoreOp = VK_ATTACHMENT_STORE_OP_DONT_CARE;
}
} }
renderPassAttachmentOps.setOps(currentAttachmentCount, depthLoadOp, depthStoreOp); renderPassAttachmentOps.setOps(currentAttachmentCount, depthLoadOp, depthStoreOp);
renderPassAttachmentOps.setStencilOps(currentAttachmentCount, stencilLoadOp, renderPassAttachmentOps.setStencilOps(currentAttachmentCount, stencilLoadOp,
stencilStoreOp); stencilStoreOp);
......
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