···253253 */
254254255255/*!
256256+ * Check if the compositor can create swapchains with this format.
257257+ */
258258+bool
259259+comp_is_format_supported(struct comp_compositor *c, VkFormat format);
260260+261261+/*!
256262 * Convenience function to convert a xrt_swapchain to a comp_swapchain.
257263 *
258264 * @private @memberof comp_swapchain
+11
src/xrt/compositor/main/comp_swapchain.c
···285285 uint32_t num_images = 3;
286286 VkResult ret;
287287288288+ if (!comp_is_format_supported(c, info->format)) {
289289+ return XRT_ERROR_SWAPCHAIN_FORMAT_UNSUPPORTED;
290290+ }
291291+288292 if ((info->create & XRT_SWAPCHAIN_CREATE_PROTECTED_CONTENT) != 0) {
289293 // This compositor doesn't support creating protected content
290294 // swapchains.
···301305302306 // Use the image helper to allocate the images.
303307 ret = vk_ic_allocate(&c->vk, info, num_images, &sc->vkic);
308308+ if (ret == VK_ERROR_FEATURE_NOT_PRESENT) {
309309+ free(sc);
310310+ return XRT_ERROR_SWAPCHAIN_FLAG_VALID_BUT_UNSUPPORTED;
311311+ } else if (ret == VK_ERROR_FORMAT_NOT_SUPPORTED) {
312312+ free(sc);
313313+ return XRT_ERROR_SWAPCHAIN_FORMAT_UNSUPPORTED;
314314+ }
304315 if (ret != VK_SUCCESS) {
305316 free(sc);
306317 return XRT_ERROR_VULKAN;