Subject: add check for shaderStorageImageMultisample feature
Bug: https://github.com/KhronosGroup/OpenXR-SDK-Source/issues/233
From: Artyom Dangizyan <artyom.dangizyan@gmail.com>
Applied-Upstream: 1.0.15, https://github.com/KhronosGroup/OpenXR-SDK-Source/commit/8240032a77e10286739221962a3ba58cdd2caaa7

Date: Sun, 13 Dec 2020 00:28:12 +0400


---
 src/tests/hello_xr/graphicsplugin_vulkan.cpp | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/src/tests/hello_xr/graphicsplugin_vulkan.cpp b/src/tests/hello_xr/graphicsplugin_vulkan.cpp
index 6299935..f12e155 100644
--- a/src/tests/hello_xr/graphicsplugin_vulkan.cpp
+++ b/src/tests/hello_xr/graphicsplugin_vulkan.cpp
@@ -1850,8 +1850,12 @@ struct VulkanGraphicsPluginLegacy : public VulkanGraphicsPlugin {
             memcpy(&features, createInfo->vulkanCreateInfo->pEnabledFeatures, sizeof(features));
 
 #if !defined(XR_USE_PLATFORM_ANDROID)
-            // Setting this quiets down a validation error triggered by the Oculus runtime
-            features.shaderStorageImageMultisample = VK_TRUE;
+            VkPhysicalDeviceFeatures availableFeatures{};
+            vkGetPhysicalDeviceFeatures(m_vkPhysicalDevice, &availableFeatures);
+            if (availableFeatures.shaderStorageImageMultisample == VK_TRUE) {
+                // Setting this quiets down a validation error triggered by the Oculus runtime
+                features.shaderStorageImageMultisample = VK_TRUE;
+            }
 #endif
 
             VkDeviceCreateInfo deviceInfo{VK_STRUCTURE_TYPE_DEVICE_CREATE_INFO};
