// Copyright (c) 2017-2024, The Khronos Group Inc.
//
// SPDX-License-Identifier: CC-BY-4.0

include::{generated}/meta/XR_KHR_vulkan_swapchain_format_list.adoc[]

*Last Modified Date*::
    2020-01-01
*IP Status*::
    No known IP claims.
*Contributors*::
    Paul Pedriana, Oculus +
    Dan Ginsburg, Valve

*Overview*

Vulkan has the ename:VK_KHR_image_format_list extension which allows
applications to tell the fname:vkCreateImage function which formats the
application intends to use when ename:VK_IMAGE_CREATE_MUTABLE_FORMAT_BIT is
specified.
This OpenXR extension exposes that Vulkan extension to OpenXR applications.
In the same way that a Vulkan-based application can pass a
sname:VkImageFormatListCreateInfo struct to the fname:vkCreateImage
function, an OpenXR application can pass an identically configured
slink:XrVulkanSwapchainFormatListCreateInfoKHR structure to
flink:xrCreateSwapchain.

Applications using this extension to specify more than one swapchain format
must create OpenXR swapchains with the
ename:XR_SWAPCHAIN_USAGE_MUTABLE_FORMAT_BIT bit set.

Runtimes implementing this extension must: support the
apiext:XR_KHR_vulkan_enable or the apiext:XR_KHR_vulkan_enable2 extension.
When apiext:XR_KHR_vulkan_enable is used, the runtime must: add
ename:VK_KHR_image_format_list to the list of extensions enabled in
flink:xrCreateVulkanDeviceKHR.

*New Object Types*

*New Flag Types*

*New Enum Constants*

elink:XrStructureType enumeration is extended with:

[source,listing]
----
    XR_TYPE_VULKAN_SWAPCHAIN_FORMAT_LIST_CREATE_INFO_KHR
----

*New Enums*

*New Structures*

[open,refpage='XrVulkanSwapchainFormatListCreateInfoKHR',type='structs',desc='A list of Vulkan view formats',xrefs='xrCreateSwapchain']
--
include::{generated}/api/structs/XrVulkanSwapchainFormatListCreateInfoKHR.adoc[]

.Member Descriptions
****
* pname:type is the elink:XrStructureType of this structure.
* pname:next is code:NULL or a pointer to the next structure in a structure
  chain.
  No such structures are defined in core OpenXR or this extension.
* pname:viewFormatCount is the number of view formats passed in
  pname:viewFormats.
* pname:viewFormats is an array of sname:VkFormat.
****

include::{generated}/validity/structs/XrVulkanSwapchainFormatListCreateInfoKHR.adoc[]
--

*New Functions*

*Issues*

*Version History*

* Revision 1, 2017-09-13 (Paul Pedriana)
** Initial proposal.
* Revision 2, 2018-06-21 (Bryce Hutchings)
** Update reference of `XR_KHR_vulkan_extension_requirements` to
   `XR_KHR_vulkan_enable`
* Revision 3, 2020-01-01 (Andres Rodriguez)
** Update for `XR_KHR_vulkan_enable2`
* Revision 4, 2021-01-21 (Rylie Pavlik, Collabora, Ltd.)
** Fix reference to the mutable-format bit in Vulkan.
