When loading resolve in vulkan make to we give color attachment read access.

Bug: chromium:1280232
Change-Id: I66c5d36a0dfeac2d2a128eb8cf2798f0c02fbc86
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/484999
Commit-Queue: Greg Daniel <egdaniel@google.com>
Auto-Submit: Greg Daniel <egdaniel@google.com>
Reviewed-by: Jim Van Verth <jvanverth@google.com>
Commit-Queue: Jim Van Verth <jvanverth@google.com>
This commit is contained in:
Greg Daniel 2021-12-15 12:28:43 -05:00 committed by SkCQ
parent dc60ca197e
commit fccec5f0e9

View File

@ -94,10 +94,16 @@ void GrVkOpsRenderPass::setAttachmentLayouts(LoadFromResolve loadFromResolve) {
GrVkImage* resolveAttachment = fFramebuffer->resolveAttachment();
SkASSERT(resolveAttachment);
if (loadFromResolve == LoadFromResolve::kLoad) {
// We need input access to do the shader read and color read access to do the attachment
// load.
VkAccessFlags dstAccess =
VK_ACCESS_INPUT_ATTACHMENT_READ_BIT | VK_ACCESS_COLOR_ATTACHMENT_READ_BIT;
VkPipelineStageFlags dstStages = VK_PIPELINE_STAGE_FRAGMENT_SHADER_BIT |
VK_PIPELINE_STAGE_COLOR_ATTACHMENT_OUTPUT_BIT;
resolveAttachment->setImageLayout(fGpu,
VK_IMAGE_LAYOUT_SHADER_READ_ONLY_OPTIMAL,
VK_ACCESS_INPUT_ATTACHMENT_READ_BIT,
VK_PIPELINE_STAGE_FRAGMENT_SHADER_BIT,
dstAccess,
dstStages,
false);
} else {
resolveAttachment->setImageLayout(