The open source OpenXR runtime
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

st/oxr: Add support for MND_swapchain_usage_input_attachment_bit

authored by

Jakob Bornecrantz and committed by
Jakob Bornecrantz
fb9ebe8b 40db8d3b

+46 -4
+1
doc/changes/state_trackers/mr.459.md
··· 1 + OpenXR: Implement the MND_swapchain_usage_input_attachment_bit extension.
+1
scripts/generate_oxr_ext_support.py
··· 16 16 ['XR_KHR_vulkan_enable', 'XR_USE_GRAPHICS_API_VULKAN'], 17 17 ['XR_EXT_debug_utils'], 18 18 ['XR_MND_headless'], 19 + ['XR_MND_swapchain_usage_input_attachment_bit'], 19 20 ['XR_EXTX_overlay'], 20 21 ['XR_MNDX_egl_enable', 'XR_USE_PLATFORM_EGL', 'XR_USE_GRAPHICS_API_OPENGL'], 21 22 ['XR_MNDX_ball_on_a_stick_controller'],
+27 -4
src/xrt/state_trackers/oxr/oxr_api_swapchain.c
··· 7 7 * @ingroup oxr_api 8 8 */ 9 9 10 - #include <stdio.h> 11 - #include <stdlib.h> 12 - #include <string.h> 13 - 14 10 #include "xrt/xrt_compiler.h" 15 11 16 12 #include "util/u_debug.h" ··· 21 17 22 18 #include "oxr_api_funcs.h" 23 19 #include "oxr_api_verify.h" 20 + 21 + #include <stdio.h> 22 + #include <stdlib.h> 23 + #include <string.h> 24 + #include <inttypes.h> 24 25 25 26 26 27 XrResult ··· 61 62 OXR_VERIFY_ARG_NOT_ZERO(&log, createInfo->arraySize); 62 63 OXR_VERIFY_ARG_NOT_ZERO(&log, createInfo->width); 63 64 OXR_VERIFY_ARG_NOT_ZERO(&log, createInfo->height); 65 + 66 + // Short hand. 67 + struct oxr_instance *inst = sess->sys->inst; 68 + 69 + XrSwapchainUsageFlags flags = 0; 70 + flags |= XR_SWAPCHAIN_USAGE_COLOR_ATTACHMENT_BIT; 71 + flags |= XR_SWAPCHAIN_USAGE_DEPTH_STENCIL_ATTACHMENT_BIT; 72 + flags |= XR_SWAPCHAIN_USAGE_UNORDERED_ACCESS_BIT; 73 + flags |= XR_SWAPCHAIN_USAGE_TRANSFER_SRC_BIT; 74 + flags |= XR_SWAPCHAIN_USAGE_TRANSFER_DST_BIT; 75 + flags |= XR_SWAPCHAIN_USAGE_SAMPLED_BIT; 76 + flags |= XR_SWAPCHAIN_USAGE_MUTABLE_FORMAT_BIT; 77 + if (inst->extensions.MND_swapchain_usage_input_attachment_bit) { 78 + flags |= XR_SWAPCHAIN_USAGE_INPUT_ATTACHMENT_BIT_MND; 79 + } 80 + 81 + if ((createInfo->usageFlags & ~flags) != 0) { 82 + return oxr_error(&log, XR_ERROR_VALIDATION_FAILURE, 83 + "(createInfo->usageFlags == 0x08%" PRIx64 84 + ") contains invalid flags", 85 + createInfo->usageFlags); 86 + } 64 87 65 88 ret = sess->create_swapchain(&log, sess, createInfo, &sc); 66 89 if (ret != XR_SUCCESS) {
+14
src/xrt/state_trackers/oxr/oxr_extension_support.h
··· 90 90 91 91 92 92 /* 93 + * XR_MND_swapchain_usage_input_attachment_bit 94 + */ 95 + #if defined(XR_MND_swapchain_usage_input_attachment_bit) 96 + #define OXR_HAVE_MND_swapchain_usage_input_attachment_bit 97 + #define OXR_EXTENSION_SUPPORT_MND_swapchain_usage_input_attachment_bit(_) \ 98 + _(MND_swapchain_usage_input_attachment_bit, \ 99 + MND_SWAPCHAIN_USAGE_INPUT_ATTACHMENT_BIT) 100 + #else 101 + #define OXR_EXTENSION_SUPPORT_MND_swapchain_usage_input_attachment_bit(_) 102 + #endif 103 + 104 + 105 + /* 93 106 * XR_EXTX_overlay 94 107 */ 95 108 #if defined(XR_EXTX_overlay) ··· 154 167 OXR_EXTENSION_SUPPORT_KHR_vulkan_enable(_) \ 155 168 OXR_EXTENSION_SUPPORT_EXT_debug_utils(_) \ 156 169 OXR_EXTENSION_SUPPORT_MND_headless(_) \ 170 + OXR_EXTENSION_SUPPORT_MND_swapchain_usage_input_attachment_bit(_) \ 157 171 OXR_EXTENSION_SUPPORT_EXTX_overlay(_) \ 158 172 OXR_EXTENSION_SUPPORT_MNDX_egl_enable(_) \ 159 173 OXR_EXTENSION_SUPPORT_MNDX_ball_on_a_stick_controller(_)
+3
src/xrt/state_trackers/oxr/oxr_swapchain.c
··· 192 192 if ((xr_usage & XR_SWAPCHAIN_USAGE_MUTABLE_FORMAT_BIT) != 0) { 193 193 usage |= XRT_SWAPCHAIN_USAGE_MUTABLE_FORMAT; 194 194 } 195 + if ((xr_usage & XR_SWAPCHAIN_USAGE_INPUT_ATTACHMENT_BIT_MND) != 0) { 196 + usage |= XRT_SWAPCHAIN_USAGE_INPUT_ATTACHMENT; 197 + } 195 198 196 199 return usage; 197 200 }