1e5c31af7Sopenharmony_ci// Copyright 2016-2021 The Khronos Group, Inc.
2e5c31af7Sopenharmony_ci//
3e5c31af7Sopenharmony_ci// SPDX-License-Identifier: CC-BY-4.0
4e5c31af7Sopenharmony_ci
5e5c31af7Sopenharmony_ciinclude::{generated}/meta/{refprefix}VK_KHR_maintenance2.txt[]
6e5c31af7Sopenharmony_ci
7e5c31af7Sopenharmony_ci=== Other Extension Metadata
8e5c31af7Sopenharmony_ci
9e5c31af7Sopenharmony_ci*Last Modified Date*::
10e5c31af7Sopenharmony_ci    2017-09-05
11e5c31af7Sopenharmony_ci*Interactions and External Dependencies*::
12e5c31af7Sopenharmony_ci  - Promoted to Vulkan 1.1 Core
13e5c31af7Sopenharmony_ci*Contributors*::
14e5c31af7Sopenharmony_ci  - Michael Worcester, Imagination Technologies
15e5c31af7Sopenharmony_ci  - Stuart Smith, Imagination Technologies
16e5c31af7Sopenharmony_ci  - Jeff Bolz, NVIDIA
17e5c31af7Sopenharmony_ci  - Daniel Koch, NVIDIA
18e5c31af7Sopenharmony_ci  - Jan-Harald Fredriksen, ARM
19e5c31af7Sopenharmony_ci  - Daniel Rakos, AMD
20e5c31af7Sopenharmony_ci  - Neil Henning, Codeplay
21e5c31af7Sopenharmony_ci  - Piers Daniell, NVIDIA
22e5c31af7Sopenharmony_ci
23e5c31af7Sopenharmony_ci=== Description
24e5c31af7Sopenharmony_ci
25e5c31af7Sopenharmony_ci`VK_KHR_maintenance2` adds a collection of minor features that were
26e5c31af7Sopenharmony_ciintentionally left out or overlooked from the original Vulkan 1.0 release.
27e5c31af7Sopenharmony_ci
28e5c31af7Sopenharmony_ciThe new features are as follows:
29e5c31af7Sopenharmony_ci
30e5c31af7Sopenharmony_ci  * Allow the application to specify which aspect of an input attachment
31e5c31af7Sopenharmony_ci    might be read for a given subpass.
32e5c31af7Sopenharmony_ci  * Allow implementations to express the clipping behavior of points.
33e5c31af7Sopenharmony_ci  * Allow creating images with usage flags that may not be supported for the
34e5c31af7Sopenharmony_ci    base image's format, but are supported for image views of the image that
35e5c31af7Sopenharmony_ci    have a different but compatible format.
36e5c31af7Sopenharmony_ci  * Allow creating uncompressed image views of compressed images.
37e5c31af7Sopenharmony_ci  * Allow the application to select between an upper-left and lower-left
38e5c31af7Sopenharmony_ci    origin for the tessellation domain space.
39e5c31af7Sopenharmony_ci  * Adds two new image layouts for depth stencil images to allow either the
40e5c31af7Sopenharmony_ci    depth or stencil aspect to be read-only while the other aspect is
41e5c31af7Sopenharmony_ci    writable.
42e5c31af7Sopenharmony_ci
43e5c31af7Sopenharmony_ci=== Input Attachment Specification
44e5c31af7Sopenharmony_ci
45e5c31af7Sopenharmony_ciInput attachment specification allows an application to specify which aspect
46e5c31af7Sopenharmony_ciof a multi-aspect image (e.g. a combined depth stencil format) will be
47e5c31af7Sopenharmony_ciaccessed via a code:subpassLoad operation.
48e5c31af7Sopenharmony_ci
49e5c31af7Sopenharmony_ciOn some implementations there may: be a performance penalty if the
50e5c31af7Sopenharmony_ciimplementation does not know (at flink:vkCreateRenderPass time) which
51e5c31af7Sopenharmony_ciaspect(s) of multi-aspect images can: be accessed as input attachments.
52e5c31af7Sopenharmony_ci
53e5c31af7Sopenharmony_ci=== Promotion to Vulkan 1.1
54e5c31af7Sopenharmony_ci
55e5c31af7Sopenharmony_ciAll functionality in this extension is included in core Vulkan 1.1, with the
56e5c31af7Sopenharmony_ciKHR suffix omitted.
57e5c31af7Sopenharmony_ciThe original type, enum and command names are still available as aliases of
58e5c31af7Sopenharmony_cithe core functionality.
59e5c31af7Sopenharmony_ci
60e5c31af7Sopenharmony_ciinclude::{generated}/interfaces/VK_KHR_maintenance2.txt[]
61e5c31af7Sopenharmony_ci
62e5c31af7Sopenharmony_ci=== Input Attachment Specification Example
63e5c31af7Sopenharmony_ci
64e5c31af7Sopenharmony_ciConsider the case where a render pass has two subpasses and two attachments.
65e5c31af7Sopenharmony_ci
66e5c31af7Sopenharmony_ciAttachment 0 has the format ename:VK_FORMAT_D24_UNORM_S8_UINT, attachment 1
67e5c31af7Sopenharmony_cihas some color format.
68e5c31af7Sopenharmony_ci
69e5c31af7Sopenharmony_ciSubpass 0 writes to attachment 0, subpass 1 reads only the depth information
70e5c31af7Sopenharmony_cifrom attachment 0 (using inputAttachmentRead) and writes to attachment 1.
71e5c31af7Sopenharmony_ci
72e5c31af7Sopenharmony_ci[source,c++]
73e5c31af7Sopenharmony_ci----------------------------------------
74e5c31af7Sopenharmony_ci    VkInputAttachmentAspectReferenceKHR references[] = {
75e5c31af7Sopenharmony_ci        {
76e5c31af7Sopenharmony_ci            .subpass = 1,
77e5c31af7Sopenharmony_ci            .inputAttachmentIndex = 0,
78e5c31af7Sopenharmony_ci            .aspectMask = VK_IMAGE_ASPECT_DEPTH_BIT
79e5c31af7Sopenharmony_ci        }
80e5c31af7Sopenharmony_ci    };
81e5c31af7Sopenharmony_ci
82e5c31af7Sopenharmony_ci    VkRenderPassInputAttachmentAspectCreateInfoKHR specifyAspects = {
83e5c31af7Sopenharmony_ci        .sType = VK_STRUCTURE_TYPE_RENDER_PASS_INPUT_ATTACHMENT_ASPECT_CREATE_INFO_KHR,
84e5c31af7Sopenharmony_ci        .pNext = NULL,
85e5c31af7Sopenharmony_ci        .aspectReferenceCount = 1,
86e5c31af7Sopenharmony_ci        .pAspectReferences = references
87e5c31af7Sopenharmony_ci    };
88e5c31af7Sopenharmony_ci
89e5c31af7Sopenharmony_ci
90e5c31af7Sopenharmony_ci    VkRenderPassCreateInfo createInfo = {
91e5c31af7Sopenharmony_ci        ...
92e5c31af7Sopenharmony_ci        .pNext = &specifyAspects,
93e5c31af7Sopenharmony_ci        ...
94e5c31af7Sopenharmony_ci    };
95e5c31af7Sopenharmony_ci
96e5c31af7Sopenharmony_ci    vkCreateRenderPass(...);
97e5c31af7Sopenharmony_ci----------------------------------------
98e5c31af7Sopenharmony_ci
99e5c31af7Sopenharmony_ci=== Issues
100e5c31af7Sopenharmony_ci
101e5c31af7Sopenharmony_ci1) What is the default tessellation domain origin?
102e5c31af7Sopenharmony_ci
103e5c31af7Sopenharmony_ci*RESOLVED*: Vulkan 1.0 originally inadvertently documented a lower-left
104e5c31af7Sopenharmony_ciorigin, but the conformance tests and all implementations implemented an
105e5c31af7Sopenharmony_ciupper-left origin.
106e5c31af7Sopenharmony_ciThis extension adds a control to select between lower-left (for
107e5c31af7Sopenharmony_cicompatibility with OpenGL) and upper-left, and we retroactively fix
108e5c31af7Sopenharmony_ciunextended Vulkan to have a default of an upper-left origin.
109e5c31af7Sopenharmony_ci
110e5c31af7Sopenharmony_ci=== Version History
111e5c31af7Sopenharmony_ci
112e5c31af7Sopenharmony_ci * Revision 1, 2017-04-28
113