From 544395a5d9da52fdaa59ad9c98f32f731b64b6b2 Mon Sep 17 00:00:00 2001
From: Michael Ludwig <michaelludwig@google.com>
Date: Thu, 21 May 2026 11:57:33 -0400
Subject: [PATCH] [ganesh] Use & when testing for input attachment self-dep

Other than these two sites, kForInputAttachment and
kForNonCoherentAdvBlend are not treated as mutually exclusive.

When using only == kForInputAttachment, the layout and bindings wouldn't
apply correctly for a renderpass that was using both forms of self
dependencies.

Bug: https://issues.chromium.org/issues/512995705
Fixed: 512995705
Change-Id: I40aff60a9209be77e6743d7a2f73dac46985507a
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/1242516
Commit-Queue: Michael Ludwig <michaelludwig@google.com>
Reviewed-by: Nicolette Prevost <nicolettep@google.com>
---
 src/gpu/ganesh/vk/GrVkOpsRenderPass.cpp | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/gpu/ganesh/vk/GrVkOpsRenderPass.cpp b/src/gpu/ganesh/vk/GrVkOpsRenderPass.cpp
index 5f9fddd296..3ff4a7c809 100644
--- a/src/gpu/ganesh/vk/GrVkOpsRenderPass.cpp
+++ b/src/gpu/ganesh/vk/GrVkOpsRenderPass.cpp
@@ -89,7 +89,7 @@ void GrVkOpsRenderPass::setAttachmentLayouts(LoadFromResolve loadFromResolve) {
     bool withStencil = fCurrentRenderPass->hasStencilAttachment();
     bool withResolve = fCurrentRenderPass->hasResolveAttachment();
 
-    if (fSelfDependencyFlags == SelfDependencyFlags::kForInputAttachment) {
+    if (fSelfDependencyFlags & SelfDependencyFlags::kForInputAttachment) {
         // We need to use the GENERAL layout in this case since we'll be using texture barriers
         // with an input attachment.
         VkAccessFlags dstAccess = VK_ACCESS_INPUT_ATTACHMENT_READ_BIT |
@@ -738,7 +738,7 @@ bool GrVkOpsRenderPass::onBindTextures(const GrGeometryProcessor& geomProc,
                                                    this->currentCommandBuffer())) {
         return false;
     }
-    if (fSelfDependencyFlags == SelfDependencyFlags::kForInputAttachment) {
+    if (fSelfDependencyFlags & SelfDependencyFlags::kForInputAttachment) {
         // We bind the color attachment as an input attachment
         auto ds = fFramebuffer->colorAttachment()->inputDescSetForBlending(fGpu);
         if (!ds) {
-- 
2.43.0

