Add GrInternalSurfaceFlag for vulkan input attachment.

This also includes all the plumbing of this flag throughout our proxy
and surface system.

Bug: skia:10409
Change-Id: I48d40012049240cfa80e045ea090f68ce2d2ff0d
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/313676
Reviewed-by: Robert Phillips <robertphillips@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Greg Daniel <egdaniel@google.com>
diff --git a/src/gpu/GrContextThreadSafeProxy.cpp b/src/gpu/GrContextThreadSafeProxy.cpp
index 8514ff5..2f1ac1e 100644
--- a/src/gpu/GrContextThreadSafeProxy.cpp
+++ b/src/gpu/GrContextThreadSafeProxy.cpp
@@ -47,7 +47,7 @@
                                      int sampleCnt, GrSurfaceOrigin origin,
                                      const SkSurfaceProps& surfaceProps,
                                      bool isMipMapped, bool willUseGLFBO0, bool isTextureable,
-                                     GrProtected isProtected) {
+                                     GrProtected isProtected, bool vkRTSupportsInputAttachment) {
     SkASSERT(fCaps);
     if (!backendFormat.isValid()) {
         return {};
@@ -60,6 +60,11 @@
         return {};
     }
 
+    if (GrBackendApi::kVulkan != backendFormat.backend() && vkRTSupportsInputAttachment) {
+        // The vkRTSupportsInputAttachment flags can only be used for a Vulkan backend.
+        return {};
+    }
+
     if (!fCaps->mipmapSupport()) {
         isMipMapped = false;
     }
@@ -106,15 +111,17 @@
 #endif
     }
 
-    return SkSurfaceCharacterization(sk_ref_sp<GrContextThreadSafeProxy>(this),
-                                     cacheMaxResourceBytes, ii, backendFormat,
-                                     origin, sampleCnt,
-                                     SkSurfaceCharacterization::Textureable(isTextureable),
-                                     SkSurfaceCharacterization::MipMapped(isMipMapped),
-                                     SkSurfaceCharacterization::UsesGLFBO0(willUseGLFBO0),
-                                     SkSurfaceCharacterization::VulkanSecondaryCBCompatible(false),
-                                     isProtected,
-                                     surfaceProps);
+    return SkSurfaceCharacterization(
+            sk_ref_sp<GrContextThreadSafeProxy>(this),
+            cacheMaxResourceBytes, ii, backendFormat,
+            origin, sampleCnt,
+            SkSurfaceCharacterization::Textureable(isTextureable),
+            SkSurfaceCharacterization::MipMapped(isMipMapped),
+            SkSurfaceCharacterization::UsesGLFBO0(willUseGLFBO0),
+            SkSurfaceCharacterization::VkRTSupportsInputAttachment(vkRTSupportsInputAttachment),
+            SkSurfaceCharacterization::VulkanSecondaryCBCompatible(false),
+            isProtected,
+            surfaceProps);
 }
 
 GrBackendFormat GrContextThreadSafeProxy::defaultBackendFormat(SkColorType skColorType,