C Specification

XrSwapchainUsageFlags specify the intended usage of the swapchain images. When images are created, the runtime needs to know how the images are used in a way that requires more information than simply the image format. The XrSwapchainCreateInfo passed to xrCreateSwapchain should match the intended usage or else undefined behavior may result when the application works with the images.

Flags include:

// Flag bits for XrSwapchainUsageFlags
static const XrSwapchainUsageFlags XR_SWAPCHAIN_USAGE_COLOR_ATTACHMENT_BIT = 0x00000001;
static const XrSwapchainUsageFlags XR_SWAPCHAIN_USAGE_DEPTH_STENCIL_ATTACHMENT_BIT = 0x00000002;
static const XrSwapchainUsageFlags XR_SWAPCHAIN_USAGE_UNORDERED_ACCESS_BIT = 0x00000004;
static const XrSwapchainUsageFlags XR_SWAPCHAIN_USAGE_TRANSFER_SRC_BIT = 0x00000008;
static const XrSwapchainUsageFlags XR_SWAPCHAIN_USAGE_TRANSFER_DST_BIT = 0x00000010;
static const XrSwapchainUsageFlags XR_SWAPCHAIN_USAGE_SAMPLED_BIT = 0x00000020;
static const XrSwapchainUsageFlags XR_SWAPCHAIN_USAGE_MUTABLE_FORMAT_BIT = 0x00000040;
static const XrSwapchainUsageFlags XR_SWAPCHAIN_USAGE_INPUT_ATTACHMENT_BIT_MND = 0x00000080;


Flag Descriptions
  • XR_SWAPCHAIN_USAGE_COLOR_ATTACHMENT_BIT — Specifies that the image may be a color rendering target.

  • XR_SWAPCHAIN_USAGE_DEPTH_STENCIL_ATTACHMENT_BIT — Specifies that the image may be a depth/stencil rendering target.

  • XR_SWAPCHAIN_USAGE_UNORDERED_ACCESS_BIT — Specifies that the image may be accessed out of order and that access may be via atomic operations.

  • XR_SWAPCHAIN_USAGE_TRANSFER_SRC_BIT — Specifies that the image may be used as the source of a transfer operation.

  • XR_SWAPCHAIN_USAGE_TRANSFER_DST_BIT — Specifies that the image may be used as the destination of a transfer operation.

  • XR_SWAPCHAIN_USAGE_SAMPLED_BIT — Specifies that the image may be sampled by a shader.

  • XR_SWAPCHAIN_USAGE_MUTABLE_FORMAT_BIT — Specifies that the image may be reinterpreted as another image format.

  • XR_SWAPCHAIN_USAGE_INPUT_ATTACHMENT_BIT_MND — Specifies that the image may be used as a input attachment. (Added by the [XR_MND_swapchain_usage_input_attachment_bit] extension)

  • XR_SWAPCHAIN_USAGE_INPUT_ATTACHMENT_BIT_KHR — Specifies that the image may be used as a input attachment. (Added by the [XR_KHR_swapchain_usage_input_attachment_bit] extension)

See Also

Document Notes

For more information, see the OpenXR Specification

This page is extracted from the OpenXR Specification. Fixes and changes should be made to the Specification, not directly.

Copyright 2014-2022 The Khronos Group Inc.