From 24de6f9edfafdfd92ac0a4f1b94fcd1781389205 Mon Sep 17 00:00:00 2001 From: Fernando Velazquez Innella Date: Mon, 11 Mar 2024 16:50:30 -0400 Subject: [PATCH] c/util: Expand on swapchain import error codes This allows the CTS in Direct3D12 to not fail when attempting to import sRGB swapchains with flags such as XR_SWAPCHAIN_USAGE_UNORDERED_ACCESS_BIT --- src/xrt/compositor/util/comp_swapchain.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/xrt/compositor/util/comp_swapchain.c b/src/xrt/compositor/util/comp_swapchain.c index 38abe77bb..c6f4ae999 100644 --- a/src/xrt/compositor/util/comp_swapchain.c +++ b/src/xrt/compositor/util/comp_swapchain.c @@ -571,6 +571,12 @@ comp_swapchain_import_init(struct comp_swapchain *sc, // Use the image helper to get the images. ret = vk_ic_from_natives(vk, info, native_images, native_image_count, &sc->vkic); + if (ret == VK_ERROR_FEATURE_NOT_PRESENT) { + return XRT_ERROR_SWAPCHAIN_FLAG_VALID_BUT_UNSUPPORTED; + } + if (ret == VK_ERROR_FORMAT_NOT_SUPPORTED) { + return XRT_ERROR_SWAPCHAIN_FORMAT_UNSUPPORTED; + } if (ret != VK_SUCCESS) { return XRT_ERROR_VULKAN; }