Report input attachment usage capability for surface images
VK_IMAGE_USAGE_INPUT_ATTACHMENT_BIT is widely supported for swapchain
surfaces. It enables fragment shaders to directly read them.
This usage capability is always enabled on Android, which provides a
swapchain surface implementation based on the Android Hardware Buffer
extension, instead of having the ICD provide it. Thus enabling this
capability on other platforms ensures we test the mandatory underlying
support with dEQP-VK.
Bug: b/170414896
Tests: dEQP-VK.image.swapchain_mutable.*
Tests: dEQP-VK.wsi.*
Change-Id: I0b63cfb110dc82bcd1f47e23d51c98d968eb772e
Reviewed-on: https://swiftshader-review.googlesource.com/c/SwiftShader/+/60529
Kokoro-Result: kokoro <noreply+kokoro@google.com>
Tested-by: Nicolas Capens <nicolascapens@google.com>
Reviewed-by: Sean Risser <srisser@google.com>
diff --git a/src/WSI/VkSurfaceKHR.cpp b/src/WSI/VkSurfaceKHR.cpp
index 9d1a91b..e4ad576 100644
--- a/src/WSI/VkSurfaceKHR.cpp
+++ b/src/WSI/VkSurfaceKHR.cpp
@@ -193,6 +193,7 @@
pSurfaceCapabilities->supportedCompositeAlpha = VK_COMPOSITE_ALPHA_OPAQUE_BIT_KHR;
pSurfaceCapabilities->supportedUsageFlags =
VK_IMAGE_USAGE_COLOR_ATTACHMENT_BIT |
+ VK_IMAGE_USAGE_INPUT_ATTACHMENT_BIT |
VK_IMAGE_USAGE_TRANSFER_SRC_BIT |
VK_IMAGE_USAGE_TRANSFER_DST_BIT |
VK_IMAGE_USAGE_SAMPLED_BIT |