From 9ae720b9d45ddb04c574eaaddb1a1ab354f2a15f Mon Sep 17 00:00:00 2001 From: Jakob Bornecrantz Date: Wed, 29 Jul 2020 14:44:15 +0100 Subject: [PATCH] xrt: Add all remaining swapchain creation flags --- src/xrt/include/xrt/xrt_compositor.h | 3 +++ src/xrt/state_trackers/oxr/oxr_swapchain.c | 4 ++++ 2 files changed, 7 insertions(+) diff --git a/src/xrt/include/xrt/xrt_compositor.h b/src/xrt/include/xrt/xrt_compositor.h index df768155c..eda7a79c2 100644 --- a/src/xrt/include/xrt/xrt_compositor.h +++ b/src/xrt/include/xrt/xrt_compositor.h @@ -55,6 +55,9 @@ typedef uint64_t VkDeviceMemory; */ enum xrt_swapchain_create_flags { + //! Our compositor just ignores this bit. + XRT_SWAPCHAIN_CREATE_PROTECTED_CONTENT = (1 << 0), + //! Signals that the allocator should only allocate one image. XRT_SWAPCHAIN_CREATE_STATIC_IMAGE = (1 << 1), }; diff --git a/src/xrt/state_trackers/oxr/oxr_swapchain.c b/src/xrt/state_trackers/oxr/oxr_swapchain.c index 0ea172d27..a4ebab0ad 100644 --- a/src/xrt/state_trackers/oxr/oxr_swapchain.c +++ b/src/xrt/state_trackers/oxr/oxr_swapchain.c @@ -155,6 +155,10 @@ static enum xrt_swapchain_create_flags convert_create_flags(XrSwapchainCreateFlags xr_flags) { enum xrt_swapchain_create_flags flags = 0; + + if ((xr_flags & XR_SWAPCHAIN_CREATE_PROTECTED_CONTENT_BIT) != 0) { + flags |= XRT_SWAPCHAIN_CREATE_PROTECTED_CONTENT; + } if ((xr_flags & XR_SWAPCHAIN_CREATE_STATIC_IMAGE_BIT) != 0) { flags |= XRT_SWAPCHAIN_CREATE_STATIC_IMAGE; }