mirror of
https://gitlab.freedesktop.org/monado/monado.git
synced 2024-12-28 02:26:16 +00:00
st/oxr: Add support for MND_swapchain_usage_input_attachment_bit
This commit is contained in:
parent
40db8d3b55
commit
fb9ebe8b88
1
doc/changes/state_trackers/mr.459.md
Normal file
1
doc/changes/state_trackers/mr.459.md
Normal file
|
@ -0,0 +1 @@
|
|||
OpenXR: Implement the MND_swapchain_usage_input_attachment_bit extension.
|
|
@ -16,6 +16,7 @@ EXTENSIONS = (
|
|||
['XR_KHR_vulkan_enable', 'XR_USE_GRAPHICS_API_VULKAN'],
|
||||
['XR_EXT_debug_utils'],
|
||||
['XR_MND_headless'],
|
||||
['XR_MND_swapchain_usage_input_attachment_bit'],
|
||||
['XR_EXTX_overlay'],
|
||||
['XR_MNDX_egl_enable', 'XR_USE_PLATFORM_EGL', 'XR_USE_GRAPHICS_API_OPENGL'],
|
||||
['XR_MNDX_ball_on_a_stick_controller'],
|
||||
|
|
|
@ -7,10 +7,6 @@
|
|||
* @ingroup oxr_api
|
||||
*/
|
||||
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
|
||||
#include "xrt/xrt_compiler.h"
|
||||
|
||||
#include "util/u_debug.h"
|
||||
|
@ -22,6 +18,11 @@
|
|||
#include "oxr_api_funcs.h"
|
||||
#include "oxr_api_verify.h"
|
||||
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <inttypes.h>
|
||||
|
||||
|
||||
XrResult
|
||||
oxr_xrEnumerateSwapchainFormats(XrSession session,
|
||||
|
@ -62,6 +63,28 @@ oxr_xrCreateSwapchain(XrSession session,
|
|||
OXR_VERIFY_ARG_NOT_ZERO(&log, createInfo->width);
|
||||
OXR_VERIFY_ARG_NOT_ZERO(&log, createInfo->height);
|
||||
|
||||
// Short hand.
|
||||
struct oxr_instance *inst = sess->sys->inst;
|
||||
|
||||
XrSwapchainUsageFlags flags = 0;
|
||||
flags |= XR_SWAPCHAIN_USAGE_COLOR_ATTACHMENT_BIT;
|
||||
flags |= XR_SWAPCHAIN_USAGE_DEPTH_STENCIL_ATTACHMENT_BIT;
|
||||
flags |= XR_SWAPCHAIN_USAGE_UNORDERED_ACCESS_BIT;
|
||||
flags |= XR_SWAPCHAIN_USAGE_TRANSFER_SRC_BIT;
|
||||
flags |= XR_SWAPCHAIN_USAGE_TRANSFER_DST_BIT;
|
||||
flags |= XR_SWAPCHAIN_USAGE_SAMPLED_BIT;
|
||||
flags |= XR_SWAPCHAIN_USAGE_MUTABLE_FORMAT_BIT;
|
||||
if (inst->extensions.MND_swapchain_usage_input_attachment_bit) {
|
||||
flags |= XR_SWAPCHAIN_USAGE_INPUT_ATTACHMENT_BIT_MND;
|
||||
}
|
||||
|
||||
if ((createInfo->usageFlags & ~flags) != 0) {
|
||||
return oxr_error(&log, XR_ERROR_VALIDATION_FAILURE,
|
||||
"(createInfo->usageFlags == 0x08%" PRIx64
|
||||
") contains invalid flags",
|
||||
createInfo->usageFlags);
|
||||
}
|
||||
|
||||
ret = sess->create_swapchain(&log, sess, createInfo, &sc);
|
||||
if (ret != XR_SUCCESS) {
|
||||
return ret;
|
||||
|
|
|
@ -89,6 +89,19 @@
|
|||
#endif
|
||||
|
||||
|
||||
/*
|
||||
* XR_MND_swapchain_usage_input_attachment_bit
|
||||
*/
|
||||
#if defined(XR_MND_swapchain_usage_input_attachment_bit)
|
||||
#define OXR_HAVE_MND_swapchain_usage_input_attachment_bit
|
||||
#define OXR_EXTENSION_SUPPORT_MND_swapchain_usage_input_attachment_bit(_) \
|
||||
_(MND_swapchain_usage_input_attachment_bit, \
|
||||
MND_SWAPCHAIN_USAGE_INPUT_ATTACHMENT_BIT)
|
||||
#else
|
||||
#define OXR_EXTENSION_SUPPORT_MND_swapchain_usage_input_attachment_bit(_)
|
||||
#endif
|
||||
|
||||
|
||||
/*
|
||||
* XR_EXTX_overlay
|
||||
*/
|
||||
|
@ -154,6 +167,7 @@
|
|||
OXR_EXTENSION_SUPPORT_KHR_vulkan_enable(_) \
|
||||
OXR_EXTENSION_SUPPORT_EXT_debug_utils(_) \
|
||||
OXR_EXTENSION_SUPPORT_MND_headless(_) \
|
||||
OXR_EXTENSION_SUPPORT_MND_swapchain_usage_input_attachment_bit(_) \
|
||||
OXR_EXTENSION_SUPPORT_EXTX_overlay(_) \
|
||||
OXR_EXTENSION_SUPPORT_MNDX_egl_enable(_) \
|
||||
OXR_EXTENSION_SUPPORT_MNDX_ball_on_a_stick_controller(_)
|
||||
|
|
|
@ -192,6 +192,9 @@ convert_usage_bits(XrSwapchainUsageFlags xr_usage)
|
|||
if ((xr_usage & XR_SWAPCHAIN_USAGE_MUTABLE_FORMAT_BIT) != 0) {
|
||||
usage |= XRT_SWAPCHAIN_USAGE_MUTABLE_FORMAT;
|
||||
}
|
||||
if ((xr_usage & XR_SWAPCHAIN_USAGE_INPUT_ATTACHMENT_BIT_MND) != 0) {
|
||||
usage |= XRT_SWAPCHAIN_USAGE_INPUT_ATTACHMENT;
|
||||
}
|
||||
|
||||
return usage;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue